@import url('https://fonts.googleapis.com/css2?family=Noto+Serif:wght@400;700&display=swap');

/* Basic Structure & Typography */
body {
  font-family: 'Noto Serif', serif;
  line-height: 1.6;
  margin: 0;
  padding: 0;
  background-color: #f5e8d0; /* Parchment background */
  color: #4a3b2a; /* Dark brown/sepia text */
}

.container {
  width: 90%;
  max-width: 800px; /* Max width for readability */
  margin: 20px auto;
  overflow: hidden;
  padding: 20px;
  background-color: transparent; /* Let body background show through or set a specific one */
  /* box-shadow: 0 0 10px rgba(0,0,0,0.1); remove shadow for flatter look */
}

h1, h2, h3 {
  color: #4a3b2a; /* Dark brown/sepia text */
}

h1 { /* For "Mantras" or "POPULAR MANTRAS" */
  text-align: left;
  text-transform: uppercase;
  font-weight: normal; /* As per image */
  letter-spacing: 1px;
  margin-bottom: 30px;
  font-size: 1.5rem; /* Adjusted size */
}

a {
  color: #8c5e3c; /* A slightly lighter brown for links */
  text-decoration: none;
}

a:hover {
  color: #4a3b2a; /* Darker brown on hover */
  text-decoration: underline;
}

.mantra-item {
  h2 { 
    text-align: center;
  }
}

/* Mantra List (Index Page) */
.mantra-list .mantra-item {
  background-color: #faf0e0; /* Light cream card background */
  border: 1px solid #c8a17a; /* Reddish-brown border */
  border-radius: 12px; /* Rounded corners */
  padding: 20px;
  margin-bottom: 25px;
  /* box-shadow: 0 2px 5px rgba(0,0,0,0.05); optional subtle shadow */
}

.mantra-list .mantra-item:last-child {
  border-bottom: 1px solid #c8a17a; /* Keep border consistent */
  margin-bottom: 0;
}

.mantra-list .mantra-item h2 {
  margin-top: 0;
  margin-bottom: 10px;
}

.mantra-list .mantra-item h2 a {
  color: inherit; /* Make link color same as text */
  text-decoration: none;
}
.mantra-list .mantra-item h2 a:hover {
  color: #8c5e3c; /* Link hover color */
}


.mantra-list .mantra-item h2 .lang-sa,
.mantra-list .mantra-item h2 .lang-en {
  display: block; /* Titles on separate lines */
  text-align: center;
}

.mantra-list .mantra-item h2 .lang-sa {
  font-size: 1.8rem; /* Larger Sanskrit title */
  font-weight: bold; /* As per image */
  margin-bottom: 5px;
  color: #3d2e1f; /* Slightly darker for emphasis */
}

.mantra-list .mantra-item h2 .lang-en {
  font-size: 1.1rem; /* Smaller English title */
  font-weight: normal;
  color: #594839;
}

.mantra-list .mantra-item p { /* Description - not in image, but we can style it subtly */
  font-size: 0.95rem;
  color: #594839;
  text-align: center; /* Or left, if preferred */
  margin-top: 15px;
  line-height: 1.5;
}

/* Mantra Detail (Show Page) */
.mantra-detail {
  background-color: #faf0e0; /* Light cream card background */
  border: 1px solid #c8a17a; /* Reddish-brown border */
  border-radius: 12px; /* Rounded corners */
  padding: 25px;
}

.mantra-detail h1 { /* Page title for mantra name */
  text-align: center;
  margin-bottom: 20px;
}

.mantra-detail h1 .lang-sa,
.mantra-detail h1 .lang-en {
  display: block;
  line-height: 1.3;
}

.mantra-detail h1 .lang-sa {
  font-size: 2.2rem;
  font-weight: bold;
  color: #3d2e1f;
  margin-bottom: 8px;
}

.mantra-detail h1 .lang-en {
  font-size: 1.3rem;
  font-weight: normal;
  color: #594839;
}

