/* ============================================================
   Mirialabs — Modern Navbar
   Sitewide navbar redesign. Two stacked bars:
     1. .logo-header  — brand row (logo + contact + language)
     2. .main-header  — primary nav + search + user menu
   The home page additionally turns these transparent while
   pinned at top, then solidifies on scroll — see home.css.
   ============================================================ */

:root {
    --ml-blue: #0452A2;
    --ml-blue-light: #1e6fd9;
    --ml-orange: #F89621;
    --ml-orange-bright: #ffaa3a;
    --ml-ink: #0a1929;
    --ml-ink-2: #0e2540;
    --ml-text-dim: #b6c2d6;
}

/* ---------- Logo header (top brand row) ----------
   Both navbar bars are now DARK to eliminate any chance of white-on-white
   text. The logo header sits as the lighter of the two dark shades so the
   visual hierarchy still reads as "two stacked bars".

   default-header.css (loaded earlier) sets the company-name to 2rem with
   the same gradient, blue contact icons, and a light border-bottom — we
   re-declare with !important so this file is the single source of truth. */
.logo-header,
div.logo-header,
body .logo-header {
    background-color: #0a1a2f !important;
    background-image: linear-gradient(180deg, #0a1a2f 0%, #0b1f3a 100%) !important;
    border-bottom: 1px solid rgba(248, 150, 33, 0.18) !important;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.03) !important;
    position: relative;
    /* Must be HIGHER than .main-header's z-index (AdminLTE sets it to
       1034). Otherwise the language dropdown that opens downward out of
       this header falls behind the main navbar. */
    z-index: 1040 !important;
    transition: background 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
}

/* Belt-and-braces: ensure any dropdown menu opening out of the logo
   header sits above the main-header (1034) even if a future rule
   collapses the parent stacking context. */
.logo-header .dropdown-menu {
    z-index: 1060 !important;
}

.logo-brand {
    display: inline-flex;
    align-items: center;
    text-decoration: none !important;
}

.logo-brand:hover {
    transform: none !important;                /* kill default-header scale(1.02) */
    text-decoration: none !important;
}

.logo-brand .logo-image {
    height: 56px !important;
    transition: transform 0.3s ease;
    /* Subtle white glow so a dark/blue logo stays visible on the dark bar.
       Has no visible effect on a logo with light/transparent edges. */
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.15));
}

.logo-brand:hover .logo-image {
    transform: scale(1.04) rotate(-2deg);
}

.logo-brand .company-name {
    font-size: 1.35rem !important;             /* default-header sets 2rem */
    font-weight: 700 !important;
    letter-spacing: 0.02em !important;
    color: #ffffff !important;                  /* fallback when gradient text isn't supported */
    background: linear-gradient(90deg, #ffffff 0%, var(--ml-orange) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Contact info inside logo header — light gray on dark, never resolves to
   white-on-white even if AdminLTE's .text-muted rule fires. */
.logo-header .contact-info,
.logo-header .contact-info small,
.logo-header .contact-info .text-muted {
    color: rgba(255, 255, 255, 0.75) !important;
    font-size: 0.82rem;
    letter-spacing: 0.01em;
}

.logo-header .contact-info i {
    color: var(--ml-orange) !important;
}

/* ---------- Language switcher (now on dark bar) ---------- */
.logo-header .dropdown .btn-outline-primary {
    border: 1px solid rgba(248, 150, 33, 0.45) !important;
    color: var(--ml-orange) !important;
    background: rgba(248, 150, 33, 0.06) !important;
    font-weight: 600;
    border-radius: 999px;
    padding: 0.3rem 0.85rem;
    transition: all 0.25s ease;
}

.logo-header .dropdown .btn-outline-primary:hover,
.logo-header .dropdown .btn-outline-primary[aria-expanded="true"] {
    background: var(--ml-orange) !important;
    border-color: var(--ml-orange) !important;
    color: #fff !important;
    box-shadow: 0 4px 12px rgba(248, 150, 33, 0.35);
}

.logo-header .dropdown-menu {
    border: none;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(4, 82, 162, 0.15);
    padding: 0.5rem;
    margin-top: 0.5rem;
}

.logo-header .dropdown-item {
    display: flex;
    align-items: center;
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    transition: background 0.2s ease;
}

.logo-header .dropdown-item:hover {
    background: rgba(4, 82, 162, 0.06);
}

.logo-header .dropdown-item.active {
    background: linear-gradient(90deg, rgba(4, 82, 162, 0.1), rgba(248, 150, 33, 0.1));
    color: var(--ml-blue);
}

/* ---------- Main nav header ----------
   Deep navy with a subtle horizontal vignette. AdminLTE's
   .bg-gradient-primary used to render this bar as a blue→orange
   gradient (parts of which read near-white against white nav text);
   that class has been removed from nav-top.php and this rule is now
   the single source of truth. Multiple selectors + !important on
   both background and background-color so nothing downstream wins. */
.main-header.navbar,
nav.main-header,
body .main-header.navbar {
    background-color: #050d1a !important;
    background-image: linear-gradient(90deg, #050d1a 0%, #0a1a2f 50%, #050d1a 100%) !important;
    border: none !important;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35) !important;
    padding: 0.5rem 0;
    position: relative;
    transition: background 0.4s ease, box-shadow 0.4s ease;
}

/* Force white text on every nav link, regardless of utility classes. */
.main-header .nav-link,
.main-header .nav-link-custom,
.main-header .navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.9) !important;
}

