/* wwwroot/css/site.css */
:root {
    --primary: #1a4d2e;
    --secondary: #4f9d69;
    --accent: #ff9f29;
    --light: #f8f9fa;
    --dark: #212529;
    --gradient-start: #1a4d2e;
    --gradient-end: #4f9d69;
    --border-radius-sm: 8px;
    --border-radius-lg: 12px;
    --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.12);
    --transition: all 0.3s ease;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
    padding-top: 80px;
}

/* ==================== */
/* MODERN NAVBAR */
/* ==================== */
.navbar {
    background: rgba(255, 255, 255, 0.98) !important;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(26, 77, 46, 0.1);
    padding: 0.8rem 0;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    position: fixed !important;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1030;
}

.navbar-brand {
    font-weight: 800;
    font-size: 1.8rem;
    display: flex;
    align-items: center;
}

    .navbar-brand .brand-part-1 {
        color: var(--primary);
    }

    .navbar-brand .brand-part-2 {
        color: var(--accent);
        background: linear-gradient(135deg, var(--accent), #ff8c00);
        -webkit-background-clip: text;
        background-clip: text;
        -webkit-text-fill-color: transparent;
    }

/* Navigation Links */
.navbar-nav .nav-link {
    color: var(--dark) !important;
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    margin: 0 0.2rem;
    border-radius: var(--border-radius-sm);
    transition: var(--transition);
    position: relative;
}

    .navbar-nav .nav-link:hover {
        color: var(--primary) !important;
        background: rgba(26, 77, 46, 0.05);
    }

/* ==================== */
/* STABILIZED DROPDOWNS */
/* ==================== */
.dropdown-menu {
    border: none;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
    padding: 0.5rem 0 !important;
    margin-top: 0 !important; /* FIXED: Gap removed to prevent flickering */
    min-width: 220px;
    border: 1px solid rgba(0,0,0,0.08) !important;
    display: none; /* Controlled by Hover on Desktop / BS5 on Mobile */
}

/* Desktop Hover Logic */
@media (min-width: 992px) {
    .nav-item.dropdown:hover > .dropdown-menu {
        display: block !important;
        animation: dropdownFadeIn 0.25s ease-out !important;
    }

    /* FIXED: Invisible bridge so mouse doesn't lose focus moving to menu */
    .nav-item.dropdown::after {
        content: "";
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        height: 15px;
    }

    .dropdown-toggle::after {
        transition: transform 0.3s ease;
    }

    .nav-item.dropdown:hover .dropdown-toggle::after {
        transform: rotate(180deg);
    }
}

@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-item {
    padding: 0.75rem 1.5rem !important;
    color: var(--dark) !important;
    font-weight: 500;
    transition: var(--transition);
    border-radius: 6px !important;
    margin: 0.1rem 0.25rem !important;
    width: calc(100% - 0.5rem) !important;
    display: block !important;
}

    .dropdown-item:hover {
        background: linear-gradient(90deg, rgba(26, 77, 46, 0.08), rgba(255, 159, 41, 0.08)) !important;
        color: var(--primary) !important;
    }

/* ==================== */
/* MOBILE OPTIMIZATION */
/* ==================== */
@media (max-width: 991.98px) {
    .navbar-collapse {
        background: white !important;
        border-radius: var(--border-radius-lg);
        padding: 1rem !important;
        margin-top: 0.5rem;
        box-shadow: var(--shadow-md);
    }

    .dropdown-menu {
        position: static !important;
        display: none;
        width: 100% !important;
        background: #f8f9fa !important;
        border: none !important;
        box-shadow: none !important;
        animation: none !important; /* FIXED: Removed jittery animation on mobile */
    }

        .dropdown-menu.show {
            display: block !important;
        }

    .dropdown-toggle::after {
        float: right;
        margin-top: 0.6rem;
    }
}
