/* Modern Timetable Creator Custom Styles & Enhancements */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
    --font-primary: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
    font-family: var(--font-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Glassmorphism effects */
.glass-panel {
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.dark .glass-panel {
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.glass-card {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(226, 232, 240, 0.8);
}

.dark .glass-card {
    background: rgba(30, 41, 59, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(156, 163, 175, 0.4);
    border-radius: 9999px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(107, 114, 128, 0.7);
}

.dark ::-webkit-scrollbar-thumb {
    background: rgba(75, 85, 99, 0.5);
}

.dark ::-webkit-scrollbar-thumb:hover {
    background: rgba(156, 163, 175, 0.8);
}

/* Drag & Drop Sortable Styles */
.sortable-ghost {
    opacity: 0.35 !important;
    transform: scale(0.96);
    border: 2px dashed #6366f1 !important;
}

.sortable-chosen {
    background-color: rgba(99, 102, 241, 0.15) !important;
    cursor: grabbing !important;
}

.sortable-drag {
    opacity: 0.9 !important;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    transform: rotate(2deg) scale(1.03);
    z-index: 9999 !important;
}

/* Cell hover & active state */
.timetable-cell {
    min-height: 90px;
    transition: all 0.2s ease;
}

.timetable-cell.drop-target-active {
    background-color: rgba(99, 102, 241, 0.1);
    border: 2px dashed #4f46e5;
}

/* Conflict state */
.has-conflict {
    border: 2px solid #ef4444 !important;
    animation: pulse-red 2s infinite;
}

@keyframes pulse-red {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
    }
    50% {
        box-shadow: 0 0 0 6px rgba(239, 68, 68, 0);
    }
}

/* Empty slot highlight */
.empty-highlight {
    background: repeating-linear-gradient(
        45deg,
        rgba(99, 102, 241, 0.03),
        rgba(99, 102, 241, 0.03) 10px,
        rgba(99, 102, 241, 0.08) 10px,
        rgba(99, 102, 241, 0.08) 20px
    ) !important;
    border: 1px dashed rgba(99, 102, 241, 0.3) !important;
}

/* Skeleton Loading Animation */
.skeleton {
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

.dark .skeleton {
    background: linear-gradient(90deg, #1e293b 25%, #334155 50%, #1e293b 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Print Styling */
@media print {
    body {
        background: #ffffff !important;
        color: #000000 !important;
        font-size: 12pt;
    }

    /* Hide UI Chrome */
    header, footer, sidebar, .no-print, #sidebar, #header-controls, .action-buttons, .toast-container, modal {
        display: none !important;
    }

    /* Full width timetable container */
    #timetable-export-container, #timetable-wrapper {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        box-shadow: none !important;
        border: none !important;
        overflow: visible !important;
    }

    table {
        width: 100% !important;
        border-collapse: collapse !important;
        page-break-inside: auto;
    }

    tr {
        page-break-inside: avoid;
        page-break-after: auto;
    }

    th, td {
        border: 1px solid #cbd5e1 !important;
        padding: 8px !important;
        color: #000000 !important;
    }

    .subject-card {
        box-shadow: none !important;
        border: 1px solid #94a3b8 !important;
    }

    .print-header {
        display: block !important;
        text-align: center;
        margin-bottom: 20px;
    }
}

.print-header {
    display: none;
}
