@import url('https://fonts.googleapis.com/css2?family=Quicksand:wght@400;500;600;700&display=swap');

:root {
  /* GRITwrx Warm Editorial Aesthetics */
  --bg-page: #f5f2eb;
  --bg-card: #ffffff;
  --bg-card-subtle: #ede9df;
  --bg-input: #ffffff;
  --border-soft: #e3ded4;
  --border-active: #d1cbbe;
  
  /* Brand Terracotta & Rust Accent (from GRITwrx logo & CTA) */
  --brand-rust: #c8532d;
  --brand-rust-hover: #b04421;
  --brand-rust-light: #faece7;
  --brand-rust-shadow: rgba(200, 83, 45, 0.22);
  
  /* Brand Dark Navy/Slate (from "wrx" logo text) */
  --brand-navy: #182c44;
  
  /* Clean Typography Colors */
  --text-primary: #1c1917;
  --text-secondary: #44403c;
  --text-muted: #78716c;
  --text-dim: #a8a29e;

  /* Status Colors */
  --success: #15803d;
  --success-bg: #ecfdf5;
  --danger: #dc2626;
  --danger-bg: #fef2f2;
  --danger-border: #fecaca;

  /* Elevation */
  --shadow-sm: 0 1px 3px rgba(44, 30, 20, 0.05);
  --shadow-card: 0 10px 30px -4px rgba(44, 30, 20, 0.06), 0 3px 10px -2px rgba(44, 30, 20, 0.03);
  --shadow-hover: 0 14px 34px -4px rgba(44, 30, 20, 0.1), 0 5px 12px -2px rgba(44, 30, 20, 0.05);
  
  --radius-lg: 16px;
  --radius-md: 10px;
  --radius-sm: 6px;
  --transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

body {
  font-family: 'Quicksand', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-page);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* SVG icons */
.icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  flex-shrink: 0;
}

.icon svg {
  width: 1.25em;
  height: 1.25em;
  fill: currentColor;
}

/* Card panels */
.card-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  transition: var(--transition);
}

/* Header */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 40px;
  background: rgba(245, 242, 235, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-soft);
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* Custom GRITwrx stylized logo badge */
.grit-brand-logo {
  display: flex;
  align-items: center;
  gap: 2px;
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  user-select: none;
}

.grit-brand-logo .grit-part {
  color: var(--brand-rust);
}

.grit-brand-logo .wrx-part {
  color: var(--brand-navy);
}

.brand-pill {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-soft);
  color: var(--brand-rust);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 3px 10px;
  border-radius: 20px;
  margin-left: 8px;
}

.user-status {
  display: flex;
  align-items: center;
  gap: 14px;
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  border: 1px solid var(--border-soft);
  padding: 6px 14px;
  border-radius: 30px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--brand-rust);
  box-shadow: 0 0 0 2px var(--brand-rust-light);
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border-soft);
  color: var(--text-secondary);
  padding: 7px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-ghost:hover {
  background: #ffffff;
  border-color: var(--border-active);
  color: var(--text-primary);
}

/* Container */
.main-container {
  max-width: 900px;
  margin: 44px auto;
  padding: 0 24px;
}

/* Auth view */
.auth-wrapper {
  min-height: calc(85vh - 120px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-card {
  width: 100%;
  max-width: 430px;
  padding: 42px 36px;
  text-align: center;
}

.auth-logo-center {
  margin-bottom: 22px;
}

.auth-card h2 {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--brand-navy);
  margin-bottom: 6px;
}

.auth-card p {
  color: var(--text-muted);
  font-size: 0.94rem;
  margin-bottom: 26px;
}

.form-group {
  margin-bottom: 20px;
  text-align: left;
}

.form-group label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 7px;
}

.form-input {
  width: 100%;
  background: var(--bg-input);
  border: 1.5px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  transition: var(--transition);
  outline: none;
}

.form-input:focus {
  border-color: var(--brand-rust);
  box-shadow: 0 0 0 3px var(--brand-rust-shadow);
}

.btn-rust {
  width: 100%;
  background: var(--brand-rust);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  padding: 13px 22px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 4px 14px var(--brand-rust-shadow);
}

.btn-rust:hover:not(:disabled) {
  background: var(--brand-rust-hover);
  box-shadow: 0 6px 18px var(--brand-rust-shadow);
  transform: translateY(-1px);
}

.btn-rust:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.error-banner {
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  color: var(--danger);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 500;
  margin-bottom: 22px;
  display: none;
  text-align: left;
}

/* Dashboard Sections */
.dashboard-grid {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.upload-card {
  padding: 34px;
}

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

.section-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--brand-navy);
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-title .icon {
  color: var(--brand-rust);
}

/* Dropzone */
.dropzone {
  border: 2px dashed var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 46px 24px;
  text-align: center;
  background: var(--bg-card-subtle);
  cursor: pointer;
  transition: var(--transition);
}

.dropzone:hover, .dropzone.dragover {
  border-color: var(--brand-rust);
  background: var(--brand-rust-light);
}

.dropzone-icon {
  width: 54px;
  height: 54px;
  margin: 0 auto 16px auto;
  border-radius: 14px;
  background: #ffffff;
  color: var(--brand-rust);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
}

