/* =========================
   Base Reset
========================= */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* =========================
   Background
========================= */
body {
  min-height: 100vh;
  background:
    radial-gradient(
      circle at top,
      rgba(56, 189, 248, 0.15),
      transparent 60%
    ),
    linear-gradient(135deg, #020617, #0f172a);

  font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  color: #e5e7eb;

  overflow-x: hidden;
}

/* Ambient motion */
body::before {
  content: "";
  position: fixed;
  inset: -20%;
  background: radial-gradient(
    circle at center,
    rgba(56, 189, 248, 0.08),
    transparent 65%
  );
  animation: float 18s ease-in-out infinite;
  z-index: -1;
  pointer-events: none;
}

@keyframes float {
  0%   { transform: translate(0, 0); }
  50%  { transform: translate(-4%, -2%); }
  100% { transform: translate(0, 0); }
}

/* =========================
   Container
========================= */
.container {
  position: relative;
  min-height: 100vh;

  display: flex;
  justify-content: center;
  align-items: center;

  padding: 20px;
}

/* =========================
   Glass Card
========================= */
.card {
  position: relative;
  width: 100%;
  max-width: 480px;
  min-height: 290px;
  padding: 32px;

  border-radius: 28px;
  background: rgba(15, 23, 42, 0.6);

  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);

  box-shadow:
    0 20px 60px rgba(0,0,0,0.45),
    inset 0 1px 0 rgba(255,255,255,0.06);

  overflow: hidden;
  will-change: transform;
}

.card.active {
  transform: translateY(-2px) scale(1.01);
  box-shadow:
    0 30px 60px rgba(0,0,0,0.6),
    inset 0 1px 0 rgba(255,255,255,0.1);
}

/* =========================
   Typography
========================= */
#splashView h1 {
  font-size: 2.6rem;
  font-weight: 700;
  margin-bottom: 8px;
}

#splashView p {
  font-size: 1rem;
  opacity: 0.75;
}


#modeText {
  font-size: 0.75rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #38bdf8;
  margin-bottom: 0.4rem;
}

#timer {
  font-size: 3.4rem;
  font-weight: 600;
  margin: 0.8rem 0 0.6rem;
}

#sessionsText {
  font-size: 0.85rem;
  color: #9ca3af;
  margin-bottom: 1.4rem;
}

/* =========================
   Buttons (Unified)
========================= */
button {
  position: relative;
  width: 100%;
  padding: 14px 0;

  border-radius: 14px;
  border: none;
  cursor: pointer;

  background: linear-gradient(
    180deg,
    rgba(56, 189, 248, 0.95),
    rgba(14, 165, 233, 0.95)
  );

  color: #020617;
  font-size: 1rem;
  font-weight: 600;

  box-shadow:
    0 8px 20px rgba(56,189,248,0.35),
    inset 0 1px 0 rgba(255,255,255,0.4);

  overflow: hidden;

  transition:
    transform 0.32s cubic-bezier(0.22,1,0.36,1),
    box-shadow 0.32s cubic-bezier(0.22,1,0.36,1),
    filter 0.32s ease;

  will-change: transform;
}

button:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

button:active {
  transform: scale(0.96);
  box-shadow:
    0 4px 10px rgba(56,189,248,0.25),
    inset 0 3px 8px rgba(0,0,0,0.2);
}

button:focus-visible {
  outline: 2px solid rgba(56,189,248,0.6);
  outline-offset: 3px;
}

/* Ripple */
button::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle at var(--x) var(--y),
    rgba(255,255,255,0.35),
    transparent 60%
  );
  opacity: 0;
  transition: opacity 0.6s ease;
}

button.ripple::after {
  opacity: 1;
}

/* Secondary reset button */
#resetBtn {
  margin-top: 10px;
  background: rgba(30,41,59,0.6);
  color: #e5e7eb;

  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);

  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.08),
    0 6px 14px rgba(0,0,0,0.4);
}

/* =========================
   Views (Single Source of Truth)
========================= */
.view {
  position: absolute;
  inset: 0;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  text-align: center;

  opacity: 0;
  transform: translateY(14px) scale(0.98);
  pointer-events: none;

  transition:
    opacity 0.35s cubic-bezier(0.22,1,0.36,1),
    transform 0.35s cubic-bezier(0.22,1,0.36,1);

  will-change: transform, opacity;
}

