/* =============================================================================
   styles.css — Premium Dark and Beige Accent Design System
   ============================================================================= */

/* --- Reset & Base Variables --- */
:root {
  --bg-color: #0f0f0f;
  --surface-color: #1a1a1a;
  --surface-glass: rgba(26, 26, 26, 0.8);
  --border-color: rgba(212, 165, 116, 0.15);
  --border-glow: rgba(212, 165, 116, 0.35);
  
  --primary-accent: #d4a574;      /* Warm beige / caramel */
  --secondary-accent: #c8a882;    /* Muted beige */
  --highlight-accent: #e8d5b7;    /* Light beige */
  
  --text-primary: #f5f0eb;        /* Warm white */
  --text-secondary: #8a7e72;      /* Muted warm gray */
  
  --error-color: #e74c3c;
  --success-color: #6dbf67;
  --danger-color: #ff4757;
  
  --font-family: 'Inter', system-ui, -apple-system, sans-serif;
  --border-radius-card: 16px;
  --border-radius-btn: 8px;
  --transition-speed: 0.3s;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-color);
  color: var(--text-primary);
  font-family: var(--font-family);
  min-height: 100vh;
  padding-top: 80px; /* Space for the fixed top nav-bar */
  overflow-x: hidden;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* --- Scrollbar Customization --- */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-color);
}
::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--primary-accent);
}

/* --- Typography --- */
h1 {
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--highlight-accent);
  letter-spacing: -0.5px;
}

h2 {
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--highlight-accent);
  margin-bottom: 20px;
}

h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--primary-accent);
  margin-bottom: 12px;
}

p {
  color: var(--text-secondary);
}

/* --- Layout Utility Classes --- */
.app-container {
  max-width: 960px;
  margin: 0 auto;
  padding: 20px;
  min-height: calc(100vh - 80px);
  display: flex;
  flex-direction: column;
}

.app-content {
  flex: 1;
  width: 100%;
}

.hidden {
  display: none !important;
}

/* --- Glassmorphic Container Card --- */
.section-card {
  background: var(--surface-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-card);
  padding: 32px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  max-width: 650px;
  margin: 40px auto;
  animation: slideUp 0.4s ease forwards;
}

/* --- Fixed Top Navigation Bar --- */
nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 60px;
  background: rgba(15, 15, 15, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color);
  z-index: 1000;
  display: flex;
  align-items: center;
}

