/**
 * GNDU Department Pages - Common Styles
 * =====================================
 * This CSS file contains all common styling for department pages.
 * Include this file in any department page that inherits from GNDU_Departments.master
 * 
 * Usage: <link rel="stylesheet" href="department-page.css" />
 * 
 * Last Updated: January 2026
 */

/* ===== DEPARTMENT PAGE - GLOBAL RESET ===== */
.department-container,
.department-container * {
    box-sizing: border-box;
}

/* ===== MAIN CONTAINER ===== */
.department-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    width: 100%;
    overflow-x: hidden;
}

/* ===== DEPARTMENT HEADER ===== */
.department-header {
    margin-bottom: 30px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.department-header h1 {
    color: #10243E;
    font-size: 2rem;
    margin-bottom: 10px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.department-header .breadcrumb {
    color: #666;
    font-size: 0.9rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.department-header .breadcrumb a {
    color: #1a5fb4;
    text-decoration: none;
}

.department-header .breadcrumb a:hover {
    text-decoration: underline;
}

/* ===== MAIN TAB NAVIGATION (Courses, Faculty, Research Activities) ===== */
.dept-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 20px;
    border-bottom: 2px solid #10243E;
    padding-bottom: 0;
    width: 100%;
}

.dept-tabs .tab-btn {
    padding: 12px 20px;
    background: #f5f5f5;
    border: none;
    border-radius: 5px 5px 0 0;
    cursor: pointer;
    font-weight: 600;
    color: #333;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.dept-tabs .tab-btn:hover {
    background: #e0e0e0;
}

.dept-tabs .tab-btn.active {
    background: #10243E;
    color: white;
}

/* ===== TAB CONTENT ===== */
.tab-content {
    display: none;
    padding: 20px 0;
    width: 100%;
    overflow-x: hidden;
}

.tab-content.active {
    display: block;
}

/* ===== FACULTY LIST STYLES ===== */
.faculty-list-container {
    display: grid;
    gap: 20px;
}

/* Faculty Card */
.faculty-card {
    display: flex;
    gap: 20px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.3s ease;
}

.faculty-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.faculty-photo {
    flex-shrink: 0;
}

.faculty-photo img {
    width: 120px;
    height: 150px;
    object-fit: cover;
    border-radius: 6px;
    border: 2px solid #e0e0e0;
}

.faculty-info {
    flex: 1;
    min-width: 0;
}

.faculty-name {
    margin-bottom: 8px;
}

.faculty-name a {
    font-size: 1.25rem;
    font-weight: 700;
    color: #10243E;
    text-decoration: none;
    word-wrap: break-word;
}

.faculty-name a:hover {
    color: #1a5fb4;
    text-decoration: underline;
}

.faculty-special-comments {
    background: #fff3cd;
    padding: 8px 12px;
    border-radius: 4px;
    margin-bottom: 10px;
    font-size: 0.9rem;
    color: #856404;
}

.faculty-designation {
    margin-bottom: 6px;
    color: #333;
}

.faculty-designation.highlight .head-designation {
    color: #c0392b;
    font-weight: 700;
}

.faculty-aoi,
.faculty-email {
    margin-bottom: 6px;
    color: #555;
    font-size: 0.95rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.faculty-email a {
    color: #1a5fb4;
    word-break: break-all;
}

.faculty-resume {
    margin-top: 10px;
}

.resume-link {
    display: inline-block;
    padding: 6px 14px;
    background: #28a745;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
    transition: background 0.3s;
}

.resume-link:hover {
    background: #218838;
    color: white;
}

/* ===== ADDITIONAL FACULTY TABLE ===== */
.additional-faculty-section {
    margin-top: 30px;
}

.additional-faculty-header {
    color: #c0392b;
    font-weight: 700;
    font-size: 1.1rem;
}

.additional-faculty-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.additional-faculty-table th,
.additional-faculty-table td {
    padding: 10px 15px;
    border: 1px solid #ddd;
    text-align: left;
}

.additional-faculty-table th {
    background: #f5f5f5;
    font-weight: 600;
}

.additional-faculty-table tr:nth-child(even) {
    background: #fafafa;
}

/* ===== LOADING SPINNER ===== */
.loading-spinner {
    text-align: center;
    padding: 40px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #10243E;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* ===== ERROR MESSAGE ===== */
.error-message,
.no-data {
    text-align: center;
    padding: 30px;
    color: #721c24;
    background: #f8d7da;
    border-radius: 8px;
}

.error-icon {
    font-size: 2rem;
    display: block;
    margin-bottom: 10px;
}

/* ===== COURSE SECTIONS ===== */
.course-section {
    margin-bottom: 30px;
    width: 100%;
    overflow-x: hidden;
}

.course-section .heading-red {
    color: #c0392b;
    font-weight: 700;
    font-size: 1.2rem;
    margin-bottom: 15px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Table wrapper for horizontal scroll on mobile */
.table-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* ===== COURSE TABLES ===== */
.hovertable {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
    font-size: 0.85rem;
}

.hovertable th,
.hovertable td {
    padding: 7px 8px;
    border: 1px solid #ddd;
    text-align: left;
}

.hovertable th {
    background: #10243E;
    color: white;
    white-space: nowrap;
    font-size: 0.82rem;
    padding: 6px 7px;
}

.hovertable td {
    font-size: 0.85rem;
}

.hovertable tr:hover {
    background: #f5f5f5;
}

/* ===== COURSE SUB-TABS ===== */
.course-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    margin-bottom: 15px;
    background: #e8f4fc;
    padding: 5px;
    border-radius: 5px;
    width: 100%;
}

.course-tab-btn {
    padding: 8px 14px;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    color: #333;
    transition: all 0.3s ease;
    flex: 1 1 auto;
    text-align: center;
    min-width: fit-content;
}

.course-tab-btn:hover {
    background: #dce8f3;
    border-color: #10243E;
}

.course-tab-btn.active {
    background: #10243E;
    color: white;
    border-color: #10243E;
}

.course-tab-content {
    display: none;
    padding: 15px;
    background: #f9fbfc;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 10px;
    width: 100%;
    overflow-x: auto;
}

.course-tab-content.active {
    display: block;
}

/* ===== ELIGIBILITY LISTS ===== */
.eligibility-list {
    list-style-type: disc;
    padding-left: 20px;
    margin: 0;
}

.eligibility-list li {
    margin-bottom: 10px;
    line-height: 1.6;
}

/* ===== JUSTIFIED TEXT ===== */
.justify {
    text-align: justify;
    line-height: 1.6;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* ===== PDF LINK STYLING ===== */
.pdf-link {
    display: inline-block;
    padding: 10px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white !important;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    word-wrap: break-word;
}

.pdf-link:hover {
    background: linear-gradient(135deg, #5a6fd6 0%, #6a4190 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    color: white !important;
    text-decoration: none;
}

/* ===== PDF LINKS CONTAINER (for displaying PDF links without bullets) ===== */
.pdf-links-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: flex-start;
}


/* =============================================================================
   RESPONSIVE STYLES - LAPTOP (min-width: 1024px)
   Optimized to fit tables without horizontal scrollbar
   ============================================================================= */
@media (min-width: 1024px) {
    .department-container {
        max-width: 1400px;
    }

    .course-tab-content {
        overflow-x: visible;
    }

    /* Compact table styling for laptops - no horizontal scroll needed */
    .hovertable {
        font-size: 0.82rem;
        min-width: auto;
    }

    .hovertable th {
        font-size: 0.78rem;
        padding: 5px 6px;
        white-space: nowrap;
    }

    .hovertable td {
        font-size: 0.82rem;
        padding: 5px 6px;
    }

    /* Ensure reserved category columns are compact */
    .hovertable td:nth-child(n+5),
    .hovertable th:nth-child(n+5) {
        text-align: center;
        padding: 5px 4px;
    }
}


/* =============================================================================
   RESPONSIVE STYLES - TABLET (min-width: 769px and max-width: 1023px)
   Tables may need horizontal scroll on tablets
   ============================================================================= */
@media (min-width: 769px) and (max-width: 1023px) {
    .department-container {
        max-width: 100%;
        padding: 15px;
    }

    .course-tab-content {
        overflow-x: auto;
    }

    .hovertable {
        font-size: 0.8rem;
        min-width: 700px;
    }

    .hovertable th,
    .hovertable td {
        padding: 6px 5px;
        font-size: 0.78rem;
    }
}


/* =============================================================================
   RESPONSIVE STYLES - MOBILE (max-width: 768px)
   ============================================================================= */
@media (max-width: 768px) {
    .department-container {
        padding: 10px;
        max-width: 100vw;
        overflow-x: hidden;
    }

    .department-header h1 {
        font-size: 1.4rem;
        line-height: 1.3;
    }

    .department-header .breadcrumb {
        font-size: 0.8rem;
    }

    /* KEEP main tabs (Courses, Faculty, Research Activities) horizontal on mobile */
    .dept-tabs {
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 2px;
        border-bottom: 2px solid #10243E;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .dept-tabs .tab-btn {
        border-radius: 5px 5px 0 0;
        flex: 1 1 auto;
        text-align: center;
        padding: 10px 8px;
        font-size: 0.85rem;
        white-space: nowrap;
        min-width: fit-content;
        border-bottom: none;
    }

    /* Stack faculty cards vertically */
    .faculty-card {
        flex-direction: column;
        text-align: center;
        padding: 15px;
    }

    .faculty-photo img {
        width: 100px;
        height: 125px;
    }

    .faculty-name a {
        font-size: 1.1rem;
    }

    /* Stack course sub-tabs vertically */
    .course-tabs {
        flex-direction: column;
        gap: 0;
        padding: 0;
        background: transparent;
    }

    .course-tab-btn {
        font-size: 0.8rem;
        padding: 10px 12px;
        border-radius: 0;
        width: 100%;
        text-align: left;
    }

    .course-tab-btn:first-child {
        border-radius: 5px 5px 0 0;
    }

    .course-tab-btn:last-child {
        border-radius: 0 0 5px 5px;
    }

    .course-section .heading-red {
        font-size: 1rem;
        line-height: 1.4;
    }

    .course-tab-content {
        padding: 10px;
        overflow-x: auto;
    }

    /* Responsive table with horizontal scroll */
    .hovertable {
        font-size: 0.75rem;
        min-width: 500px;
    }

    .hovertable th,
    .hovertable td {
        padding: 6px 4px;
        font-size: 0.7rem;
    }

    .tab-content {
        padding: 10px 0;
    }

    .pdf-link {
        padding: 8px 15px;
        font-size: 0.9rem;
        display: block;
        text-align: center;
    }

    .eligibility-list {
        padding-left: 15px;
    }

    .eligibility-list li {
        font-size: 0.9rem;
    }

    .justify {
        font-size: 0.9rem;
    }
}


/* =============================================================================
   RESPONSIVE STYLES - SMALL MOBILE (max-width: 480px)
   ============================================================================= */
@media (max-width: 480px) {
    .department-container {
        padding: 8px;
    }

    .department-header h1 {
        font-size: 1.2rem;
    }

    .course-section .heading-red {
        font-size: 0.95rem;
    }

    .hovertable {
        font-size: 0.65rem;
    }

    .hovertable th,
    .hovertable td {
        padding: 4px 3px;
    }
}


/* =============================================================================
   DESKTOP MODE ON MOBILE (Touch devices requesting desktop view)
   ============================================================================= */
@media (pointer: coarse) and (min-width: 769px) {
    .department-container {
        max-width: 100%;
        padding: 15px;
    }

    /* Keep horizontal tabs on desktop mode */
    .dept-tabs {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .dept-tabs .tab-btn {
        border-radius: 5px 5px 0 0;
        width: auto;
    }

    .course-tabs {
        flex-direction: row;
        flex-wrap: wrap;
        background: #e8f4fc;
        padding: 5px;
    }

    .course-tab-btn {
        width: auto;
        border-radius: 4px;
        font-size: 0.75rem;
        padding: 6px 10px;
    }

    .hovertable {
        font-size: 0.7rem;
    }

    .hovertable th,
    .hovertable td {
        padding: 5px 4px;
    }

    .course-section .heading-red {
        font-size: 1rem;
    }
}