/* Subtle accent stripe at the bottom edge — brand gradient */
.main-header.navbar::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent 0%, var(--ml-orange) 50%, transparent 100%);
    opacity: 0.6;
}

/* Nav links — modern underline animation
   IMPORTANT: default-header.css (loaded earlier in the chain) defines a
   different .nav-link-custom hover treatment (pill background, translateY
   lift, box-shadow) AND a different ::before underline (width-based,
   translateX(-50%)). Those rules stacked with this file caused the underline
   to wobble off-center and the hover to fight itself. We explicitly reset
   them below with !important so this is the single source of truth. */
.main-header .nav-link-custom {
    position: relative;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-size: 0.85rem;
    padding: 0.65rem 1rem !important;
    margin: 0 0.1rem !important;
    color: rgba(255, 255, 255, 0.85) !important;
    background: transparent !important;        /* kill default-header pill bg */
    border-radius: 0 !important;
    box-shadow: none !important;               /* kill default-header lift shadow */
    transform: none !important;                /* kill default-header translateY */
    transition: color 0.25s ease;
}

.main-header .nav-link-custom::before {
    content: '';
    position: absolute;
    left: 20%;
    right: 20%;
    bottom: 4px;
    height: 2px;
    background: var(--ml-orange);
    border-radius: 2px;
    box-shadow: 0 0 8px var(--ml-orange);
    /* scaleX is GPU-accelerated and guarantees the underline grows from
       its centre line in one smooth motion — no left/width race. */
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
    /* Reset width/translateX from default-header.css */
    width: auto !important;
}

.main-header .nav-link-custom:hover,
.main-header .nav-link-custom:focus {
    color: #ffffff !important;
    background: transparent !important;        /* kill default-header pill bg on hover */
    box-shadow: none !important;
    transform: none !important;
}

.main-header .nav-link-custom:hover::before,
.main-header .nav-link-custom.active::before {
    transform: scaleX(1);
    /* override default-header.css's `width: 80%` */
    width: auto !important;
}

/* ---------- Search box ---------- */
.main-header .search-box {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    overflow: hidden;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: border-color 0.25s ease, background 0.25s ease;
}

.main-header .search-box:focus-within {
    border-color: var(--ml-orange);
    background: rgba(255, 255, 255, 0.14);
    box-shadow: 0 0 0 3px rgba(248, 150, 33, 0.15);
}

.main-header .form-control-navbar {
    background: transparent !important;
    border: none !important;
    color: #fff !important;
    padding: 0.4rem 1rem;
}

.main-header .form-control-navbar::placeholder {
    color: rgba(255, 255, 255, 0.55);
}

.main-header .btn-search {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.75);
    padding: 0.4rem 0.85rem;
    transition: color 0.2s ease;
}

.main-header .btn-search:hover {
    color: var(--ml-orange);
}

/* ---------- User menu ---------- */
.main-header .user-dropdown-toggle {
    padding: 0.35rem 0.85rem !important;
    border-radius: 999px;
    transition: background 0.25s ease;
}

.main-header .user-dropdown-toggle:hover {
    background: rgba(255, 255, 255, 0.08);
}

