/* ===================================
   MODERN FLIGHT LOGBOOK DESIGN
   Professional Aviation + Nature Colors
   =================================== */

:root {
    /* Nature-inspired color palette */
    --sage-green: #7D9B7F;
    --forest-green: #4A5F4D;
    --warm-gray: #8B8680;
    --sand: #F5F3EE;
    --cream: #FDFCF9;
    --moss: #5A6F5C;
    --earth-dark: #3D4A3F;
    --stone: #A8A39E;
    --white: #FFFFFF;

    /* Accent colors */
    --sky-blue: #A8C5C5;
    --sunrise: #D4A574;

    /* Typography */
    --font-display: 'Archivo', sans-serif;
    --font-body: 'DM Sans', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    /* Spacing */
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 1.5rem;
    --space-lg: 2.5rem;
    --space-xl: 4rem;

    /* Effects */
    --shadow-soft: 0 2px 12px rgba(77, 95, 77, 0.08);
    --shadow-medium: 0 8px 24px rgba(77, 95, 77, 0.12);
    --shadow-strong: 0 16px 48px rgba(77, 95, 77, 0.16);
}

/* ===================================
   GLOBAL STYLES
   =================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    background: var(--sand);
    color: var(--earth-dark);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Topographic background pattern */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 80px,
            rgba(125, 155, 127, 0.03) 80px,
            rgba(125, 155, 127, 0.03) 81px
        ),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 80px,
            rgba(125, 155, 127, 0.03) 80px,
            rgba(125, 155, 127, 0.03) 81px
        );
    pointer-events: none;
    z-index: 0;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    color: var(--earth-dark);
    letter-spacing: -0.02em;
}

/* ===================================
   NAVIGATION
   =================================== */

.modern-nav {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(125, 155, 127, 0.15);
    position: sticky;
    top: 0;
    z-index: 100;
    animation: slideDown 0.6s ease-out;
}

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

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--space-md) var(--space-lg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.nav-brand-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--forest-green);
    letter-spacing: -0.02em;
    position: relative;
    text-decoration: none;
}

.logo::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 40%;
    height: 3px;
    background: linear-gradient(90deg, var(--sage-green), transparent);
}

/* Hamburger menu toggle */
.navbar-toggler {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    flex-direction: column;
    gap: 4px;
}

.navbar-toggler span {
    display: block;
    width: 25px;
    height: 3px;
    background: var(--forest-green);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.navbar-collapse {
    flex-basis: 100%;
    flex-grow: 1;
    align-items: center;
}

.nav-links {
    display: flex;
    gap: var(--space-lg);
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-links a {
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--warm-gray);
    text-decoration: none;
    transition: color 0.3s ease;
    position: relative;
    padding: 0.5rem 0;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--forest-green);
}

.nav-links a.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--sage-green);
}

/* ===================================
   MAIN CONTAINER
   =================================== */

.main-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--space-xl) var(--space-lg);
    position: relative;
    z-index: 1;
}

/* ===================================
   PAGE HEADER
   =================================== */

.page-header {
    margin-bottom: var(--space-xl);
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

h1 {
    font-family: var(--font-display);
    font-size: 3rem;
    font-weight: 700;
    color: var(--earth-dark);
    letter-spacing: -0.03em;
    margin-bottom: var(--space-xs);
}

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

/* ===================================
   STAT CARDS
   =================================== */

.stat-card {
    background: var(--white);
    border-radius: 16px;
    padding: 0;
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(125, 155, 127, 0.1);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: visible;
    animation: fadeInUp 0.8s ease-out both;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--sage-green), var(--sky-blue));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 16px 16px 0 0;
}

.stat-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-medium);
}

.stat-card:hover::before {
    transform: scaleX(1);
}

.stat-card .card-body {
    text-align: center;
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 140px;
}

.stat-card .card-subtitle {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--warm-gray);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
    line-height: 1.4;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.stat-card .card-title {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--forest-green);
    line-height: 1;
    margin: 0 0 0.5rem 0;
}

.stat-card .card-text {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--sage-green);
    font-weight: 400;
    line-height: 1;
    margin: 0;
}

/* Stagger animation for stat cards */
.row > div:nth-child(1) .stat-card { animation-delay: 0.3s; }
.row > div:nth-child(2) .stat-card { animation-delay: 0.4s; }
.row > div:nth-child(3) .stat-card { animation-delay: 0.5s; }
.row > div:nth-child(4) .stat-card { animation-delay: 0.6s; }
.row > div:nth-child(5) .stat-card { animation-delay: 0.7s; }
.row > div:nth-child(6) .stat-card { animation-delay: 0.8s; }

/* ===================================
   CARDS
   =================================== */

.card {
    background: var(--white);
    border-radius: 20px;
    padding: 0;
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(125, 155, 127, 0.1);
    margin-bottom: var(--space-lg);
    overflow: hidden;
}

.card-header {
    background: linear-gradient(135deg, var(--forest-green) 0%, var(--earth-dark) 100%);
    border-bottom: none;
    padding: var(--space-md) var(--space-lg);
}

.card-header h5 {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--white);
    margin: 0;
    letter-spacing: -0.01em;
}

.card-header.bg-primary {
    background: linear-gradient(135deg, var(--sage-green) 0%, var(--moss) 100%) !important;
}

.card-header.bg-info {
    background: linear-gradient(135deg, var(--sky-blue) 0%, var(--sage-green) 100%) !important;
}

.card-header.bg-success {
    background: linear-gradient(135deg, var(--forest-green) 0%, var(--moss) 100%) !important;
}