.dropzone-text {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.dropzone-hint {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.file-preview {
  display: none;
  margin-top: 18px;
  background: #ffffff;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 14px 20px;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
}

.file-info {
  display: flex;
  align-items: center;
  gap: 14px;
}

.file-icon {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: var(--brand-rust-light);
  color: var(--brand-rust);
  display: flex;
  align-items: center;
  justify-content: center;
}

.file-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
  max-width: 440px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-size {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.btn-remove-file {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.btn-remove-file:hover {
  color: var(--danger);
  background: var(--danger-bg);
}

/* Professional Animated Progress View */
.progress-container {
  display: none;
  padding: 48px 36px;
  text-align: center;
}

.progress-spinner-wrap {
  position: relative;
  width: 88px;
  height: 88px;
  margin: 0 auto 24px auto;
}

.progress-spinner-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.progress-spinner-bg {
  stroke: var(--border-soft);
  stroke-width: 5;
  fill: transparent;
}

.progress-spinner-circle {
  stroke: var(--brand-rust);
  stroke-width: 5;
  stroke-linecap: round;
  fill: transparent;
  stroke-dasharray: 264;
  stroke-dashoffset: 264;
  transition: stroke-dashoffset 0.4s ease;
}

.progress-spinner-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--brand-navy);
}

.progress-headline {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--brand-navy);
  margin-bottom: 8px;
}

.progress-status-text {
  font-size: 0.96rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 28px;
  min-height: 24px;
}

.progress-pulse-dots {
  display: inline-flex;
  gap: 6px;
  margin-top: 14px;
}

.progress-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand-rust);
  animation: pulseDot 1.4s infinite ease-in-out both;
}

.progress-pulse-dot:nth-child(1) { animation-delay: -0.32s; }
.progress-pulse-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes pulseDot {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1.1); opacity: 1; }
}

/* Transcript Result Card */
.result-card {
  display: none;
  padding: 34px;
}

.result-meta-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 22px;
}

.meta-chip {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-soft);
  padding: 6px 14px;
  border-radius: 24px;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.meta-chip strong {
  color: var(--text-primary);
  font-weight: 700;
}

.result-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-secondary {
  background: #ffffff;
  border: 1px solid var(--border-soft);
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  padding: 9px 16px;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition);
  text-decoration: none;
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
  background: var(--bg-card-subtle);
  border-color: var(--border-active);
  color: var(--text-primary);
  transform: translateY(-1px);
}

/* Export Dropdown Styling */
.export-dropdown-wrapper {
  position: relative;
  display: inline-block;
}

.export-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 280px;
  background: #ffffff;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 32px -4px rgba(44, 30, 20, 0.12), 0 4px 12px -2px rgba(44, 30, 20, 0.06);
  padding: 6px;
  z-index: 1000;
  animation: dropdownFade 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.export-menu.show {
  display: block;
}

.export-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text-primary);
  transition: var(--transition);
}

.export-item:hover {
  background: var(--bg-card-subtle);
}

.export-item .icon {
  font-size: 1.25rem;
  margin-top: 2px;
}

.export-icon-docx { color: #2563eb; }
.export-icon-pdf { color: #dc2626; }
.export-icon-md { color: #0284c7; }
.export-icon-txt { color: #64748b; }

.export-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--brand-navy);
}

.export-desc {
  font-size: 0.76rem;
  color: var(--text-muted);
  line-height: 1.35;
  margin-top: 2px;
}

.export-divider {
  height: 1px;
  background: var(--border-soft);
  margin: 6px 4px;
}

/* Transcript Container */
.transcript-box {
  background: #ffffff;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 26px;
  max-height: 560px;
  overflow-y: auto;
  font-size: 0.98rem;
  line-height: 1.8;
}

.transcript-turn {
  margin-bottom: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border-soft);
}

.transcript-turn:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.turn-speaker {
  font-weight: 700;
  display: inline-block;
  margin-right: 8px;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 0.82rem;
}

.speaker-1 {
  background: #faece7;
  color: var(--brand-rust);
}

.speaker-2 {
  background: #e9eff5;
  color: var(--brand-navy);
}

.speaker-3 {
  background: #ecfdf5;
  color: var(--success);
}

.speaker-other {
  background: #fef3c7;
  color: #b45309;
}

.turn-timestamp {
  font-size: 0.84rem;
  color: var(--text-dim);
  margin-right: 10px;
  font-weight: 600;
}

.turn-text {
  color: var(--text-primary);
  font-weight: 500;
}

/* Reset / New File Button */
.btn-reset-wrap {
  margin-top: 24px;
  display: flex;
  justify-content: flex-end;
}

/* Toast */
.toast-msg {
  position: fixed;
  bottom: 28px;
  right: 28px;
  background: var(--brand-navy);
  color: #ffffff;
  padding: 14px 22px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-hover);
  font-size: 0.92rem;
  font-weight: 600;
  z-index: 9999;
  opacity: 0;
  transform: translateY(12px);
  transition: var(--transition);
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 10px;
}

.toast-msg.show {
  opacity: 1;
  transform: translateY(0);
}
