﻿/* ==========================================================================
   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; }

/* ==========================================================================
   Campus Page Layout
   ========================================================================== */
.campus-container {
    max-width: 1200px;
    margin: 60px auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 50px;
    align-items: start;
    box-sizing: border-box; /* Added for safety */
}

/* Utilities */
.section-title h2 { color: var(--primary-blue); font-size: 2.2rem; margin-bottom: 15px; }
.accent-line { width: 60px; height: 4px; background-color: var(--secondary-yellow); margin-bottom: 25px; }
.mt-40 { margin-top: 50px; }
.mb-40 { margin-bottom: 50px; }
.mb-30 { margin-bottom: 30px; }
.mt-10 { margin-top: 10px; }
.text-blue { color: var(--primary-blue); }
.text-red { color: var(--primary-red); }
.text-muted { color: #6b7280; }
.w-100 { width: 100%; }
.d-flex-between { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }

/* Sticky Sidebar Navigation */
.campus-sidebar { height: 100%; }
.sticky-nav {
    position: sticky;
    top: 100px;
    background: var(--white);
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px 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 #f3f4f6; transition: var(--transition);
    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;
}

/* ==========================================================================
   Content Sections
   ========================================================================== */

/* Infrastructure Stats */
.stats-overview {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}
.stat-box {
    background: var(--primary-blue);
    color: var(--white);
    padding: 30px;
    border-radius: 12px;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.stat-box i { position: absolute; right: -15px; bottom: -15px; font-size: 6rem; opacity: 0.1; }
.stat-number { display: block; font-size: 3rem; font-weight: 700; color: var(--secondary-yellow); line-height: 1; margin-bottom: 5px; }
.stat-label { font-size: 1rem; font-weight: 600; letter-spacing: 0.5px; }

/* Data Tables */
.table-responsive { width: 100%; overflow-x: auto; border-radius: 8px; border: 1px solid #e5e7eb; }
.data-table { width: 100%; border-collapse: collapse; background: var(--white); text-align: left; }
.data-table th, .data-table td { padding: 16px 20px; border-bottom: 1px solid #e5e7eb; line-height: 1.6; }
.data-table th { background: #f9fafb; color: var(--dark-text); font-weight: 700; border-bottom: 2px solid #e5e7eb; }

/* Faculty & Coordinator Cards */
.faculty-member {
    display: flex; align-items: center; gap: 15px;
    background: #f9fafb; padding: 20px; border-radius: 8px; border: 1px solid #e5e7eb;
}
.highlight-box { border-left: 4px solid var(--secondary-yellow); }
.faculty-name { font-weight: 700; color: var(--primary-blue); font-size: 1.1rem; }
.badge-role { background: var(--primary-red); color: var(--white); font-size: 0.75rem; padding: 4px 10px; border-radius: 50px; font-weight: 600; }
.faculty-quals { display: flex; gap: 6px; flex-wrap: wrap; }
.faculty-quals span { background: #e0e7ff; color: var(--primary-blue); font-size: 0.75rem; padding: 3px 8px; border-radius: 4px; font-weight: 700; }

/* Lists & Accordions */
.styled-list { list-style: none; color: #4b5563; padding: 0; }
.styled-list li { margin-bottom: 15px; line-height: 1.7; position: relative; padding-left: 20px; }
.styled-list li::before { content: "•"; color: var(--primary-red); font-weight: bold; font-size: 1.5rem; position: absolute; left: 0; top: -5px; }

.research-accordion { background: var(--white); border: 1px solid #e5e7eb; border-radius: 8px; overflow: hidden; }
.research-accordion summary { padding: 15px 20px; font-weight: 600; color: var(--primary-blue); cursor: pointer; list-style: none; background: #f9fafb; }
.research-accordion summary::-webkit-details-marker { display: none; }
.research-content { padding: 20px; border-top: 1px solid #e5e7eb; color: #4b5563; }
.simple-list { margin-top: 15px; padding-left: 20px; }
.simple-list li { margin-bottom: 8px; }

/* Action Cards */
.action-card-simple {
    display: flex; justify-content: space-between; align-items: center;
    padding: 25px; border-radius: 8px; border: 1px solid #dbeafe; flex-wrap: wrap; gap: 20px;
}
.bg-light-blue { background-color: #f0f7ff; }

/* Activities Grid */
.activities-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 25px; }
.activity-box { background: var(--white); padding: 30px 20px; border-radius: 8px; border: 1px solid #e5e7eb; text-align: center; transition: var(--transition); }
.activity-box:hover { transform: translateY(-5px); box-shadow: 0 10px 20px rgba(0,0,0,0.05); border-color: var(--secondary-yellow); }
.activity-box i { font-size: 2.5rem; color: var(--primary-red); margin-bottom: 15px; }
.activity-box h3 { color: var(--primary-blue); font-size: 1.2rem; margin-bottom: 10px; }
.activity-box p { color: #6b7280; font-size: 0.95rem; line-height: 1.5; }

/* ==========================================================================
   FIX: Sub-section Header Spacing & Alignment (Campus Page)
   ========================================================================== */
.campus-content h3 {
    margin-top: 50px; 
    margin-bottom: 15px;
    display: flex;
    align-items: center; 
    gap: 12px;
}

.campus-content h3:first-of-type {
    margin-top: 0; 
}

.campus-content h3 + p {
    margin-bottom: 20px;
}

/* ==========================================================================
   FIX: Activity Box Headings
   ========================================================================== */
.activity-box h4 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-blue);
    border-bottom: 2px solid #f3f4f6; 
    padding-bottom: 12px;
    margin-bottom: 20px;
    position: relative;
    display: block;
}

.activity-box h4::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -2px; 
    width: 40px;
    height: 2px;
    background-color: var(--primary-red);
}

/* ==========================================================================
   Responsive Adjustments (Clean & Safe)
   ========================================================================== */
@media (max-width: 992px) {
    .campus-container { grid-template-columns: 1fr; }
    .sticky-nav { position: relative; top: 0; }
    .activities-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    /* Safe container containment */
    .campus-container {
        padding: 0 15px !important;
        width: 100%;
        max-width: 100vw;
        box-sizing: border-box;
        overflow-x: hidden;
    }

    /* Stack grids vertically safely */
    .stats-overview { grid-template-columns: 1fr; }
    .action-card-simple { flex-direction: column; align-items: flex-start; }
    
    /* Ensure boxes and cards don't bleed out */
    .stat-box, .activity-box, .faculty-member, .action-card-simple {
        width: 100%;
        box-sizing: border-box;
    }

    /* Ensure table can swipe */
    .table-responsive {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        display: block;
    }
}

@media (max-width: 576px) {
    .activities-grid { grid-template-columns: 1fr; }
    .d-flex-between { flex-direction: column; align-items: flex-start; }
}
/* ==========================================================================
   ULTIMATE MOBILE LAYOUT RESET (Fixes Grid Blowouts & Tables)
   ========================================================================== */

/* 1. Tablet View: Force Grid to respect screen boundaries */
@media (max-width: 992px) {
    .campus-container,
    .naac-container,
    .admin-container,
    .academics-container {
        /* minmax(0, 1fr) strips the grid's ability to lock to minimum content widths */
        grid-template-columns: minmax(0, 1fr) !important;
    }
}

/* 2. Mobile View: Destroy the Grid completely */
@media (max-width: 768px) {
    .campus-container,
    .naac-container,
    .admin-container,
    .academics-container {
        display: block !important; /* Converts Grid to Block */
        width: 100% !important;
        max-width: 100vw !important;
        padding-left: 15px !important;
        padding-right: 15px !important;
        box-sizing: border-box !important;
        overflow-x: hidden !important; 
    }

    /* 3. Force tables to become horizontally scrollable boxes */
    .table-responsive {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important; /* Smooth scroll on iPhones */
        box-shadow: none !important;
        border-right: 1px solid #e5e7eb !important;
    }

    .data-table {
        min-width: 550px !important; /* Forces the table to stretch inside its scrollable box */
        width: 100% !important;
    }

    /* 4. Ensure all flex containers (like stats and cards) stack */
    .stats-overview,
    .action-card-simple,
    div[class*="grid"] {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        gap: 20px !important;
    }

    /* 5. Force NAAC PDF links to stack properly */
    .pdf-links {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        width: 100% !important;
        padding-left: 0 !important;
        gap: 12px !important;
    }
}