:root {
  --primary: #2c3e50;
  --secondary: #3498db;
  --accent: #e74c3c;
  --bg-light: #f8fafc;
  --white: #ffffff;
  --text-main: #334155;
  --text-muted: #64748b;
  --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --border: #e2e8f0;
  --nav-height: 120px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-light);
  color: var(--text-main);
  line-height: 1.6;
  overflow-x: hidden;
}

/* Header & Navigation */
.top-header {
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
  color: white;
  padding: 1rem 2rem;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow);
}

.header-main {
  text-align: center;
  margin-bottom: 1rem;
}

.main-title {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 1.8rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 15px;
}

.main-title span {
  position: relative;
  padding: 0 5px;
}

.main-title .el {
  color: #ffd700;
}

.top-nav ul {
  list-style: none;
  display: flex;
  justify-content: center;
  gap: 20px;
}

.top-nav a {
  color: #e2e8f0;
  text-decoration: none;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.top-nav a:hover,
.top-nav a.active {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

/* Dropdown */
.dropdown {
  position: relative;
}

.dropdown-content {
  display: none;
  position: absolute;
  background-color: #334155;
  min-width: 160px;
  box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
  z-index: 1;
  border-radius: 8px;
  top: 100%;
}

.dropdown-content a {
  color: white;
  padding: 12px 16px;
  text-decoration: none;
  display: block;
  text-align: left;
}

.dropdown:hover .dropdown-content {
  display: block;
}

/* Layout */
.app-container {
  display: flex;
  height: calc(100vh - var(--nav-height));
}

.sidebar {
  width: 300px;
  background: white;
  border-right: 1px solid var(--border);
  padding: 1.5rem;
  overflow-y: auto;
  display: none;
  /* Hidden by default for Home view */
}

body.show-sidebar .sidebar {
  display: block;
}

.main-content {
  flex: 1;
  padding: 2rem;
  overflow-y: auto;
}

/* Home Section */
.hero {
  max-width: 900px;
  margin: 3rem auto;
  text-align: center;
}

.hero h2 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  color: var(--primary);
}

.quick-links {
  margin-top: 3rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
}

.link-card {
  background: white;
  padding: 2rem;
  border-radius: 16px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.3s ease;
}

.link-card:hover {
  transform: translateY(-5px);
}

.link-card .icon {
  font-size: 3rem;
  display: block;
  margin-bottom: 1rem;
}

/* Dashboard Elements */
.level-selector {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 1.5rem;
}

.level-btn {
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
  cursor: pointer;
  text-align: left;
  font-weight: 500;
}

.level-btn.active {
  background: var(--secondary);
  color: white;
  border-color: var(--secondary);
}

.lesson-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.lesson-item {
  padding: 6px 12px;
  font-size: 0.95rem;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
}

.lesson-item:hover {
  background: #f1f5f9;
}

.lesson-item.selected {
  background: #e0f2fe;
  color: #0369a1;
  font-weight: 600;
}

.content-header {
  background: white;
  padding: 0.25rem 0.5rem;
  border-radius: 8px;
  margin-bottom: 0.5rem;
  box-shadow: var(--shadow);
  position: sticky;
  top: -1rem;
  z-index: 100;
}

.content-header h1 {
  font-size: 1.1rem;
  margin: 0;
  text-align: center;
}

.audio-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 0.5rem;
}

.player-card {
  background: #f8fafc;
  padding: 0.3rem 0.6rem;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.player-card h3 {
  margin-bottom: 2px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.player-card h3 span.flag {
  font-size: 0.85rem;
}

audio {
  width: 100%;
  height: 25px;
}

.text-frames {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.text-pane {
  background: white;
  border-radius: 16px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  min-height: 500px;
}

.pane-header {
  background: #f1f5f9;
  padding: 1rem 1.5rem;
  border-radius: 16px 16px 0 0;
  font-weight: 600;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.text-content {
  padding: 1.5rem;
  font-size: 1.1rem;
}

/* Questions View */
.questions-layout {
  display: grid;
  grid-template-columns: 1fr;
  /* Spans full width now */
  gap: 2rem;
}

.questions-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
  margin-top: 1rem;
}

.questions-table thead th {
  position: sticky;
  top: -2rem;
  /* Should align with main content top */
  z-index: 10;
  background: #f1f5f9;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.questions-table th,
.questions-table td {
  padding: 0.35rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.questions-table th:nth-child(1),
.questions-table td:nth-child(1) {
  width: 50px;
}

.questions-table th:nth-child(2),
.questions-table td:nth-child(2) {
  width: 35%;
  font-weight: 500;
}

.questions-table th:nth-child(3),
.questions-table td:nth-child(3) {
  width: 35%;
  color: var(--text-muted);
}

/* Specific sticky behavior for audio cells with rowspan */
.audio-cell {
  background: #fafafa;
  border-left: 2px solid var(--secondary);
  vertical-align: top;
}

.audio-cell>div,
.audio-cell>audio {
  position: sticky;
  top: 3rem;
  /* Sticky within the cell's range */
}

.audio-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 5px;
  font-weight: 600;
}

.extra-text-section {
  margin-top: 3rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  background: white;
  padding: 2rem;
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.extra-greek {
  font-weight: 500;
}

.extra-russian {
  color: var(--text-muted);
}

.questions-audio-list {
  background: white;
  padding: 1.5rem;
  border-radius: 16px;
  box-shadow: var(--shadow);
  align-self: start;
}

/* Word Style Overrides (from extraction) */
.WordSection1 {
  font-family: inherit !important;
}

p {
  margin-bottom: 1rem;
}

@media (max-width: 1024px) {
  .app-container {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    height: auto;
  }

  .text-frames,
  .audio-controls {
    grid-template-columns: 1fr;
  }

  .questions-layout {
    grid-template-columns: 1fr;
  }
}
/* Auth Styles */
.auth-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(10px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
}

.auth-modal {
  background: white;
  padding: 2.5rem;
  border-radius: 20px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  text-align: center;
}

.auth-modal h2 {
  margin-bottom: 0.5rem;
  color: #1e293b;
  font-family: 'Outfit', sans-serif;
}

.auth-modal p {
  margin-bottom: 2rem;
  color: #64748b;
  font-size: 0.9rem;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.auth-form input {
  padding: 0.8rem 1rem;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s;
}

.auth-form input:focus {
  border-color: #3b82f6;
}

.auth-form button {
  padding: 0.8rem;
  background: #3b82f6;
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.auth-form button:hover {
  background: #2563eb;
}

.error-msg {
  color: #ef4444;
  font-size: 0.85rem;
  margin-top: 0.5rem;
  display: none;
}

/* Admin Panel Section */
.admin-panel-container {
  padding: 2rem;
  max-width: 800px;
  margin: 0 auto;
}

.admin-card {
  background: white;
  padding: 2rem;
  border-radius: 16px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.admin-card h2 {
  margin-bottom: 1.5rem;
  color: #1e293b;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.user-file-editor {
  width: 100%;
  height: 300px;
  font-family: 'Courier New', monospace;
  padding: 1rem;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  background: #f8fafc;
}

.admin-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.admin-btn {
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s;
}

.admin-btn.primary {
  background: #3b82f6;
  color: white;
}

.admin-btn.secondary {
  background: #e2e8f0;
  color: #1e293b;
}

.auth-status-bar {
  background: #f1f5f9;
  padding: 10px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  border-bottom: 1px solid #e2e8f0;
}

.logout-btn {
  background: none;
  border: none;
  color: #ef4444;
  cursor: pointer;
  font-weight: 600;
  text-decoration: underline;
}
