/* NT Memorize - Modern UI Design System */

/* ===========================
   CSS Variables & Theme
   =========================== */
:root {
  /* Responsive font sizes */
  --verse-font-size-mobile: 24px;
  --verse-font-size-tablet: 28px;
  --verse-font-size-desktop: 32px;
  --verse-font-size-large: 36px;
  
  /* Dark theme colors (now default) */
  --color-primary: 99 102 241; /* Indigo-500 */
  --color-primary-dark: 79 70 229; /* Indigo-600 */
  --color-secondary: 168 85 247; /* Purple-500 */
  --color-accent: 196 181 253; /* Purple-300 */
  
  --color-bg-base: 3 7 18; /* Gray-950 */
  --color-bg-card: 17 24 39; /* Gray-900 */
  --color-bg-overlay: 17 24 39;
  
  --color-text-primary: 243 244 246; /* Gray-100 */
  --color-text-secondary: 156 163 175; /* Gray-400 */
  --color-text-muted: 75 85 99; /* Gray-600 */
  
  --color-border: 31 41 55; /* Gray-800 */
  --color-border-light: 55 65 81; /* Gray-700 */
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  --shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);
  --shadow-glow: 0 0 30px rgb(99 102 241 / 0.2);
  --shadow-inner: inset 0 2px 4px 0 rgb(0 0 0 / 0.05);
}

/* ===========================
   Container System
   =========================== */
.container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1rem;
}

.container-lg {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.container-fluid {
  width: 100%;
  padding: 0 1rem;
}

/* Responsive container padding */
@media (min-width: 640px) {
  .container,
  .container-lg {
    padding: 0 1.5rem;
  }
}

@media (min-width: 1024px) {
  .container {
    padding: 0 2rem;
  }
  
  .container-lg {
    padding: 0 3rem;
  }
}

/* ===========================
   Base Styles
   =========================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background: rgb(var(--color-bg-base));
  color: rgb(var(--color-text-primary));
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Smooth transitions for theme changes */
* {
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

/* ===========================
   Viewport & Safe Areas
   =========================== */
.h-dvh {
  height: 100dvh;
  height: 100svh;
  height: 100vh;
}

@supports (height: 100dvh) {
  .h-dvh { height: 100dvh; }
}

.safe-pt { padding-top: env(safe-area-inset-top); }
.safe-pb { padding-bottom: env(safe-area-inset-bottom); }
.safe-pl { padding-left: env(safe-area-inset-left); }
.safe-pr { padding-right: env(safe-area-inset-right); }

/* ===========================
   Glassmorphism Effects
   =========================== */
.glass {
  background: rgba(var(--color-bg-overlay), 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(var(--color-border), 0.2);
}

.glass-subtle {
  background: rgba(var(--color-bg-overlay), 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* ===========================
   Gradient Effects
   =========================== */
.gradient-primary {
  background: linear-gradient(135deg, 
    rgb(var(--color-primary)) 0%, 
    rgb(var(--color-secondary)) 100%);
}

.gradient-text {
  background: linear-gradient(135deg, 
    rgb(var(--color-primary)) 0%, 
    rgb(var(--color-secondary)) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: inline-block;
}

.gradient-border {
  position: relative;
  background: rgb(var(--color-bg-card));
  border-radius: 12px;
}

.gradient-border::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 12px;
  padding: 1px;
  background: linear-gradient(135deg, 
    rgb(var(--color-primary)), 
    rgb(var(--color-secondary)));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}

/* ===========================
   Card Styles
   =========================== */
.card-modern {
  background: rgb(var(--color-bg-card));
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(var(--color-border), 0.5);
}

.card-modern::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, 
    rgb(var(--color-primary)), 
    rgb(var(--color-secondary)));
  opacity: 0;
  transition: opacity 0.3s;
}

.card-modern:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: var(--shadow-xl), var(--shadow-glow);
  border-color: rgba(var(--color-primary), 0.3);
}

.card-modern:hover::before {
  opacity: 1;
}

.card-modern:active {
  transform: translateY(-2px) scale(1.01);
  transition: transform 0.1s;
}

/* Book cards with icon */
.book-card {
  @apply card-modern;
  cursor: pointer;
  padding: 1.5rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.book-card .book-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: linear-gradient(135deg, 
    rgba(var(--color-primary), 0.1), 
    rgba(var(--color-secondary), 0.1));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  transition: all 0.3s;
}

.book-card:hover .book-icon {
  transform: rotate(-5deg) scale(1.1);
  background: linear-gradient(135deg, 
    rgba(var(--color-primary), 0.2), 
    rgba(var(--color-secondary), 0.2));
}

/* ===========================
   Button Styles
   =========================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1.25rem;
  border-radius: 8px;
  font-weight: 500;
  transition: all 0.2s;
  cursor: pointer;
  border: none;
  outline: none;
  position: relative;
  overflow: hidden;
}

.btn:focus-visible {
  outline: 2px solid rgb(var(--color-primary));
  outline-offset: 2px;
}

.btn-primary {
  background: linear-gradient(135deg, 
    rgb(var(--color-primary)), 
    rgb(var(--color-secondary)));
  color: white;
  box-shadow: var(--shadow-md);
}

.btn-primary:hover {
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  transform: translateY(-2px);
}

.btn-primary:active {
  transform: translateY(0);
}

/* Ripple effect */
.btn::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn:active::after {
  width: 300px;
  height: 300px;
}

.btn-ghost {
  background: transparent;
  color: rgb(var(--color-text-secondary));
  padding: 0.5rem 1rem;
}

.btn-ghost:hover {
  background: rgba(var(--color-primary), 0.1);
  color: rgb(var(--color-primary));
}

.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 10px;
  background: rgba(var(--color-bg-card), 0.8);
  border: 1px solid rgba(var(--color-border), 0.3);
}

.btn-icon:hover {
  background: rgba(var(--color-primary), 0.1);
  border-color: rgba(var(--color-primary), 0.3);
}

/* ===========================
   Verse Styles
   =========================== */
.verses {
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  scroll-behavior: smooth;
}

.verse {
  margin: 0.75rem 0;
  padding: 1.25rem;
  border-radius: 16px;
  background: rgb(var(--color-bg-card));
  border: 1px solid rgba(var(--color-border), 0.3);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.verse::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, 
    transparent, 
    rgba(var(--color-primary), 0.1), 
    transparent);
  transition: left 0.5s;
}

