/* Modern Dashboard Styles for AudioToTextApp */

:root {
  --primary: #0f766e;
  --primary-glow: rgba(15, 118, 110, 0.15);
  --primary-dark: #0f172a;
  --secondary: #0d9488;
  --bg-app: #f8fafc;
  --card-bg: rgba(255, 255, 255, 0.85);
  --card-border: rgba(15, 118, 110, 0.08);
  --text-main: #0f172a;
  --text-muted: #475569;
  --line-color: #e2e8f0;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 10px 25px -5px rgba(15, 118, 110, 0.08), 0 8px 10px -6px rgba(15, 118, 110, 0.08);
  --shadow-lg: 0 20px 25px -5px rgba(15, 118, 110, 0.1), 0 10px 10px -5px rgba(15, 118, 110, 0.04);
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-height, 80px) + 24px);
}

/* Background Atmosphere */
body {
  background-color: var(--bg-app);
  background-image: 
    radial-gradient(at 0% 0%, rgba(13, 148, 136, 0.08) 0px, transparent 50%),
    radial-gradient(at 100% 0%, rgba(15, 118, 110, 0.06) 0px, transparent 50%),
    radial-gradient(at 50% 100%, rgba(15, 118, 110, 0.04) 0px, transparent 50%);
  background-attachment: fixed;
  font-family: 'Sora', 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Header & Navigation */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: rgba(255, 255, 255, 0.75);
  border-bottom: 1px solid var(--card-border);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.02);
  transition: all 0.3s ease;
}

.nav-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  max-width: 1340px;
  margin: 0 auto;
  gap: 16px;
}

.brand {
  font-size: 1.25rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.03em;
}

.links {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  min-width: 0;
}

/* General Layout */
.app-shell {
  max-width: 1340px;
  margin: calc(var(--nav-height, 80px) + 30px) auto 60px;
  padding: 0 24px;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
}

.app-shell h1 {
  font-size: clamp(2rem, 4vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--primary-dark);
  text-align: center;
  margin-bottom: 40px;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Styled Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 9999px;
  border: 1px solid var(--line-color);
  background: #ffffff;
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  outline: none;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  border-color: #cbd5e1;
}

.btn.primary, .btn.mini.active {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  border: none;
  color: #ffffff;
  box-shadow: 0 10px 20px -5px rgba(15, 118, 110, 0.3);
}

.btn.primary:hover, .btn.mini.active:hover {
  box-shadow: 0 12px 22px -4px rgba(15, 118, 110, 0.4);
  transform: translateY(-1.5px);
}

.btn.mini {
  padding: 8px 14px;
  font-size: 0.815rem;
  border-radius: 12px;
}

/* Pre-Login Portal Layout */
.login-portal-stack {
  display: grid;
  gap: 24px;
  margin-top: 20px;
  min-width: 0;
}

.card.tool-card {
  border-radius: 24px;
  border: 1px solid var(--card-border);
  background-color: var(--card-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow-md);
  padding: 32px;
  transition: all 0.3s ease;
  overflow-wrap: anywhere;
  box-sizing: border-box;
  min-width: 0;
}

.card.tool-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.login-hero {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  background: radial-gradient(circle at 100% 0%, rgba(13, 148, 136, 0.05) 0%, transparent 40%), var(--card-bg);
}

.login-hero h3 {
  font-size: 1.5rem;
  font-weight: 800;
  margin: 0 0 12px 0;
  color: var(--primary-dark);
  letter-spacing: -0.02em;
}

.login-hero .tool-status {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.login-hero #gsiButton,
.login-hero #gsiButton > div {
  max-width: 100%;
}

.login-demo-panel {
  display: block;
  min-width: 0;
  border-radius: 24px;
  border: 1px solid var(--card-border);
  background: rgba(255, 255, 255, 0.85);
  box-shadow: var(--shadow-md);
  padding: 28px 32px 32px;
}