.mantra-detail .description {
  font-style: normal; /* Image doesn't show italics for description */
  color: #594839;
  margin-bottom: 30px;
  text-align: center;
  font-size: 1rem;
}

.mantra-text h2 { /* "Mantra Text" heading */
  margin-top: 30px;
  border-bottom: 1px solid #dcc8b3; /* Lighter border */
  padding-bottom: 8px;
  font-size: 1.3rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: normal;
}

.mantra-text h3 { /* "Sanskrit" / "English" subheadings */
  margin-top: 20px;
  font-size: 1.1rem;
  font-weight: bold;
  color: #4a3b2a;
}

.mantra-text pre {
  background-color: transparent; /* No distinct background for pre in image */
  border: none; /* No border for pre in image */
  padding: 10px 0; /* Adjust padding */
  border-radius: 0;
  white-space: pre-wrap;
  word-wrap: break-word;
  font-size: 1.2rem; /* Good readable size for mantra text */
  line-height: 1.8; /* Generous line height for readability */
  font-family: 'Noto Serif', serif; /* Ensure font consistency */
  color: #3d2e1f;
}

.sanskrit-text pre {
  font-size: 1.4rem;
  margin: 0;
  margin-bottom: 24px;
  padding: 0; /* Slightly larger for Sanskrit text */
}

.sanskrit-text h3 {
  margin-bottom: 0;
}

.back-link {
  display: block; /* Make it a block for easier styling */
  width: fit-content;
  margin: 30px auto 0; /* Center the link */
  padding: 10px 20px;
  background-color: #c8a17a; /* Button color from border */
  color: #fff;
  border-radius: 8px;
  text-align: center;
}

.back-link:hover {
  background-color: #b08d68; /* Darker shade for hover */
  color: #fff;
  text-decoration: none;
}

