/* Main Application Layout Styles */

:root {
    --primary-color: #2ECC71;
    --primary-dark: #27AE60;
    --primary-light: #58D68D;
    --secondary-color: #3498DB;
    --dark-color: #1a1a2e;
    --danger-color: #E74C3C;
    --warning-color: #F39C12;
    --success-color: #2ECC71;
    --info-color: #3498DB;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: #f8f9fa;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1 0 auto;
}

/* Navbar Styles */
.navbar {
    background: linear-gradient(135deg, var(--dark-color) 0%, #16213e 100%);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

/* Reduce navbar height on mobile/PWA */
@media (max-width: 991.98px) {
    .navbar {
        padding-top: 0.3rem;
        padding-bottom: 0.3rem;
        min-height: auto;
        max-height: 50px;
    }

    .navbar > .container-fluid {
        max-height: 50px;
    }

    .navbar-brand {
        font-size: 1rem;
        padding-top: 0;
        padding-bottom: 0;
        line-height: 1;
    }

    .navbar-brand img {
        height: 28px;
    }

    .navbar-toggler {
        padding: 0.2rem 0.4rem;
        font-size: 0.9rem;
    }

    /* Dark background for mobile dropdown menu */
    .navbar-collapse {
        background: linear-gradient(135deg, var(--dark-color) 0%, #16213e 100%);
        margin-left: -12px;
        margin-right: -12px;
        padding: 1rem 12px;
        margin-top: 0.5rem;
        border-radius: 8px;
    }

    .navbar-nav {
        background: transparent;
    }

    .nav-item {
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .nav-item:last-child {
        border-bottom: none;
    }

    .dropdown-menu {
        background: rgba(22, 33, 62, 0.95);
        border: 1px solid rgba(255, 255, 255, 0.1);
    }
}

.navbar-brand {
    font-weight: 700;
    color: var(--primary-color) !important;
}

.navbar-brand i {
    margin-right: 8px;
}

/* Navbar link styles with proper specificity */
.navbar-dark .nav-link,
.navbar .nav-link {
    color: rgba(255, 255, 255, 0.55) !important;
    font-weight: 500;
    transition: all 0.2s ease;
}

.navbar-dark .nav-link:hover,
.navbar .nav-link:hover {
    color: rgba(255, 255, 255, 0.85) !important;
}

.navbar-dark .nav-link.active,
.navbar .nav-link.active {
    color: #2ECC71 !important;
    font-weight: 600;
}

/* Dropdown toggle active state */
.navbar-dark .nav-link.dropdown-toggle.active,
.navbar .nav-link.dropdown-toggle.active {
    color: #2ECC71 !important;
}

/* Button Styles */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border: none;
    font-weight: 600;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary-color) 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(46, 204, 113, 0.3);
}

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Card Styles */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid #eee;
    font-weight: 600;
}

/* Form Styles */
.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(46, 204, 113, 0.25);
}

/* Alert Styles */
.alert-success {
    background-color: rgba(46, 204, 113, 0.1);
    border-color: var(--primary-color);
    color: var(--primary-dark);
}

/* Utility Classes */
.text-primary {
    color: var(--primary-color) !important;
}

.bg-primary {
    background-color: var(--primary-color) !important;
}

/* Dropdown Styles */
.dropdown-menu {
    border: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border-radius: 10px;
}

.dropdown-item:hover {
    background-color: rgba(46, 204, 113, 0.1);
}

.badge-primary {
    background-color: var(--primary-color);
}

/* Footer */
footer {
    background: var(--dark-color);
    color: rgba(255, 255, 255, 0.7);
    flex-shrink: 0;
    margin-top: auto;
}

/* Flight Card Specific Styles */
.flight-card {
    border-left: 4px solid var(--primary-color);
}

.flight-route {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark-color);
}

.airport-code {
    font-size: 1.25rem;
    font-weight: 600;
}

.flight-line {
    flex: 1;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    margin: 0 15px;
    position: relative;
}

.flight-line::before {
    content: '✈';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(90deg);
    font-size: 1rem;
}

/* Responsive Sidebar */
@media (min-width: 992px) {
    .sidebar {
        position: fixed;
        top: 56px;
        bottom: 0;
        left: 0;
        z-index: 100;
        padding: 20px 0;
        overflow-x: hidden;
        overflow-y: auto;
        background: #fff;
        border-right: 1px solid #eee;
    }

    .main-content {
        margin-left: 250px;
    }
}

/* Animations */
.fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

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

/* Loading Spinner */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 1100;
}

/* Lazy Loading */
.lazy-loading {
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

.lazy-loaded {
    opacity: 1;
    animation: lazyFadeIn 0.3s ease;
}

.lazy-error {
    opacity: 0.3;
    filter: grayscale(100%);
}

@keyframes lazyFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Image Placeholders */
img[loading="lazy"] {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Dropdown Width */
.dropdown-menu-300 {
    width: 300px;
}

/* Achievement Modal */
.achievement-modal-header {
    background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
}

.achievement-modal-title {
    letter-spacing: 2px;
}