.section-kicker {
  margin: 0 0 7px;
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.demo-row-heading,
.credits-card-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.demo-row-heading h3,
.credits-card-heading h3 {
  margin: 0;
  font-size: 1.25rem;
}

.demo-live-badge {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 7px 12px;
  background: #dcfce7;
  color: #166534;
  font-size: 0.75rem;
  font-weight: 800;
}

.shared-credits-card {
  margin-top: 24px;
}

/* Beautiful Live Subtitle Animation Demo */
.transcript-animation {
  border: 1px solid rgba(15, 118, 110, 0.08);
  border-radius: 20px;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  padding: 26px;
  margin-top: 20px;
  position: relative;
  box-shadow: inset 0 2px 8px rgba(0,0,0,0.4);
  width: 100%;
  min-height: 190px;
  box-sizing: border-box;
  overflow: hidden;
}

.workflow-track {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  position: relative;
  z-index: 2;
}

.workflow-stage {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 16px;
  background: rgba(255,255,255,.07);
}

.workflow-stage strong,
.workflow-stage small {
  display: block;
}

.workflow-stage strong {
  color: #fff;
  font-size: 0.9rem;
}

.workflow-stage small {
  margin-top: 3px;
  color: rgba(255,255,255,.62);
  font-size: 0.72rem;
}

.workflow-icon {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: linear-gradient(135deg, var(--secondary), var(--primary));
  font-weight: 800;
}

.workflow-icon.anim-bars {
  gap: 2px;
  align-items: center;
}

.workflow-icon.anim-bars i {
  width: 3px;
  height: 15px;
  border-radius: 9px;
  background: #fff;
  animation: wave 1s ease-in-out infinite;
}

.workflow-icon.anim-bars i:nth-child(2) { animation-delay: .15s; }
.workflow-icon.anim-bars i:nth-child(3) { animation-delay: .3s; }
.workflow-icon.anim-bars i:nth-child(4) { animation-delay: .45s; }

.workflow-arrow {
  flex: 0 0 auto;
  color: #5eead4;
  font-size: 1.4rem;
  font-weight: 800;
}

.moving-transcript-line {
  margin-top: 22px;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid rgba(94,234,212,.18);
  background: rgba(15,118,110,.16);
  padding: 10px 0;
}

.moving-transcript-line span {
  display: inline-block;
  min-width: max-content;
  color: rgba(255,255,255,.88);
  font-size: 0.85rem;
  animation: transcriptLeftToRight 9s linear infinite;
}

@keyframes transcriptLeftToRight {
  0% { transform: translateX(-105%); }
  100% { transform: translateX(calc(100vw + 100%)); }
}

@keyframes wave {
  0%, 100% { transform: scaleY(.45); opacity: .65; }
  50% { transform: scaleY(1); opacity: 1; }
}

.credit-destinations {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 22px;
}

.credit-destination {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line-color);
  border-radius: 16px;
  background: #fff;
  transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}

.credit-destination:hover {
  transform: translateY(-2px);
  border-color: rgba(15,118,110,.4);
  box-shadow: var(--shadow-md);
}

.credit-destination strong,
.credit-destination small {
  display: block;
}

.credit-destination small {
  margin-top: 4px;
  color: var(--text-muted);
  line-height: 1.45;
}

.destination-icon {
  flex: 0 0 44px;
  height: 44px;
  border-radius: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ecfdf5;
  color: var(--primary);
  font-size: .72rem;
  font-weight: 900;
}

.account-credit-note {
  margin-top: 8px;
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--text-muted);
}

.account-credit-note a {
  color: var(--primary);
  font-weight: 800;
  text-decoration: underline;
}

/* Post-Login Dashboard Grid Layout */
.dashboard-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 30px;
  align-items: start;
  min-width: 0;
}

@media (max-width: 900px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

.sidebar-col {
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-width: 0;
}

@media (min-width: 901px) {
  .sidebar-col {
    position: sticky;
    top: calc(var(--nav-height, 80px) + 30px);
    max-height: calc(100vh - var(--nav-height, 80px) - 70px);
    overflow-y: auto;
    padding-bottom: 20px;
    scrollbar-width: none;
  }
  .sidebar-col::-webkit-scrollbar {
    display: none;
  }
}

.main-col {
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-width: 0;
}

/* User Summary Box */
#userSummary {
  background: linear-gradient(135deg, var(--primary-dark) 0%, #1e293b 100%);
  color: #ffffff;
  padding: 24px;
  border-radius: 20px;
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

#welcomeLine {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: #fff;
  letter-spacing: -0.01em;
}

#usernameLine {
  font-size: 0.815rem;
  color: #94a3b8;
  overflow-wrap: anywhere;
  margin-bottom: 16px;
}

