﻿/* ==========================================================================
   ADMINISTRATION PAGE STYLES (COMPLETE)
   ========================================================================== */
/* ==========================================================================
   Page Header (Inner Page Banners) with Blurred Background
   ========================================================================== */
.page-header {
    position: relative;
    background-color: var(--primary-blue);
    color: var(--white);
    padding: 80px 20px;
    text-align: center;
    border-bottom: 5px solid var(--primary-red);
    overflow: hidden; 
}

.page-header::before {
    content: "";
    position: absolute;
    top: -15px; 
    left: -15px; 
    right: -15px; 
    bottom: -15px;
    background: url('header bg.jpg') center/cover no-repeat;
    filter: blur(8px); 
    opacity: 0.25; 
    z-index: 1;
}

.page-header .container {
    position: relative;
    z-index: 2;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5); 
}

.page-header h1 {
    font-size: 2.8rem;
    margin-bottom: 10px;
}

.page-header p {
    font-size: 1.1rem;
    opacity: 0.95;
}

/* 1. Global Box-Sizing Reset for this page */
.admin-container, 
.admin-container *, 
.admin-container *::before, 
.admin-container *::after {
    box-sizing: border-box !important;
}

/* 2. Main Container (Sidebar + Content) */
.admin-container {
    max-width: 1200px;
    margin: 60px auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 40px;
    align-items: start;
    width: 100%;
}

/* 3. Utility Classes (Required by HTML) */
.section-title h2 { color: var(--primary-blue); font-size: 2.2rem; margin-bottom: 10px; }
.accent-line { width: 60px; height: 4px; background-color: var(--secondary-yellow); margin-bottom: 25px; }
.accent-line-small { width: 40px; height: 3px; background-color: var(--secondary-yellow); margin-bottom: 15px; }
.mt-40 { margin-top: 40px; }
.mb-40 { margin-bottom: 40px; }
.mt-30 { margin-top: 30px; }
.mt-20 { margin-top: 20px; }
.mt-15 { margin-top: 15px; }
.mb-20 { margin-bottom: 20px; }
.text-blue { color: var(--primary-blue); }
.text-red { color: var(--primary-red); }
.bg-light-blue { background-color: #f0f7ff; }

/* 4. Grid Utilities */
.grid-2-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    width: 100%;
}

/* 5. Sticky Sidebar Navigation */
.admin-sidebar { height: 100%; width: 100%; }

.sticky-nav {
    position: sticky;
    top: 100px;
    background: var(--white);
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.sticky-nav ul { list-style: none; padding: 0; margin: 0; }

.sticky-nav a {
    display: flex; align-items: center; gap: 15px;
    padding: 15px 20px; color: var(--dark-text); font-weight: 600;
    border-bottom: 1px solid #e5e7eb; transition: all 0.3s ease;
    text-decoration: none;
}

.sticky-nav a i { width: 20px; text-align: center; color: var(--primary-red); }

.sticky-nav a:hover, .sticky-nav a.active {
    background-color: #f9fafb; color: var(--primary-blue);
    border-left: 4px solid var(--primary-blue); padding-left: 25px;
}

/* ==========================================================================
   Leadership & Staff Cards
   ========================================================================== */
.leadership-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); 
    gap: 15px; 
    width: 100%;
}

.leadership-card {
    background: var(--white);
    border: 1px solid #e5e7eb; 
    border-radius: 8px; 
    padding: 25px 20px;
    text-align: center;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.leadership-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.05); 
    border-color: #cbd5e1;
}

.highlight-card { border-top: 4px solid var(--primary-red); }

.leader-icon {
    width: 70px; height: 70px;
    background: #eff6ff; color: var(--primary-blue);
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-size: 2rem; margin-bottom: 15px;
    flex-shrink: 0;
}

.leader-info h3 { color: var(--primary-blue); font-size: 1.15rem; margin-bottom: 10px; }

.badge-role {
    background: var(--primary-red); color: var(--white);
    font-size: 0.8rem; padding: 5px 12px; border-radius: 50px; font-weight: 600;
    display: inline-block; margin-bottom: 15px;
}

.bg-blue { background-color: var(--primary-blue) !important; }

.quals { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; width: 100%; }

.quals span {
    background: #e0e7ff; color: var(--primary-blue);
    font-size: 0.75rem; padding: 4px 8px; border-radius: 4px; font-weight: 700;
}

/* ==========================================================================
   Content Formatting (Org Chart & Info Cards)
   ========================================================================== */
.org-chart-box {
    background: var(--white);
    padding: 30px; border-radius: 12px; border: 1px solid #e5e7eb;
    text-align: center;
}

