/**
 * ==============================================================================
 * CMCHIS & GOVERNMENT OF TAMIL NADU - OFFICIAL PORTAL DESIGN SYSTEM
 * Department of Otorhinolaryngology (ENT) - Thanjavur Medical College & Hospital
 * ==============================================================================
 * Inspiration: Chief Minister's Comprehensive Health Insurance Scheme (CMCHIS)
 * Colors:
 * - CMCHIS Deep Navy:        #0F3562 / #0C2E56
 * - Tamil Nadu Govt Green:   #007A3D
 * - Govt Header Crimson:     #C8102E
 * - Top Utility Bar Blue:    #002B66
 * - Accent Gold:             #E5A823
 * - Clean White Surface:     #FFFFFF
 * - Page Background:         #F3F5F9
 * ==============================================================================
 */

:root {
    --cmchis-navy: #0F3562;
    --cmchis-navy-dark: #0A2240;
    --cmchis-navy-light: #164780;
    --cmchis-navy-hover: #1E5596;
    --cmchis-top-blue: #002B66;
    --cmchis-crimson: #C8102E;
    --cmchis-crimson-hover: #A00C24;
    --cmchis-tn-green: #007A3D;
    --cmchis-gold: #E5A823;
    --cmchis-bg: #F4F6FA;
    --cmchis-surface: #FFFFFF;
    --cmchis-border: #DDE3ED;
    --cmchis-text-main: #1A2238;
    --cmchis-text-muted: #5A6578;
}

body.cmchis-body-layout {
    background-color: var(--cmchis-bg);
    color: var(--cmchis-text-main);
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ------------------------------------------------------------------------------
   1. TOP RED & BLUE NEWS TICKER & UTILITY BAR
   ------------------------------------------------------------------------------ */
.cmchis-topbar {
    background-color: var(--cmchis-top-blue);
    color: #FFFFFF;
    font-size: 0.81rem;
    min-height: 38px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    position: relative;
    z-index: 1040;
}

.cmchis-news-badge {
    background-color: var(--cmchis-crimson);
    color: #FFFFFF;
    font-weight: 800;
    letter-spacing: 0.05em;
    font-size: 0.75rem;
    padding: 0.5rem 1.15rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    text-transform: uppercase;
    position: relative;
    clip-path: polygon(0 0, 92% 0, 100% 100%, 0 100%);
    padding-right: 1.5rem;
    white-space: nowrap;
    flex-shrink: 0;
}

.cmchis-ticker-container {
    overflow: hidden;
    white-space: nowrap;
    position: relative;
    flex-grow: 1;
    mask-image: linear-gradient(to right, transparent, black 20px, black 95%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 20px, black 95%, transparent);
}

.cmchis-ticker-track {
    display: inline-block;
    padding-left: 100%;
    animation: cmchisTicker 32s linear infinite;
}

.cmchis-ticker-container:hover .cmchis-ticker-track {
    animation-play-state: paused;
}

@keyframes cmchisTicker {
    0% { transform: translate3d(0, 0, 0); }
    100% { transform: translate3d(-100%, 0, 0); }
}

.cmchis-ticker-item {
    display: inline-flex;
    align-items: center;
    color: #F8FAFC;
    font-weight: 500;
    margin-right: 2.5rem;
    text-decoration: none;
    font-size: 0.8rem;
}

.cmchis-ticker-item:hover {
    color: #FDE047;
}

.cmchis-ticker-item .bullet {
    color: #F87171;
    margin-right: 0.5rem;
    font-size: 1rem;
}

.cmchis-topbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
    padding: 0 0.75rem;
}

.cmchis-top-contact {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: #E2E8F0;
    font-size: 0.78rem;
    text-decoration: none;
    white-space: nowrap;
}

.cmchis-top-contact i {
    color: #38BDF8;
    font-size: 0.95rem;
}

.cmchis-top-contact:hover {
    color: #FFFFFF;
}

.cmchis-a11y-group {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    background: rgba(255, 255, 255, 0.12);
    padding: 0.15rem 0.35rem;
    border-radius: 4px;
}

.cmchis-a11y-btn {
    background: transparent;
    border: none;
    color: #FFFFFF;
    font-size: 0.74rem;
    font-weight: 700;
    padding: 0.15rem 0.35rem;
    border-radius: 3px;
    cursor: pointer;
    line-height: 1;
    transition: background 0.15s ease;
}

.cmchis-a11y-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

.cmchis-lang-btn {
    color: #FFFFFF;
    font-size: 0.76rem;
    font-weight: 700;
    text-decoration: none;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.15);
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.cmchis-lang-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    color: #FFFFFF;
}