.card-header.bg-warning {
    background: linear-gradient(135deg, var(--sunrise) 0%, var(--warm-gray) 100%) !important;
    color: var(--earth-dark) !important;
}

.card-header.bg-warning h5 {
    color: var(--earth-dark) !important;
}

.card-body {
    padding: var(--space-lg);
}

.card-body h6 {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    color: var(--earth-dark);
    margin-bottom: var(--space-md);
}

/* ===================================
   BADGES
   =================================== */

.badge {
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.4em 0.8em;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge.bg-success {
    background: var(--forest-green) !important;
}

.badge.bg-danger {
    background: #B85C5C !important;
}

.badge.bg-warning {
    background: var(--sunrise) !important;
    color: var(--earth-dark) !important;
}

.badge.bg-secondary {
    background: var(--stone) !important;
}

.badge.bg-info {
    background: var(--sky-blue) !important;
    color: var(--earth-dark) !important;
}

.badge.bg-primary {
    background: var(--sage-green) !important;
}

/* ===================================
   PROGRESS BARS
   =================================== */

.progress {
    height: 8px;
    background: var(--sand);
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    border: none;
}

.progress-bar {
    background: linear-gradient(90deg, var(--sage-green), var(--moss));
    border-radius: 8px;
    transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-bar.bg-success {
    background: linear-gradient(90deg, var(--forest-green), var(--moss)) !important;
}

.progress-bar.bg-danger {
    background: linear-gradient(90deg, #B85C5C, #8B4545) !important;
}

.progress-bar.bg-warning {
    background: linear-gradient(90deg, var(--sunrise), var(--warm-gray)) !important;
}

/* ===================================
   TABLES
   =================================== */

.table {
    background: var(--white);
    border: 1px solid rgba(125, 155, 127, 0.1);
    font-family: var(--font-body);
    margin-bottom: 0;
}

.table thead th {
    background: var(--sand);
    border-bottom: 2px solid rgba(125, 155, 127, 0.2);
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--earth-dark);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: var(--space-md);
}

.table tbody td {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--earth-dark);
    padding: var(--space-md);
    border-color: rgba(125, 155, 127, 0.08);
}

.table-striped tbody tr:nth-of-type(odd) {
    background: rgba(245, 243, 238, 0.4);
}

.table tbody tr:hover {
    background: rgba(125, 155, 127, 0.08);
}

.table-sm {
    font-size: 0.85rem;
}

.table-sm td,
.table-sm th {
    padding: var(--space-sm);
}

.table-bordered {
    border: 1px solid rgba(125, 155, 127, 0.2);
}

/* ===================================
   CHARTS
   =================================== */

canvas {
    max-height: 400px;
}

/* ===================================
   UTILITY CLASSES
   =================================== */

.text-muted {
    color: var(--warm-gray) !important;
}

.text-success {
    color: var(--forest-green) !important;
}

.text-warning {
    color: var(--sunrise) !important;
}

.text-danger {
    color: #B85C5C !important;
}

.text-white {
    color: var(--white) !important;
}

small {
    font-family: var(--font-body);
    font-size: 0.85rem;
}

/* ===================================
   BOOTSTRAP OVERRIDES
   =================================== */

.container-fluid {
    max-width: 1400px;
    margin: 0 auto;
}

.d-flex {
    display: flex;
}

.justify-content-between {
    justify-content: space-between;
}

.align-items-center {
    align-items: center;
}

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mb-0 { margin-bottom: 0; }

.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }

.ms-2 { margin-left: 0.5rem; }

.py-4 { padding-top: 1.5rem; padding-bottom: 1.5rem; }

/* ===================================
   RESPONSIVE DESIGN
   =================================== */

/* Desktop navigation - always visible */
@media (min-width: 992px) {
    .nav-brand-section {
        width: auto;
    }

    .navbar-collapse {
        display: flex !important;
        flex-basis: auto;
        justify-content: flex-end;
    }
}

/* Tablet and mobile */
@media (max-width: 991px) {
    .navbar-toggler {
        display: flex;
    }

    .navbar-collapse {
        display: none;
        width: 100%;
        margin-top: var(--space-md);
    }

    .navbar-collapse.show {
        display: block;
    }

    .nav-links {
        flex-direction: column;
        gap: var(--space-sm);
        padding-top: var(--space-md);
    }

    .nav-links a {
        display: block;
        padding: var(--space-sm) 0;
    }

    .nav-links a.active::after {
        bottom: 0;
    }
}

@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }

    .stat-card .card-body {
        min-height: 120px;
        padding: 1.25rem 0.75rem;
    }

    .stat-card .card-subtitle {
        font-size: 0.7rem;
        margin-bottom: 0.6rem;
    }

    .stat-card .card-title {
        font-size: 2rem;
        margin-bottom: 0.4rem;
    }

    .stat-card .card-text {
        font-size: 0.8rem;
    }

    .main-container {
        padding: var(--space-lg) var(--space-md);
    }

    canvas {
        max-height: 300px;
    }
}

@media (max-width: 576px) {
    .stat-card .card-body {
        min-height: 110px;
        padding: 1rem 0.5rem;
    }

    .stat-card .card-subtitle {
        font-size: 0.65rem;
        letter-spacing: 0.03em;
        margin-bottom: 0.5rem;
    }

    .stat-card .card-title {
        font-size: 1.75rem;
        margin-bottom: 0.4rem;
    }

    .stat-card .card-text {
        font-size: 0.75rem;
    }

    .logo {
        font-size: 1.25rem;
    }
}
