/* ==========================================================================
   G.R. Medical College, Hospital & Research Centre
   Header Component Stylesheet (Figma Pixel-Perfect Implementation)
   Font: Instrument Sans | Brand Colors: #2A3EC0 (Blue), #ED2225 (Red)
   ========================================================================== */

:root {
    --gr-font-family: 'Instrument Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

    /* Brand Colors from Figma */
    --gr-primary-blue: #2A3EC0;
    --gr-primary-blue-hover: #1e2fa0;
    --gr-accent-red: #ED2225;
    --gr-accent-red-hover: #d6181b;

    /* Neutrals */
    --gr-text-dark: #1E1E1E;
    --gr-text-muted: #555555;
    --gr-border-divider: #E5E7EB;
    --gr-border-light: #EEEEEE;
    --gr-bg-white: #FFFFFF;
    --gr-bg-subtle: #F7F9FC;
    --gr-bg-hover: #F0F3FA;

    /* Dimensions */
    --gr-header-height: 125px;
    --gr-header-max-width: 100%;

    /* Shadows & Transitions */
    --gr-shadow-dropdown: 0 16px 36px rgba(20, 45, 95, 0.12);
    --gr-transition-fast: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --gr-transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Global Reset for Header */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--gr-font-family);
    color: var(--gr-text-dark);
    background-color: #FFFFFF;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* ==========================================================================
   Header Main Container (Full Width Edge-to-Edge)
   ========================================================================== */
.gr-header {
    width: 100%;
    background-color: var(--gr-bg-white);
    border-bottom: 1px solid var(--gr-border-light);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: var(--gr-transition-smooth);
}

.gr-header.header-scrolled {
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.08);
}

.gr-header-container {
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 31px;
    height: var(--gr-header-height);
    min-height: var(--gr-header-height);
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    position: relative;
    box-sizing: border-box;
}

/* ==========================================================================
   Brand & Logo Section
   ========================================================================== */
.gr-brand {
    display: flex;
    align-items: center;
    gap: 16px;
    text-decoration: none;
    color: inherit;
    flex-shrink: 0;
    transition: var(--gr-transition-fast);
}

.gr-brand:hover {
    opacity: 0.95;
}

.gr-brand-logo img {
    width: auto;
    height: 78px;
    display: block;
    object-fit: contain;
}

.gr-brand-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.gr-brand-title {
    font-family: var(--gr-font-family);
    font-size: 18px;
    font-weight: 700;
    line-height: 1.25;
    color: var(--gr-primary-blue);
    letter-spacing: -0.01em;
}

.gr-brand-trust {
    font-family: var(--gr-font-family);
    font-size: 13.5px;
    font-weight: 400;
    color: #444444;
    margin-top: 3px;
}

/* ==========================================================================
   Desktop Navigation Wrapper
   ========================================================================== */
.gr-nav-wrapper {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-end;
    flex-grow: 1;
    height: 100%;
    margin-left: 28px;
    padding-top: 14px;
}

/* ==========================================================================
   Top Utility Bar
   ========================================================================== */
.gr-topbar {
    display: flex;
    justify-content: flex-end;
    width: 100%;
    margin-bottom: 10px;
}

.gr-topbar-nav {
    display: flex;
    align-items: center;
    list-style: none;
    gap: 22px;
    white-space: nowrap;
}

.top-dot {
    width: 3.5px;
    height: 3.5px;
    border-radius: 50%;
    background-color: #1E1E1E;
    display: inline-block;
    margin-right: 6px;
    flex-shrink: 0;
    vertical-align: middle;
}

.top-dot.dot-red {
    background-color: var(--gr-accent-red);
}

.top-link {
    font-family: var(--gr-font-family);
    font-size: 13.5px;
    font-weight: 400;
    color: var(--gr-text-dark);
    text-decoration: none;
    transition: var(--gr-transition-fast);
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
}

.top-link:hover {
    color: var(--gr-primary-blue);
}

/* Admission Open Highlighting */
.top-link-admission {
    color: var(--gr-accent-red);
    font-weight: 500;
}

.top-link-admission:hover {
    color: var(--gr-accent-red-hover);
}

/* ==========================================================================
   Divider Line
   ========================================================================== */
.gr-nav-divider {
    width: 100%;
    height: 1px;
    background-color: var(--gr-border-divider);
    margin: 0;
}

/* ==========================================================================
   Main Navigation Bar
   ========================================================================== */
.gr-main-nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    width: 100%;
    height: 60px;
    gap: 24px;
}

.gr-nav-list {
    display: flex;
    align-items: center;
    list-style: none;
    gap: 24px;
    height: 100%;
    white-space: nowrap;
    flex-wrap: nowrap;
}

