/* Base variables for the entire project */
:root {
    --primary-color: #1e3a8a;
    --primary-hover: #1e40af;
    --navbar-text: #374151;
    --navbar-text-hover: #1e3a8a;
    --navbar-hover-bg: #f3f4f6;
    --bg-main: #f8fafc;
    --text-main: #1f2937;
}

/* Base styles to ensure consistency */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--text-main);
    background-color: var(--bg-main);
    line-height: 1.6;
}

/* Base transition for interactive elements */
a,
button,
input,
select,
textarea {
    transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 200ms;
}


.navbar-fixed {
    position: fixed;
    top: 0px;
    left: 0;
    z-index: 1000;
    width: 100%;
    transition: all 0.3s ease;
    background-color: #ffffff;
    border-bottom: 1px solid #e5e7eb;
}

.navbar-container {
    max-width: 90rem;
    margin: 0 auto;
}

/* Navbar themable link */
.navbar-link {
    color: var(--navbar-text);
    font-weight: 500;
}

.navbar-link:hover {
    color: var(--navbar-text-hover);
    background-color: var(--navbar-hover-bg);
}

/* Navbar themable button */
.navbar-btn {
    color: var(--navbar-text);
    font-weight: 500;
}

.navbar-btn:hover {
    color: var(--navbar-text-hover);
    background-color: var(--navbar-hover-bg);
}

/* Navbar Transitions on Scroll */
.navbar-fixed.scrolled {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    height: 4rem;
}

/* Responsive navbar adjustments */
@media (max-width: 768px) {
    .navbar-fixed {
        max-width: 100%;
    }
}

/* Dropdown menu professional styling */
.dropdown-menu {
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    z-index: 50;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    border-radius: 0.75rem;
}

/* Show dropdown on hover or when parent has .open class (mobile) */
.dropdown:hover>.dropdown-menu,
.dropdown.open>.dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

/* Invisible bridge to prevent losing hover between button and menu */
.dropdown-menu::before {
    content: '';
    position: absolute;
    top: -15px;
    left: 0;
    width: 100%;
    height: 15px;
    background: transparent;
}


/* Keep dropdown open when hovering the menu */
.dropdown-menu:hover {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

/* Dropdown arrow rotation */
.dropdown:hover>.dropdown-button svg.chevron,
.dropdown.open>.dropdown-button svg.chevron {
    transform: rotate(180deg);
}

/* Nested Dropdown Styling */
.nested-dropdown-menu {
    opacity: 0;
    visibility: hidden;
    transform: translateX(10px);
    transition: all 150ms ease-in-out;
    pointer-events: none;
}

.dropdown-item:hover>.nested-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
    pointer-events: auto;
}

/* Invisible bridge for nested dropdowns (sideways) */
.nested-dropdown-menu::before {
    content: '';
    position: absolute;
    top: 0;
    right: -20px;
    width: 20px;
    height: 100%;
    background: transparent;
}


/* Side Navbar - Simple but Polished */
.side-navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100vh;
    background: #ffffff;
    z-index: 10000;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
}

.side-navbar.open {
    transform: translateX(0);
}

.side-navbar-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: none;
}

.side-navbar-backdrop.active {
    display: block;
}

.side-nav-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #f3f4f6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.side-nav-header span {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--primary-color);
}

.side-nav-content {
    padding: 0.75rem;
}

.side-nav-link,
.side-nav-button {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 0.75rem 1rem;
    color: #4b5563;
    text-decoration: none;
    border: none;
    background: none;
    text-align: left;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: 0.5rem;
    margin-bottom: 0.25rem;
}

.side-nav-link:hover,
.side-nav-button:hover {
    background: #f3f4f6;
    color: var(--primary-color);
}

.side-nav-dropdown {
    display: none;
    background: #f9fafb;
    border-radius: 0.5rem;
    margin: 0.25rem 0.5rem;
}

.side-nav-dropdown.open {
    display: block;
}

.side-nav-dropdown-link {
    display: block;
    padding: 0.6rem 1rem 0.6rem 2.5rem;
    color: #6b7280;
    text-decoration: none;
    font-size: 0.9rem;
    border-radius: 0.375rem;
}

.side-nav-dropdown-link:hover {
    background: #f3f4f6;
    color: var(--primary-color);
}

.side-navbar-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 0.5rem;
    cursor: pointer;
    background: none;
    border: none;
    transition: background 0.2s;
}

.side-navbar-toggle:hover {
    background: #f3f4f6;
}

@media (min-width: 1024px) {
    .side-navbar-toggle {
        display: none;
    }
}

/* Footer & Visitor Badge */
footer {
    background-color: #1e3a8a !important;
    color: #ffffff;
}

.visitor-badge {
    background: rgba(255, 255, 255, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}