/* ============================================
   GCTU PORTAL - RESOURCES & TIMETABLE
   ============================================ */

/* Resources Container */
.resources-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 32px 24px;
}

.resources-header {
    text-align: center;
    margin-bottom: 40px;
}

.resources-header h1 {
    font-size: 30px;
    color: #1a1a2e;
    margin: 0 0 8px;
    font-weight: 700;
}

.resources-header p {
    color: #888;
    font-size: 15px;
    margin: 0;
}

/* Resource Section */
.resource-section {
    margin-bottom: 44px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 2px solid #eef0f5;
    flex-wrap: wrap;
    gap: 10px;
}

.section-header h2 {
    font-size: 20px;
    color: #1a1a2e;
    margin: 0;
    font-weight: 700;
}

.section-badge {
    background: #667eea;
    color: white;
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

/* ==========================================
   TIMETABLE - Desktop (Table)
   ========================================== */
.timetable-wrapper {
    overflow-x: auto;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    border: 1px solid #eef0f5;
}

.timetable {
    width: 100%;
    border-collapse: collapse;
    background: white;
    min-width: 600px;
}

.timetable thead {
    background: #1a1a2e;
    color: white;
}

.timetable th {
    padding: 14px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    white-space: nowrap;
}

.timetable td {
    padding: 14px 16px;
    border-bottom: 1px solid #eef0f5;
    font-size: 13px;
    vertical-align: top;
}

.timetable tbody tr:last-child td {
    border-bottom: none;
}

.timetable tbody tr:hover {
    background: #f8f9ff;
}

.time-slot {
    font-weight: 600;
    color: #667eea;
    min-width: 110px;
    font-size: 13px;
    text-align: center;
    vertical-align: middle;
}

.class-slot {
    border-left: 3px solid transparent;
    padding: 14px 12px;
    font-size: 13px;
    line-height: 1.5;
    text-align: center;
    vertical-align: middle;
}

.class-slot:not(:empty) {
    border-left-color: #667eea;
}

.room {
    display: block;
    font-size: 11px;
    color: #999;
    margin-top: 3px;
    font-style: italic;
}

.lecturer {
    display: block;
    font-size: 11px;
    color: #667eea;
    margin-top: 2px;
    font-weight: 500;
}

.course-lecturer {
    font-size: 12px;
    color: #667eea;
    margin: 0 0 6px;
    font-weight: 500;
}

/* ==========================================
   TIMETABLE - Mobile (Card layout)
   ========================================== */
.timetable-cards {
    display: none;
}

.timetable-day-label {
    background: #1a1a2e;
    color: white;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    margin: 16px 0 10px;
}

.timetable-day-label:first-child {
    margin-top: 0;
}

.timetable-card {
    background: white;
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 10px;
    border: 1px solid #eef0f5;
    border-left: 4px solid #667eea;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.timetable-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 6px;
}

.timetable-card-course {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a2e;
    flex: 1;
}

.timetable-card-time {
    font-size: 12px;
    color: #667eea;
    font-weight: 600;
    white-space: nowrap;
    margin-left: 10px;
}

.timetable-card-details {
    font-size: 12px;
    color: #888;
    line-height: 1.6;
}

.timetable-card-details span {
    display: inline-block;
    margin-right: 12px;
}

.no-classes {
    color: #bbb;
    font-size: 13px;
    padding: 20px;
    text-align: center;
}

/* Resources Grid */
.resources-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.resource-card {
    background: white;
    border-radius: 14px;
    padding: 24px 20px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
    border: 1px solid #eef0f5;
}

.resource-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.1);
}

.resource-icon {
    font-size: 36px;
    margin-bottom: 12px;
    display: inline-block;
}

.resource-card h3 {
    font-size: 16px;
    color: #1a1a2e;
    margin: 0 0 8px;
    font-weight: 600;
}

.resource-description {
    color: #888;
    font-size: 13px;
    margin: 0 0 16px;
    line-height: 1.5;
    flex-grow: 1;
}

.resource-files {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.file-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: #f8f9ff;
    border-radius: 8px;
    text-decoration: none;
    color: #667eea;
    transition: all 0.2s;
    font-size: 13px;
    border-left: 3px solid transparent;
}

.file-link:hover {
    background: #eef0ff;
    border-left-color: #667eea;
    transform: translateX(4px);
}

.file-icon {
    font-size: 15px;
    min-width: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Announcements */
.announcements-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.announcement-item {
    display: flex;
    gap: 18px;
    padding: 18px 20px;
    background: white;
    border-radius: 12px;
    border-left: 4px solid #667eea;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: all 0.2s;
}

.announcement-item:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.announcement-date {
    background: #f8f9ff;
    color: #667eea;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    min-width: 70px;
    text-align: center;
    white-space: nowrap;
    height: fit-content;
}

.announcement-content h4 {
    margin: 0 0 6px;
    font-size: 15px;
    color: #1a1a2e;
}

.announcement-content p {
    margin: 0;
    color: #888;
    font-size: 13px;
    line-height: 1.6;
}

/* Loading / No-data */
.no-files, .error-loading, .no-announcements {
    color: #bbb;
    font-size: 13px;
    padding: 12px;
    text-align: center;
}

.loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #eef0f5;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin: 10px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ==========================================
   RESPONSIVE
   ========================================== */
@media (max-width: 900px) {
    .timetable-wrapper {
        display: none;
    }
    
    .timetable-cards {
        display: block;
    }
}

@media (max-width: 768px) {
    .resources-container {
        padding: 20px 16px;
    }

    .resources-header h1 {
        font-size: 24px;
    }

    .resources-header p {
        font-size: 14px;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .section-header h2 {
        font-size: 18px;
    }

    .resources-grid {
        grid-template-columns: 1fr;
    }

    .announcement-item {
        flex-direction: column;
        gap: 10px;
    }

    .announcement-date {
        min-width: unset;
        width: fit-content;
    }
}

@media (max-width: 480px) {
    .resources-container {
        padding: 14px 12px;
    }

    .resources-header h1 {
        font-size: 20px;
    }

    .resources-header p {
        font-size: 13px;
    }

    .resource-card {
        padding: 18px 16px;
    }

    .announcement-item {
        padding: 14px 16px;
    }
}