.gr-nav-item {
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
    white-space: nowrap;
    flex-shrink: 0;
}

.gr-nav-link {
    font-family: var(--gr-font-family);
    font-size: 15px;
    font-weight: 500;
    color: var(--gr-text-dark);
    text-decoration: none;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 6px 0;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    transition: var(--gr-transition-fast);
}

.gr-nav-link:hover,
.gr-nav-item.active>.gr-nav-link {
    color: var(--gr-primary-blue);
}

/* Hide default Bootstrap dropdown-toggle caret arrow */
.gr-nav-link.dropdown-toggle::after,
.gr-nav-link::after,
.dropdown-toggle::after {
    display: none !important;
    content: none !important;
}

.dropdown-chevron {
    transition: transform 0.2s ease;
    color: var(--gr-text-dark);
    margin-left: 2px;
}

.gr-nav-item:hover .dropdown-chevron,
.gr-nav-item.open .dropdown-chevron {
    transform: rotate(180deg);
    color: var(--gr-primary-blue);
}

/* ==========================================================================
   Dropdown Menus (Luminous Ultra-Light Frosted Glass Aesthetic matching Figma)
   ========================================================================== */
.gr-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    width: 100%;
    transform: translateY(0);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.95) 0%, rgba(246, 251, 255, 0.90) 100%);
    backdrop-filter: blur(24px) saturate(160%);
    -webkit-backdrop-filter: blur(24px) saturate(160%);
    border-radius: 0;
    border-left: none;
    border-right: none;
    border-top: 1px solid rgba(255, 255, 255, 0.95);
    border-bottom: 1px solid rgba(215, 230, 250, 0.7);
    box-shadow: 0 16px 36px -10px rgba(20, 50, 120, 0.06);
    padding: 36px 0 46px 0;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1), transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1010;
}

.gr-dropdown-menu::before {
    display: none;
}

/* Dropdown Open / Hover States */
.gr-nav-item:hover>.gr-dropdown-menu,
.gr-nav-item.is-hovered>.gr-dropdown-menu,
.gr-nav-item.open>.gr-dropdown-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

.gr-nav-item:hover>.dropdown-chevron,
.gr-nav-item.is-hovered>.dropdown-chevron,
.gr-nav-item.open>.dropdown-chevron {
    transform: rotate(180deg);
    color: var(--gr-primary-blue);
}

.gr-nav-item.mega-dropdown {
    position: static;
}

/* Simple Dropdown Submenus (Generous Figma Spacing & Whitish Frosted Glass Card) */
.gr-dropdown-menu.simple-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: auto;
    min-width: 360px;
    width: max-content;
    max-width: 440px;
    transform: translateY(0);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.95) 0%, rgba(246, 251, 255, 0.90) 100%);
    backdrop-filter: blur(24px) saturate(160%);
    -webkit-backdrop-filter: blur(24px) saturate(160%);
    border-radius: 0;
    border: 1px solid rgba(220, 234, 252, 0.9);
    box-shadow: 0 16px 36px rgba(20, 45, 95, 0.09);
    padding: 42px 40px 48px 44px;
    z-index: 1010;
}

.dropdown-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.dropdown-list li a {
    display: inline-block;
    font-size: 16px;
    font-weight: 400;
    color: #1E1E1E;
    text-decoration: none;
    padding: 2px 0;
    transition: color 0.15s ease;
}

.dropdown-list li a:hover {
    color: var(--gr-primary-blue);
    background: transparent;
}

/* Mega Menu for Departments (Full Width Whitish Frosted Glass Panel as per Figma) */
.gr-dropdown-menu.mega-menu {
    position: absolute;
    top: 93%;
    left: 0;
    right: 0;
    width: 100%;
    transform: translateY(0);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.95) 0%, rgba(246, 251, 255, 0.90) 100%);
    backdrop-filter: blur(24px) saturate(160%);
    -webkit-backdrop-filter: blur(24px) saturate(160%);
    border-radius: 0;
    border-left: none;
    border-right: none;
    border-top: 1px solid rgba(255, 255, 255, 0.95);
    border-bottom: 1px solid rgba(215, 230, 250, 0.7);
    box-shadow: 0 16px 36px -10px rgba(20, 50, 120, 0.06);
    padding: 36px 0 46px 0;
    z-index: 999;
}

.gr-dropdown-menu.mega-menu::before {
    display: none;
}

.gr-nav-item.mega-dropdown:hover>.gr-dropdown-menu.mega-menu,
.gr-nav-item.mega-dropdown.is-hovered>.gr-dropdown-menu.mega-menu,
.gr-nav-item.mega-dropdown.open>.gr-dropdown-menu.mega-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

