/* Modern Timetable Creator - Custom Stylesheet */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --color-primary: #4f46e5;
  --color-primary-hover: #4338ca;
  --transition-speed: 0.2s;
}

body {
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.03);
}
.dark ::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.03);
}
::-webkit-scrollbar-thumb {
  background: rgba(156, 163, 175, 0.5);
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(107, 114, 128, 0.8);
}

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

.glass-dropdown {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(229, 231, 235, 0.8);
}
.dark .glass-dropdown {
  background: rgba(30, 41, 59, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Gradient Text and Backgrounds */
.gradient-text {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #ec4899 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.dark .gradient-text {
  background: linear-gradient(135deg, #818cf8 0%, #a78bfa 50%, #f472b6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.gradient-glow {
  background: radial-gradient(circle at 50% 50%, rgba(99, 102, 241, 0.15), transparent 70%);
}

/* Drag & Drop Visuals */
.sortable-ghost {
  opacity: 0.35;
  transform: scale(0.96);
  border: 2px dashed #6366f1 !important;
  background-color: rgba(99, 102, 241, 0.08) !important;
}

.sortable-chosen {
  cursor: grabbing !important;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2), 0 10px 10px -5px rgba(0, 0, 0, 0.1);
  transform: scale(1.03) rotate(1deg);
  z-index: 50;
}

.sortable-drag {
  opacity: 0.95;
  cursor: grabbing !important;
  box-shadow: 0 25px 50px -12px rgba(79, 70, 229, 0.35);
}

.drop-target-active {
  background-color: rgba(99, 102, 241, 0.08) !important;
  border-color: #6366f1 !important;
}

.drop-target-hover {
  background-color: rgba(99, 102, 241, 0.15) !important;
  border-color: #4f46e5 !important;
  outline: 2px solid #6366f1;
}

/* Timetable Grid Cell Styles */
.timetable-cell {
  transition: all var(--transition-speed) ease;
  min-height: 110px;
}

.timetable-cell:hover .add-slot-btn {
  opacity: 1;
  transform: scale(1);
}

.timetable-card {
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  cursor: grab;
}

.timetable-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px -4px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.timetable-card:active {
  cursor: grabbing;
}

/* Conflict Pulse Animation */
@keyframes pulse-danger {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(239, 68, 68, 0);
  }
}

.has-conflict {
  animation: pulse-danger 2s infinite;
  border-color: #ef4444 !important;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes scaleUp {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.animate-fade-in {
  animation: fadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-scale-up {
  animation: scaleUp 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Search Highlight */
.search-highlight {
  box-shadow: 0 0 0 3px #fbbf24, 0 8px 20px rgba(245, 158, 11, 0.3) !important;
  transform: scale(1.02) !important;
}

.search-dimmed {
  opacity: 0.35 !important;
  filter: grayscale(40%);
}

/* Responsive Table Wrapper */
.timetable-scroll-container {
  scrollbar-width: thin;
  scrollbar-color: rgba(156, 163, 175, 0.5) transparent;
}

/* Print Optimization */
@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
    font-size: 11pt !important;
  }
  
  header,
  footer,
  aside,
  #controls-bar,
  #sidebar,
  .no-print,
  .toast-container,
  #modal-container,
  #marketing-sections,
  .btn,
  button,
  .quick-palette-container {
    display: none !important;
  }

  main {
    padding: 0 !important;
    margin: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
  }

  #timetable-container {
    box-shadow: none !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 0 !important;
    width: 100% !important;
    overflow: visible !important;
  }

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

  .timetable-card {
    box-shadow: none !important;
    border: 1px solid rgba(0, 0, 0, 0.15) !important;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .timetable-cell {
    min-height: 80px !important;
    border-color: #cbd5e1 !important;
  }

  @page {
    size: landscape;
    margin: 1cm;
  }
}