.responsive-img { max-width: 100%; height: auto; border-radius: 8px; border: 1px solid #f3f4f6; }

.org-chart-box p, .admin-container > p, .content-section > p { 
    color: #4b5563; text-align: left; line-height: 1.7; margin-bottom: 15px; 
}

.info-card { 
    background: var(--white); padding: 30px; border-radius: 12px; border: 1px solid #e5e7eb; width: 100%;
}
.border-red { border-top: 4px solid var(--primary-red); }

.info-card h3 { font-size: 1.3rem; margin-bottom: 15px; display: flex; align-items: center; gap: 10px; }
.info-card p { color: #4b5563; line-height: 1.6; margin-bottom: 10px; margin-top: 0; }

.styled-list { padding-left: 20px; color: #4b5563; line-height: 1.8; }
.styled-list li { margin-bottom: 8px; }
.styled-list li strong { color: var(--primary-blue); font-weight: 600; }

/* ==========================================================================
   Data Tables
   ========================================================================== */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
    text-align: left;
}

.data-table th, .data-table td {
    padding: 16px 20px;
    border: 1px solid #e5e7eb;
    line-height: 1.6;
}

.data-table th {
    background: var(--primary-blue);
    color: var(--white);
    font-weight: 600;
}

.data-table tr:nth-child(even) { background-color: #fcfcfd; }
.data-table td strong { color: var(--primary-blue); }

/* ==========================================================================
   Accordions / Committees 
   ========================================================================== */
.accordion-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
}

.committee-card {
    background: var(--white);
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
    overflow: hidden;
    width: 100%;
}

.committee-card summary {
    padding: 20px;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-blue);
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.3s;
}

.committee-card summary::-webkit-details-marker {
    display: none;
}

.committee-card summary:hover { background: #f9fafb; }

.committee-card summary::after {
    content: '\f107'; 
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    color: var(--primary-red);
    transition: transform 0.3s ease;
}

.committee-card[open] summary::after {
    transform: rotate(180deg);
}

.committee-content {
    padding: 0 20px 20px;
    border-top: 1px solid #e5e7eb;
    margin-top: 10px;
    padding-top: 15px;
    color: #4b5563;
}

.committee-card summary .badge-role {
    margin-bottom: 0;
    margin-left: 10px;
    font-size: 0.75rem;
}


/* ==========================================================================
   RESPONSIVE DESIGN (Solves Grid Blowout & Horizontal Scrolling)
   ========================================================================== */

/* Tablets / Small Desktops */
@media (max-width: 992px) {
    .admin-container {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    .sticky-nav {
        position: relative;
        top: 0;
    }
}

/* The Ultimate Global Overflow Kill-Switch */
html, body {
    overflow-x: hidden !important;
    width: 100%;
    max-width: 100vw;
}

/* Mobile Phones */
@media (max-width: 768px) {
    
    .admin-container {
        padding: 0 15px !important;
        margin: 30px auto;
        width: 100% !important;
        max-width: 100vw !important;
        box-sizing: border-box !important;
    }

    /* Force columns to stack */
    .grid-2-col {
        grid-template-columns: 1fr !important;
        gap: 20px;
    }
    
    /* The 'minmax(0, 1fr)' trick forces grids to respect the screen edge */
    .leadership-grid, 
    .staff-grid {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) !important; 
        width: 100% !important;
        box-sizing: border-box !important;
        gap: 20px;
    }

    /* Force the cards to shrink */
    .leadership-card, 
    .staff-card {
        width: 100% !important;
        min-width: 0 !important; 
        max-width: 100% !important;
        padding: 20px 15px !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
    }

    /* Brutally force ALL text, badges, and titles to wrap to the next line */
    .badge-role, 
    .leader-info h3, 
    .staff-card h3 {
        white-space: normal !important;
        word-wrap: break-word !important;
        word-break: break-word !important;
        height: auto !important;
        max-width: 100% !important;
    }

    /* Force qualification tags to wrap instead of staying in a wide row */
    .quals, 
    .qualifications, 
    div[style*="display: flex"] {
        flex-wrap: wrap !important;
        max-width: 100% !important;
    }
    
    .committee-card summary {
        font-size: 1rem;
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .committee-card summary .badge-role {
        margin-left: 0; 
    }
}
/* ==========================================================================
   THE ULTIMATE MOBILE BLOWOUT FIX
   ========================================================================== */

@media (max-width: 992px) {
    /* 1. Kill the Master Grid. 
       This stops wide tables at the bottom from stretching the cards at the top! */
    .admin-container {
        display: block !important;
        width: 100% !important;
    }
    
    .admin-sidebar {
        margin-bottom: 40px !important;
    }
}

@media (max-width: 768px) {
    /* 2. Force all sections to respect the phone screen width */
    .content-section {
        width: 100% !important;
        max-width: 100vw !important;
        overflow: hidden !important; /* Contains the blowout */
    }

    /* 3. Allow tables to scroll horizontally inside their own safe box */
    .table-responsive {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: auto !important;
        display: block !important;
        -webkit-overflow-scrolling: touch;
    }

    /* 4. Convert Card Grids to Safe Flex Columns */
    .leadership-grid, 
    .staff-grid,
    .grid-2-col {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* 5. Lock Card Widths */
    .leadership-card, 
    .staff-card,
    .committee-card {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    /* 6. Guarantee text wraps securely inside the cards */
    .leader-info, .leader-info h3, .badge-role {
        width: 100% !important;
        white-space: normal !important;
        word-wrap: break-word !important;
        word-break: break-word !important;
    }
}
/* ==========================================================================
   FIX: RESTORE STICKY HEADER & SIDE MENU (Desktop)
   ========================================================================== */
@media (min-width: 769px) {
    /* 
       This removes the overflow lock on desktop screens. 
       It allows both the top navbar and the side menu to "stick" again! 
    */
    html, body {
        overflow-x: visible !important;
        overflow-y: visible !important;
    }
}