/* ==========================================================================
   TOP TUTOR - Modern SAT Math Institute Stylesheet
   ========================================================================== */

:root {
  --primary: #1e3a8a;       /* Deep Academic Royal Blue */
  --primary-light: #3b82f6; /* Electric Blue */
  --primary-dark: #0f172a;  /* Midnight Slate */
  --accent-gold: #f59e0b;   /* Prestige Gold for 800 scores & badges */
  --accent-teal: #06b6d4;   /* Modern Cyan/Teal for Math/Desmos */
  --bg-gradient-start: #0a0f1d;
  --bg-gradient-end: #101c3d;
  --card-bg: rgba(255, 255, 255, 0.05);
  --card-border: rgba(255, 255, 255, 0.12);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 10px;
}
::-webkit-scrollbar-track {
  background: #0f172a;
}
::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 5px;
}
::-webkit-scrollbar-thumb:hover {
  background: #475569;
}

/* Background Math & Grid Pattern */
.bg-math-grid {
  background-color: #070b15;
  background-image: 
    radial-gradient(circle at 50% 0%, rgba(37, 99, 235, 0.18) 0%, transparent 60%),
    radial-gradient(circle at 100% 50%, rgba(245, 158, 11, 0.08) 0%, transparent 40%),
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 40px 40px, 40px 40px;
}

/* Glassmorphism Card */
.glass-card {
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.5);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.glass-card:hover {
  border-color: rgba(96, 165, 250, 0.3);
  box-shadow: 0 25px 50px -12px rgba(37, 99, 235, 0.25);
  transform: translateY(-4px);
}

/* Hero Badge Glow */
.glow-badge {
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.4);
}