/* Custom Audio Player - iOS Podcast/Music App Style */
.custom-audio-player {
  background: linear-gradient(145deg, #ffffff, #f0f0f0);
  border-radius: 20px;
  padding: 25px;
  margin: 30px 0;
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.custom-audio-player h2 {
  text-align: center;
  margin-bottom: 20px;
  font-size: 1.1rem;
  font-weight: 600;
  color: #333;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.audio-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

.play-pause-btn {
  width: 64px;
  height: 64px;
  border-radius: 32px;
  background: linear-gradient(145deg, #007AFF, #0051D5);
  border: none;
  box-shadow: 
    0 4px 16px rgba(0, 122, 255, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.play-pause-btn:hover {
  transform: translateY(-1px);
  box-shadow: 
    0 6px 20px rgba(0, 122, 255, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.play-pause-btn:active {
  transform: translateY(0);
  box-shadow: 
    0 2px 8px rgba(0, 122, 255, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.play-pause-btn .material-icons {
  color: white;
  font-size: 32px;
  margin-left: 2px; /* Slight optical adjustment for play icon */
}

.play-pause-btn.playing .material-icons {
  margin-left: 0;
}

.control-buttons {
  display: flex;
  gap: 12px;
  align-items: center;
}

.repeat-btn {
  width: 44px;
  height: 44px;
  border-radius: 22px;
  background: rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  color: #666;
}

.repeat-btn:hover {
  background: rgba(0, 0, 0, 0.08);
  transform: translateY(-1px);
}

.repeat-btn:active {
  transform: translateY(0);
  background: rgba(0, 0, 0, 0.12);
}

.repeat-btn .material-icons {
  font-size: 20px;
  color: #666;
}

/* Repeat button states */
.repeat-btn.repeat-once {
  background: rgba(255, 149, 0, 0.1);
  border-color: rgba(255, 149, 0, 0.3);
}

.repeat-btn.repeat-once .material-icons {
  color: #FF9500;
}

.repeat-btn.repeat-108 {
  background: rgba(52, 199, 89, 0.1);
  border-color: rgba(52, 199, 89, 0.3);
  position: relative;
}

.repeat-btn.repeat-108 .material-icons {
  color: #34C759;
}

.repeat-108-badge {
  position: absolute;
  bottom: -8px;
  right: -8px;
  background: #34C759;
  color: white;
  font-size: 9px;
  font-weight: 600;
  padding: 1px 3px;
  border-radius: 6px;
  line-height: 1;
  min-width: 16px;
  text-align: center;
}

/* Index Header with Language Selector */
.index-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  gap: 20px;
}

.index-header h1 {
  margin: 0;
  flex: 1;
}

.language-selector {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.language-selector label {
  font-size: 14px;
  font-weight: 500;
  color: #4a3b2a;
  white-space: nowrap;
}

.language-form {
  margin: 0;
}

.language-dropdown {
  background: linear-gradient(145deg, #ffffff, #f0f0f0);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 14px;
  font-weight: 500;
  color: #333;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease;
  min-width: 160px;
}

.language-dropdown:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transform: translateY(-1px);
}

.language-dropdown:focus {
  outline: none;
  border-color: #007AFF;
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

/* Responsive adjustments */
@media (max-width: 600px) {
  .index-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  
  .language-selector {
    margin-top: 15px;
    flex-direction: column;
    gap: 8px;
  }
  
  .language-dropdown {
    min-width: 200px;
  }
}

/* Update class names for the new structure */
.mantra-detail h1 .lang-selected {
  font-size: 1.3rem;
  font-weight: normal;
  color: #594839;
}

.selected-text pre {
  background-color: transparent;
  border: none;
  /* padding: 10px 0; */
  border-radius: 0;
  white-space: pre-wrap;
  word-wrap: break-word;
  font-size: 1.2rem;
  line-height: 1.8;
  font-family: 'Noto Serif', serif;
  color: #3d2e1f;
  margin: 0;
}

.selected-text h3 {
  margin-bottom: 0;
}

/* Analytics Dashboard */
.analytics-dashboard {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  background-color: #f5e8d0;
  min-height: 100vh;
  font-family: 'Noto Serif', serif;
}

.dashboard-header {
  text-align: center;
  margin-bottom: 40px;
}

.dashboard-header h1 {
  color: #4a3b2a;
  font-size: 2.5rem;
  margin-bottom: 10px;
}

.subtitle {
  color: #666;
  font-size: 1.1rem;
  margin: 0;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.metric-card {
  background: linear-gradient(145deg, #ffffff, #f0f0f0);
  border-radius: 12px;
  padding: 24px;
  text-align: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.metric-number {
  font-size: 2.5rem;
  font-weight: bold;
  color: #4a3b2a;
  margin-bottom: 8px;
}

.metric-label {
  font-size: 0.9rem;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 500;
}

.section {
  background: #faf0e0;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
  border: 1px solid #c8a17a;
}

.section h2 {
  color: #4a3b2a;
  font-size: 1.4rem;
  margin-bottom: 20px;
  border-bottom: 1px solid #dcc8b3;
  padding-bottom: 8px;
}

.list-stats {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.stat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #eee;
}

.stat-item:last-child {
  border-bottom: none;
}

.stat-name {
  font-weight: 500;
  color: #4a3b2a;
}

.stat-value {
  color: #666;
  font-weight: 600;
}

.activity-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.activity-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  font-size: 0.9rem;
}

.activity-name {
  font-weight: 500;
  color: #4a3b2a;
}

.activity-time {
  color: #999;
  font-size: 0.8rem;
}

.activity-detail {
  color: #666;
  font-style: italic;
}

.dashboard-footer {
  text-align: center;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid #dcc8b3;
}

.dashboard-footer a {
  color: #8c5e3c;
  text-decoration: none;
}

.dashboard-footer a:hover {
  color: #4a3b2a;
  text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
  .metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .metric-card {
    padding: 16px;
  }
  
  .metric-number {
    font-size: 2rem;
  }
  
  .activity-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
}

/* Hide the actual audio element */
#audioElement {
  display: none;
} 