:root {
  --primary: #EA580C;
  --primary-hover: #D24B00;
  --primary-light: #FFF4ED;
  --accent-1: #DC2626;
  --accent-2: #EA580C;
  --accent-3: #F59E0B;
  --accent-4: #10B981;
  --accent-5: #6366F1;
  --bg: #FFF8F5;
  --card-bg: #FFFFFF;
  --text: #1C1917;
  --text-light: #6B6258;
  --text-muted: #A8A09A;
  --border: #F0E8E0;
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 6px 16px rgba(0,0,0,0.08);
  --radius: 12px;
  --radius-sm: 8px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
.container { max-width: 920px; margin: 0 auto; padding: 0 16px; }

header {
  background: linear-gradient(135deg, #DC2626 0%, #EA580C 40%, #F59E0B 100%);
  color: #fff;
  padding: 36px 0 32px;
  position: relative;
  overflow: hidden;
}
header .header-bg {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.07);
  pointer-events: none;
}
header .bg-1 { width: 260px; height: 260px; top: -80px; right: -60px; animation: floatA 7s ease-in-out infinite; }
header .bg-2 { width: 160px; height: 160px; bottom: -50px; left: 8%; animation: floatA 9s ease-in-out infinite reverse; }
header .bg-3 { width: 90px; height: 90px; top: 10px; right: 28%; animation: floatA 6s ease-in-out infinite 1s; }
header .bg-4 { width: 50px; height: 50px; bottom: 20px; right: 18%; animation: floatA 5s ease-in-out infinite 0.5s; }

@keyframes floatA {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-18px) rotate(6deg); }
}

.select-divider{
  color:#999
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  position: relative;
  z-index: 1;
}
header h1 {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.3px;
  line-height: 1.3;
  text-shadow: 0 1px 4px rgba(0,0,0,0.1);
}
.subtitle {
  font-size: 15px;
  opacity: 0.92;
  margin-top: 8px;
  font-weight: 500;
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 6px;
}
.subtitle .spark { animation: sparkle 2s ease-in-out infinite; display: inline-block; }
@keyframes sparkle {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(1.3); }
}
.lang-selector {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}
.lang-selector label {
  font-size: 13px;
  opacity: 0.9;
  display: none;
}
.lang-selector select {
  appearance: none;
  -webkit-appearance: none;
  background: rgba(255,255,255,0.2);
  border: 1px solid rgba(255,255,255,0.3);
  color: #fff;
  padding: 7px 34px 7px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  outline: none;
  transition: background 0.2s;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='white' d='M6 8.825a.5.5 0 0 1-.354-.146l-4-4a.5.5 0 0 1 .708-.708L6 7.617l3.646-3.646a.5.5 0 0 1 .708.708l-4 4A.5.5 0 0 1 6 8.825z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}
.lang-selector select:hover { background: rgba(255,255,255,0.28); }
.lang-selector select option {
  background: #fff;
  color: var(--text);
}

.intro-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  margin: 24px 0 16px;
  font-size: 14px;
  line-height: 1.8;
  color: var(--text-light);
}
.intro-card p + p { margin-top: 14px; }
.intro-card strong { color: var(--primary); }

.journey-banner {
  background: linear-gradient(135deg, #FFF7ED 0%, #FEF3C7 100%);
  border: 1px solid #FDE68A;
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 20px;
  text-align: center;
  box-shadow: var(--shadow);
}
.journey-banner .journey-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 600;
  color: var(--primary);
  line-height: 1.5;
}
.journey-banner .journey-icon {
  font-size: 24px;
  flex-shrink: 0;
}

.features-section {
  margin-bottom: 24px;
}
.features-section .section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 10px;
  padding-left: 2px;
}
.features-compact {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.feature-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  transition: background 0.2s;
}
.feature-item:last-child { border-bottom: none; }
.feature-item:hover { background: var(--primary-light); }
.feat-num {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  margin-top: 2px;
}
.feature-item[data-color="1"] .feat-num { background: var(--accent-1); }
.feature-item[data-color="2"] .feat-num { background: var(--accent-2); }
.feature-item[data-color="3"] .feat-num { background: var(--accent-3); }
.feature-item[data-color="4"] .feat-num { background: var(--accent-4); }
.feat-body { flex: 1; min-width: 0; }
.feat-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.feat-desc {
  font-size: 13px;
  color: var(--text-light);
  margin-top: 1px;
  line-height: 1.55;
}

.day-section {
  margin-bottom: 28px;
}
.day-section h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.day-section h2 .badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 20px;
  letter-spacing: 0.3px;
}
.day-desc {
  font-size: 13px;
  color: var(--text-light);
  margin-bottom: 12px;
}

.table-wrapper {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 1px;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  min-width: 580px;
}
thead th {
  background: #FFF8F5;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-light);
  padding: 12px 10px;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
  text-align: left;
  position: sticky;
  top: 0;
}
thead th.col-num { min-width: 80px; }
thead th.col-ipa { min-width: 160px; }
thead th.col-audio { text-align: center; min-width: 50px; }
thead th.col-notes { min-width: 140px; }
thead th.center { text-align: center; }