#creditsLine {
  font-size: 1.25rem;
  font-weight: 800;
  color: #2dd4bf !important;
  display: flex;
  align-items: center;
  gap: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 14px;
}

/* History List Styling */
#transcriptHistoryList {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

.history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line-color);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.5);
  transition: all 0.2s ease;
  min-width: 0;
}

.history-item:hover {
  background: #ffffff;
  border-color: rgba(15, 118, 110, 0.2);
  transform: translateX(2px);
  box-shadow: 0 4px 12px rgba(15, 118, 110, 0.03);
}

.history-meta {
  min-width: 0;
  flex: 1;
}

.history-title {
  font-weight: 700;
  font-size: 0.875rem;
  color: var(--primary-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

.history-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
}

.badge {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
}

.badge.web {
  background-color: #f0fdf4;
  color: #166534;
}

.badge.add-on {
  background-color: #f0f9ff;
  color: #075985;
}

/* Inputs and Forms */
input[type="file"] {
  display: block;
  width: 100%;
  padding: 16px;
  background: #f8fafc;
  border: 2px dashed var(--line-color);
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--text-muted);
  box-sizing: border-box;
}

input[type="file"]:hover {
  border-color: var(--primary);
  background: rgba(15, 118, 110, 0.02);
}

input, select, textarea {
  width: 100%;
  border: 1px solid var(--line-color);
  border-radius: 12px;
  padding: 12px 14px;
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--text-main);
  background: #ffffff;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

label {
  display: block;
  font-weight: 700;
  font-size: 0.815rem;
  margin-bottom: 6px;
  color: var(--text-main);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 14px;
}

/* Live Transcript Player and highlighting */
.live-transcript {
  min-height: 200px;
  max-height: 400px;
  overflow-y: auto;
  border: 1px solid var(--line-color);
  border-radius: 16px;
  padding: 20px;
  line-height: 1.85;
  background: #fbfdfd;
  font-size: 0.95rem;
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.02);
  scrollbar-width: thin;
  scrollbar-color: var(--line-color) transparent;
}

.live-word {
  padding: 3px 6px;
  margin: 0 2px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-block;
}

.live-word:hover {
  background-color: var(--primary-glow);
  color: var(--primary);
}

.live-word.active {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(15, 118, 110, 0.3);
  transform: scale(1.05);
}

/* Progress Logs inside sections */
.progress-log-container {
  background: #1e293b;
  color: #38bdf8;
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.78rem;
  padding: 14px;
  border-radius: 12px;
  margin-top: 14px;
  white-space: pre-wrap;
  max-height: 120px;
  overflow-y: auto;
  border: 1px solid rgba(255,255,255,0.05);
  overflow-wrap: anywhere;
}

/* Speaker Line Rendering in Interactive Player */
.speaker-line {
  margin-bottom: 12px;
  border-left: 3px solid var(--primary);
  padding-left: 12px;
}

.speaker-header {
  font-weight: 800;
  font-size: 0.78rem;
  color: var(--primary);
  text-transform: uppercase;
  margin-bottom: 2px;
}

/* Media Players */
audioPlayer, videoPlayer {
  outline: none;
}

#videoPlayer {
  box-shadow: var(--shadow-md);
  border: 1px solid var(--card-border);
}

.video-preview-stage {
  position: relative;
  margin-top: 12px;
  overflow: hidden;
  border-radius: 14px;
}

.video-subtitle-overlay {
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: 54px;
  z-index: 2;
  padding: 8px 14px;
  color: #fff;
  font-size: clamp(1rem, 2.4vw, 1.55rem);
  font-weight: 800;
  line-height: 1.3;
  text-align: center;
  text-shadow: 0 2px 4px #000, 0 0 8px #000;
  pointer-events: none;
  border-radius: 8px;
}