.verse:hover::before {
  left: 100%;
}

.verse:hover {
  transform: translateX(4px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(var(--color-primary), 0.3);
}

.verse.current {
  background: linear-gradient(135deg, 
    rgba(var(--color-primary), 0.05), 
    rgba(var(--color-secondary), 0.05));
  border-left: 4px solid rgb(var(--color-primary));
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.verse-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, 
    rgba(var(--color-primary), 0.1), 
    rgba(var(--color-secondary), 0.1));
  color: rgb(var(--color-primary));
  font-weight: 600;
  font-size: 18px;
  flex-shrink: 0;
  transition: all 0.3s;
}

.verse.current .verse-number {
  background: linear-gradient(135deg, 
    rgb(var(--color-primary)), 
    rgb(var(--color-secondary)));
  color: white;
  transform: scale(1.1);
}

.verse-text {
  line-height: 1.6;
  color: rgb(var(--color-text-primary));
  font-size: var(--verse-font-size-mobile);
}

/* Tablet screens */
@media (min-width: 640px) {
  .verse-text {
    font-size: var(--verse-font-size-tablet);
  }
}

/* Desktop screens */
@media (min-width: 1024px) {
  .verse-text {
    font-size: var(--verse-font-size-desktop);
  }
}

/* Large desktop screens */
@media (min-width: 1536px) {
  .verse-text {
    font-size: var(--verse-font-size-large);
  }
}

.verse .ellipsis {
  display: inline-block;
  animation: pulse 2s infinite;
}

/* Progress bar for verses */
.verse-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(var(--color-border), 0.2);
  overflow: hidden;
}

.verse-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, 
    rgb(var(--color-primary)), 
    rgb(var(--color-secondary)));
  transition: width 0.5s ease;
  box-shadow: 0 0 10px rgba(var(--color-primary), 0.5);
}

/* ===========================
   Animations
   =========================== */
