/* static/css/mantra.css */
:root {
  --primary-bg: #f9f6f3;
  --secondary-bg: #fff4dc;
  --text-primary: #3d2e1e;
  --text-secondary: #5d3a00;
  --accent: #d19d00;
  --accent-dark: #b8860b;
  --border: #e6d7c3;
  --shadow: rgba(0, 0, 0, 0.1);
  --gradient: linear-gradient(135deg, #f9f6f3 0%, #fff4dc 100%);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Noto Sans Devanagari', serif;
  background: var(--gradient);
  color: var(--text-primary);
  padding: 1rem;
  line-height: 1.8;
  min-height: 100vh;
}

.container {
  max-width: 900px;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 20px;
  box-shadow: 0 10px 30px var(--shadow);
  padding: 2rem;
  backdrop-filter: blur(10px);
  overflow: visible; /* Allow pointer to be visible */
}

h1 {
  text-align: center;
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
  font-size: 2.5rem;
  font-weight: 700;
  text-shadow: 2px 2px 4px var(--shadow);
}

.subtitle {
  text-align: center;
  margin-bottom: 2rem;
  color: var(--text-primary);
  font-size: 1.1rem;
  font-style: italic;
  opacity: 0.8;
}

.gurudev-image-container {
  text-align: center;
  margin: 2rem 0;
  padding: 1rem;
}

.gurudev-image {
  max-width: 300px;
  width: 100%;
  height: auto;
  border-radius: 15px;
  box-shadow: 0 8px 25px var(--shadow);
  border: 3px solid var(--accent);
  object-fit: contain;
  background: white;
  padding: 0.5rem;
}

.audio-container {
  display: none;
}

.controls {
  background: var(--secondary-bg);
  border-radius: 15px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  border: 2px solid var(--border);
  box-shadow: 0 5px 15px var(--shadow);
}

.control-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin: 0.75rem 0;
  flex-wrap: wrap;
}

button {
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 50px;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 600;
  box-shadow: 0 3px 10px var(--shadow);
}

button:hover {
  background: var(--accent-dark);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px var(--shadow);
}

button:active {
  transform: translateY(0);
}

button:disabled {
  background: #ccc;
  cursor: not-allowed;
  transform: none;
}

button:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

input[type="range"] {
  appearance: none;
  background: transparent;
  cursor: pointer;
  width: 200px;
  height: 6px;
  border-radius: 3px;
  background: #e0e0e0;
  outline: none;
  position: relative;
}

input[type="range"]::-webkit-slider-runnable-track {
  width: 100%;
  height: 6px;
  background: #e0e0e0;
  border-radius: 3px;
}

input[type="range"]::-moz-range-track {
  width: 100%;
  height: 6px;
  background: #e0e0e0;
  border-radius: 3px;
}

input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  height: 20px;
  width: 20px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  box-shadow: 0 2px 6px var(--shadow);
  transition: all 0.2s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

input[type="range"]::-moz-range-thumb {
  height: 20px;
  width: 20px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 6px var(--shadow);
}

input[type="range"]:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

select {
  padding: 0.5rem 1rem;
  border: 2px solid var(--border);
  border-radius: 25px;
  background: white;
  font-size: 1rem;
  cursor: pointer;
  outline: none;
  transition: border-color 0.3s ease;
}

select:focus {
  border-color: var(--accent);
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.time-display {
  background: white;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  border: 1px solid var(--border);
  font-weight: 600;
  color: var(--text-secondary);
  font-family: monospace;
  min-width: 120px;
  text-align: center;
}

.volume-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.loop-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: white;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  border: 1px solid var(--border);
}

.loop-container input[type="checkbox"] {
  transform: scale(1.2);
  accent-color: var(--accent);
  cursor: pointer;
}

.loop-container label {
  cursor: pointer;
}

#verses {
  margin-top: 2rem;
  position: relative;
  overflow: visible; /* Ensure pointer is visible */
}

.shloka {
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: white;
  border-radius: 15px;
  border: 2px solid transparent;
  box-shadow: 0 3px 10px var(--shadow);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  cursor: pointer;
}

.shloka.is-active {
  cursor: pointer;
}

.shloka:hover {
  border-color: var(--border);
  transform: translateY(-2px);
  box-shadow: 0 5px 20px var(--shadow);
}

.shloka.is-active {
  background: var(--secondary-bg);
  border-color: var(--accent);
  box-shadow: 0 8px 25px rgba(209, 157, 0, 0.3);
  transform: translateY(-3px) scale(1.02);
  cursor: pointer !important;
  border-width: 3px;
  animation: activeShlokGlow 2s ease-in-out infinite;
}

.shloka.is-active::before {
  content: "🎵";
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 1.5rem;
  animation: pulse 1.5s ease-in-out infinite;
}