.view.active {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* =========================
   Notes
========================= */
.notes {
  margin-top: 24px;
  text-align: left;
}

.notes h3 {
  font-size: 0.9rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #9ca3af;
  margin-bottom: 8px;
}

textarea {
  width: 100%;
  min-height: 160px;
  resize: vertical;

  background: rgba(2,6,23,0.6);
  color: #e5e7eb;

  border: 1px solid rgba(148,163,184,0.15);
  border-radius: 14px;
  padding: 14px;

  font-size: 0.95rem;
  line-height: 1.6;
  font-family: inherit;

  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);

  transition:
    border-color 0.3s ease,
    background 0.3s ease;
}

textarea:focus {
  outline: none;
  border-color: rgba(56,189,248,0.6);
  background: rgba(2,6,23,0.75);
}

textarea::placeholder {
  color: #64748b;
}

/* Split */
.notes-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.preview {
  min-height: 160px;
  padding: 14px;
  border-radius: 14px;

  background: rgba(2,6,23,0.55);
  border: 1px solid rgba(148,163,184,0.12);

  font-size: 0.95rem;
  line-height: 1.6;

  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);

  opacity: 0;
  transition: opacity 0.35s ease;
}

.preview.visible {
  opacity: 1;
}

.preview:empty::before {
  content: "Preview";
  color: #475569;
  font-style: italic;
}

/* Mobile */
@media (max-width: 600px) {
  .notes-split {
    grid-template-columns: 1fr;
  }
}

/* =========================
   Flashcards
========================= */
.flashcards {
  max-width: 420px;
  margin: 28px auto 0;
}

.flashcard-view {
  perspective: 1000px;
}

.flashcard {
  position: relative;
  height: 120px;

  border-radius: 16px;
  background: rgba(15,23,42,0.7);

  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);

  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
  cursor: pointer;

  transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.22,1,0.36,1);

  will-change: transform;
}

.flashcard.flipped {
  transform: rotateY(180deg);
}

.flashcard .front,
.flashcard .back {
  position: absolute;
  inset: 0;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 16px;
  backface-visibility: hidden;
}

.flashcard .back {
  transform: rotateY(180deg);
  color: #38bdf8;
}

.flashcard-controls {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

/* =========================
   Helpers
========================= */
.hidden {
  display: none;
}

/* =========================
   Accessibility
========================= */
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
/* Hide back button by default */
.back-btn {
  opacity: 0;
  pointer-events: none;
}

/* Show only inside space views */
.space-view .back-btn {
  opacity: 1;
  pointer-events: auto;
}
/* =========================
   Spaces – Floating Tiles
========================= */

.space-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 24px;
  width: 100%;
  max-width: 320px;
}

.space-tile {
  display: flex;
  align-items: center;
  gap: 14px;

  padding: 18px 20px;
  border-radius: 18px;
  border: none;
  cursor: pointer;

  background: rgba(255, 255, 255, 0.06);
  color: #e5e7eb;

  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);

  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.08),
    0 10px 30px rgba(0,0,0,0.35);

  font-size: 1.05rem;
  font-weight: 500;

  transition:
    transform 0.28s cubic-bezier(0.22,1,0.36,1),
    background 0.28s ease,
    box-shadow 0.28s ease;
}

.space-tile:hover {
  transform: translateY(-3px);
  background: rgba(255, 255, 255, 0.1);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.12),
    0 18px 40px rgba(0,0,0,0.45);
}

.space-tile:active {
  transform: scale(0.96);
}

.space-tile .icon {
  font-size: 1.4rem;
}

.space-tile .label {
  flex: 1;
  text-align: left;
}
/* =========================
   Splash – iOS Style Enter Button
========================= */

.enter-btn {
  margin-top: 28px;

  padding: 14px 28px;
  width: auto;
  min-width: 180px;

  border-radius: 999px;
  border: none;
  cursor: pointer;

  background: linear-gradient(
    180deg,
    rgba(255,255,255,0.22),
    rgba(255,255,255,0.12)
  );

  color: #eaf2ff;
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.2px;

  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);

  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.25),
    0 10px 30px rgba(0,0,0,0.35);

  transition:
    transform 0.25s cubic-bezier(0.22,1,0.36,1),
    background 0.25s ease,
    box-shadow 0.25s ease;
}

