/* Coded for Argentine Tango Masterclass App */
/* Designed for high readability, premium aesthetic, and mobile accessibility */

:root {
  --base-font-size: 16px;
  --bg-color: #121212;
  --panel-bg: rgba(30, 30, 30, 0.85);
  --panel-border: rgba(212, 175, 55, 0.25);
  --text-primary: #FAF9F6;
  --text-secondary: #CCCCCC;
  --gold: #D4AF37;
  --gold-hover: #F3E5AB;
  --crimson: #9B111E;
  --crimson-hover: #D2143A;
  --active-tab-bg: rgba(212, 175, 55, 0.15);
  --font-family: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --border-radius: 12px;
  --transition-speed: 0.3s;
}

/* Base Font Size Configuration */
body { --base-font-size: 16px; }

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-family);
  font-size: var(--base-font-size);
  background-color: #080808;
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background-image: radial-gradient(circle at 10% 10%, rgba(212, 175, 55, 0.05), transparent 400px),
                    radial-gradient(circle at 90% 90%, rgba(155, 17, 30, 0.05), transparent 400px);
}

/* Mobile App Shell Container */
.app-container {
  width: 100%;
  max-width: 480px;
  height: 100vh;
  background-color: var(--bg-color);
  position: relative;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8), 0 0 12px rgba(212, 175, 55, 0.15);
  border-left: 1px solid rgba(212, 175, 55, 0.15);
  border-right: 1px solid rgba(212, 175, 55, 0.15);
  overflow: hidden;
}

/* App Header */
header {
  flex-shrink: 0;
  background-color: rgba(18, 18, 18, 0.98);
  border-bottom: 2px solid var(--gold);
  padding: 12px 16px;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand-row {
  flex: 1;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.app-banner {
  width: 50px;
  height: 50px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--gold);
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.3);
}

.brand-text {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.brand-highlight {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}

.highlight-names {
  color: var(--gold);
  font-weight: 800;
  font-size: 0.98rem;
  border-bottom: 1.5px solid var(--crimson);
  padding-bottom: 1px;
}

.brand-sub {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 500;
  margin-top: 2px;
}

.header-ctrl-row {
  margin-left: 8px;
}

/* Scrollable Content Area */
.content-area {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  padding-bottom: 85px; /* space for bottom nav bar */
  -webkit-overflow-scrolling: touch;
}

/* Bottom Navigation Bar */
.bottom-nav {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 65px;
  background-color: rgba(18, 18, 18, 0.98);
  border-top: 1.5px solid rgba(212, 175, 55, 0.25);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 100;
  backdrop-filter: blur(10px);
}

.nav-tab {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 100%;
  flex: 1;
  cursor: pointer;
  transition: all var(--transition-speed);
}

.nav-tab:hover {
  color: var(--gold);
}

.nav-tab.active {
  color: var(--gold);
  background-color: rgba(212, 175, 55, 0.08);
}

.nav-icon {
  font-size: 1.2rem;
}

.nav-label {
  font-size: 0.7rem;
  font-weight: 600;
}

/* Content Elements Styling */
.tab-content {
  display: none;
  animation: fadeIn 0.3s ease-out;
}

.tab-content.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.card {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: var(--border-radius);
  padding: 18px;
  margin-bottom: 16px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
}

h2 {
  color: var(--gold);
  margin-bottom: 12px;
  font-size: 1.3rem;
  border-left: 4px solid var(--crimson);
  padding-left: 10px;
  line-height: 1.2;
}

h3 {
  color: var(--gold-hover);
  margin-bottom: 8px;
  font-size: 1.15rem;
}

p {
  margin-bottom: 12px;
  color: var(--text-primary);
  font-size: 0.95rem;
}

/* Course Filters */
.course-filter-buttons {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.course-filter-btn {
  flex: 1;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--panel-border);
  color: var(--text-secondary);
  padding: 10px;
  font-size: 0.88rem;
  font-weight: 700;
  border-radius: 8px;
  cursor: pointer;
  transition: all var(--transition-speed);
}

.course-filter-btn:hover {
  color: var(--gold);
  border-color: var(--gold);
}

.course-filter-btn.active {
  background: var(--active-tab-bg);
  color: var(--gold);
  border-color: var(--gold);
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.2);
}

/* Curriculum list & Accordion */
.curriculum-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.week-item {
  border-left: 3px solid var(--gold);
  background: rgba(255, 255, 255, 0.015);
  padding: 12px;
  border-radius: 0 var(--border-radius) var(--border-radius) 0;
  transition: all var(--transition-speed);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.week-item:hover {
  background: rgba(212, 175, 55, 0.03);
}

.week-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.week-badge {
  background: var(--crimson);
  color: white;
  padding: 2px 8px;
  font-size: 0.75rem;
  font-weight: bold;
  border-radius: 12px;
}

.week-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--gold);
  flex: 1;
  padding-right: 10px;
}

.week-content {
  color: var(--text-secondary);
  font-size: 0.88rem;
  line-height: 1.45;
}

