/* 
  SaaS-grade Timetable Maker Custom Styles
  Complementary to Tailwind CSS for advanced effects and print styles
*/

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

:root {
  --radius-sm: 0.375rem;
  --radius-md: 0.75rem;
  --radius-lg: 1.25rem;
  --radius-full: 9999px;
  
  --font-heading: 'Outfit', 'Inter', sans-serif;
  --font-body: 'Inter', sans-serif;
}

body {
  font-family: var(--font-body);
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
}

/* Glassmorphism Styles */
.glass {
  background: rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.dark .glass {
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.glass-premium {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0.3) 100%);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
}

.dark .glass-premium {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.8) 0%, rgba(15, 23, 42, 0.4) 100%);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.07);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

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

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

.dark ::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.2);
}

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

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

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

.dark ::-webkit-scrollbar-thumb:hover {
  background: rgba(71, 85, 105, 0.7);
}

/* SortableJS drag & drop helpers */
.sortable-ghost {
  opacity: 0.3;
  transform: scale(0.95);
  border: 2px dashed #8b5cf6 !important;
}

.sortable-chosen {
  box-shadow: 0 10px 15px -3px rgba(139, 92, 246, 0.3);
  transform: rotate(-1deg);
}

.sortable-drag {
  opacity: 0.9;
}

/* Timetable Builder Drag Target Indicator */
.empty-slot-highlight {
  animation: pulse-border 2s infinite ease-in-out;
}

@keyframes pulse-border {
  0%, 100% {
    border-color: rgba(139, 92, 246, 0.2);
    background-color: rgba(139, 92, 246, 0.02);
  }
  50% {
    border-color: rgba(139, 92, 246, 0.6);
    background-color: rgba(139, 92, 246, 0.08);
  }
}

/* Conflict highlight animation */
.conflict-highlight {
  animation: pulse-danger 1.5s infinite ease-in-out;
}

@keyframes pulse-danger {
  0%, 100% {
    border-color: rgba(239, 68, 68, 0.4);
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.2);
  }
  50% {
    border-color: rgba(239, 68, 68, 0.9);
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1);
  }
}

/* Micro-animations */
.hover-lift {
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease;
}

.hover-lift:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 20px -5px rgba(0, 0, 0, 0.1);
}

.dark .hover-lift:hover {
  box-shadow: 0 12px 20px -5px rgba(0, 0, 0, 0.4);
}

.pulse-soft {
  animation: pulse-s 2s infinite ease-in-out;
}

@keyframes pulse-s {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.03); }
}

/* Shimmer loading effect */
.shimmer {
  background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
  background-size: 200% 100%;
  animation: shimmer-anim 1.5s infinite;
}

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

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

/* Print Overrides */
@media print {
  body {
    background: white !important;
    color: black !important;
    font-size: 10pt;
  }
  
  /* Hide all dashboard/builder chrome, sidebars, and control buttons */
  .no-print,
  #sidebar,
  #controls,
  #theme-customizer,
  .adsense-placeholder,
  header,
  footer,
  nav,
  button,
  .undo-redo-container,
  .export-options-dropdown {
    display: none !important;
  }
  
  /* Ensure main container occupies full screen and preserves colors */
  #main-content,
  .print-area {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    box-shadow: none !important;
    border: none !important;
    background: white !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  
  /* Ensure the grid takes full width and expands correctly */
  #timetable-grid-wrapper {
    overflow: visible !important;
    width: 100% !important;
  }

  table, tr, td, th {
    page-break-inside: avoid;
  }
  
  /* Force dark colored borders to render clearly */
  .border, td, th {
    border-color: #64748b !important;
  }
}
