:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --bg-gradient: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(255, 255, 255, 0.4);
  --text-main: #1e293b;
  --text-muted: #64748b;
  --card-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
  --accent-fr: #ef4444; /* French Red */
  --accent-ca: #22c55e; /* Canadian Green (Maple Leaf vibe) or just distinct */
  --accent-blue: #3b82f6; /* French Blue */
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
  background: var(--bg-gradient);
  min-height: 100vh;
  color: var(--text-main);
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

header {
  width: 100%;
  max-width: 1000px;
  margin-bottom: 30px;
  text-align: center;
}

h1 {
  font-size: 2.5rem;
  font-weight: 800;
  background: linear-gradient(to right, #0055a4, #ffffff, #ef4135); /* Tricolour vibe */
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 10px;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.subtitle {
  color: var(--text-muted);
  font-size: 1.1rem;
}

main {
  width: 100%;
  max-width: 1000px;
  display: flex;
  gap: 20px;
  height: calc(100vh - 150px);
}

/* Sidebar for lessons */
#sidebar {
  width: 250px;
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 20px;
  overflow-y: auto;
  box-shadow: var(--card-shadow);
}

.lesson-item {
  padding: 12px 16px;
  margin-bottom: 8px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 1px solid transparent;
}

.lesson-item:hover {
  background: rgba(255, 255, 255, 0.5);
  transform: translateX(5px);
}

.lesson-item.active {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.lesson-number {
  font-size: 0.8rem;
  opacity: 0.8;
  display: block;
}

.lesson-name {
  font-weight: 600;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Content Area */
#content {
  flex: 1;
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 30px;
  overflow-y: auto;
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
}

.lesson-header {
  margin-bottom: 25px;
  border-bottom: 1px solid rgba(0,0,0,0.05);
  padding-bottom: 15px;
}

.sentence-card {
  background: white;
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 15px;
  border: 1px solid #f1f5f9;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
}

.sentence-card:hover {
  box-shadow: 0 10px 20px rgba(0,0,0,0.03);
  transform: translateY(-2px);
}

.speaker {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.french-text {
  font-size: 1.25rem;
  font-weight: 500;
  line-height: 1.4;
  color: var(--text-main);
}

.chinese-text {
  font-size: 1rem;
  color: var(--text-muted);
  border-top: 1px dashed #e2e8f0;
  padding-top: 8px;
}

.audio-controls {
  display: flex;
  gap: 12px;
  margin-top: 10px;
}

.play-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 50px;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.play-fr {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fee2e2;
}

.play-fr:hover {
  background: #fee2e2;
}

.play-ca {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #dcfce7;
}

.play-ca:hover {
  background: #dcfce7;
}

.play-btn svg {
  width: 18px;
  height: 18px;
}

/* Floating Controls */
.toolbar {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(15px);
  padding: 12px 24px;
  border-radius: 100px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.1);
  display: flex;
  gap: 20px;
  align-items: center;
  border: 1px solid rgba(255,255,255,0.5);
  z-index: 100;
}

.toolbar-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 20px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #cbd5e1;
  transition: .4s;
  border-radius: 20px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--primary);
}

input:checked + .slider:before {
  transform: translateX(20px);
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.1);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(0,0,0,0.2);
}

@media (max-width: 768px) {
  main {
    flex-direction: column;
    height: auto;
  }
  #sidebar {
    width: 100%;
    max-height: 200px;
  }
  .toolbar {
    bottom: 10px;
    padding: 8px 16px;
    gap: 10px;
    width: 90%;
    justify-content: space-around;
  }
  .toolbar-item span {
    display: none;
  }
}