/* Expandable details area inside week */
.week-details {
  display: none;
  padding-top: 12px;
  margin-top: 6px;
  border-top: 1px dashed rgba(255, 255, 255, 0.08);
  animation: slideDown 0.3s ease-out;
}

.week-item.expanded .week-details {
  display: block;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}

.week-detail-header {
  font-weight: bold;
  color: var(--gold-hover);
  font-size: 0.9rem;
  margin-bottom: 4px;
}

.week-detail-desc {
  font-size: 0.88rem;
  color: var(--text-primary);
  margin-bottom: 10px;
}

.week-demo-player {
  width: 100%;
  border-radius: 8px;
  border: 1px solid rgba(212, 175, 55, 0.3);
  background: #000;
  max-height: 220px;
  margin-bottom: 10px;
  display: block;
}

/* Professor mode upload widgets (always visible for easy updates) */
.prof-upload-btn-container {
  display: block;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dotted rgba(212, 175, 55, 0.3);
}

.btn-prof-upload {
  background: rgba(155, 17, 30, 0.15);
  border: 1px dashed var(--crimson);
  color: #FFC0C0;
  width: 100%;
  padding: 8px;
  font-size: 0.8rem;
  font-weight: bold;
  border-radius: 6px;
  cursor: pointer;
  transition: all var(--transition-speed);
}

.btn-prof-upload:hover {
  background: var(--crimson);
  color: white;
}

/* Glossary Styling */
.search-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.search-input {
  flex: 1;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--gold);
  padding: 10px 14px;
  border-radius: var(--border-radius);
  color: var(--text-primary);
  font-size: 0.95rem;
  outline: none;
}

.btn-search {
  background: var(--gold);
  color: var(--bg-color);
  border: none;
  padding: 10px 18px;
  font-weight: bold;
  border-radius: var(--border-radius);
  cursor: pointer;
  font-size: 0.9rem;
}

.category-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.tag {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 5px 10px;
  border-radius: 15px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all var(--transition-speed);
}

.tag.active {
  background: var(--active-tab-bg);
  border-color: var(--gold);
  color: var(--gold);
}

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

.glossary-item {
  background: rgba(35, 35, 35, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: var(--border-radius);
  padding: 16px;
}

.glossary-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.glossary-term-ko {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--gold);
}

.glossary-term-es {
  font-size: 0.88rem;
  font-style: italic;
  color: var(--text-secondary);
  margin-left: 6px;
}

.glossary-level {
  background: rgba(212, 175, 55, 0.08);
  color: var(--gold);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.72rem;
  border: 1px solid var(--gold);
}

.glossary-desc {
  font-size: 0.88rem;
  line-height: 1.45;
  margin-bottom: 10px;
}

.glossary-tip {
  background: rgba(155, 17, 30, 0.06);
  border-left: 3px solid var(--crimson);
  padding: 6px 10px;
  font-size: 0.82rem;
  color: #FFC0C0;
  border-radius: 0 4px 4px 0;
}

.glossary-tip strong {
  color: var(--gold);
}

/* AI Dual Video Analysis Styling */
.upload-container {
  border: 2px dashed var(--gold);
  border-radius: var(--border-radius);
  padding: 30px 16px;
  text-align: center;
  background: rgba(0, 0, 0, 0.2);
  cursor: pointer;
  margin-bottom: 16px;
}

.upload-icon {
  font-size: 2.5rem;
  color: var(--gold);
  margin-bottom: 10px;
}

.upload-btn-real {
  display: none;
}

.btn-upload {
  background: var(--crimson);
  color: white;
  padding: 10px 20px;
  border-radius: var(--border-radius);
  font-weight: bold;
  cursor: pointer;
  border: none;
  font-size: 0.95rem;
  transition: background var(--transition-speed);
}

.btn-upload:hover {
  background: var(--crimson-hover);
}

/* Dual Side-by-Side Panel Layout */
.dual-video-container {
  display: flex;
  gap: 8px;
  width: 100%;
  margin-bottom: 16px;
}

.video-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0; /* prevents flex overflows */
}

.panel-label {
  font-size: 0.75rem;
  font-weight: bold;
  color: var(--gold);
  text-align: center;
  background: rgba(0, 0, 0, 0.3);
  padding: 4px;
  border-radius: 4px;
  border: 1px solid rgba(212, 175, 55, 0.15);
}

.video-wrapper-mini {
  position: relative;
  width: 100%;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--gold);
  background: #000;
  aspect-ratio: 4 / 3;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.video-wrapper-mini video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.video-wrapper-mini canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
}

.sync-controls {
  display: flex;
  gap: 6px;
  width: 100%;
  margin-bottom: 16px;
}

