@charset "utf-8";

/* vTimetable.css - Gray Tone Style */

/* General Layout */
body {
    font-family: "Malgun Gothic", Dotum, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #fff;
    color: #333;
}

.timetable-page-container {
    width: 98%;
    margin: 10px auto;
}

h1 {
    text-align: center;
    font-size: 24px;
    margin: 20px 0;
    color: #333;
}

/* Search Area */
.search-area {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: nowrap;
    gap: 15px;
    background: #f1f5f9;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    border: 1px solid #e2e8f0;
}

.search-area select {
    padding: 10px 15px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 14px;
    min-width: 100px;
    background-color: #fff;
    color: #334155;
}

.search-area input[type="submit"] {
    padding: 10px 30px;
    background-color: #334155;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 700;
    transition: all 0.2s;
}

.search-area input[type="submit"]:hover {
    background-color: #1e293b;
    transform: translateY(-1px);
}

.excel-btn {
    padding: 10px 30px;
    background-color: #107c41;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 700;
    transition: all 0.2s;
    font-size: 14px;
    /* Ensure match with input */
}

.excel-btn:hover {
    background-color: #0b5c2e;
    transform: translateY(-1px);
}

/* Table Styling */
.timetable-wrapper {
    overflow-x: auto;
    margin-bottom: 50px;
}

.timetable-grid {
    width: auto;
    /* Fit to content */
    margin: 0 auto;
    /* Center alignment */
    border-collapse: collapse;
    /* table-layout: fixed; REMOVED */
    border: 2px solid #555;
    font-size: 12px;
}

.timetable-grid th,
.timetable-grid td {
    border: 1px solid #999;
    padding: 4px;
    /* Reduced padding for compact view */
    text-align: center;
    vertical-align: middle;
}

/* Headers */
.timetable-grid thead th {
    background-color: #e0e0e0;
    font-weight: bold;
    color: #000;
    height: 30px;
}

/* Period Column */
.timetable-grid th:first-child {
    background-color: #d0d0d0;
    width: 50px;
}

/* Weekday Columns */
.week-col {
    /* Base style */
}

/* Cell Styling */
.timetable-grid tbody th {
    height: 60px;
}


.timetable-grid td {
    position: relative;
    /* height: auto;  - remove explicit height, rely on row height */
    vertical-align: top;
    background-color: #fff;
    padding: 0;
    /* Remove padding to let child fill completely */
    width: 100px;
    /* Fixed width matching assigned-subject + margin */
    min-width: 100px;
}

/* Assigned Subject Styling */
.assigned-subject {
    /* Use absolute positioning to fill parent TD */
    position: absolute;
    top: 3px;
    bottom: 3px;
    left: 0;
    right: 0;
    margin: auto;

    background-color: #f5f5f5;
    border: 1px solid #bbb;
    border-radius: 5px;
    padding: 4px;
    text-align: center;
    box-shadow: none;
    /* optional: remove shadow for flat look or keep */

    /* Height/Width Logic */
    height: auto;
    width: 90px;
    min-width: 90px;

    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    /* Vertically center content */
}

.subject-name {
    font-weight: bold;
    font-size: 1.1em;
    display: block;
    margin-bottom: 2px;
}

.instructor-name {
    font-size: 0.9em;
    color: #555;
}

.room-info {
    font-size: 0.85em;
    color: #666;
    margin-top: 2px;
    display: block;
}

/* Filtered Headers - Gray Variations if needed, but mostly flat gray for this request */
.dept-bg-0,
.dept-bg-1,
.dept-bg-2,
.dept-bg-3,
.dept-bg-4 {
    background-color: #eaeaea !important;
    color: #333;
}

/* Header hierarchy distinction */
.timetable-grid thead tr:nth-child(1) th {
    background-color: #ccc;
}

/* Weekdays */
.timetable-grid thead tr:nth-child(2) th {
    background-color: #dcdcdc;
}

/* Department */
.timetable-grid thead tr:nth-child(3) th {
    background-color: #e6e6e6;
}

/* Admission */
.timetable-grid thead tr:nth-child(4) th {
    background-color: #f0f0f0;
}

/* Grade */
.timetable-grid thead tr:nth-child(5) th {
    background-color: #f9f9f9;
}

/* Class */

/* Print Optimization */
@media print {
    body {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .timetable-page-container {
        width: 100%;
        margin: 0;
    }

    h1 {
        display: none;
        /* Optional: Hide header on print if needed, but keeping for now */
    }
}