/* ==========================================
   CITY BUS ADVISOR - CUSTOM STYLES
   ========================================== */

/* === CSS Variables === */
:root {
    --primary: #FF6B35;
    --secondary: #004E89;
    --accent: #1AA7EC;
    --dark: #1A1A2E;
    --light: #F7F7F9;
    --success: #10B981;
    --error: #EF4444;
    --warning: #F59E0B;
    
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.16);
    
    --border-radius: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* === Base Styles === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    overflow-x: hidden;
    position: relative;
}

/* === Header Gradient === */
.header-gradient {
    background: linear-gradient(135deg, var(--secondary) 0%, #003566 50%, var(--dark) 100%);
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(10px);
}

/* === Navigation === */
.logo-container {
    animation: slideDown 0.6s ease-out;
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-family: 'DM Sans', sans-serif;
    font-weight: 500;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.nav-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}

.nav-btn:hover::before {
    transform: translateX(0);
}

.nav-btn:hover {
    color: white;
    transform: translateY(-2px);
}

.nav-btn.active {
    color: white;
    background: rgba(255, 107, 53, 0.2);
    border: 1px solid rgba(255, 107, 53, 0.4);
}

.mobile-nav-btn {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    text-align: left;
    font-family: 'DM Sans', sans-serif;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
}

.mobile-nav-btn:hover,
.mobile-nav-btn.active {
    color: white;
    background: rgba(255, 107, 53, 0.2);
}

/* === Section Styles === */
.content-section {
    display: none;
    animation: fadeIn 0.5s ease-out;
}

.content-section.active {
    display: block;
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
    animation: slideUp 0.6s ease-out;
}

.section-title {
    font-family: 'Syne', sans-serif;
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--dark);
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.section-subtitle {
    font-family: 'DM Sans', sans-serif;
    font-size: 1.125rem;
    color: #64748b;
    font-weight: 400;
}

/* === Card Gradient === */
.card-gradient {
    background: white;
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(0, 78, 137, 0.08);
    transition: var(--transition);
    animation: slideUp 0.6s ease-out;
    position: relative;
    overflow: hidden;
}

.card-gradient::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 50%, var(--secondary) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.card-gradient:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.card-gradient:hover::before {
    opacity: 1;
}

/* === Form Elements === */
.form-group {
    margin-bottom: 0;
}

.form-label {
    display: block;
    font-family: 'DM Sans', sans-serif;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--dark);
    margin-bottom: 0.5rem;
    letter-spacing: 0.01em;
}

.form-input {
    width: 100%;
    padding: 0.875rem 1rem;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.9375rem;
    color: var(--dark);
    background: var(--light);
    border: 2px solid transparent;
    border-radius: 8px;
    outline: none;
    transition: var(--transition);
}

.form-input:focus {
    background: white;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(26, 167, 236, 0.1);
}

.form-input::placeholder {
    color: #94a3b8;
}

/* === Buttons === */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.75rem;
    font-family: 'DM Sans', sans-serif;
    font-weight: 600;
    font-size: 0.9375rem;
    color: white;
    background: linear-gradient(135deg, var(--primary) 0%, #FF8C61 100%);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #FF8C61 0%, var(--primary) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.btn-primary:hover::before {
    opacity: 1;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 53, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary > * {
    position: relative;
    z-index: 1;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.75rem;
    font-family: 'DM Sans', sans-serif;
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--secondary);
    background: white;
    border: 2px solid var(--secondary);
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
}

.btn-secondary:hover {
    color: white;
    background: var(--secondary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 78, 137, 0.3);
}

/* === Badge === */
.badge-secondary {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    font-family: 'DM Sans', sans-serif;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--secondary);
    background: rgba(0, 78, 137, 0.1);
    border-radius: 20px;
}

/* === Bus Card === */
.bus-card {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(0, 78, 137, 0.08);
    transition: var(--transition);
    animation: slideUp 0.4s ease-out backwards;
}

.bus-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-4px);
    border-color: var(--accent);
}

.bus-number {
    font-family: 'Syne', sans-serif;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.bus-type-badge {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    font-family: 'DM Sans', sans-serif;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: 6px;
    margin-bottom: 1rem;
}

.bus-type-express {
    color: #7C3AED;
    background: rgba(124, 58, 237, 0.1);
}

.bus-type-ordinary {
    color: #059669;
    background: rgba(5, 150, 105, 0.1);
}

.bus-type-deluxe {
    color: #DC2626;
    background: rgba(220, 38, 38, 0.1);
}

.bus-type-ac {
    color: #2563EB;
    background: rgba(37, 99, 235, 0.1);
}

.route-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: var(--light);
    border-radius: 8px;
}

