/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

/* ============================================
   TOPIC NAVIGATION HIGHLIGHT
   ============================================ */

/* Highlight animation when clicking sidebar navigation */
.topic-highlight {
  animation: topic-pulse 2.5s ease-out;
}

@keyframes topic-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(60, 141, 147, 0.4), 0 0 20px rgba(60, 141, 147, 0.3);
    border-color: rgba(60, 141, 147, 0.6);
  }
  25% {
    box-shadow: 0 0 0 8px rgba(60, 141, 147, 0), 0 0 30px rgba(60, 141, 147, 0.2);
    border-color: rgba(60, 141, 147, 0.5);
  }
  50% {
    box-shadow: 0 0 0 0 rgba(60, 141, 147, 0.3), 0 0 15px rgba(60, 141, 147, 0.15);
    border-color: rgba(60, 141, 147, 0.4);
  }
  100% {
    box-shadow: none;
    border-color: rgba(226, 232, 240, 0.6);
  }
}

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  .topic-highlight {
    animation: none;
    box-shadow: 0 0 0 3px rgba(60, 141, 147, 0.3);
    transition: box-shadow 0.3s ease;
  }
}

/* Modal animations */
dialog[open] {
  animation: fade-in 0.2s ease-out;
}

dialog::backdrop {
  animation: fade-in 0.2s ease-out;
}

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

/* Bottom sheet modal on mobile */
@media (max-width: 767px) {
  dialog[open] {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    top: auto;
    max-width: 100%;
    width: 100%;
    margin: 0;
    border-radius: 1.5rem 1.5rem 0 0;
    max-height: 90vh;
    animation: slide-up 0.3s ease-out;
  }

  @keyframes slide-up {
    from {
      transform: translateY(100%);
    }
    to {
      transform: translateY(0);
    }
  }
}

@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in-up {
  animation: fade-in-up 0.3s ease-out;
}