.mega-menu-inner {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0 32px;
}

.mega-menu-grid {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 48px;
}

.mega-col-clinical {
    flex: 1 1 480px;
    max-width: 540px;
}

.mega-col-preclinical {
    flex: 0 1 200px;
}

.mega-col-postclinical {
    flex: 0 1 260px;
}

.mega-col-title {
    font-family: var(--gr-font-family);
    font-size: 15px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--gr-primary-blue);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(42, 62, 192, 0.2);
    width: 100%;
}

.mega-col-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.mega-col-list li a {
    display: inline-block;
    font-size: 14px;
    font-weight: 400;
    color: #1E1E1E;
    text-decoration: none;
    padding: 2px 0;
    transition: color 0.15s ease;
}

.mega-col-list li a:hover {
    color: var(--gr-primary-blue);
    background: transparent;
    padding-left: 0;
}

.mega-subgrid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px;
}

/* ==========================================================================
   Emergency CTA Button
   ========================================================================== */
.gr-btn-emergency {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    background-color: var(--gr-accent-red);
    color: #FFFFFF !important;
    font-family: var(--gr-font-family);
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    padding: 9px 20px;
    border-radius: 3px;
    transition: background-color 0.2s ease;
    flex-shrink: 0;
    white-space: nowrap;
}

.gr-btn-emergency:hover {
    background-color: var(--gr-accent-red-hover);
}

.gr-btn-emergency .phone-icon {
    flex-shrink: 0;
}

/* ==========================================================================
   Mobile Toggle Button
   ========================================================================== */
.gr-mobile-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 42px;
    height: 42px;
    background: transparent;
    border: 1px solid var(--gr-border-divider);
    border-radius: 8px;
    cursor: pointer;
    padding: 9px;
    z-index: 1020;
    transition: var(--gr-transition-fast);
}

.gr-mobile-toggle:hover {
    background-color: var(--gr-bg-hover);
}

.gr-mobile-toggle .bar {
    width: 100%;
    height: 2.5px;
    background-color: var(--gr-text-dark);
    border-radius: 2px;
    transition: var(--gr-transition-smooth);
}

.gr-mobile-toggle.is-active .bar-1 {
    transform: translateY(7px) rotate(45deg);
}

.gr-mobile-toggle.is-active .bar-2 {
    opacity: 0;
}

.gr-mobile-toggle.is-active .bar-3 {
    transform: translateY(-7px) rotate(-45deg);
}

/* ==========================================================================
   Mobile Drawer & Backdrop
   ========================================================================== */
.gr-mobile-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: var(--gr-transition-smooth);
    z-index: 1050;
}

.gr-mobile-backdrop.is-visible {
    opacity: 1;
    visibility: visible;
}

.gr-mobile-drawer {
    position: fixed;
    top: 0;
    right: -360px;
    width: 340px;
    max-width: 85vw;
    height: 100vh;
    background: var(--gr-bg-white);
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.15);
    z-index: 1060;
    transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.gr-mobile-drawer.is-open {
    right: 0;
}

.gr-mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px solid var(--gr-border-light);
}

.gr-mobile-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    color: var(--gr-primary-blue);
    font-size: 15px;
}

.gr-mobile-close {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--gr-text-dark);
    padding: 4px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gr-mobile-close:hover {
    background-color: var(--gr-bg-hover);
}

.gr-mobile-content {
    padding: 20px;
    flex-grow: 1;
}

.mobile-emergency {
    width: 100%;
    margin-bottom: 20px;
    padding: 12px 16px;
    border-radius: 8px;
}

/* Mobile Nav Accordion */
.gr-mobile-nav {
    list-style: none;
    margin-bottom: 24px;
}

.mobile-nav-item {
    border-bottom: 1px solid var(--gr-border-light);
}

.mobile-nav-toggle,
.mobile-nav-direct {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 14px 4px;
    background: transparent;
    border: none;
    font-family: var(--gr-font-family);
    font-size: 16px;
    font-weight: 600;
    color: var(--gr-text-dark);
    text-decoration: none;
    cursor: pointer;
    text-align: left;
}

.accordion-arrow {
    transition: transform 0.25s ease;
}

.mobile-nav-item.is-open .accordion-arrow {
    transform: rotate(180deg);
}

.mobile-accordion-body {
    display: none;
    padding: 0 8px 14px 12px;
}

.mobile-nav-item.is-open .mobile-accordion-body {
    display: block;
}

.mobile-category {
    margin-bottom: 12px;
}

