/* ==========================================================================
   1. ROOT VARIABLES & GLOBAL STYLES
   ========================================================================== */
:root {
    --primary-color: #005035; /* UNCC Green */
    --secondary-color: #a49665; /* UNCC Gold accent */
    --bg-color: #f8fafc;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --card-bg: #ffffff;
    --focus-ring: #2563eb;
}

* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
    font-family: 'Segoe UI', system-ui, sans-serif; 
}

body { 
    background-color: var(--bg-color); 
    color: var(--text-main); 
    line-height: 1.6; 
    overflow-y: scroll; 
    overflow-x: hidden;
}

/* ==========================================================================
   2. ACCESSIBILITY (ADA COMPLIANCE)
   ========================================================================== */
*:focus-visible {
    outline: 3px solid var(--focus-ring);
    outline-offset: 2px;
    border-radius: 2px;
}

/* ==========================================================================
   3. HEADER & NAVIGATION
   ========================================================================== */
.header-tabs {
    background: linear-gradient(to right, #005035 0%, #111111 100%);
    color: white;
    padding: 1.25rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
}

.logo-img { height: 45px; }

.tab-links { list-style: none; display: flex; gap: 1.5rem; }

.tab-links button {
    background: none;
    border: none;
    color: #e2e8f0;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    padding: 0.5rem 0;
    transition: color 0.2s;
}

.tab-links button:hover { color: white; }
.tab-links button.active {
    color: white;
    border-bottom: 3px solid var(--secondary-color);
}

/* ==========================================================================
   4. HOME PAGE CONTENT & BANNER
   ========================================================================== */
.hero-image-container img { 
    width: 65%; 
    max-width: 850px; /* Restricts the banner from stretching too far */
    margin: 2rem auto; 
    display: block; 
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

.hero-image-container img { 
    width: 65%; 
    max-width: none; /* Removes the 1400px restriction */
    height: auto; 
    display: block; 
    object-fit: cover; /* Ensures edge-to-edge coverage */
}

/* Team Photos Layout */
.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin: 3rem 0;
    text-align: center;
}
.team-member img {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--secondary-color);
    margin-bottom: 1rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.home-content-container {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 3rem 4rem;
    margin: 2rem auto 4rem auto; 
    max-width: 950px; 
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px -1px rgba(0,0,0,0.03);
    border-top: 4px solid var(--secondary-color); 
}

.home-content-container h2 {
    color: var(--primary-color); font-style: italic; margin-top: 30px; margin-bottom: 10px;
}

.page-title { color: var(--primary-color); font-size: 2.2rem; margin-bottom: 20px; line-height: 1.2; }
.section-heading { color: var(--primary-color); font-style: italic; margin-top: 40px; margin-bottom: 15px; }
.content-list { margin-bottom: 30px; padding-left: 20px; }
.content-list li { margin-bottom: 8px; }

.brand-quote {
    border-left: 4px solid var(--primary-color); 
    padding-left: 15px; 
    margin-bottom: 25px; 
    font-style: italic;
    background-color: #f1f5f9;
    padding: 15px 15px 15px 20px;
    border-radius: 0 4px 4px 0;
}

.brand-link { color: var(--primary-color); font-weight: bold; text-decoration: underline; }
.brand-link:hover { color: #003624; }
.cursor-pointer { cursor: pointer; }
.loading-text { text-align: center; width: 100%; color: var(--text-muted); font-style: italic; padding: 2rem; }

/* ==========================================================================
   5. EVENTS & LIBRARY HERO CENTERING
   ========================================================================== */
.hero { text-align: center; padding: 3rem 1rem 1rem; }
.hero h1 { font-size: 2.5rem; margin-bottom: 1rem; color: var(--primary-color); }
.hero p { color: var(--text-muted); font-size: 1.1rem; max-width: 600px; margin: 0 auto; }

/* ==========================================================================
   6. TABLES & RESPONSIVE WRAPPERS
   ========================================================================== */
.table-responsive-wrapper { overflow-x: auto; width: 100%; margin-bottom: 40px; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
.custom-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    background: transparent;
}
.custom-table th {
    background: var(--primary-color);
    color: white;
    text-align: left;
    padding: 1rem;
}
.custom-table td {
    padding: 1rem;
    border-bottom: 1px solid #e2e8f0;
}
.custom-table tr:last-child td { border-bottom: none; }

/* ==========================================================================
   7. APP LAYOUT & COURSE VIEWER
   ========================================================================== */
.app-layout { display: flex; height: calc(100vh - 75px); }

.sidebar { width: 300px; background: white; border-right: 1px solid #e2e8f0; padding: 1.5rem; overflow-y: auto; }
.viewer-pane { flex: 1; background: var(--bg-color); display: flex; flex-direction: column; }
.empty-state { margin: auto; text-align: center; color: var(--text-muted); }
#content-frame { width: 100%; height: 100%; border: none; display: none; }

.back-btn { background: none; border: none; color: var(--primary-color); font-weight: 600; cursor: pointer; margin-bottom: 1.5rem; display: inline-block; }

.download-all-btn { width: 100%; padding: 0.75rem; background: var(--primary-color); color: white; border: none; border-radius: 6px; font-weight: 600; cursor: pointer; margin-bottom: 1.5rem; display: flex; align-items: center; justify-content: center; transition: background 0.2s; }
.download-all-btn:hover { background: #003624; }

.module-title { font-weight: bold; color: var(--text-muted); text-transform: uppercase; font-size: 0.85rem; margin: 1.5rem 0 0.5rem 0; letter-spacing: 0.05em; }

.file-item { padding: 0.75rem; background: white; border: 1px solid #e2e8f0; border-radius: 6px; margin-bottom: 0.5rem; cursor: pointer; display: flex; justify-content: space-between; align-items: center; transition: all 0.2s; }
.file-item:hover { border-color: var(--primary-color); box-shadow: 0 2px 4px rgba(0,0,0,0.05); }
.file-item.active { border-color: var(--primary-color); background: #f0fdf4; }

/* ENHANCEMENT: Restored Gold Hover for Library Downloads */
.download-icon-btn { 
    color: var(--primary-color); 
    background: #f1f5f9; 
    border: none; 
    cursor: pointer; 
    padding: 6px; 
    border-radius: 4px;
    display: flex; 
    transition: all 0.2s ease; 
}
.download-icon-btn:hover { 
    color: white !important; 
    background-color: var(--secondary-color) !important; 
    transform: scale(1.05); 
}

/* ==========================================================================
   8. EVENTS & LIBRARY GRIDS 
   ========================================================================== */
/* ENHANCEMENT: Increased top padding to 4rem to fix Back Button spacing */
.events-container, .details-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 4rem 2rem 2rem 2rem; 
}

.events-grid, .course-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.5rem; margin-top: 1.5rem; }

.event-card, .course-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px -1px rgba(0,0,0,0.03);
    cursor: pointer;
    border-top: 4px solid var(--secondary-color); 
    animation: slideUpFade 0.35s ease-out backwards; 
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.event-card:hover, .course-card:hover { transform: translateY(-5px); box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1); }
.click-details-text { color: var(--primary-color); font-weight: 600; font-size: 0.9rem; margin-top: 1rem; }
.detail-meta { background: white; padding: 1.5rem; border-radius: 8px; margin: 1.5rem 0; box-shadow: 0 1px 3px rgba(0,0,0,0.1); border-left: 4px solid var(--secondary-color); }
.detail-description { background: white; padding: 2rem; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.1); line-height: 1.8; }

/* PAST EVENT CARDS (Images touch the edges, 0 padding) */
.past-event-card {
    background: white;
    border-radius: 12px;
    padding: 0; /* No padding so the image touches the top corners */
    overflow: hidden; 
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px -1px rgba(0,0,0,0.03);
    border-top: 4px solid var(--secondary-color); 
    animation: slideUpFade 0.35s ease-out backwards; 
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.past-event-card:hover { transform: translateY(-5px); box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1); }

.past-event-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
    border-bottom: 1px solid #e2e8f0;
}

.past-event-content {
    padding: 1.5rem; /* Padding is applied specifically to the text area underneath the image */
}

.past-event-content h3 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: 1.3rem;
}