.main-header .user-avatar {
    width: 34px;
    height: 34px;
    object-fit: cover;
    border: 2px solid rgba(248, 150, 33, 0.6);
    box-shadow: 0 0 0 3px rgba(248, 150, 33, 0.15);
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.main-header .user-dropdown-toggle:hover .user-avatar {
    border-color: var(--ml-orange);
    box-shadow: 0 0 0 4px rgba(248, 150, 33, 0.25);
}

.main-header .user-name {
    font-weight: 500;
    font-size: 0.92rem;
}

.dropdown-menu-modern {
    border: none !important;
    border-radius: 14px !important;
    box-shadow: 0 12px 40px rgba(10, 25, 41, 0.25) !important;
    padding: 0 !important;
    overflow: hidden;
    min-width: 260px;
    margin-top: 0.5rem !important;
}

.user-header-modern {
    background: linear-gradient(135deg, var(--ml-blue) 0%, var(--ml-ink-2) 100%);
    color: #fff;
    padding: 1.1rem 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.user-header-modern .user-avatar-large {
    width: 52px;
    height: 52px;
    object-fit: cover;
    border: 2px solid var(--ml-orange);
}

.user-header-modern .user-name-large {
    font-size: 1rem;
    margin: 0;
    color: #fff;
}

.dropdown-item-modern {
    padding: 0.65rem 1.1rem !important;
    font-weight: 500;
    color: #2a3950 !important;
    transition: background 0.18s ease, padding-left 0.18s ease;
}

.dropdown-item-modern:hover {
    background: rgba(4, 82, 162, 0.06) !important;
    padding-left: 1.4rem !important;
}

.dropdown-item-modern.logout-item:hover {
    background: rgba(220, 53, 69, 0.08) !important;
    color: #c82333 !important;
}

/* ---------- Login button (unauthenticated state) ---------- */
.main-header .btn-login {
    background: var(--ml-orange) !important;
    color: #fff !important;
    border: none !important;
    font-weight: 600;
    padding: 0.45rem 1.3rem !important;
    border-radius: 999px;
    box-shadow: 0 4px 14px rgba(248, 150, 33, 0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.main-header .btn-login:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(248, 150, 33, 0.5);
}

/* ---------- Mobile toggle ---------- */
.main-header .navbar-toggler {
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 0.4rem 0.6rem;
}

/* ---------- Responsive tightening ---------- */
@media (max-width: 768px) {
    .logo-brand .company-name {
        font-size: 1.1rem;
    }
    .main-header .nav-link-custom {
        text-align: left;
        padding: 0.7rem 1rem !important;
    }
    .main-header .nav-link-custom::before {
        left: 1rem;
        width: 0;
    }
    .main-header .nav-link-custom:hover::before,
    .main-header .nav-link-custom.active::before {
        width: 24px;
        left: 1rem;
    }
}

/* ============================================================
   FOOTER — sitewide, dark with orange bottom stripe
   ============================================================ */

.ml-footer {
    background: linear-gradient(180deg, #061224 0%, #050d1a 100%);
    color: var(--ml-text-dim);
    padding: 3.5rem 0 0;
    position: relative;
    margin-top: 4rem;
}

.ml-footer .footer-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr 1.2fr;
    gap: 2.5rem;
    padding-bottom: 2.5rem;
}

.ml-footer .footer-brand .footer-logo {
    height: 48px;
    margin-bottom: 1rem;
}

.ml-footer .footer-brand .footer-brand-name {
    font-size: 1.3rem;
    font-weight: 700;
    background: linear-gradient(90deg, #ffffff 0%, var(--ml-orange) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

.ml-footer .footer-brand .footer-tagline {
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.88rem;
    line-height: 1.6;
    margin-bottom: 1.25rem;
    max-width: 320px;
}

.ml-footer .footer-socials {
    display: flex;
    gap: 0.5rem;
}

.ml-footer .footer-socials a {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.75);
    display: grid;
    place-items: center;
    transition: all 0.25s ease;
    font-size: 0.9rem;
}

.ml-footer .footer-socials a:hover {
    background: var(--ml-orange);
    border-color: var(--ml-orange);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(248, 150, 33, 0.4);
}

.ml-footer .footer-col h5 {
    color: #fff;
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 1.2rem;
    position: relative;
    padding-bottom: 0.7rem;
}

.ml-footer .footer-col h5::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 28px;
    height: 2px;
    background: var(--ml-orange);
    border-radius: 2px;
}

.ml-footer .footer-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ml-footer .footer-col li {
    margin-bottom: 0.65rem;
}

.ml-footer .footer-col a,
.ml-footer .footer-col .contact-line {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
    text-decoration: none;
    transition: color 0.2s ease, padding-left 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.ml-footer .footer-col a:hover {
    color: var(--ml-orange);
    padding-left: 4px;
    text-decoration: none;
}

.ml-footer .footer-col .contact-line i {
    color: var(--ml-orange);
    width: 16px;
}

/* Footer newsletter */
.ml-footer .footer-newsletter-form {
    margin-top: 0.5rem;
    display: flex;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    overflow: hidden;
    padding: 4px;
}

.ml-footer .footer-newsletter-form input {
    background: transparent;
    border: none;
    color: #fff;
    flex: 1;
    padding: 0.5rem 0.9rem;
    font-size: 0.88rem;
    outline: none;
}

.ml-footer .footer-newsletter-form input::placeholder {
    color: rgba(255, 255, 255, 0.45);
}

.ml-footer .footer-newsletter-form button {
    background: var(--ml-orange);
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: 0.5rem 1rem;
    font-weight: 600;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background 0.2s ease;
}

.ml-footer .footer-newsletter-form button:hover {
    background: var(--ml-orange-bright);
}

/* Bottom stripe */
.ml-footer .footer-bottom {
    background: var(--ml-orange);
    color: #fff;
    text-align: center;
    padding: 0.85rem 1rem;
    font-size: 0.82rem;
    letter-spacing: 0.05em;
    margin-top: 1rem;
}

.ml-footer .footer-bottom a {
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    border-bottom: 1px dotted rgba(255, 255, 255, 0.6);
}

/* Responsive */
@media (max-width: 992px) {
    .ml-footer .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 600px) {
    .ml-footer .footer-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}