.shloka.is-active::after {
  content: "👉";
  position: absolute;
  top: 50%;
  left: 10px;
  transform: translateY(-50%);
  font-size: 2.5rem;
  animation: pointPulse 1.5s ease-in-out infinite;
  z-index: 100;
  pointer-events: none;
  filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.3));
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  line-height: 1;
}

/* Pointer element added via JavaScript */
.shlok-pointer {
  position: absolute;
  top: 50%;
  left: 10px;
  transform: translateY(-50%);
  font-size: 2.5rem;
  z-index: 100;
  pointer-events: none;
  filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.3));
  line-height: 1;
  display: block;
  visibility: visible;
  opacity: 1;
  animation: pointPulse 1.5s ease-in-out infinite;
}

@keyframes pointPulse {
  0%, 100% { 
    opacity: 0.9; 
    transform: translateY(-50%) scale(1);
    left: 10px;
  }
  50% { 
    opacity: 1; 
    transform: translateY(-50%) scale(1.2);
    left: 15px;
  }
}

/* Ensure active shlok has prominent cursor */
.shloka.is-active * {
  cursor: pointer;
}

@keyframes activeShlokGlow {
  0%, 100% {
    box-shadow: 0 8px 25px rgba(209, 157, 0, 0.3);
  }
  50% {
    box-shadow: 0 12px 35px rgba(209, 157, 0, 0.5);
  }
}

@keyframes pulse {
  0%, 100% { 
    opacity: 0.6; 
    transform: scale(1); 
  }
  50% { 
    opacity: 1; 
    transform: scale(1.15); 
  }
}

.shloka p {
  margin: 0.5rem 0;
  font-size: 1.1rem;
  line-height: 1.8;
  font-weight: 400;
  transition: all 0.3s ease;
}

.shloka.is-active p {
  font-weight: 600;
  color: var(--text-secondary);
}

.verse-number {
  position: absolute;
  top: -10px;
  left: 20px;
  background: var(--accent);
  color: white;
  padding: 0.3rem 0.8rem;
  border-radius: 15px;
  font-size: 0.8rem;
  font-weight: 700;
  box-shadow: 0 2px 8px var(--shadow);
}

.shloka.is-active .verse-number {
  background: var(--accent-dark);
  animation: verseGlow 2s ease-in-out infinite;
}

@keyframes verseGlow {
  0%, 100% { box-shadow: 0 2px 8px var(--shadow); }
  50% { box-shadow: 0 4px 16px rgba(209, 157, 0, 0.5); }
}

.home-button-section {
  text-align: center;
  margin: 2rem 0 1rem;
}

.home-button {
  display: inline-block;
  background: var(--accent);
  color: white;
  text-decoration: none;
  padding: 0.75rem 1.5rem;
  border-radius: 50px;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 3px 10px var(--shadow);
}

.home-button:hover {
  background: var(--accent-dark);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px var(--shadow);
}

.credit {
  font-style: italic;
  font-size: 0.9rem;
  text-align: center;
  margin-top: 2rem;
  padding: 1rem;
  background: var(--secondary-bg);
  border-radius: 10px;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  line-height: 1.6;
}

.loading {
  text-align: center;
  padding: 2rem;
  color: var(--text-secondary);
  font-style: italic;
  animation: fadeInOut 2s ease-in-out infinite;
}

@keyframes fadeInOut {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

.error {
  background: #ffe6e6;
  color: #cc0000;
  padding: 1rem;
  border-radius: 10px;
  border: 1px solid #ffcccc;
  margin: 1rem 0;
  text-align: center;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@media (max-width: 768px) {
  .container {
    padding: 1rem;
    margin: 0.5rem;
    overflow: visible;
  }

  h1 {
    font-size: 2rem;
  }

  .gurudev-image {
    max-width: 250px;
  }

  .control-row {
    flex-direction: column;
    gap: 0.5rem;
  }

  input[type="range"] {
    width: 250px;
  }

  .shloka {
    padding: 1rem;
  }

  .shloka p {
    font-size: 1rem;
  }

  button {
    padding: 0.6rem 1.2rem;
  }

  #verses {
    overflow: visible;
  }

  .shloka.is-active::after {
    left: 5px;
    font-size: 2rem;
  }
}

@media (max-width: 480px) {
  .container {
    overflow: visible;
  }

  .gurudev-image {
    max-width: 200px;
  }

  input[type="range"] {
    width: 200px;
  }
  
  .time-display {
    min-width: 100px;
    font-size: 0.9rem;
  }

  h1 {
    font-size: 1.75rem;
  }

  .subtitle {
    font-size: 1rem;
  }

  .shloka {
    padding: 0.75rem;
  }

  .shloka p {
    font-size: 0.95rem;
  }

  #verses {
    overflow: visible;
  }

  .shloka.is-active::after {
    left: 5px;
    font-size: 1.8rem;
  }
}