.nav-content {
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-brand {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--primary-accent);
  letter-spacing: 0.5px;
  text-transform: capitalize;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-link {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 4px;
  transition: all var(--transition-speed) ease;
}

.nav-link:hover, .nav-link.active {
  color: var(--primary-accent);
}

.nav-link.active {
  background: rgba(212, 165, 116, 0.1);
}

/* --- Form Fields & Labels --- */
.form-group {
  margin-bottom: 24px;
  text-align: left;
}

.form-label {
  display: block;
  margin-bottom: 8px;
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

.form-input {
  width: 100%;
  padding: 14px 16px;
  background: #141414;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-btn);
  color: var(--text-primary);
  font-size: 1rem;
  font-family: var(--font-family);
  transition: all var(--transition-speed) ease;
}

.form-input:focus {
  border-color: var(--primary-accent);
  box-shadow: 0 0 0 3px rgba(212, 165, 116, 0.15);
  outline: none;
}

.date-display {
  font-size: 1rem;
  color: var(--highlight-accent);
  padding: 12px 0;
  border-bottom: 1px solid rgba(212, 165, 116, 0.1);
}

/* --- Button Styling --- */
.btn-primary {
  background: linear-gradient(135deg, var(--primary-accent), var(--secondary-accent));
  color: #0f0f0f;
  font-weight: 600;
  padding: 14px 28px;
  border-radius: var(--border-radius-btn);
  border: none;
  cursor: pointer;
  font-size: 1rem;
  font-family: var(--font-family);
  transition: all var(--transition-speed) ease;
  width: 100%;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--border-glow);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-secondary {
  background: transparent;
  border: 1px solid rgba(212, 165, 116, 0.35);
  color: var(--primary-accent);
  font-weight: 500;
  padding: 12px 24px;
  border-radius: var(--border-radius-btn);
  cursor: pointer;
  font-size: 0.95rem;
  font-family: var(--font-family);
  transition: all var(--transition-speed) ease;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

.btn-secondary:hover:not(:disabled) {
  background: rgba(212, 165, 116, 0.08);
  border-color: var(--primary-accent);
}

.btn-danger {
  background: linear-gradient(135deg, var(--danger-color), #d63031);
  color: #ffffff;
  font-weight: 600;
  padding: 14px 28px;
  border-radius: var(--border-radius-btn);
  border: none;
  cursor: pointer;
  font-size: 1rem;
  font-family: var(--font-family);
  transition: all var(--transition-speed) ease;
  width: 100%;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

.btn-danger:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 71, 87, 0.3);
}

.btn-danger:active {
  transform: translateY(0);
}

.btn-icon {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  transition: all var(--transition-speed) ease;
}

.btn-icon:hover {
  color: var(--primary-accent);
  background: rgba(212, 165, 116, 0.1);
}

.btn-delete-icon {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  transition: all var(--transition-speed) ease;
  flex-shrink: 0;
}

.btn-delete-icon:hover {
  color: var(--error-color);
  background: rgba(231, 76, 60, 0.12);
  transform: scale(1.05);
}

.btn-download {
  flex: 1;
  background: #222;
  border: 1px solid var(--border-color);
  color: var(--highlight-accent);
  padding: 10px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all var(--transition-speed) ease;
}

.btn-download:hover {
  background: var(--surface-color);
  border-color: var(--primary-accent);
  color: var(--primary-accent);
}

/* --- Auth Page Centering --- */
#auth-section {
  min-height: calc(100vh - 120px);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.auth-card {
  background: var(--surface-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-card);
  padding: 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  text-align: center;
  animation: fadeIn 0.5s ease;
}

.auth-header h1 {
  font-size: 2.5rem;
  color: var(--primary-accent);
  margin-bottom: 4px;
}

.auth-subtitle {
  font-size: 0.9rem;
  color: var(--text-secondary);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 24px;
}

.auth-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-color), transparent);
  margin-bottom: 28px;
}

.error-message {
  color: var(--error-color);
  font-size: 0.85rem;
  text-align: left;
  margin-bottom: 16px;
  min-height: 20px;
}

/* --- Dynamic Meeting Title Info --- */
.meeting-title-display {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--highlight-accent);
  text-align: center;
  margin-bottom: 24px;
  position: relative;
  display: inline-block;
  align-self: center;
}

.meeting-title-display::after {
  content: '';
  display: block;
  width: 40px;
  height: 2px;
  background: var(--primary-accent);
  margin: 8px auto 0;
  border-radius: 1px;
}

/* --- Ready Section --- */
.ready-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 0;
  gap: 24px;
}

.record-btn {
  width: 130px;
  height: 130px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-accent), var(--secondary-accent));
  color: #0f0f0f;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 30px rgba(212, 165, 116, 0.25);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.record-btn:hover {
  transform: scale(1.06);
  box-shadow: 0 0 45px rgba(212, 165, 116, 0.45);
}

.record-btn:active {
  transform: scale(0.96);
}

.ready-text {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--highlight-accent);
}

/* --- Recording Section --- */
.recording-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 0;
  gap: 28px;
}

.recording-indicator {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 16px;
  border-radius: 20px;
  background: rgba(255, 71, 87, 0.1);
  border: 1px solid rgba(255, 71, 87, 0.2);
}

.recording-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: var(--danger-color);
  animation: pulse 1.5s infinite;
}

.recording-label {
  color: var(--danger-color);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.timer-display {
  font-size: 3rem;
  font-weight: 700;
  color: var(--highlight-accent);
  font-family: monospace;
  letter-spacing: 2px;
  font-variant-numeric: tabular-nums;
}

.chunks-info {
  font-size: 0.9rem;
  color: var(--text-secondary);
  background: #1e1e1e;
  padding: 4px 12px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
}

/* --- Processing/Loading Section --- */
.processing-container {
  text-align: center;
  max-width: 500px;
  margin: 40px auto;
  padding: 20px;
}

.processing-container h2 {
  margin-bottom: 28px;
}

.processing-steps {
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: left;
  margin-bottom: 30px;
}

.processing-step {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.02);
  border-left: 3px solid transparent;
  border-radius: 0 8px 8px 0;
  transition: all var(--transition-speed) ease;
}