tbody tr { transition: background 0.15s; }
tbody tr:nth-child(even) { background: #FFFAF7; }
tbody tr:hover { background: var(--primary-light); }
tbody td {
  padding: 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
td.digit {
  font-weight: 700;
  font-size: 16px;
  color: var(--primary);
  font-family: 'Courier New', Courier, monospace;
}
td.ipa {
  font-family: 'Segoe UI', 'Arial Unicode MS', 'DejaVu Sans', sans-serif;
  font-size: 14px;
  color: var(--text);
  line-height: 1.4;
}
td.ipa .empty-ipa {
  color: var(--text-muted);
  font-style: italic;
  font-size: 12px;
}
td.audio-cell { text-align: center; }

.play-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  font-size: 14px;
  position: relative;
}
.play-btn:hover {
  background: var(--primary);
  color: #fff;
  transform: scale(1.12);
}
.play-btn:active { transform: scale(0.92); }
.play-btn.playing {
  background: #10B981;
  color: #fff;
  animation: pulse 0.8s ease-in-out infinite;
}
.play-btn.playing::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 2px solid #10B981;
  animation: ripple 0.8s ease-out infinite;
}
.play-btn.disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.play-btn .gender-label { font-size: 10px; font-weight: 700; }

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
  50% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
}
@keyframes ripple {
  0% { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(1.6); opacity: 0; }
}

.note-input {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  color: var(--text);
  background: #FFFAF7;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  font-family: inherit;
}
.note-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(234, 88, 12, 0.1);
  background: #fff;
}
.note-input::placeholder { color: var(--text-muted); }

.note-saved {
  font-size: 10px;
  color: #10B981;
  position: absolute;
  margin-left: 6px;
  opacity: 0;
  transition: opacity 0.3s;
}
.note-saved.show { opacity: 1; }

footer {
  text-align: center;
  padding: 28px 0 36px;
  font-size: 12px;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  margin-top: 8px;
}

@media (min-width: 640px) {
  .container { padding: 0 24px; }
  header { padding: 48px 0 40px; }
  header h1 { font-size: 30px; }
  .subtitle { font-size: 17px; margin-top: 10px; }
  .lang-selector label { display: inline; }
  .intro-card { padding: 32px; font-size: 15px; margin-top: 32px; }
  .journey-banner { padding: 20px 24px; }
  .journey-banner .journey-content { font-size: 18px; }
  .feature-item { padding: 16px 24px; gap: 16px; }
  .feat-num { width: 32px; height: 32px; font-size: 14px; }
  .feat-title { font-size: 15px; }
  .feat-desc { font-size: 14px; }
  .day-section h2 { font-size: 20px; }
  table { font-size: 14px; min-width: 640px; }
  thead th { padding: 14px 14px; }
  tbody td { padding: 12px 14px; }
}
@media (min-width: 900px) {
  table { min-width: 100%; }
  thead th.col-ipa { min-width: 200px; }
  thead th.col-notes { min-width: 180px; }
}

@media (max-width: 480px) {
  .header-top { flex-direction: column; gap: 12px; }
  .lang-selector { width: 100%; }
  .lang-selector select { width: 100%; }
  header h1 { font-size: 18px; }
  .intro-card { padding: 16px; font-size: 13px; }
  .journey-banner .journey-content { font-size: 14px; }
  .feature-item { padding: 12px 14px; gap: 10px; }
  .feat-num { width: 24px; height: 24px; font-size: 11px; margin-top: 1px; }
  .feat-title { font-size: 13px; }
  .feat-desc { font-size: 12px; }
  tbody td { padding: 8px 6px; font-size: 13px; }
  thead th { padding: 10px 6px; font-size: 11px; }
  td.ipa { font-size: 12px; }
  .play-btn { width: 32px; height: 32px; font-size: 12px; }
  .note-input { font-size: 12px; padding: 5px 8px; }
}

.test-entry-section {
  background: linear-gradient(135deg, #FFF7ED 0%, #FEF3C7 100%);
  border: 1px solid #FDE68A;
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
  text-align: center;
}
.test-entry-section p {
  font-size: 15px;
  color: var(--text-light);
  margin-bottom: 12px;
  line-height: 1.6;
}
.test-entry-section a {
  display: inline-block;
  padding: 10px 24px;
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  transition: background 0.2s;
}
.test-entry-section a:hover {
  background: var(--primary-hover);
}

/* New styles for Contact Us and Admin */
.form-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 24px;
}
.form-group {
  margin-bottom: 16px;
}
.form-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.form-row .form-group {
  margin-bottom: 16px;
}
.col-6 { flex: 6; min-width: 200px; }
.col-4 { flex: 4; min-width: 150px; }

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-light);
}
.form-control {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}
.form-control:focus {
  border-color: var(--primary);
}
.btn {
  display: inline-block;
  padding: 10px 20px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.btn:hover {
  background: var(--primary-hover);
}
.msg-thread {
  margin-bottom: 24px;
}
.msg-post {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 20px;
  margin-bottom: 12px;
  border-left: 4px solid var(--primary);
}
.msg-reply {
  background: #fdfdfd;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 12px 16px;
  margin-left: 32px;
  margin-bottom: 8px;
  border-left: 4px solid var(--text-muted);
}
.msg-header {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.msg-content {
  font-size: 14px;
  color: var(--text);
  white-space: pre-wrap;
}
.msg-meta {
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-muted);
}

.is-mobile table {
  min-width: 0;
}
.is-mobile thead th.col-num,
.is-mobile tbody td.digit {
  min-width: 0;
  white-space: nowrap;
}
.is-mobile .day-section[data-day="2"] thead th.col-ipa,
.is-mobile .day-section[data-day="2"] tbody td.ipa {
  display: none;
}
.is-mobile thead th.col-ipa,
.is-mobile tbody td.ipa {
  min-width: 0;
  width: auto;
  white-space: nowrap;
}
