/* ===== TIMETABLE CLEAN & ORGANIZED STYLES ===== */

/* CSS Variables - Clean Blue Theme */
:root {
    --primary: #1e40af;
    --primary-dark: #1e3a8a;
    --primary-light: #3b82f6;
    --primary-lighter: #dbeafe;
    --secondary: #0f172a;
    --accent: #06d6a0;
    --danger: #ef4444;
    --warning: #f59e0b;
    --success: #10b981;
    --text: #ffffff;
    --text-light: #cbd5e1;
    --text-dark: #1e293b;
    --border: #334155;
    --bg: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
    --card-bg: rgba(255, 255, 255, 0.95);
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.4);
    --radius: 12px;
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* Layout */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px 20px;
    position: relative;
}

/* Header */
.header {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--radius);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-lg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid var(--glass-border);
}

.header-left h2 {
    color: white;
    font-size: 2rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.header-left p {
    color: var(--text-light);
    font-size: 1rem;
    margin: 0;
}

/* Section */
.section {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--radius);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--glass-border);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.section-title i {
    color: var(--accent);
    font-size: 1.5rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.btn-primary {
    background: var(--primary-light);
    color: white;
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-warning {
    background: var(--warning);
    color: white;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-info {
    background: var(--primary);
    color: white;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

.btn-xs {
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
}

/* View Toggle */
.view-toggle {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    background: rgba(255, 255, 255, 0.08);
    padding: 0.75rem;
    border-radius: 8px;
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
}

.toggle-btn {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1px solid var(--glass-border);
    background: transparent;
    color: var(--text-light);
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.toggle-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.toggle-btn.active {
    background: var(--primary-light);
    color: white;
    border-color: transparent;
}

/* Controls Section */
.timetable-controls {
    background: rgba(255, 255, 255, 0.08);
    padding: 1.5rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
}

.timetable-controls .form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.timetable-controls .form-group {
    display: flex;
    flex-direction: column;
}

.timetable-controls .form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: white;
    font-size: 0.9rem;
}

.timetable-controls .form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--glass-border);
    border-radius: 6px;
    font-size: 0.95rem;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    transition: all 0.3s ease;
}

.timetable-controls .form-control:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.15);
}

/* Card */
.card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius);
    padding: 1.5rem;
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
}

/* ===== CLASSIC VIEW STYLES ===== */
.classic-timetable {
    display: none;
}

.classic-timetable.active {
    display: block;
}

.timetable-class-section {
    margin-bottom: 2rem;
}

.classic-header {
    margin-bottom: 1rem;
}

.classic-header h3 {
    color: white;
    font-size: 1.25rem;
    font-weight: 600;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--accent);
}