.route-text {
    font-family: 'DM Sans', sans-serif;
    font-weight: 500;
    color: var(--dark);
}

.route-arrow {
    color: var(--accent);
    font-weight: 700;
}

.timings-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.timing-badge {
    padding: 0.5rem 0.875rem;
    font-family: 'DM Sans', sans-serif;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--secondary);
    background: rgba(0, 78, 137, 0.08);
    border-radius: 6px;
    transition: var(--transition);
}

.timing-badge:hover {
    background: var(--secondary);
    color: white;
    transform: scale(1.05);
}

/* === List Item === */
.list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: var(--light);
    border-radius: 8px;
    transition: var(--transition);
    animation: slideUp 0.3s ease-out backwards;
}

.list-item:hover {
    background: rgba(0, 78, 137, 0.08);
    transform: translateX(4px);
}

.list-item-content {
    flex: 1;
}

.list-item-title {
    font-family: 'DM Sans', sans-serif;
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--dark);
    margin-bottom: 0.25rem;
}

.list-item-subtitle {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.8125rem;
    color: #64748b;
}

.list-item-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
}

.btn-icon:hover {
    transform: scale(1.1);
}

.btn-icon.edit {
    color: var(--accent);
}

.btn-icon.edit:hover {
    background: rgba(26, 167, 236, 0.1);
}

.btn-icon.delete {
    color: var(--error);
}

.btn-icon.delete:hover {
    background: rgba(239, 68, 68, 0.1);
}

.btn-icon svg {
    width: 18px;
    height: 18px;
}

/* === Toast Notification === */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1000;
    animation: slideInRight 0.4s ease-out;
}

.toast.hidden {
    display: none;
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background: white;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    border-left: 4px solid var(--success);
    font-family: 'DM Sans', sans-serif;
    font-weight: 500;
    color: var(--dark);
}

.toast.error .toast-content {
    border-left-color: var(--error);
}

.toast.warning .toast-content {
    border-left-color: var(--warning);
}

.toast-icon {
    width: 20px;
    height: 20px;
    color: var(--success);
}

.toast.error .toast-icon {
    color: var(--error);
}

.toast.warning .toast-icon {
    color: var(--warning);
}

/* === Loading Overlay === */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(26, 26, 46, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-overlay.hidden {
    display: none;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* === Custom Scrollbar === */
.custom-scrollbar::-webkit-scrollbar {
    width: 8px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: var(--light);
    border-radius: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(0, 78, 137, 0.3);
    border-radius: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 78, 137, 0.5);
}

/* === Animations === */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* === Responsive === */
@media (max-width: 768px) {
    .section-title {
        font-size: 2rem;
    }
    
    .card-gradient {
        padding: 1.5rem;
    }
    
    .bus-card {
        padding: 1.25rem;
    }
    
    .toast {
        bottom: 1rem;
        right: 1rem;
        left: 1rem;
    }
}

/* === Animation Delays === */
.bus-card:nth-child(1) { animation-delay: 0.1s; }
.bus-card:nth-child(2) { animation-delay: 0.2s; }
.bus-card:nth-child(3) { animation-delay: 0.3s; }
.bus-card:nth-child(4) { animation-delay: 0.4s; }
.bus-card:nth-child(5) { animation-delay: 0.5s; }

.list-item:nth-child(1) { animation-delay: 0.05s; }
.list-item:nth-child(2) { animation-delay: 0.1s; }
.list-item:nth-child(3) { animation-delay: 0.15s; }
.list-item:nth-child(4) { animation-delay: 0.2s; }
.list-item:nth-child(5) { animation-delay: 0.25s; }
.list-item:nth-child(6) { animation-delay: 0.3s; }
.list-item:nth-child(7) { animation-delay: 0.35s; }
.list-item:nth-child(8) { animation-delay: 0.4s; }

/* === Modal Styles === */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-out;
}

.modal.hidden {
    display: none;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(26, 26, 46, 0.7);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    width: 90%;
    max-width: 450px;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.4s ease-out;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.modal-title {
    font-family: 'Syne', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark);
}

.modal-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    color: #64748b;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
}

.modal-close:hover {
    color: var(--dark);
    background: var(--light);
}

.modal-body {
    padding: 2rem;
}

.modal-body .form-group:not(:last-child) {
    margin-bottom: 1.5rem;
}

/* === Admin Badge === */
.admin-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    font-family: 'DM Sans', sans-serif;
    font-weight: 600;
    font-size: 0.75rem;
    color: white;
    background: linear-gradient(135deg, var(--primary) 0%, #FF8C61 100%);
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.admin-badge svg {
    width: 14px;
    height: 14px;
}