.analysis-ctrls {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn-action {
  padding: 10px 12px;
  border-radius: var(--border-radius);
  font-size: 0.88rem;
  font-weight: bold;
  cursor: pointer;
  border: none;
  transition: all var(--transition-speed);
}

.btn-action.primary {
  background: var(--gold);
  color: var(--bg-color);
}

.btn-action.secondary {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.scan-status {
  text-align: center;
  font-size: 0.95rem;
  font-weight: bold;
  color: var(--gold);
  margin-bottom: 16px;
  display: none;
}

.scan-status.active {
  display: block;
}

.scan-bar-animation {
  width: 100%;
  height: 3px;
  background: var(--gold);
  position: absolute;
  top: 0;
  left: 0;
  z-index: 12;
  box-shadow: 0 0 10px var(--gold);
  animation: scanMotion 2s infinite linear;
  display: none;
}

.scan-bar-animation.active {
  display: block;
}

@keyframes scanMotion {
  0% { top: 0%; }
  50% { top: 100%; }
  100% { top: 0%; }
}

/* AI Report Panel */
.report-panel {
  display: none;
  border-top: 1.5px solid var(--gold);
  padding-top: 16px;
  margin-top: 16px;
}

.report-panel.active {
  display: block;
}

.report-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.score-badge {
  background: var(--gold);
  color: var(--bg-color);
  padding: 6px 12px;
  border-radius: 20px;
  font-weight: bold;
  font-size: 1rem;
}

.metric-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.metric-card {
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.04);
  padding: 12px;
  border-radius: var(--border-radius);
}

.metric-name {
  font-weight: bold;
  color: var(--gold);
  font-size: 0.88rem;
  margin-bottom: 4px;
}

.metric-status {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.metric-meter {
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  overflow: hidden;
}

.metric-fill {
  height: 100%;
  background: var(--crimson);
  border-radius: 3px;
  width: 0;
  transition: width 1s ease-out;
}

.metric-fill.good { background: #2ecc71; }
.metric-fill.warning { background: #f1c40f; }

.report-feedback {
  background: rgba(212, 175, 55, 0.04);
  border: 1px solid var(--gold);
  border-radius: var(--border-radius);
  padding: 14px;
}

.feedback-section {
  margin-bottom: 10px;
}

.feedback-title {
  font-weight: bold;
  color: var(--gold);
  font-size: 0.88rem;
  margin-bottom: 4px;
}

.feedback-text {
  font-size: 0.88rem;
  line-height: 1.4;
}

/* Rhythm metronome */
.rhythm-visualizer-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.visual-metronome {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  border: 4px solid var(--gold);
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  background: rgba(0, 0, 0, 0.4);
}

.metronome-dot {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--text-secondary);
  transition: all 0.05s ease-out;
}

.metronome-dot.active-beat {
  background: var(--crimson);
  transform: scale(1.25);
  box-shadow: 0 0 15px var(--crimson);
}

.metronome-dot.strong-beat {
  background: var(--gold);
  transform: scale(1.35);
  box-shadow: 0 0 20px var(--gold);
}

.beat-indicators {
  display: flex;
  gap: 10px;
}

.beat-node {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: bold;
  color: var(--text-secondary);
}

.beat-node.active {
  background: var(--crimson);
  color: white;
  border-color: var(--crimson);
}

.beat-node.strong {
  border-color: var(--gold);
  color: var(--gold);
}

.beat-node.strong.active {
  background: var(--gold);
  color: var(--bg-color);
}

.metro-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.bpm-display {
  font-size: 1.6rem;
  font-weight: bold;
  color: var(--gold);
}

.tempo-slider-container {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: 280px;
}

.tempo-slider {
  flex: 1;
  -webkit-appearance: none;
  background: rgba(255, 255, 255, 0.1);
  height: 6px;
  border-radius: 3px;
  outline: none;
}

.tempo-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--gold);
  cursor: pointer;
}

.rhythm-options {
  display: flex;
  gap: 6px;
}

/* Journal Input Form styling */
.journal-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-weight: bold;
  color: var(--gold);
  font-size: 0.88rem;
}

.form-input, .form-textarea {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--gold);
  color: var(--text-primary);
  border-radius: var(--border-radius);
  padding: 10px;
  font-size: 0.95rem;
  outline: none;
}

.form-textarea {
  min-height: 80px;
  resize: vertical;
}

.form-input-file {
  display: none;
}

.file-name-display {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 4px;
  display: block;
}

/* Saved entries in journal */
.journal-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.journal-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--border-radius);
  padding: 14px;
}

.journal-meta {
  display: flex;
  justify-content: space-between;
  color: var(--text-secondary);
  font-size: 0.8rem;
  margin-bottom: 6px;
}

.journal-text {
  font-size: 0.9rem;
}

.journal-video-player {
  width: 100%;
  max-width: 100%;
  margin-top: 10px;
  border-radius: 8px;
  border: 1px solid rgba(212, 175, 55, 0.3);
  display: block;
}

.btn-delete-journal {
  background: transparent;
  color: var(--crimson);
  border: 1px solid var(--crimson);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.75rem;
  cursor: pointer;
}

/* Master card button states */
.master-card-btn.active {
  border-color: var(--gold) !important;
  background: rgba(212, 175, 55, 0.1) !important;
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.2);
}

/* Footer styling */
footer {
  text-align: center;
  color: var(--text-secondary);
  padding: 20px 10px;
  font-size: 0.8rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  margin-top: 30px;
}

/* Media Query: True Mobile screen override */
@media (max-width: 480px) {
  .app-container {
    height: 100vh;
    border-left: none;
    border-right: none;
    max-width: 100%;
    box-shadow: none;
  }
}