/* ------------------------------------------------------------------------------
   2. MAIN GOVERNMENT BRANDING HEADER (WHITE BAR WITH CRESTS & OFFICIAL TITLES)
   ------------------------------------------------------------------------------ */
.cmchis-branding-header {
    background-color: var(--cmchis-surface);
    border-bottom: 2px solid #E2E8F0;
    padding: 0.85rem 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
    position: relative;
    z-index: 1030;
}

.cmchis-branding-container {
    max-width: 1600px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.cmchis-header-left,
.cmchis-header-right {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    flex-shrink: 0;
}

.cmchis-crest-logo {
    height: 78px;
    width: 78px;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.08));
    transition: transform 0.2s ease;
}

.cmchis-crest-logo:hover {
    transform: scale(1.03);
}

.cmchis-header-center {
    text-align: center;
    flex-grow: 1;
    padding: 0 1rem;
}

.cmchis-title-tn {
    font-size: 1.12rem;
    font-weight: 800;
    color: var(--cmchis-tn-green);
    letter-spacing: 0.02em;
    margin-bottom: 0.15rem;
    text-transform: capitalize;
}

.cmchis-title-dept {
    font-family: 'Outfit', 'Plus Jakarta Sans', sans-serif;
    font-size: 1.65rem;
    font-weight: 800;
    color: var(--cmchis-navy);
    letter-spacing: -0.01em;
    margin-bottom: 0.15rem;
    line-height: 1.25;
}

.cmchis-title-college {
    font-size: 0.96rem;
    font-weight: 700;
    color: var(--cmchis-crimson);
    letter-spacing: 0.01em;
    margin-bottom: 0;
}

@media (max-width: 1200px) {
    .cmchis-title-dept {
        font-size: 1.35rem;
    }
    .cmchis-crest-logo {
        height: 64px;
        width: 64px;
    }
}

@media (max-width: 991px) {
    .cmchis-branding-container {
        flex-direction: column;
        text-align: center;
        gap: 0.75rem;
    }
    .cmchis-header-left, .cmchis-header-right {
        justify-content: center;
    }
    .cmchis-header-right {
        display: none !important;
    }
    .cmchis-crest-logo {
        height: 56px;
        width: 56px;
    }
    .cmchis-title-dept {
        font-size: 1.25rem;
    }
    .cmchis-title-tn {
        font-size: 0.95rem;
    }
    .cmchis-title-college {
        font-size: 0.85rem;
    }
}

/* ------------------------------------------------------------------------------
   3. HORIZONTAL FULL-WIDTH NAVIGATION BAR (CMCHIS DEEP NAVY BLUE)
   ------------------------------------------------------------------------------ */
