/* Custom Styles & Overrides */

/* Glassmorphism Utilities */
.glass-header {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.dark .glass-header {
    background: rgba(17, 24, 39, 0.8);
}

.glass-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.dark .glass-card {
    background: rgba(31, 41, 55, 0.7);
}

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

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

.custom-scrollbar::-webkit-scrollbar-thumb {
    background-color: rgba(156, 163, 175, 0.5);
    border-radius: 20px;
}

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

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background-color: rgba(107, 114, 128, 0.8);
}

/* Drag & Drop Styles (SortableJS) */
.sortable-ghost {
    opacity: 0.4;
    background-color: #f3f4f6;
    border: 2px dashed #9ca3af;
    border-radius: 0.5rem;
}

.dark .sortable-ghost {
    background-color: #374151;
    border-color: #6b7280;
}

.sortable-drag {
    cursor: grabbing !important;
    opacity: 1 !important;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04) !important;
    transform: scale(1.02);
}

.slot-container {
    min-height: 80px;
    transition: background-color 0.2s ease;
}

.slot-container.drag-over {
    background-color: rgba(59, 130, 246, 0.1);
}

.dark .slot-container.drag-over {
    background-color: rgba(59, 130, 246, 0.2);
}

/* Print Styles */
@media print {
    body {
        background: white !important;
        color: black !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    /* Hide everything except the app section */
    header, footer, #hero, #features, #templates, #faq, #toast, #periodModal {
        display: none !important;
    }
    /* Hide the toolbar inside the app section */
    #app .glass-card {
        display: none !important;
    }
    /* Make the app container take the full page */
    #app {
        padding: 0 !important;
        margin: 0 !important;
        background: white !important;
    }
    /* Force the grid wrapper to fill the printed page and remove styling */
    #timetableWrapper {
        box-shadow: none !important;
        border: none !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        border-radius: 0 !important;
    }
    .overflow-x-auto {
        overflow: visible !important;
    }
    .slot-container {
        border: 1px solid #e5e7eb !important;
        break-inside: avoid;
    }
    /* Ensure colors are printed */
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
}

/* Tooltip */
.tooltip-trigger {
    position: relative;
}

.tooltip-trigger::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    background-color: #1f2937;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    pointer-events: none;
    z-index: 50;
}

.dark .tooltip-trigger::after {
    background-color: #f9fafb;
    color: #111827;
}

.tooltip-trigger:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-4px);
}