@keyframes fadeIn {
  from { 
    opacity: 0; 
    transform: translateY(20px); 
  }
  to { 
    opacity: 1; 
    transform: translateY(0); 
  }
}

@keyframes slideIn {
  from { 
    transform: translateX(-100%); 
  }
  to { 
    transform: translateX(0); 
  }
}

@keyframes slideUp {
  from { 
    transform: translateY(100%); 
  }
  to { 
    transform: translateY(0); 
  }
}

@keyframes pulse {
  0%, 100% { 
    opacity: 1; 
  }
  50% { 
    opacity: 0.5; 
  }
}

@keyframes shimmer {
  0% { 
    background-position: -200% 0; 
  }
  100% { 
    background-position: 200% 0; 
  }
}

@keyframes rotate {
  from { 
    transform: rotate(0deg); 
  }
  to { 
    transform: rotate(360deg); 
  }
}

.animate-fade-in {
  animation: fadeIn 0.5s ease-out forwards;
}

.animate-slide-in {
  animation: slideIn 0.3s ease-out forwards;
}

.animate-slide-up {
  animation: slideUp 0.4s ease-out forwards;
}

.animate-pulse {
  animation: pulse 2s infinite;
}

/* Staggered animations */
.stagger-1 { animation-delay: 50ms; }
.stagger-2 { animation-delay: 100ms; }
.stagger-3 { animation-delay: 150ms; }
.stagger-4 { animation-delay: 200ms; }
.stagger-5 { animation-delay: 250ms; }

/* ===========================
   Loading States
   =========================== */
.skeleton {
  background: linear-gradient(90deg, 
    rgba(var(--color-border), 0.3) 25%, 
    rgba(var(--color-border), 0.1) 50%, 
    rgba(var(--color-border), 0.3) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 8px;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(var(--color-border), 0.3);
  border-top-color: rgb(var(--color-primary));
  border-radius: 50%;
  animation: rotate 1s linear infinite;
}

/* ===========================
   Scrollbar Styles
   =========================== */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(var(--color-border), 0.1);
}

::-webkit-scrollbar-thumb {
  background: rgba(var(--color-border), 0.3);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(var(--color-primary), 0.5);
}

/* ===========================
   Accessibility
   =========================== */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition: none !important;
  }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Focus visible styles */
*:focus-visible {
  outline: 2px solid rgb(var(--color-primary));
  outline-offset: 2px;
  border-radius: 4px;
}

/* ===========================
   Responsive Design
   =========================== */
@media (max-width: 640px) {
  .verse {
    margin: 0.5rem 0;
    padding: 1rem;
  }
  
  .verse-number {
    width: 36px;
    height: 36px;
    font-size: 16px;
  }
}

/* Ensure content doesn't get too wide for readability */
@media (min-width: 1024px) {
  .verse-text {
    max-width: 900px;
  }
}

/* Large screens - add subtle background pattern */
@media (min-width: 1536px) {
  body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
      radial-gradient(circle at 20% 50%, rgba(var(--color-primary), 0.02) 0%, transparent 50%),
      radial-gradient(circle at 80% 50%, rgba(var(--color-secondary), 0.02) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
  }
}

/* ===========================
   Special Effects
   =========================== */
.glow {
  box-shadow: 0 0 20px rgba(var(--color-primary), 0.5);
}

.blur-bg {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, 
    rgba(var(--color-primary), 0.1), 
    rgba(var(--color-secondary), 0.1));
  filter: blur(100px);
  z-index: -1;
}

/* Floating gradient orbs for background */
.gradient-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.3;
  animation: float 20s infinite ease-in-out;
  z-index: -1;
}

.gradient-orb-1 {
  width: 400px;
  height: 400px;
  background: rgb(var(--color-primary));
  top: -200px;
  left: -200px;
}

.gradient-orb-2 {
  width: 300px;
  height: 300px;
  background: rgb(var(--color-secondary));
  bottom: -150px;
  right: -150px;
  animation-delay: -10s;
}

@keyframes float {
  0%, 100% {
    transform: translate(0, 0) scale(1);
  }
  33% {
    transform: translate(30px, -30px) scale(1.1);
  }
  66% {
    transform: translate(-20px, 20px) scale(0.9);
  }
}