/* =========================================
   EMERGENCY PAGE SPECIFIC STYLES
   ========================================= */

/* Hero Section for Emergency Page */
.hero-centered {
    background-color: var(--deep-blue);
    min-height: 10vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    color: var(--white);
}

.hero-centered h1 {
    font-size: 3rem;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: #fff;
}

/* NEWS SECTION - MUST BE ABOVE EVERYTHING */
.news-section {
    background-color: var(--deep-blue);
    color: var(--white);
    padding: 15px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
    z-index: 100; /* HIGH z-index to stay above emergency content */
}

.news-wrapper {
    display: flex;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.news-label {
    font-family: var(--font-sans);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 1px;
    background-color: var(--primary-blue);
    padding: 5px 15px;
    border-radius: 4px;
    white-space: nowrap;
    margin-right: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    z-index: 10;
    position: relative;
}

.news-ticker-container {
    flex-grow: 1;
    overflow: hidden;
    position: relative;
    mask-image: linear-gradient(to right, black 90%, transparent 100%);
    -webkit-mask-image: linear-gradient(to right, black 90%, transparent 100%);
}

.news-list {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
    width: max-content;
    /* Always animate in a continuous loop */
    animation: scrollSeamless 18s linear infinite;
}

.news-item {
    padding-right: 50px;
    font-size: 0.9rem;
    white-space: nowrap;
    display: flex;
    align-items: center;
}

.news-item a {
    color: var(--white);
    text-decoration: none;
    transition: color 0.3s;
}

.news-item a:hover {
    color: #8fb3ff;
    text-decoration: underline;
}

.news-date {
    font-size: 0.75rem;
    opacity: 0.7;
    margin-right: 10px;
    border: 1px solid rgba(255,255,255,0.3);
    padding: 2px 6px;
    border-radius: 3px;
}

@keyframes scrollSeamless {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.news-item {
    padding-right: 50px;
    font-size: 0.9rem;
    white-space: nowrap;
    display: flex;
    align-items: center;
}

.news-item a {
    color: var(--white);
    text-decoration: none;
    transition: color 0.3s;
}

.news-item a:hover {
    color: #8fb3ff;
    text-decoration: underline;
}

.news-date {
    font-size: 0.75rem;
    opacity: 0.7;
    margin-right: 10px;
    border: 1px solid rgba(255,255,255,0.3);
    padding: 2px 6px;
    border-radius: 3px;
}

@keyframes scrollSeamless {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* =========================================
   EMERGENCY CONTAINER - LOWER Z-INDEX
   ========================================= */
.emergency-container {
    display: flex;
    gap: 30px;
    margin-top: 10px;
    margin-bottom: 60px;
    position: relative;
    z-index: 1; /* LOWER than news section */
}

/* =========================================
   SIDEBAR NAVIGATION
   ========================================= */
.emergency-sidebar {
    width: 280px;
    background: white;
    padding: 30px 20px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    height: fit-content;
    position: sticky;
    top: 100px;
    z-index: 1; /* LOWER than news */
}

.e-nav-btn {
    display: block;
    width: 100%;
    text-align: left;
    padding: 14px 20px;
    margin-bottom: 8px;
    background: transparent;
    border: none;
    border-left: 3px solid transparent;
    color: var(--deep-blue);
    font-weight: 500;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 6px;
}

.e-nav-btn:hover {
    background: #F0F4F8;
    border-left-color: var(--primary-blue);
}

.e-nav-btn.active {
    background: #DCE4F2;
    border-left-color: var(--deep-blue);
    font-weight: 700;
    color: var(--deep-blue);
}

.e-nav-link {
    display: block;
    padding: 12px 20px;
    margin-top: 20px;
    color: var(--primary-blue);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: color 0.3s;
}

.e-nav-link:hover {
    color: var(--deep-blue);
    text-decoration: none;
}

/* =========================================
   CONTENT WRAPPER
   ========================================= */
.emergency-content-wrapper {
    flex: 1;
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    position: relative;
    z-index: 1; /* LOWER than news */
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* =========================================
   HEADS GRID (for CMHW Heads section)
   ========================================= */
.heads-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    margin-top: 20px;
    justify-content: center;  /* Centers items */
}
.heads-grid .head-card:only-child {
    grid-column: 1 / -1;
    max-width: 500px;
    margin: 0 auto;
}

.head-card {
    flex: 0 1 calc(50% - 15px);  /* 2 cards per row */
    max-width: 500px;
    text-align: center; /* Center all content including image */
}

/* Single card will auto-center */

.head-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

.head-img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 20px; /* Center the image horizontally */
    display: block;
    border: 4px solid white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* =========================================
   CONTACT ROWS (for all other sections)
   ========================================= */
.contact-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    margin-bottom: 15px;
    background: #F9FAFB;
    border-radius: 8px;
    border-left: 4px solid var(--primary-blue);
    transition: all 0.3s;
}

.contact-row:hover {
    background: #F0F4F8;
    transform: translateX(5px);
}

.dept-name {
    font-weight: 700;
    color: var(--deep-blue);
    font-size: 1rem;
    width: 40%;
}

.person-name {
    font-size: 0.95rem;
    color: #666;
    width: 30%;
}

.contact-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 30%;
    text-align: right;
}

.contact-details a {
    color: var(--deep-blue);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s;
}

.contact-details a:hover {
    color: var(--primary-blue);
    text-decoration: underline;
}

/* =========================================
   RESPONSIVE
   ========================================= */
@media (max-width: 992px) {
    .emergency-container {
        flex-direction: column;
    }

    .emergency-sidebar {
        width: 100%;
        position: relative;
        top: 0;
    }

    .heads-grid {
        grid-template-columns: 1fr;
    }

    .contact-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .dept-name,
    .person-name,
    .contact-details {
        width: 100%;
        text-align: left;
    }
}

@media (max-width: 768px) {
    .emergency-content-wrapper {
        padding: 25px 20px;
    }

    .hero-centered h1 {
        font-size: 2rem;
    }

    .news-wrapper {
        flex-direction: column;
        align-items: flex-start;
    }

    .news-label {
        margin-bottom: 10px;
    }
}

/* =========================================
   EMERGENCY ALERT MODAL
   ========================================= */
.emergency-alert-modal {
    display: flex;
    position: fixed;
    z-index: 10050;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
    padding: 20px;
    font-family: var(--font-sans);
    animation: fadeIn 0.3s ease;
}

.emergency-modal-content {
    background-color: #fff;
    border-radius: 20px;
    padding: 50px 40px;
    max-width: 500px;
    width: 100%;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.3);
    position: relative;
    text-align: center;
    animation: slideDown 0.3s ease;
}