.mobile-category h5 {
    font-size: 12px;
    text-transform: uppercase;
    color: var(--gr-primary-blue);
    font-weight: 700;
    margin-bottom: 6px;
}

.mobile-accordion-body ul {
    list-style: none;
}

.mobile-accordion-body ul li a {
    display: block;
    padding: 7px 0;
    font-size: 14px;
    color: var(--gr-text-dark);
    text-decoration: none;
    transition: var(--gr-transition-fast);
}

.mobile-accordion-body ul li a:hover {
    color: var(--gr-primary-blue);
    padding-left: 6px;
}

/* Quick Links in Mobile */
.mobile-quick-links {
    background: var(--gr-bg-subtle);
    padding: 16px;
    border-radius: 8px;
}

.quick-links-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    color: #888888;
    display: block;
    margin-bottom: 10px;
}

.mobile-quick-links ul {
    list-style: none;
}

.mobile-quick-links ul li a {
    display: block;
    padding: 8px 0;
    font-size: 14px;
    color: var(--gr-text-dark);
    text-decoration: none;
}

.mobile-quick-links ul li a:hover {
    color: var(--gr-primary-blue);
}

.mobile-admission-badge {
    color: var(--gr-accent-red) !important;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* ==========================================================================
   Responsive Media Queries for Universal Screen Compatibility (100% Zoom)
   ========================================================================== */

/* Large Laptops / Monitors (1400px - 1560px) */
@media (max-width: 1560px) {
    .gr-header-container {
        padding: 0 24px;
    }

    .gr-brand-title {
        font-size: 16.5px;
    }

    .gr-brand-logo img {
        height: 70px;
    }

    .gr-nav-wrapper {
        margin-left: 18px;
    }

    .gr-topbar-nav {
        gap: 16px;
    }

    .top-link {
        font-size: 12.5px;
    }

    .gr-main-nav {
        gap: 16px;
    }

    .gr-nav-list {
        gap: 16px;
    }

    .gr-nav-link {
        font-size: 14px;
    }
}

/* Medium Laptops (1280px - 1399px, Standard 100% Zoom Viewports) */
@media (max-width: 1399px) {
    :root {
        --gr-header-height: 115px;
    }

    .gr-brand {
        gap: 12px;
    }

    .gr-brand-title {
        font-size: 15px;
    }

    .gr-brand-trust {
        font-size: 12px;
    }

    .gr-brand-logo img {
        height: 62px;
    }

    .gr-nav-wrapper {
        margin-left: 12px;
        padding-top: 10px;
    }

    .gr-topbar {
        margin-bottom: 6px;
    }

    .gr-topbar-nav {
        gap: 12px;
    }

    .top-link {
        font-size: 11.5px;
    }

    .gr-main-nav {
        height: 52px;
        gap: 12px;
    }

    .gr-nav-list {
        gap: 12px;
    }

    .gr-nav-link {
        font-size: 13px;
    }

    .gr-contact-btn {
        height: 38px;
        padding: 0 16px;
        font-size: 13px;
    }
}

/* Small Laptops (1150px - 1279px) */
@media (max-width: 1279px) {
    .gr-header-container {
        padding: 0 12px;
    }

    .gr-brand {
        gap: 8px;
    }

    .gr-brand-title {
        font-size: 13.5px;
        line-height: 1.2;
    }

    .gr-brand-trust {
        font-size: 11px;
    }

    .gr-brand-logo img {
        height: 54px;
    }

    .gr-nav-wrapper {
        margin-left: 8px;
    }

    .gr-topbar-nav {
        gap: 9px;
    }

    .top-link {
        font-size: 11px;
    }

    .gr-nav-list {
        gap: 9px;
    }

    .gr-nav-link {
        font-size: 12px;
    }

    .gr-contact-btn {
        height: 36px;
        padding: 0 12px;
        font-size: 12px;
    }
}

/* Mobile & Tablet Breakpoint (< 1150px) */
@media (max-width: 1149px) {
    .gr-header-container {
        height: auto;
        min-height: 80px;
        padding: 12px 20px;
        align-items: center;
    }

    .gr-nav-wrapper {
        display: none;
        /* Switch to Mobile Navigation Drawer */
    }

    .gr-mobile-toggle {
        display: flex;
    }

    .gr-brand-logo img {
        height: 56px;
    }

    .gr-brand-title {
        font-size: 15px;
    }

    .gr-brand-trust {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .gr-brand-info {
        max-width: 210px;
    }

    .gr-brand-title {
        font-size: 13px;
        line-height: 1.2;
    }

    .gr-brand-trust {
        font-size: 11px;
    }

    .gr-brand-logo img {
        height: 44px;
    }
}