.subtitle-editor-wrap {
  margin-top: 18px;
}

.subtitle-style-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 16px;
}

.subtitle-color-control input[type="color"] {
  width: 100%;
  height: 48px;
  padding: 4px;
  cursor: pointer;
}

.transparent-background-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  cursor: pointer;
  font-weight: 700;
}

.transparent-background-toggle input {
  width: auto;
  margin: 0;
}

#subtitleEditor {
  min-height: 180px;
  line-height: 1.5;
  resize: vertical;
}

/* Footer style sync */
.footer {
  margin-top: 80px;
  background: transparent;
  border-top: 1px solid var(--card-border);
}

/* Responsive adjustment */
@media (max-width: 600px) {
  .nav {
    position: sticky;
  }

  .nav-inner {
    align-items: flex-start;
    padding: 12px 16px;
  }

  .brand {
    flex: 0 0 auto;
    margin-top: 7px;
  }

  .links {
    gap: 8px;
  }

  #navAuthText {
    flex-basis: 100%;
    margin-right: 0 !important;
    text-align: right;
  }

  .app-shell {
    margin-top: 28px;
    padding: 0 16px;
  }

  .app-shell h1 {
    font-size: 1.85rem;
    margin-bottom: 24px;
  }

  .login-portal-stack {
    gap: 18px;
  }

  .login-hero,
  .demo-row-heading,
  .credits-card-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .login-hero #gsiButton {
    margin: 8px 0 0;
  }

  .login-demo-panel {
    padding: 20px;
    border-radius: 18px;
  }

  .card.tool-card {
    padding: 20px;
    border-radius: 18px;
  }

  .transcript-animation {
    padding: 18px;
    margin-top: 0;
  }

  .workflow-track {
    align-items: stretch;
    flex-direction: column;
  }

  .workflow-stage {
    width: 100%;
  }

  .workflow-arrow {
    align-self: center;
    line-height: 1;
    transform: rotate(90deg);
  }

  .credit-destinations {
    grid-template-columns: 1fr;
  }

  .dashboard-grid,
  .sidebar-col,
  .main-col {
    gap: 16px;
  }

  .history-item {
    align-items: flex-start;
    flex-direction: column;
  }

  .history-item .btn {
    width: 100%;
  }

  .tool-actions {
    flex-wrap: wrap;
  }

  .tool-actions .btn {
    max-width: 100%;
  }

  .live-transcript {
    padding: 14px;
    font-size: 0.88rem;
  }

  .video-subtitle-overlay {
    left: 4%;
    right: 4%;
    bottom: 42px;
    padding: 6px 10px;
  }
}

@media (max-width: 400px) {
  .nav-inner {
    flex-direction: column;
  }

  .links,
  .links .btn {
    width: 100%;
  }

  #navAuthText {
    text-align: left;
  }

  .subtitle-style-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .anim-bars span,
  .anim-lines p {
    animation: none;
  }
}
}

/* Impact Subtitle Mode Styles */
.video-subtitle-overlay.impact-mode {
  text-transform: uppercase !important;
  font-family: 'Sora', 'Plus Jakarta Sans', 'Arial Black', sans-serif !important;
  font-weight: 800 !important;
  letter-spacing: -0.03em !important;
  background-color: rgba(0, 0, 0, 0.85) !important;
  border: 2px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 12px !important;
  padding: 10px 20px !important;
  display: inline-block !important;
  margin: 0 auto !important;
  left: 50% !important;
  right: auto !important;
  transform: translateX(-50%) !important;
  width: auto !important;
  min-width: 140px !important;
  max-width: 90% !important;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5), inset 0 1px 1px rgba(255, 255, 255, 0.2) !important;
  animation: subtitlePop 0.12s cubic-bezier(0.175, 0.885, 0.32, 1.275) both !important;
}

@keyframes subtitlePop {
  0% {
    transform: translateX(-50%) scale(0.85);
    opacity: 0.8;
  }
  100% {
    transform: translateX(-50%) scale(1.06);
    opacity: 1;
  }
}