.processing-step.active {
  border-left-color: var(--primary-accent);
  background: rgba(212, 165, 116, 0.05);
}

.processing-step.completed {
  border-left-color: var(--success-color);
  background: rgba(109, 191, 103, 0.04);
}

.processing-step.completed .step-icon {
  color: var(--success-color);
}

.step-icon {
  font-size: 1.2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
}

.step-text {
  font-size: 0.95rem;
  font-weight: 500;
}

.processing-step.active .step-text {
  color: var(--highlight-accent);
}

.processing-step.completed .step-text {
  color: var(--text-primary);
}

/* --- Results Section --- */
.language-toggle-container {
  display: flex;
  justify-content: center;
  margin-bottom: 24px;
}

.language-toggle {
  display: inline-flex;
  background: #141414;
  padding: 4px;
  border-radius: 30px;
  border: 1px solid var(--border-color);
}

.lang-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 700;
  padding: 6px 18px;
  border-radius: 20px;
  cursor: pointer;
  transition: all var(--transition-speed) ease;
}

.lang-btn.active {
  background: var(--primary-accent);
  color: #0f0f0f;
}

#language-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
}

.spinner {
  width: 28px;
  height: 28px;
  border: 3px solid rgba(212, 165, 116, 0.2);
  border-top-color: var(--primary-accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.results-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 20px;
}

.result-card {
  background: var(--surface-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-card);
  padding: 24px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  max-height: 480px;
}

.result-preview {
  flex: 1;
  overflow-y: auto;
  background: #141414;
  border: 1px solid rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  padding: 16px;
  font-size: 0.9rem;
  color: var(--text-primary);
  margin-bottom: 16px;
  text-align: left;
  white-space: pre-wrap;
  line-height: 1.5;
}

.download-buttons {
  display: flex;
  gap: 10px;
}

/* --- History Section --- */
.meeting-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 24px;
  width: 100%;
}

.meeting-card {
  background: var(--surface-glass);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all var(--transition-speed) ease;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.meeting-card:hover {
  border-color: var(--border-glow);
  transform: translateY(-2px);
}

.meeting-info {
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.meeting-card-title {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--highlight-accent);
}

.meeting-card-meta {
  font-size: 0.8rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 12px;
}

.meta-badge {
  background: rgba(212, 165, 116, 0.1);
  color: var(--primary-accent);
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 600;
}

.meeting-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 220px;
}

.action-row {
  display: flex;
  gap: 8px;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
  font-size: 1.05rem;
}

/* --- Settings Modal --- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal.hidden {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(7, 11, 20, 0.72);
  backdrop-filter: blur(6px);
}

.modal-card {
  position: relative;
  z-index: 1;
  width: min(560px, 100%);
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid var(--border-color);
  border-radius: 18px;
  padding: 24px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.modal-copy {
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 18px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 18px;
  flex-wrap: wrap;
}

/* --- Animations --- */
@keyframes pulse {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(255, 71, 87, 0.7);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 10px rgba(255, 71, 87, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(255, 71, 87, 0);
  }
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

.fade-in {
  animation: fadeIn 0.4s ease forwards;
}

/* --- Responsive Adjustments --- */
@media (max-width: 820px) {
  .results-grid {
    grid-template-columns: 1fr;
  }
  .meeting-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
  .meeting-actions {
    width: 100%;
  }
}

@media (max-width: 480px) {
  body {
    padding-top: 70px;
  }
  nav {
    height: 54px;
  }
  .app-container {
    padding: 10px;
  }
  .section-card {
    padding: 20px;
  }
  .timer-display {
    font-size: 2.2rem;
  }
  .record-btn {
    width: 110px;
    height: 110px;
  }
  h1 {
    font-size: 1.8rem;
  }
}