.enter-btn:hover {
  background: linear-gradient(
    180deg,
    rgba(255,255,255,0.28),
    rgba(255,255,255,0.16)
  );

  transform: translateY(-1px);

  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.3),
    0 12px 36px rgba(56,189,248,0.38), /* 👈 glow wakes up */
    0 18px 40px rgba(0,0,0,0.45);
}
.enter-btn {
  /* existing styles stay */

  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.25),
    0 8px 24px rgba(56,189,248,0.25), /* 👈 soft blue life */
    0 12px 32px rgba(0,0,0,0.35);
}
.enter-btn:active {
  transform: scale(0.96);

  box-shadow:
    inset 0 2px 6px rgba(0,0,0,0.25),
    0 6px 18px rgba(56,189,248,0.35),
    0 10px 24px rgba(0,0,0,0.3);
}
@keyframes glowPulse {
  0%, 100% {
    box-shadow:
      inset 0 1px 0 rgba(255,255,255,0.25),
      0 8px 22px rgba(56,189,248,0.22),
      0 12px 32px rgba(0,0,0,0.35);
  }
  50% {
    box-shadow:
      inset 0 1px 0 rgba(255,255,255,0.25),
      0 10px 28px rgba(56,189,248,0.32),
      0 16px 36px rgba(0,0,0,0.4);
  }
}

.enter-btn {
  animation: glowPulse 6s ease-in-out infinite;
}
/* =========================
   Card Size Modes
========================= */

.card {
  transition:
    padding 0.45s cubic-bezier(0.22,1,0.36,1),
    min-height 0.45s cubic-bezier(0.22,1,0.36,1),
    box-shadow 0.45s ease;
}

/* Compact – Splash */
.card.compact {
  min-height: 300px;
  padding: 32px;
}

/* Spacious – Home / Spaces */
.card.spacious {
  min-height: 460px;
  padding: 40px 36px 44px;
}
.space-tile {
  /* keep existing styles */

  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.08),
    0 10px 28px rgba(0,0,0,0.35),
    0 0 0 rgba(56,189,248,0);

  transition:
    transform 0.28s cubic-bezier(0.22,1,0.36,1),
    background 0.28s ease,
    box-shadow 0.28s ease;
}
.space-tile:hover {
  transform: translateY(-3px);

  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.12),
    0 16px 36px rgba(0,0,0,0.45),
    0 0 24px rgba(56,189,248,0.28); /* 👈 soft blue life */
}
.space-tile:active {
  transform: scale(0.96);

  box-shadow:
    inset 0 2px 6px rgba(0,0,0,0.25),
    0 8px 18px rgba(56,189,248,0.32);
}
/* =========================
   Intent Sheet
========================= */

.intent-sheet {
  width: 100%;
  max-width: 360px;

  padding: 28px 26px 30px;
  border-radius: 22px;

  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);

  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.08),
    0 20px 50px rgba(0,0,0,0.45);

  text-align: center;

  transition:
    opacity 0.35s ease,
    transform 0.35s cubic-bezier(0.22,1,0.36,1);
}

.intent-sheet h3 {
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: 16px;
  opacity: 0.85;
}

.intent-sheet input {
  width: 100%;
  padding: 14px 16px;
  margin-bottom: 18px;

  border-radius: 14px;
  border: 1px solid rgba(148,163,184,0.2);

  background: rgba(2,6,23,0.7);
  color: #e5e7eb;
  font-size: 0.95rem;

  outline: none;
}

.intent-sheet input::placeholder {
  color: #64748b;
}
/* =========================
   Focus Active State
========================= */

/* Hide start button during focus */
.card.focus-active #startBtn {
  display: none;
}

/* Hide back button during focus */
.card.focus-active .back-btn {
  opacity: 0;
  pointer-events: none;
}

/* Center focus room properly */
.card.focus-active #focusRoom {
  margin-top: 0;
}