/* Course Card Creator Profiles */
.course-card-header {
    display: flex;
    align-items: center; /* Vertically centers the text with the image */
    gap: 1rem;           /* Space between the picture and the text */
}

.creator-img {
    width: 65px;
    height: 65px;
    border-radius: 50%;  /* This makes the image a perfect circle! */
    object-fit: cover;   /* Ensures the image doesn't stretch or warp */
    border: 3px solid var(--secondary-color); /* Adds a nice UNCC Gold ring around the photo */
    flex-shrink: 0;      /* Prevents the circle from squishing on small screens */
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.course-card-header h2 {
    margin: 0; /* Removes default margin so it aligns perfectly with the photo */
    font-size: 1.25rem;
    color: var(--primary-color);
}

/* ==========================================================================
   9. ANIMATION KEYFRAMES (NEW: Scroll Animations)
   ========================================================================== */
.tab-view { animation: fastFadeIn 0.25s ease-in-out; }

@keyframes fastFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUpFade { from { opacity: 0; transform: translateY(15px); } to { opacity: 1; transform: translateY(0); } }

/* ENHANCEMENT: Scroll Pop-Up Classes */
.scroll-animate {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s ease-out, transform 0.7s ease-out;
    will-change: opacity, transform;
}
.scroll-animate.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ==========================================================================
   10. MOBILE OPTIMIZATION
   ========================================================================== */
@media (max-width: 768px) {
    /* Stacks the logo on top and the navigation links below */
    .header-tabs {
        flex-direction: column;
        justify-content: center;
        gap: 1.5rem;
        padding: 1.5rem 1rem;
    }

    /* Centers the buttons and lets them wrap to a new line if needed */
    .tab-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem;
        width: 100%;
    }

    /* Makes the tap target a bit friendlier for fingers */
    .tab-links button {
        font-size: 0.95rem;
        padding: 0.5rem;
    }
    .home-content-container h2 { 
        margin-top: 2rem; 
        margin-bottom: 0.75rem; 
        font-size: 1.5rem;
        color: var(--text-main); 
    }
    .events-container, .details-container { padding: 2rem 1rem; }
    .app-layout { display: flex; flex-direction: column; height: auto !important; }
    .sidebar, .viewer-pane { width: 100% !important; flex: none; }
    .sidebar { max-height: 400px; border-right: none; border-bottom: 2px solid #e2e8f0; }
    .viewer-pane { height: 600px !important; padding: 10px; }
    .viewer-pane iframe { height: 100% !important; width: 100% !important; }
}

/* =========================================
   Footer Strip (With Logo)
   ========================================= */
.site-footer {
    background: linear-gradient(to right, #005035, #111111); 
    color: #ffffff;
    padding: 30px 5%; /* Slightly tighter padding so the logo fits snugly */
    margin-top: 60px;
    box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.1); 
}

.footer-content {
    display: flex;
    justify-content: space-between; 
    align-items: center;
    max-width: 1400px; 
    margin: 0 auto;
}

/* --- New Logo Styling --- */
.footer-brand {
    display: flex;
    align-items: center;
}

.footer-logo {
    max-height: 50px; /* Keeps the logo at a professional, manageable size */
    width: auto;      /* Ensures the logo doesn't stretch weirdly */
    object-fit: contain;
}
/* ------------------------ */

.footer-socials {
    display: flex;
    gap: 25px; 
}

.footer-socials a {
    color: #ffffff;
    font-size: 1.6rem; 
    transition: transform 0.3s ease, color 0.3s ease;
}

.footer-socials a:hover {
    color: var(--secondary-color, #f1c40f); 
    transform: translateY(-3px); 
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .site-footer {
        padding: 30px 20px; 
    }
    .footer-content {
        flex-direction: column;
        gap: 25px; /* Adds space between the logo and icons on mobile */
        text-align: center;
    }
    .footer-logo {
        max-height: 45px; /* Scales the logo down slightly for small phone screens */
    }
}