/* Lesson selector drag-and-drop */
[data-lesson-id] {
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

[data-lesson-id].sortable-ghost,
.slot.sortable-ghost {
  opacity: 0.4;
}

[data-lesson-id].sortable-drag,
.slot.sortable-drag {
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

/* Sortable chosen state (element being picked up) */
.slot.sortable-chosen {
  background-color: rgba(60, 141, 147, 0.15) !important;
  border-color: var(--color-primary, #3C8D93) !important;
}

/* Drag handle cursor states */
.drag-handle {
  cursor: grab;
  touch-action: none;
}

.drag-handle:active {
  cursor: grabbing;
}

/* Lesson selector - show/hide elements based on parent container */

/* Selected list styling - blue left border */
[data-lesson-selector-target="selectedList"] [data-lesson-id].lesson-item {
  border-left: 3px solid #3b82f6;
}

/* Position number: show in selected, hide in available */
[data-lesson-selector-target="selectedList"] .position-number {
  display: block;
}
[data-lesson-selector-target="availableList"] .position-number {
  display: none;
}

/* Button base styles - hidden by default, flex centering when shown */
.move-up-btn,
.move-down-btn,
.remove-btn,
.add-btn {
  display: none;
  align-items: center;
  justify-content: center;
}

/* Selected list: show move buttons + remove */
[data-lesson-selector-target="selectedList"] .move-up-btn,
[data-lesson-selector-target="selectedList"] .move-down-btn,
[data-lesson-selector-target="selectedList"] .remove-btn {
  display: flex;
}

/* Calendar slots: show remove button in filled slots */
.slot-filled .remove-btn {
  display: flex;
}

/* Selected list: hide add button */
[data-lesson-selector-target="selectedList"] .add-btn {
  display: none !important;
}

/* Available list: show add button only */
[data-lesson-selector-target="availableList"] .add-btn {
  display: flex;
}

/* Available list: hide move and remove buttons */
[data-lesson-selector-target="availableList"] .move-up-btn,
[data-lesson-selector-target="availableList"] .move-down-btn,
[data-lesson-selector-target="availableList"] .remove-btn {
  display: none !important;
}

/* Controls always visible on touch/mobile (no hover capability) */
@media (hover: none) {
  .lesson-item .lesson-controls {
    opacity: 1;
  }
}

/* Move button disabled state (managed by JS) */
.move-up-btn.disabled,
.move-down-btn.disabled {
  opacity: 0.25;
  pointer-events: none;
  cursor: default;
}

/* Calendar Slots - Month Headers (horizontal, like semester headers) */
.month-header {
  /* No vertical styling - horizontal layout from JS Tailwind classes */
}

/* Calendar Slots - Month Group Container (vertical stack: header on top, slots below) */
.month-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 0.75rem;
}

.month-group:last-child {
  margin-bottom: 0;
}

.month-slots {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

/* Calendar Slots - Slot States */
.slot {
  transition: all 0.15s ease;
}

.slot-empty {
  border-style: dashed;
}

.slot-empty:hover {
  border-color: #93c5fd;
  background-color: #eff6ff;
}

.slot-filled {
  border-style: solid;
}

.slot-nonworking {
  cursor: not-allowed;
}

/* Non-working slot stripe patterns */
.slot-nonworking-school {
  background: repeating-linear-gradient(
    -45deg,
    rgba(245, 166, 35, 0.15),
    rgba(245, 166, 35, 0.15) 4px,
    rgba(245, 166, 35, 0.08) 4px,
    rgba(245, 166, 35, 0.08) 8px
  );
  border-color: rgba(245, 166, 35, 0.5);
}

.slot-nonworking-subject {
  background: repeating-linear-gradient(
    -45deg,
    rgba(234, 179, 8, 0.15),
    rgba(234, 179, 8, 0.15) 4px,
    rgba(234, 179, 8, 0.08) 4px,
    rgba(234, 179, 8, 0.08) 8px
  );
  border-color: rgba(234, 179, 8, 0.5);
}

/* ============================================
   HOVER PREVIEW SYSTEM
   ============================================ */

/* Preview target slot - elevated "ghost preview" with pulse */
.slot-preview-target {
  border-color: var(--color-primary) !important;
  border-style: solid !important;
  border-width: 2px !important;
  background: linear-gradient(135deg, rgba(60, 141, 147, 0.12) 0%, rgba(60, 141, 147, 0.06) 100%) !important;
  box-shadow:
    0 0 0 3px rgba(60, 141, 147, 0.2),
    0 4px 12px rgba(60, 141, 147, 0.15);
  animation: slot-ready 0.3s ease-out forwards, slot-pulse 2s ease-in-out 0.3s infinite;
}

@keyframes slot-ready {
  0% { transform: scale(0.98); opacity: 0.7; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes slot-pulse {
  0%, 100% {
    box-shadow:
      0 0 0 3px rgba(60, 141, 147, 0.2),
      0 4px 12px rgba(60, 141, 147, 0.15);
  }
  50% {
    box-shadow:
      0 0 0 5px rgba(60, 141, 147, 0.15),
      0 6px 16px rgba(60, 141, 147, 0.2);
  }
}

/* Hide original slot content completely */
.slot-preview-target > *:not(.slot-preview-content) {
  visibility: hidden;
}

/* Preview content injected by JS - opaque background */
.slot-preview-content {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: rgba(60, 141, 147, 0.08);
  border-radius: inherit;
  animation: preview-fade-in 0.25s ease-out;
}

@keyframes preview-fade-in {
  0% { opacity: 0; transform: translateX(8px); }
  100% { opacity: 1; transform: translateX(0); }
}

.slot-preview-content .preview-icon {
  flex-shrink: 0;
  width: 1.25rem;
  height: 1.25rem;
  color: var(--color-primary);
  animation: preview-icon-bounce 0.4s ease-out;
}

@keyframes preview-icon-bounce {
  0% { transform: translateX(4px); }
  50% { transform: translateX(-2px); }
  100% { transform: translateX(0); }
}

.slot-preview-content .preview-text {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-primary-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.slot-preview-content .preview-date {
  font-size: 0.6875rem;
  color: var(--color-primary);
  opacity: 0.8;
  margin-left: auto;
  flex-shrink: 0;
}

/* Hovering lesson item - elevated lift effect */
.lesson-item-dragging {
  transform: scale(1.02) translateY(-1px);
  box-shadow: 0 8px 20px rgba(60, 141, 147, 0.2);
  border-color: var(--color-primary) !important;
  background: linear-gradient(135deg, rgba(60, 141, 147, 0.08) 0%, rgba(60, 141, 147, 0.04) 100%) !important;
}

/* No slots available - lesson item feedback */
.lesson-item-no-slots {
  opacity: 0.5;
  cursor: not-allowed !important;
  position: relative;
}

.lesson-item-no-slots::after {
  content: "Svi slotovi popunjeni";
  position: absolute;
  top: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-text-primary);
  color: white;
  font-size: 0.6875rem;
  font-weight: 500;
  padding: 0.25rem 0.5rem;
  border-radius: 0.375rem;
  white-space: nowrap;
  z-index: 50;
  animation: tooltip-appear-down 0.2s ease-out;
  pointer-events: none;
}

.lesson-item-no-slots::before {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 4px solid transparent;
  border-bottom-color: var(--color-text-primary);
  z-index: 50;
  animation: tooltip-appear-down 0.2s ease-out;
}

@keyframes tooltip-appear-down {
  0% { opacity: 0; transform: translateX(-50%) translateY(-4px); }
  100% { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* Last item (not first): show tooltip above */
.lesson-item-no-slots:last-child:not(:first-child)::after {
  top: auto;
  bottom: calc(100% + 4px);
  animation: tooltip-appear-up 0.2s ease-out;
}

.lesson-item-no-slots:last-child:not(:first-child)::before {
  top: auto;
  bottom: 100%;
  border-bottom-color: transparent;
  border-top-color: var(--color-text-primary);
  animation: tooltip-appear-up 0.2s ease-out;
}

@keyframes tooltip-appear-up {
  0% { opacity: 0; transform: translateX(-50%) translateY(4px); }
  100% { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* Collapsed section indicator - shows on collapsed month/semester header */
.collapsed-preview-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  margin-left: 0.5rem;
  padding: 0.25rem 0.625rem;
  background: var(--color-primary);
  color: white;
  font-size: 0.6875rem;
  font-weight: 600;
  border-radius: 9999px;
  animation: indicator-pop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.15s ease;
}

.collapsed-preview-indicator:hover {
  background: var(--color-primary-dark);
  transform: scale(1.05);
}

.collapsed-preview-indicator svg {
  width: 0.75rem;
  height: 0.75rem;
}

@keyframes indicator-pop {
  0% { opacity: 0; transform: scale(0.8); }
  100% { opacity: 1; transform: scale(1); }
}

/* Beacon indicator - fixed centered in visible left column */
.slot-beacon {
  position: fixed;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  color: white;
  font-size: 0.8125rem;
  font-weight: 600;
  border-radius: 9999px;
  box-shadow: 0 4px 16px rgba(60, 141, 147, 0.35);
  cursor: pointer;
  animation: beacon-pulse 1.5s ease-in-out infinite;
  transition: transform 0.15s ease, background 0.15s ease;
  transform: translateX(-50%);
}

.slot-beacon:hover {
  animation: none;
  transform: translateX(-50%) scale(1.05);
  background: linear-gradient(135deg, var(--color-primary-dark), var(--color-primary));
}

.slot-beacon svg {
  width: 1.125rem;
  height: 1.125rem;
}

@keyframes beacon-pulse {
  0%, 100% {
    box-shadow: 0 4px 16px rgba(60, 141, 147, 0.35);
  }
  50% {
    box-shadow: 0 4px 24px rgba(60, 141, 147, 0.5);
  }
}

/* Undo toast animation */
.undo-toast {
  animation: toast-slide-up 0.3s ease-out;
}

@keyframes toast-slide-up {
  from {
    opacity: 0;
    transform: translate(-50%, 20px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

.undo-toast-exit {
  animation: toast-fade-out 0.2s ease-in forwards;
}

@keyframes toast-fade-out {
  to {
    opacity: 0;
    transform: translate(-50%, 10px);
  }
}

/* ============================================
   LANDING PAGE ANIMATIONS
   ============================================ */

/* Scroll reveal animation */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered children reveal */
.reveal-stagger > * {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.reveal-stagger.visible > * {
  opacity: 1;
  transform: translateY(0);
}

.reveal-stagger.visible > *:nth-child(1) { transition-delay: 0.1s; }
.reveal-stagger.visible > *:nth-child(2) { transition-delay: 0.2s; }
.reveal-stagger.visible > *:nth-child(3) { transition-delay: 0.3s; }
.reveal-stagger.visible > *:nth-child(4) { transition-delay: 0.4s; }
.reveal-stagger.visible > *:nth-child(5) { transition-delay: 0.5s; }
.reveal-stagger.visible > *:nth-child(6) { transition-delay: 0.6s; }

/* Directional reveal variants */
.reveal-left {
  opacity: 0;
  transform: translateX(-30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal-right {
  opacity: 0;
  transform: translateX(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal-scale {
  opacity: 0;
  transform: scale(0.95);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.reveal-left.visible,
.reveal-right.visible,
.reveal-scale.visible {
  opacity: 1;
  transform: translateX(0) scale(1);
}

/* Custom delay support via inline style --delay */
[style*="--delay"].visible {
  transition-delay: var(--delay, 0s);
}

/* Primary button hover effects */
.btn-primary {
  transition: background-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(245, 166, 35, 0.4);
}

.btn-primary:active {
  transform: translateY(0);
}

/* Secondary button hover */
.btn-secondary {
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  .reveal,
  .reveal-left,
  .reveal-right,
  .reveal-scale,
  .reveal-stagger > * {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .btn-primary,
  .btn-secondary {
    transition: none;
  }

  .btn-primary:hover {
    transform: none;
  }
}

/* ============================================
   PREMIUM MESH GRADIENT BACKGROUND
   Stripe-inspired animated gradient effect
   ============================================ */

.mesh-gradient-bg {
  position: relative;
  overflow: hidden;
}

.mesh-gradient-bg::before,
.mesh-gradient-bg::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.4;
  animation: mesh-float 20s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}

.mesh-gradient-bg::before {
  width: 70%;
  height: 70%;
  background: var(--color-primary);
  top: -30%;
  left: -20%;
}

.mesh-gradient-bg::after {
  width: 60%;
  height: 60%;
  background: var(--color-accent);
  bottom: -25%;
  right: -15%;
  animation-delay: -10s;
}

/* Third gradient blob via .gradient-blob element */
.mesh-gradient-bg .gradient-blob {
  position: absolute;
  width: 50%;
  height: 50%;
  background: var(--color-primary-light);
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.3;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation: mesh-float 25s ease-in-out infinite reverse;
  pointer-events: none;
  z-index: 0;
}

@keyframes mesh-float {
  0%, 100% {
    transform: translate(0, 0) scale(1);
  }
  25% {
    transform: translate(5%, 8%) scale(1.05);
  }
  50% {
    transform: translate(-3%, 5%) scale(0.95);
  }
  75% {
    transform: translate(8%, -5%) scale(1.02);
  }
}

/* Ensure content sits above gradient */
.mesh-gradient-bg > *:not(.gradient-blob) {
  position: relative;
  z-index: 1;
}

@media (prefers-reduced-motion: reduce) {
  .mesh-gradient-bg::before,
  .mesh-gradient-bg::after,
  .mesh-gradient-bg .gradient-blob {
    animation: none;
  }
}

/* ============================================
   PREMIUM BENTO CARD HOVER CHOREOGRAPHY
   500ms staggered animation sequence
   ============================================ */

.bento-card {
  transition: transform 150ms ease-out,
              box-shadow 200ms ease-out,
              border-color 200ms ease-out;
}

.bento-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-large);
  border-color: rgba(60, 141, 147, 0.3);
}

.bento-card .card-headline {
  transition: color 200ms ease-out 100ms;
}

.bento-card:hover .card-headline {
  color: var(--color-primary);
}

/* Don't change headline color on dark cards - already has good contrast */
.bento-card.glass-card-dark:hover .card-headline {
  color: inherit;
}

.bento-card .card-action {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 200ms ease-out 200ms,
              transform 200ms ease-out 200ms;
}

.bento-card:hover .card-action {
  opacity: 1;
  transform: translateY(0);
}

/* Optional shimmer sweep effect */
.bento-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    110deg,
    transparent 20%,
    rgba(255, 255, 255, 0.1) 50%,
    transparent 80%
  );
  transform: translateX(-100%);
  transition: transform 600ms ease-out 100ms;
  pointer-events: none;
  border-radius: inherit;
}

.bento-card:hover::after {
  transform: translateX(100%);
}

@media (prefers-reduced-motion: reduce) {
  .bento-card,
  .bento-card .card-headline,
  .bento-card .card-action {
    transition: none;
  }

  .bento-card:hover {
    transform: none;
  }

  .bento-card .card-action {
    opacity: 1;
    transform: none;
  }

  .bento-card::after {
    display: none;
  }
}

/* ============================================
   HERO MICRO-DEMO ANIMATIONS
   CSS-only animated lesson cards
   ============================================ */

.hero-demo-card {
  opacity: 0;
  transform: translateX(-20px);
  animation: hero-card-slide-in 0.6s ease-out forwards;
}

.hero-demo-card:nth-child(1) { animation-delay: 0.2s; }
.hero-demo-card:nth-child(2) { animation-delay: 0.4s; }
.hero-demo-card:nth-child(3) { animation-delay: 0.6s; }

@keyframes hero-card-slide-in {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Checkmark pop animation */
.hero-checkmark {
  transform: scale(0);
  animation: checkmark-pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.hero-demo-card:nth-child(1) .hero-checkmark { animation-delay: 0.8s; }
.hero-demo-card:nth-child(2) .hero-checkmark { animation-delay: 1.0s; }

@keyframes checkmark-pop {
  to {
    transform: scale(1);
  }
}

/* PDF badge float animation */
.hero-pdf-badge {
  animation: pdf-float 3s ease-in-out infinite;
}

@keyframes pdf-float {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(0, -8px); }
}

@media (prefers-reduced-motion: reduce) {
  .hero-demo-card,
  .hero-checkmark {
    opacity: 1;
    transform: none;
    animation: none;
  }

  .hero-pdf-badge {
    animation: none;
  }
}

/* ============================================
   HERO ENTRANCE ORCHESTRATION
   Staggered page load animation
   ============================================ */

/* Initial hidden states for hero elements */
.hero-entrance-badge {
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.hero-entrance-headline {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.hero-entrance-subheadline {
  opacity: 0;
  transition: opacity 0.5s ease;
}

.hero-entrance-metrics {
  opacity: 0;
  transform: translateY(15px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.hero-entrance-cta {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.hero-entrance-trust {
  opacity: 0;
  transition: opacity 0.6s ease;
}

.hero-entrance-mockup {
  opacity: 0;
  transform: translateX(30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

/* Visible state - applied by JS */
.hero-entrance-visible {
  opacity: 1 !important;
  transform: translateY(0) translateX(0) !important;
}

@media (prefers-reduced-motion: reduce) {
  .hero-entrance-badge,
  .hero-entrance-headline,
  .hero-entrance-subheadline,
  .hero-entrance-metrics,
  .hero-entrance-cta,
  .hero-entrance-trust,
  .hero-entrance-mockup {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ============================================
   SIGNUP PREVIEW ANIMATIONS
   Staggered entrance + floating badge
   ============================================ */

.signup-preview-element {
  opacity: 0;
  transform: translateY(15px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.signup-preview-visible {
  opacity: 1 !important;
  transform: translateY(0) !important;
}

.signup-preview-float {
  animation: signup-float 3s ease-in-out infinite;
  animation-play-state: paused;
}

.signup-preview-float.signup-preview-visible {
  animation-play-state: running;
}

@keyframes signup-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

@media (prefers-reduced-motion: reduce) {
  .signup-preview-element {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .signup-preview-float {
    animation: none;
  }
}

/* ============================================
   FOOTER PREMIUM HOVER EFFECTS
   ============================================ */

/* Footer links with underline slide-in */
.footer-link {
  transition: color 200ms ease-out;
}

.footer-link:hover {
  color: white;
}

/* Footer social icons with glassmorphism hover */
.footer-social-link {
  transition: all 200ms ease-out;
}

.footer-social-link:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.25);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

@media (prefers-reduced-motion: reduce) {
  .footer-link span span,
  .footer-social-link {
    transition: none;
  }

  .footer-social-link:hover {
    transform: none;
  }
}

/* ============================================
   MOBILE OPTIMIZATIONS
   ============================================ */

/* CRITICAL: No overflow on html/body - it breaks fixed/sticky positioning by creating new containing blocks */
html {
  width: 100%;
  height: 100%;
}

body {
  width: 100%;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  position: relative;
}

/* NOTE: overflow-x: hidden on main breaks sticky positioning
   If horizontal scroll becomes an issue, apply overflow-x: clip instead
   (clip doesn't create a new scroll container) */
main {
  overflow-x: clip;
}

/* iOS smooth scrolling */
body, .overflow-y-auto {
  -webkit-overflow-scrolling: touch;
}

/* Safe area insets moved to specific components:
   - Header handles top inset
   - Bottom tabs handle bottom inset
   - Mobile menu handles its own insets
*/

/* Prevent iOS zoom on input focus (16px minimum) */
@media (max-width: 767px) {
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="number"],
  textarea,
  select {
    font-size: 16px;
  }
}

/* Hide native number-input spinners for clean, centered count fields
   (e.g. weekly schedule day inputs). Arrow keys still increment on focus. */
input[type="number"].no-spinner::-webkit-inner-spin-button,
input[type="number"].no-spinner::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input[type="number"].no-spinner {
  -moz-appearance: textfield;
  appearance: textfield;
}

/* Touch-friendly minimum sizes (44x44px per Apple HIG) */
.touch-target {
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Body scroll lock when menu/modal open */
body.menu-open {
  overflow: hidden;
  position: fixed;
  width: 100%;
  height: 100%;
}

/* Mobile menu overlay */
.mobile-menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 40;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.mobile-menu-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* ============================================
   CUSTOM SELECT DROPDOWN
   ============================================ */

/* Custom select dropdown scrollbar */
[data-custom-select-target="menu"] {
  scrollbar-width: thin;
  scrollbar-color: var(--color-border, #e2e8f0) transparent;
}

[data-custom-select-target="menu"]::-webkit-scrollbar {
  width: 6px;
}

[data-custom-select-target="menu"]::-webkit-scrollbar-thumb {
  background-color: var(--color-border, #e2e8f0);
  border-radius: 3px;
}

[data-custom-select-target="menu"]::-webkit-scrollbar-track {
  background: transparent;
}

/* Mobile menu slide from right */
.mobile-menu {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 80%;
  max-width: 320px;
  background: white;
  z-index: 60;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  box-shadow: -2px 0 8px rgba(0, 0, 0, 0.1);
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
}

.mobile-menu.active {
  transform: translateX(0);
}

/* Hamburger icon */
.hamburger {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  width: 24px;
  height: 24px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  min-width: 44px;
  min-height: 44px;
}

.hamburger-line {
  width: 24px;
  height: 2px;
  background: currentColor;
  transition: all 0.3s ease;
}

.hamburger.active .hamburger-line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.hamburger.active .hamburger-line:nth-child(2) {
  opacity: 0;
}

.hamburger.active .hamburger-line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Remove tap highlight on mobile */
@media (hover: none) {
  * {
    -webkit-tap-highlight-color: transparent;
  }
}

/* ============================================
   TOUCH ACTIVE STATES
   ============================================ */

/* Touch feedback for interactive elements */
@media (hover: none) {
  /* Cards and clickable containers */
  a[class*="bg-white"]:active,
  button:not(:disabled):active,
  [role="button"]:active {
    transform: scale(0.98);
    opacity: 0.9;
    transition: transform 0.1s ease, opacity 0.1s ease;
  }

  /* Bottom tabs already have active state */
  .bottom-tab:active {
    transform: scale(0.95);
  }

  /* FAB (Floating Action Button) */
  a[class*="rounded-full"]:active {
    transform: scale(0.95);
  }

  /* Prevent double-transform on elements with existing active states */
  .hamburger:active,
  .btn-primary:active {
    /* Keep existing active states */
  }
}

/* ============================================
   HORIZONTAL SCROLL FADE INDICATORS
   ============================================ */

/* Wrapper for scroll container with fade indicators */
.scroll-fade-wrapper {
  position: relative;
}

/* Left fade gradient */
.scroll-fade-left {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2rem;
  background: linear-gradient(to right, white, transparent);
  pointer-events: none;
  z-index: 10;
  transition: opacity 0.2s ease;
}

/* Right fade gradient */
.scroll-fade-right {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 2rem;
  background: linear-gradient(to left, white, transparent);
  pointer-events: none;
  z-index: 10;
  transition: opacity 0.2s ease;
}


/* ============================================
   BOTTOM TAB NAVIGATION
   ============================================ */

/* Bottom nav container - MUST use fixed positioning */
nav[class*="bottom-0"] {
  position: fixed !important;
  bottom: 0 !important;
  left: 0 !important;
  right: 0 !important;
  z-index: 100 !important;
}

.bottom-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.125rem;
  padding: 0.5rem;
  min-width: 60px;
  min-height: 48px;
  color: var(--color-text-muted, #9ca3af);
  transition: color 0.2s ease, transform 0.1s ease;
  text-decoration: none;
  border: none;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.bottom-tab.active {
  color: var(--color-primary, #3C8D93);
}

.bottom-tab.active svg {
  transform: scale(1.1);
}

.bottom-tab:active {
  transform: scale(0.95);
}

/* ============================================
   FLATPICKR TAILWIND STYLING
   ============================================ */

/* Calendar container */
.flatpickr-calendar {
  background: white;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  border-radius: 0.75rem;
  border: 1px solid var(--color-border, #e5e7eb);
  margin-top: 0.5rem;
}

.flatpickr-calendar.arrowTop:before,
.flatpickr-calendar.arrowTop:after {
  display: none;
}

/* Month navigation */
.flatpickr-months {
  background: white;
  border-radius: 0.75rem 0.75rem 0 0;
  padding: 0.75rem 0.5rem;
}

.flatpickr-month {
  color: var(--color-text-primary, #1f2937);
}

.flatpickr-current-month {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text-primary, #1f2937);
}

.flatpickr-monthDropdown-months {
  appearance: none;
  background: white;
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: 0.5rem;
  padding: 0.25rem 0.5rem;
  font-weight: 600;
  color: var(--color-text-primary, #1f2937);
}

.flatpickr-monthDropdown-months:hover {
  background: var(--color-bg-secondary, #f9fafb);
}

.numInputWrapper:hover {
  background: var(--color-bg-secondary, #f9fafb);
}

/* Navigation arrows */
.flatpickr-prev-month,
.flatpickr-next-month {
  padding: 0.5rem;
  color: var(--color-text-secondary, #6b7280);
  transition: all 0.15s ease;
  border-radius: 0.5rem;
}

.flatpickr-prev-month:hover,
.flatpickr-next-month:hover {
  color: var(--color-primary, #f5a623);
  background: var(--color-bg-secondary, #f9fafb);
}

/* Days container */
.flatpickr-days {
  background: white;
  border-radius: 0 0 0.75rem 0.75rem;
}

.flatpickr-day {
  color: var(--color-text-primary, #1f2937);
  border: none;
  border-radius: 0.5rem;
  transition: all 0.15s ease;
}

.flatpickr-day:hover {
  background: var(--color-bg-secondary, #f9fafb);
  border: none;
}

.flatpickr-day.today {
  border-color: var(--color-primary, #f5a623);
  background: var(--color-primary-light, #fef3e2);
  color: var(--color-primary, #f5a623);
  font-weight: 600;
}

.flatpickr-day.selected,
.flatpickr-day.selected:hover {
  background: var(--color-accent, #f5a623);
  border-color: var(--color-accent, #f5a623);
  color: white;
  font-weight: 600;
}

.flatpickr-day.prevMonthDay,
.flatpickr-day.nextMonthDay {
  color: var(--color-text-muted, #9ca3af);
}

.flatpickr-day.disabled {
  color: var(--color-text-muted, #9ca3af);
  cursor: not-allowed;
  opacity: 0.4;
}

/* Weekdays */
.flatpickr-weekdays {
  background: white;
}

.flatpickr-weekday {
  color: var(--color-text-secondary, #6b7280);
  font-weight: 600;
  font-size: 0.875rem;
}

/* Input styling when flatpickr is active */
.flatpickr-input.active {
  border-color: var(--color-border-focus, #f5a623);
  box-shadow: 0 0 0 3px rgba(245, 166, 35, 0.1);
}

/* Mobile responsiveness */
@media (max-width: 767px) {
  .flatpickr-calendar {
    font-size: 16px;
  }

  .flatpickr-day {
    min-width: 44px;
    min-height: 44px;
  }
}

/* ============================================
   TRIX EDITOR - PREMIUM STYLING
   ============================================ */

/* Toolbar container */
trix-toolbar {
  border: none !important;
  background: transparent !important;
  padding: 0 0 8px 0 !important;
}

/* Button row layout */
trix-toolbar .trix-button-row {
  gap: 8px;
  justify-content: flex-start !important;
  flex-wrap: nowrap !important;
  overflow: visible !important;
}

/* Button groups - pill design */
trix-toolbar .trix-button-group {
  border: none !important;
  background: #f1f5f9 !important;
  border-radius: 8px !important;
  padding: 4px !important;
  gap: 2px;
  display: inline-flex !important;
  margin: 0 !important;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05) !important;
}

trix-toolbar .trix-button-group:not(:first-child) {
  margin-left: 0 !important;
}

/* Individual buttons */
trix-toolbar .trix-button {
  background: transparent !important;
  border: none !important;
  border-radius: 6px !important;
  width: 32px !important;
  height: 32px !important;
  padding: 0 !important;
  margin: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  color: #64748b !important;
  transition: all 0.15s ease !important;
  position: relative !important;
  float: none !important;
}

trix-toolbar .trix-button:hover {
  background: #e2e8f0 !important;
  color: #334155 !important;
}

trix-toolbar .trix-button.trix-active {
  background: #3c8d93 !important;
  color: white !important;
  box-shadow: 0 1px 3px rgba(60, 141, 147, 0.3) !important;
}

trix-toolbar .trix-button:disabled {
  opacity: 0.4 !important;
  cursor: not-allowed !important;
}

/* Button icons - centered */
trix-toolbar .trix-button::before {
  background-size: 16px 16px !important;
  width: 16px !important;
  height: 16px !important;
  opacity: 0.8;
  position: absolute !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
}

trix-toolbar .trix-button:hover::before,
trix-toolbar .trix-button.trix-active::before {
  opacity: 1;
}

/* Editor area */
trix-editor {
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 12px !important;
  padding: 12px 16px !important;
  min-height: 100px !important;
  font-size: 0.9375rem !important;
  line-height: 1.6 !important;
  color: #1e293b !important;
  transition: all 0.2s ease !important;
  outline: none !important;
}

trix-editor:focus {
  background: white !important;
  border-color: #3c8d93 !important;
  box-shadow: 0 0 0 3px rgba(60, 141, 147, 0.15) !important;
}

trix-editor:empty:not(:focus)::before {
  color: #94a3b8 !important;
}

/* Content styling - lists with visible markers */
trix-editor ul {
  list-style-type: disc !important;
  margin: 0.5em 0 !important;
  padding-left: 1.75em !important;
}

trix-editor ol {
  list-style-type: decimal !important;
  margin: 0.5em 0 !important;
  padding-left: 1.75em !important;
}

trix-editor li {
  margin: 0.25em 0 !important;
  display: list-item !important;
}

trix-editor strong {
  font-weight: 600 !important;
  color: #0f172a !important;
}

/* ============================================
   HIDE UNWANTED TRIX BUTTONS
   ============================================ */

/* Hide: strikethrough, link, heading, quote, code, attach, indent/outdent, undo/redo */
trix-toolbar [data-trix-attribute="strike"],
trix-toolbar [data-trix-attribute="href"],
trix-toolbar [data-trix-attribute="heading1"],
trix-toolbar [data-trix-attribute="quote"],
trix-toolbar [data-trix-attribute="code"],
trix-toolbar [data-trix-action="attachFiles"],
trix-toolbar [data-trix-action="increaseNestingLevel"],
trix-toolbar [data-trix-action="decreaseNestingLevel"],
trix-toolbar [data-trix-action="undo"],
trix-toolbar [data-trix-action="redo"] {
  display: none !important;
}

/* Hide spacer and dialogs */
trix-toolbar .trix-button-group-spacer,
trix-toolbar .trix-dialogs {
  display: none !important;
}

/* Hide button groups that have no visible children */
trix-toolbar .trix-button-group:not(:has(.trix-button[data-trix-attribute="bold"])):not(:has(.trix-button[data-trix-attribute="bullet"])) {
  display: none !important;
}

/* ============================================
   CELEBRATION MODAL - CONFETTI & ANIMATIONS
   ============================================ */

/* Confetti particle styles */
.confetti-container {
  pointer-events: none;
}

.confetti-particle {
  position: absolute;
  top: -10px;
  left: var(--x, 50%);
  width: 10px;
  height: 10px;
  border-radius: 2px;
  opacity: 0;
  animation: confetti-fall var(--duration, 2s) ease-out var(--delay, 0s) forwards;
  transform: rotate(var(--rotation, 0deg));
}

@keyframes confetti-fall {
  0% {
    opacity: 1;
    transform: translateY(0) rotate(0deg) scale(1);
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateY(400px) rotate(720deg) scale(0.5);
  }
}

/* Checkmark pop animation */
.checkmark-pop {
  animation: checkmark-pop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes checkmark-pop {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  .confetti-particle {
    animation: none;
    opacity: 0;
  }

  .checkmark-pop {
    animation: none;
    transform: scale(1);
    opacity: 1;
  }

  /* Slot preview - static highlight instead of animations */
  .slot-preview-target {
    animation: none;
    transform: none;
  }

  .slot-preview-content {
    animation: none;
  }

  .slot-preview-content .preview-icon {
    animation: none;
  }

  .lesson-item-dragging {
    transform: none;
  }

  .lesson-item-no-slots::after,
  .lesson-item-no-slots::before {
    animation: none;
  }

  .collapsed-preview-indicator {
    animation: none;
  }

  .slot-beacon {
    animation: none;
  }
}

/* ============================================
   WIZARD STEP TRANSITIONS
   ============================================ */

/* Step enter animation - slide in from right */
.wizard-step-enter {
  animation: wizard-step-enter 0.3s ease-out forwards;
}

@keyframes wizard-step-enter {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Step exit animation - fade out to left */
.wizard-step-exit {
  animation: wizard-step-exit 0.2s ease-in forwards;
}

@keyframes wizard-step-exit {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(-20px);
  }
}

/* Progress bar pulse when step advances */
.progress-pulse {
  animation: progress-pulse 0.6s ease-out;
}

@keyframes progress-pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(60, 141, 147, 0);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(60, 141, 147, 0.3);
  }
}

/* Lesson slot success animation */
.slot-success {
  animation: slot-success 0.4s ease-out;
}

@keyframes slot-success {
  0% {
    background-color: rgba(60, 141, 147, 0.3);
    transform: scale(1.02);
  }
  100% {
    background-color: transparent;
    transform: scale(1);
  }
}

/* Auto-assign success burst */
.auto-assign-success {
  animation: auto-assign-burst 0.5s ease-out;
}

@keyframes auto-assign-burst {
  0% {
    box-shadow: 0 0 0 0 rgba(60, 141, 147, 0.4);
  }
  50% {
    box-shadow: 0 0 0 15px rgba(60, 141, 147, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(60, 141, 147, 0);
  }
}

/* Respect reduced motion preference for wizard */
@media (prefers-reduced-motion: reduce) {
  .wizard-step-enter,
  .wizard-step-exit,
  .progress-pulse,
  .slot-success,
  .auto-assign-success {
    animation: none;
  }
}

/* Non-working days calendar: day modal frame */
turbo-frame#nwd-day-frame {
  display: block;
}

turbo-frame#nwd-day-frame[busy] {
  opacity: 0.4;
  pointer-events: none;
  transition: opacity 150ms ease;
}