.classic-table {
    display: grid;
    grid-template-columns: 120px repeat(5, 1fr);
    gap: 1px;
    background: var(--glass-border);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.table-header {
    display: contents;
}

.header-cell {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    padding: 1rem;
    text-align: center;
    font-weight: 700;
    font-size: 0.9rem;
}

.time-cell {
    background: var(--primary-lighter);
    color: var(--primary-dark);
    padding: 1rem;
    text-align: center;
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.table-row {
    display: contents;
}

.schedule-cell {
    background: white;
    padding: 0.75rem;
    border-left: 3px solid var(--accent);
    color: #1e293b;
    transition: all 0.3s ease;
}

.schedule-cell:hover {
    background: #f8fafc;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.schedule-cell .subject {
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 0.25rem;
    font-size: 0.95rem;
}

.schedule-cell .teacher,
.schedule-cell .room {
    font-size: 0.8rem;
    color: #64748b;
    margin-bottom: 0.1rem;
}

.empty-cell {
    background: #f8fafc;
    padding: 1rem;
    text-align: center;
    color: #94a3b8;
    font-style: italic;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cell-actions {
    margin-top: 0.5rem;
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

.btn-icon {
    background: none;
    border: none;
    color: #64748b;
    cursor: pointer;
    padding: 0.25rem;
    font-size: 0.8rem;
    transition: color 0.3s;
    border-radius: 4px;
}

.btn-icon:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--primary);
}

/* ===== BLOCK VIEW STYLES ===== */
.block-timetable {
    display: none;
}

.block-timetable.active {
    display: block;
}

.block-section {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    margin: 1rem 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.block-header {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    padding: 1rem;
    text-align: center;
}

.block-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
}

.block-header p {
    margin: 0.25rem 0 0;
    opacity: 0.9;
    font-size: 0.85rem;
}

.block-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.block-table th {
    background: var(--primary-lighter);
    color: var(--primary-dark);
    padding: 0.75rem;
    text-align: center;
    font-weight: 600;
    border: 1px solid #e2e8f0;
}

.block-table td {
    border: 1px solid #e2e8f0;
    padding: 0.75rem;
    text-align: center;
    vertical-align: top;
    min-height: 60px;
}

.time-col {
    background: #f8fafc;
    font-weight: 600;
    color: var(--primary-dark);
    width: 120px;
}

.break-cell {
    background: #f1f5f9;
    color: #64748b;
    font-weight: 600;
    font-size: 0.8rem;
}

.schedule-cell {
    background: #f0f9ff;
}

.schedule-cell strong {
    display: block;
    color: var(--primary-dark);
    font-weight: 700;
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
}

.schedule-cell small {
    display: block;
    color: #4b5563;
    margin-bottom: 0.15rem;
    font-size: 0.8rem;
}

.schedule-cell em {
    display: block;
    color: #6b7280;
    font-size: 0.75rem;
    font-style: italic;
}

.block-footer {
    background: #f8fafc;
    padding: 1rem;
    text-align: center;
    color: #64748b;
    font-size: 0.8rem;
    border-top: 1px solid #e2e8f0;
}

/* ===== DAILY VIEW STYLES ===== */
.daily-timetable {
    display: none;
}

.daily-timetable.active {
    display: block;
}

.daily-view-header {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    padding: 1rem;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.daily-view-header h3 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
}

.day-navigation {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.current-day {
    font-weight: 700;
    font-size: 1rem;
    min-width: 100px;
    text-align: center;
}

.daily-class {
    background: white;
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.daily-class h4 {
    color: var(--primary-dark);
    margin: 0 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--accent);
    font-size: 1rem;
}

.periods-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.period-item {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 1rem;
    align-items: start;
    background: #f8fafc;
    border-radius: 6px;
    padding: 1rem;
    border-left: 4px solid var(--primary);
}

.period-time {
    font-weight: 600;
    color: var(--primary-dark);
    font-size: 0.9rem;
}

.period-details .period-subject {
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.25rem;
    font-size: 0.95rem;
}

.period-details .period-teacher,
.period-details .period-room {
    font-size: 0.85rem;
    color: #64748b;
}

.no-classes {
    text-align: center;
    padding: 2rem;
    color: #94a3b8;
    font-style: italic;
}

/* No Data States */
.no-data {
    text-align: center;
    padding: 3rem;
    color: #94a3b8;
    font-size: 1rem;
}

.no-timetable {
    text-align: center;
    color: var(--text-light);
    font-size: 1.1rem;
    padding: 3rem;
    display: none;
}

.no-timetable i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--primary-lighter);
    opacity: 0.5;
    display: block;
}

.no-timetable h3 {
    color: white;
    margin-bottom: 1rem;
    font-weight: 600;
}

.no-timetable p {
    margin-bottom: 2rem;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

/* Statistics Cards */
.timetable-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.stat-card {
    background: rgba(255, 255, 255, 0.08);
    border-radius: var(--radius);
    padding: 1rem;
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.12);
}

.stat-card i {
    font-size: 1.5rem;
    color: var(--accent);
    width: 50px;
    height: 50px;
    background: rgba(6, 214, 160, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-content h4 {
    color: var(--text-light);
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
    font-weight: 600;
}

.stat-content p {
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

/* ===== MODAL STYLES ===== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(10px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: white;
    border-radius: var(--radius);
    padding: 2rem;
    width: 100%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    border: 1px solid #e5e7eb;
    animation: modalSlideIn 0.4s ease;
    position: relative;
    color: #1e293b;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e5e7eb;
}

.modal-header h3 {
    font-size: 1.5rem;
    color: #1e40af;
    margin: 0;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.close {
    background: #f3f4f6;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: #4b5563;
    cursor: pointer;
    transition: all 0.3s ease;
}

.close:hover {
    background: var(--danger);
    color: white;
}

.modal-form .form-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.modal-form .form-section h4 {
    color: #1e40af;
    margin-bottom: 1rem;
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-form .form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.modal-form .form-group {
    display: flex;
    flex-direction: column;
}

.modal-form .form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #374151;
    font-size: 0.9rem;
}

.modal-form .form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.95rem;
    background: white;
    color: #1f2937;
    transition: all 0.3s ease;
}

.modal-form .form-control:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.modal-form select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
}

.modal-form .form-hint {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 0.25rem;
    font-style: italic;
}

.modal-form .required .form-label::after {
    content: " *";
    color: #ef4444;
    font-weight: bold;
}

.modal-form .form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e5e7eb;
}

/* Notification System */
#notificationContainer {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 3000;
    max-width: 300px;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.notification {
    background: white;
    border-radius: 8px;
    padding: 1rem 1.25rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    border-left: 5px solid var(--success);
    display: flex;
    align-items: center;
    gap: 1rem;
    animation: slideInRight 0.5s ease;
    color: #1e293b;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.notification.success {
    border-left-color: var(--success);
}

.notification.error {
    border-left-color: var(--danger);
}

.notification.warning {
    border-left-color: var(--warning);
}

.notification-content i {
    font-size: 1.25rem;
    color: inherit;
}

/* Print Styles */
@media print {
    body {
        background: white !important;
        color: black !important;
    }
    
    .container {
        padding: 0 !important;
        max-width: 100% !important;
    }
    
    .header-right,
    .view-toggle,
    .timetable-controls,
    .btn:not(.print-btn),
    .timetable-stats,
    .modal {
        display: none !important;
    }
    
    .header {
        background: white !important;
        color: black !important;
        box-shadow: none !important;
        border: 1px solid #333 !important;
        margin-bottom: 1rem !important;
        padding: 1rem !important;
    }
    
    .header-left h2 {
        color: black !important;
    }
    
    .section {
        box-shadow: none !important;
        border: none !important;
        background: white !important;
        color: black !important;
        padding: 0 !important;
    }
    
    .card {
        box-shadow: none !important;
        border: none !important;
        background: white !important;
        padding: 0 !important;
    }
    
    .block-section {
        box-shadow: none !important;
        border: 2px solid #333 !important;
        break-inside: avoid;
        margin: 0 !important;
    }
    
    .block-table {
        font-size: 11px !important;
    }
    
    .block-table th {
        background: #f1f5f9 !important;
        color: #1e293b !important;
        -webkit-print-color-adjust: exact;
    }
    
    .classic-timetable,
    .daily-timetable {
        display: none !important;
    }
    
    .block-timetable {
        display: block !important;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .header {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
        padding: 1.5rem;
    }
    
    .section-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .classic-table {
        grid-template-columns: 80px repeat(5, 1fr);
        font-size: 0.8rem;
    }
    
    .header-cell,
    .time-cell,
    .schedule-cell,
    .empty-cell {
        padding: 0.5rem;
        font-size: 0.75rem;
    }
    
    .block-table {
        font-size: 0.75rem;
    }
    
    .block-table th,
    .block-table td {
        padding: 0.5rem;
    }
    
    .period-item {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .timetable-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .modal-form .form-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .view-toggle {
        flex-direction: column;
    }
    
    .timetable-stats {
        grid-template-columns: 1fr;
    }
    
    .stat-card {
        flex-direction: column;
        text-align: center;
    }
    
    .modal-form .form-actions {
        flex-direction: column;
    }
    
    .modal-form .form-actions .btn {
        width: 100%;
    }
}
/* ===== ENHANCED REPORTING STYLES ===== */
.report-panel {
    animation: slideInUp 0.3s ease;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.report-panel:hover {
    box-shadow: 0 15px 40px rgba(0,0,0,0.4);
    transform: translateY(-2px);
}

.report-content::-webkit-scrollbar {
    width: 6px;
}

.report-content::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.report-content::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.report-content::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Print-specific styles */
@media print {
    .report-panel,
    .btn,
    .view-toggle,
    .timetable-controls,
    .header-actions {
        display: none !important;
    }
}

/* Responsive report panel */
@media (max-width: 768px) {
    .report-panel {
        width: 300px !important;
        right: 10px !important;
        bottom: 10px !important;
    }
    
    .report-panel.expanded {
        width: 90vw !important;
        height: 80vh !important;
        right: 5vw !important;
    }
}