.cmchis-navbar {
    background: linear-gradient(180deg, #124074 0%, #0c2d54 100%);
    box-shadow: 0 4px 12px rgba(10, 34, 64, 0.18);
    position: sticky;
    top: 0;
    z-index: 1020;
    padding: 0;
    border-bottom: 3px solid var(--cmchis-gold);
}

.cmchis-navbar-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.cmchis-nav-list {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    flex-wrap: nowrap;
}

.cmchis-nav-item {
    position: relative;
}

.cmchis-nav-link {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: #FFFFFF !important;
    text-decoration: none;
    padding: 0.85rem 1rem;
    font-size: 0.88rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    white-space: nowrap;
    transition: background-color 0.2s ease, color 0.2s ease;
    border-top: 3px solid transparent;
    cursor: pointer;
}

.cmchis-nav-link i.caret-icon {
    font-size: 0.75rem;
    opacity: 0.8;
    transition: transform 0.2s ease;
}

.cmchis-nav-link:hover,
.cmchis-nav-item:hover > .cmchis-nav-link {
    background-color: var(--cmchis-navy-hover);
    color: #FFFFFF !important;
    border-top-color: var(--cmchis-gold);
}

.cmchis-nav-item:hover > .cmchis-nav-link i.caret-icon {
    transform: rotate(180deg);
}

.cmchis-nav-link.active {
    background-color: rgba(255, 255, 255, 0.15);
    border-top-color: #FDE047;
    color: #FFFFFF !important;
}

/* Dropdown Menus */
.cmchis-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: #FFFFFF;
    border: 1px solid #CBD5E1;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 12px 28px rgba(10, 34, 64, 0.2);
    min-width: 240px;
    padding: 0.45rem 0;
    list-style: none;
    margin: 0;
    display: none;
    z-index: 1050;
    animation: cmchisFadeSlide 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes cmchisFadeSlide {
    0% {
        opacity: 0;
        transform: translateY(-6px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Hover Support for Desktop */
@media (min-width: 992px) {
    .cmchis-nav-item.dropdown:hover > .cmchis-dropdown-menu {
        display: block;
    }
}

.cmchis-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.65rem 1.15rem;
    color: #1E293B;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: background 0.15s ease, color 0.15s ease, padding-left 0.15s ease;
    border-left: 3px solid transparent;
}

.cmchis-dropdown-item i {
    font-size: 1rem;
    color: var(--cmchis-navy);
    width: 18px;
    text-align: center;
}

.cmchis-dropdown-item:hover {
    background-color: #F1F5F9;
    color: var(--cmchis-navy);
    padding-left: 1.35rem;
    border-left-color: var(--cmchis-navy);
    font-weight: 600;
}

.cmchis-dropdown-item.active {
    background-color: #EEF2F6;
    color: var(--cmchis-navy);
    border-left-color: var(--cmchis-navy);
    font-weight: 700;
}

/* Right-side Utilities in Nav */
.cmchis-nav-utilities {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-left: auto;
    padding-left: 1rem;
}

.cmchis-nav-btn {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #FFFFFF !important;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    white-space: nowrap;
}

.cmchis-nav-btn:hover {
    background: rgba(255, 255, 255, 0.22);
    color: #FFFFFF !important;
    border-color: rgba(255, 255, 255, 0.4);
}

.cmchis-user-pill {
    background: #FFFFFF;
    color: var(--cmchis-navy) !important;
    border-radius: 50px;
    padding: 0.25rem 0.85rem 0.25rem 0.35rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
    cursor: pointer;
}

.cmchis-user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background-color: var(--cmchis-navy);
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 800;
}

/* ------------------------------------------------------------------------------
   4. FULL-WIDTH LANDSCAPE CONTENT WRAPPER
   ------------------------------------------------------------------------------ */
.cmchis-main-wrapper {
    flex-grow: 1;
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    padding: 1.5rem 1rem 3rem;
    box-sizing: border-box;
}

/* Override existing sidebar styles when full-width horizontal nav is active */
.dashboard-layout {
    display: block !important;
    background: transparent !important;
}

.dashboard-layout > nav.sidebar {
    display: none !important;
}

.dashboard-layout > .main-wrapper,
.dashboard-layout > .content-wrapper {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    height: auto !important;
    min-height: auto !important;
    overflow: visible !important;
    background: transparent !important;
}

/* Hide duplicate header inside dashboard.php since horizontal nav is active */
.dashboard-layout > .main-wrapper > header.sticky-top {
    display: none !important;
}

.main-content {
    padding: 0 !important;
}

/* ------------------------------------------------------------------------------
   5. PROFESSIONAL GOVERNMENT MEDICAL FOOTER
   ------------------------------------------------------------------------------ */
.cmchis-footer {
    background: linear-gradient(180deg, #0C2E56 0%, #061A33 100%);
    color: #CBD5E1;
    font-size: 0.85rem;
    margin-top: auto;
    border-top: 4px solid var(--cmchis-gold);
}

.cmchis-footer-top {
    max-width: 1600px;
    margin: 0 auto;
    padding: 3rem 1.5rem 2rem;
}

.cmchis-footer-title {
    color: #FFFFFF;
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 1.15rem;
    position: relative;
    padding-bottom: 0.5rem;
}

.cmchis-footer-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 36px;
    height: 2.5px;
    background-color: var(--cmchis-gold);
    border-radius: 2px;
}

.cmchis-footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.cmchis-footer-links li {
    margin-bottom: 0.55rem;
}

.cmchis-footer-links a {
    color: #94A3B8;
    text-decoration: none;
    transition: color 0.15s ease, padding-left 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.cmchis-footer-links a:hover {
    color: #FFFFFF;
    padding-left: 0.35rem;
}

.cmchis-footer-bottom {
    background-color: #041224;
    padding: 1.25rem 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.78rem;
    color: #94A3B8;
}

.cmchis-footer-bottom-container {
    max-width: 1600px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: gap;
    gap: 1rem;
}

@media (max-width: 768px) {
    .cmchis-footer-bottom-container {
        flex-direction: column;
        text-align: center;
    }
}

/* ------------------------------------------------------------------------------
   6. ACTIVITY TABS & SPECIAL MODULE CARDS
   ------------------------------------------------------------------------------ */
.activity-hero-banner {
    background: linear-gradient(135deg, #0F3562 0%, #1A4E8C 100%);
    border-radius: 16px;
    padding: 2rem;
    color: #FFFFFF;
    box-shadow: 0 8px 24px rgba(15, 53, 98, 0.15);
    margin-bottom: 1.75rem;
}

.activity-hero-badge {
    background: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #FFFFFF;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 0.35rem 0.85rem;
    border-radius: 50px;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
}

.activity-stat-card {
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 14px;
    padding: 1.25rem 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.activity-stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}