.emergency-modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 32px;
    font-weight: bold;
    color: #999;
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.2s;
}

.emergency-modal-close:hover {
    color: #333;
}

.emergency-modal-icon {
    font-size: 4rem;
    color: #e74c3c;
    margin-bottom: 20px;
    animation: pulse 1.5s infinite;
}

.emergency-modal-title {
    font-size: 2rem;
    color: var(--deep-blue);
    margin-bottom: 20px;
    font-weight: 700;
    font-family: var(--font-serif);
}

.emergency-modal-text {
    font-size: 1.05rem;
    color: #666;
    line-height: 1.6;
    margin-bottom: 30px;
    font-weight: 500;
}

.emergency-modal-contact {
    background: linear-gradient(135deg, #ffe5e5 0%, #ffcccc 100%);
    border-left: 4px solid #e74c3c;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 30px;
}

.emergency-modal-contact p {
    margin: 0;
    color: var(--deep-blue);
    font-weight: 600;
}

.emergency-modal-contact p:first-child {
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.emergency-modal-contact p:last-child {
    font-size: 1.1rem;
}

.emergency-modal-btn {
    background-color: var(--deep-blue);
    color: white;
    border: none;
    padding: 14px 40px;
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.emergency-modal-btn:hover {
    background-color: var(--primary-blue);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(42, 64, 104, 0.3);
}

.emergency-alert-modal.hidden {
    display: none;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideDown {
    from {
        transform: translateY(-30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

@media (max-width: 600px) {
    .emergency-modal-content {
        padding: 30px 20px;
    }

    .emergency-modal-icon {
        font-size: 3rem;
    }

    .emergency-modal-title {
        font-size: 1.5rem;
    }

    .emergency-modal-text {
        font-size: 0.95rem;
    }

    .emergency-modal-btn {
        padding: 12px 30px;
        font-size: 0.9rem;
    }
}