/* Text Gradient */
.text-gradient-gold {
  background: linear-gradient(135deg, #fde047 0%, #f59e0b 50%, #d97706 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.text-gradient-blue {
  background: linear-gradient(135deg, #93c5fd 0%, #3b82f6 50%, #60a5fa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Interactive Button Animations */
.btn-primary {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  transition: all 0.25s ease;
  box-shadow: 0 10px 25px -5px rgba(37, 99, 235, 0.4);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  box-shadow: 0 15px 30px -5px rgba(37, 99, 235, 0.6);
  transform: translateY(-2px);
}

.btn-gold {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  transition: all 0.25s ease;
  box-shadow: 0 10px 25px -5px rgba(245, 158, 11, 0.4);
}

.btn-gold:hover {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  box-shadow: 0 15px 30px -5px rgba(245, 158, 11, 0.6);
  transform: translateY(-2px);
}

.btn-line {
  background: linear-gradient(135deg, #06c755 0%, #05a847 100%);
  transition: all 0.25s ease;
  box-shadow: 0 10px 25px -5px rgba(6, 199, 85, 0.4);
}

.btn-line:hover {
  background: linear-gradient(135deg, #10db63 0%, #06c755 100%);
  box-shadow: 0 15px 30px -5px rgba(6, 199, 85, 0.6);
  transform: translateY(-2px);
}

/* Calendar Container Styling */
.calendar-frame-container {
  position: relative;
  width: 100%;
  border-radius: 1rem;
  overflow: hidden;
  background: #ffffff;
  border: 2px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
}

.calendar-frame-container iframe {
  width: 100%;
  height: 650px;
  border: 0;
  display: block;
}

@media (max-width: 768px) {
  .calendar-frame-container iframe {
    height: 520px;
  }
}

/* Modal Dialog */
dialog {
  border: none;
  background: transparent;
  padding: 0;
  max-width: 90vw;
  width: 600px;
  margin: auto;
}

dialog::backdrop {
  background: rgba(3, 7, 18, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

dialog[open] {
  animation: modalFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Pulse indicator for live slots */
.pulse-dot {
  width: 10px;
  height: 10px;
  background-color: #22c55e;
  border-radius: 50%;
  position: relative;
  display: inline-block;
}

.pulse-dot::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background-color: #22c55e;
  animation: pulseAnimation 1.8s infinite;
}

@keyframes pulseAnimation {
  0% {
    transform: scale(1);
    opacity: 0.8;
  }
  100% {
    transform: scale(2.6);
    opacity: 0;
  }
}

/* Instagram Reel Container & Device Mockup */
.reel-device-mockup {
  position: relative;
  max-width: 380px;
  width: 100%;
  margin: 0 auto;
  border-radius: 28px;
  padding: 8px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.03));
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.8), 0 0 40px rgba(59, 130, 246, 0.2);
}

.reel-iframe-wrapper {
  position: relative;
  width: 100%;
  border-radius: 20px;
  overflow: hidden;
  background: #000;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5);
}

.reel-iframe-wrapper iframe {
  width: 100%;
  min-height: 560px;
  border: 0;
  display: block;
}

.btn-instagram {
  background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
  transition: all 0.25s ease;
  box-shadow: 0 10px 25px -5px rgba(220, 39, 67, 0.4);
}

.btn-instagram:hover {
  filter: brightness(1.1);
  box-shadow: 0 15px 30px -5px rgba(220, 39, 67, 0.6);
  transform: translateY(-2px);
}

/* ==========================================================================
   Admin Portal & Invoice PDF Styling
   ========================================================================== */

/* A4 Paper Mockup for Live Preview */
.invoice-paper {
  background: #ffffff;
  color: #0f172a;
  width: 100%;
  max-width: 210mm;
  min-height: 297mm;
  margin: 0 auto;
  padding: 16mm 16mm 14mm 16mm;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  font-family: 'Prompt', -apple-system, BlinkMacSystemFont, sans-serif;
  box-sizing: border-box;
}

@media (max-width: 1024px) {
  .invoice-paper {
    padding: 10mm;
    min-height: auto;
  }
}

/* Print Specific Rules */
@media print {
  @page {
    size: A4 portrait;
    margin: 8mm;
  }

  body {
    background: #ffffff !important;
    color: #000000 !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  /* Hide everything except the invoice */
  header, 
  footer, 
  #adminControls, 
  #siteToast, 
  .no-print,
  .btn-print,
  .mobile-nav-bar {
    display: none !important;
  }

  .invoice-paper {
    box-shadow: none !important;
    border-radius: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    min-height: auto !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  /* Ensure colors and table borders print properly */
  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
}

/* ==========================================================================
   Interactive Admin Calendar Widget
   ========================================================================== */
.admin-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 5px;
}

.cal-cell {
  min-height: 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  position: relative;
  user-select: none;
  border: 1px solid rgba(255, 255, 255, 0.05);
  background-color: rgba(15, 23, 42, 0.6);
}

.cal-cell:hover:not(.empty-cell) {
  background-color: rgba(37, 99, 235, 0.25);
  border-color: rgba(96, 165, 250, 0.5);
  transform: translateY(-2px);
}

.cal-cell.selected {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%) !important;
  color: #ffffff !important;
  font-weight: 800;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.5);
  border: 1px solid #93c5fd !important;
  transform: scale(1.02);
}

.cal-cell.today:not(.selected) {
  border: 1px solid rgba(245, 158, 11, 0.6);
}

.cal-cell.today::after {
  content: '';
  position: absolute;
  bottom: 3px;
  width: 4px;
  height: 4px;
  background-color: #fbbf24;
  border-radius: 50%;
}

.cal-cell.empty-cell {
  opacity: 0.2;
  pointer-events: none;
  cursor: default;
  border-color: transparent !important;
  background-color: transparent !important;
}

/* Conflict & Blocked Indicators */
.cal-cell.has-other-student:not(.selected) {
  border: 1px dashed rgba(245, 158, 11, 0.7);
  background-color: rgba(245, 158, 11, 0.08);
}

.cal-cell.is-blocked:not(.selected) {
  border: 1px dashed rgba(239, 68, 68, 0.6);
  background-color: rgba(239, 68, 68, 0.08);
}

.cal-cell.conflict-active {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%) !important;
  color: #ffffff !important;
  border: 1px solid #fca5a5 !important;
  box-shadow: 0 4px 14px rgba(220, 38, 38, 0.6) !important;
  animation: pulse-border 1.8s infinite;
}

@keyframes pulse-border {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
  }
  50% {
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.3);
  }
}

.conflict-pill {
  font-size: 8.5px;
  line-height: 1;
  padding: 2px 3px;
  border-radius: 4px;
  font-weight: 700;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}




