/* YouAudioLab — Studio Signal theme */

:root {
  --yal-ink: #0b3d3a;
  --yal-ink-soft: #145a55;
  --yal-ink-deep: #072826;
  --yal-accent: #d97706;
  --yal-accent-soft: #f59e0b;
  --yal-accent-tint: rgba(217, 119, 6, 0.14);
  --yal-surface: #f4f7f6;
  --yal-surface-2: #eef3f1;
  --yal-card: #ffffff;
  --yal-border: rgba(11, 61, 58, 0.12);
  --yal-text: #14201f;
  --yal-muted: #5c6f6c;
  --yal-radius: 0.65rem;
  --yal-radius-lg: 0.9rem;
  --yal-shadow: 0 1px 2px rgba(11, 61, 58, 0.05), 0 4px 14px rgba(11, 61, 58, 0.06);
  --yal-ease: 180ms ease;
  --yal-font: "IBM Plex Sans", "Segoe UI", sans-serif;
  --yal-display: "Fraunces", Georgia, serif;

  /* Auth aliases (same system) */
  --primary-gradient-start: var(--yal-ink-deep);
  --primary-gradient-end: var(--yal-ink);
  --accent-color: var(--yal-ink-soft);
  --highlight-color: var(--yal-accent);
  --text-light: rgba(255, 255, 255, 0.88);
}

body {
  font-family: var(--yal-font);
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(20, 90, 85, 0.07), transparent 55%),
    var(--yal-surface);
  color: var(--yal-text);
  min-height: 100vh;
}

.badge {
  font-weight: 500;
}

/* —— Sidebar —— */
.sidebar {
  min-height: 100vh;
  background: linear-gradient(180deg, var(--yal-ink) 0%, var(--yal-ink-deep) 100%);
  color: white;
}

@media (min-width: 768px) {
  .sidebar {
    position: sticky;
    top: 0;
    align-self: flex-start;
    max-height: 100vh;
    overflow-y: auto;
  }
}

.sidebar h4,
.sidebar h4 a,
.login-logo h1 {
  font-family: var(--yal-display);
  letter-spacing: -0.02em;
}

.sidebar .nav-link {
  color: rgba(255, 255, 255, 0.72);
  padding: 0.7rem 1.1rem;
  border-radius: var(--yal-radius);
  margin: 0.1rem 0.45rem;
  border-left: 3px solid transparent;
  transition: background var(--yal-ease), color var(--yal-ease), border-color var(--yal-ease);
}

.sidebar .nav-link i {
  margin-right: 0.5rem;
}

.sidebar .nav-link:hover {
  background: rgba(255, 255, 255, 0.08);
  color: white;
}

.sidebar .nav-link.active {
  background: var(--yal-accent-tint);
  color: #fff8eb;
  border-left-color: var(--yal-accent-soft);
}

.sidebar hr {
  border-color: rgba(255, 255, 255, 0.12);
  opacity: 1;
}

.sidebar-section-label {
  color: rgba(255, 255, 255, 0.42);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.5rem 1.25rem 0.25rem;
  margin: 0;
}

.lang-flag-btn {
  background: rgba(255, 255, 255, 0.12);
  border: 2px solid transparent;
  border-radius: 8px;
  padding: 4px 8px;
  cursor: pointer;
  font-size: 1.15rem;
  line-height: 1;
  transition: background var(--yal-ease), border-color var(--yal-ease);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.lang-flag-btn:hover {
  background: rgba(255, 255, 255, 0.22);
}

.lang-flag-btn.active {
  border-color: var(--yal-accent-soft);
  background: var(--yal-accent-tint);
}

.auth-body .lang-flag-btn {
  background: rgba(255, 255, 255, 0.12);
}

.login-header .language-switcher {
  position: absolute;
  top: 0.75rem;
  right: 1rem;
  z-index: 10;
  margin-bottom: 0 !important;
}

.user-profile {
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--yal-radius);
  padding: 0.75rem;
  margin-bottom: 0.5rem;
}

.user-profile .username {
  font-weight: 600;
  color: white;
  font-size: 0.9rem;
}

.user-profile .user-email {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.5);
  word-break: break-all;
}

.btn-logout {
  background: rgba(217, 119, 6, 0.16);
  color: #ffd9a0;
  border: 1px solid rgba(245, 158, 11, 0.35);
  width: 100%;
  border-radius: var(--yal-radius);
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  transition: background var(--yal-ease), color var(--yal-ease);
}

.btn-logout:hover {
  background: rgba(217, 119, 6, 0.32);
  color: white;
}

/* —— Cards —— */
.card {
  background: var(--yal-card);
  box-shadow: var(--yal-shadow);
  border: 1px solid var(--yal-border);
}

.card-project {
  transition: box-shadow var(--yal-ease), border-color var(--yal-ease);
  cursor: pointer;
  border-radius: var(--yal-radius-lg);
}

.card-project:hover {
  box-shadow: 0 4px 18px rgba(11, 61, 58, 0.1);
  border-color: rgba(11, 61, 58, 0.22);
}

.stats-card {
  border: none;
  border-radius: var(--yal-radius-lg);
}

.workspace-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: rgba(11, 61, 58, 0.08);
  color: var(--yal-ink);
  font-size: 0.8rem;
  font-weight: 600;
}

.meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: rgba(217, 119, 6, 0.12);
  color: #92400e;
  font-size: 0.75rem;
  font-weight: 500;
}

.meta-pill i {
  font-size: 0.85rem;
}

/* —— Project navigation —— */
.project-nav {
  border-bottom: 1px solid var(--yal-border);
  margin-bottom: 1.5rem;
}

.project-nav .breadcrumb {
  font-size: 0.8rem;
  margin-bottom: 0.35rem;
}

.project-nav__bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.project-nav__title {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--yal-ink);
  text-decoration: none;
  transition: color var(--yal-ease);
}

.project-nav__title:hover {
  color: var(--yal-accent);
}

.project-tabs {
  display: flex;
  gap: 0.15rem;
  margin-bottom: -1px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.project-tab {
  flex: 0 0 auto;
  padding: 0.5rem 0.85rem;
  border: 1px solid transparent;
  border-bottom: 2px solid transparent;
  border-radius: 0.5rem 0.5rem 0 0;
  color: var(--yal-muted);
  font-size: 0.9rem;
  font-weight: 500;
  white-space: nowrap;
  text-decoration: none;
  transition: color var(--yal-ease), background var(--yal-ease);
}

.project-tab:hover {
  color: var(--yal-ink);
  background: rgba(11, 61, 58, 0.04);
}

.project-tab.active {
  color: var(--yal-ink);
  background: var(--yal-card);
  border-color: var(--yal-border);
  border-bottom-color: var(--yal-card);
  font-weight: 600;
  box-shadow: inset 0 -2px 0 var(--yal-accent);
}

.page-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.page-head__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

/* —— Alerts —— */
.alert {
  animation: yal-fade-in 0.28s ease;
}

@keyframes yal-fade-in {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.kbd {
  font-family: ui-monospace, "IBM Plex Mono", monospace;
  background: var(--yal-surface-2);
  border: 1px solid var(--yal-border);
  border-bottom-width: 2px;
  border-radius: 0.25rem;
  padding: 0.05rem 0.35rem;
  font-size: 0.8rem;
}

/* —— Bootstrap accent remap (app chrome) —— */
.btn-primary {
  --bs-btn-bg: var(--yal-ink);
  --bs-btn-border-color: var(--yal-ink);
  --bs-btn-hover-bg: var(--yal-ink-soft);
  --bs-btn-hover-border-color: var(--yal-ink-soft);
  --bs-btn-active-bg: var(--yal-ink-deep);
  --bs-btn-active-border-color: var(--yal-ink-deep);
  --bs-btn-disabled-bg: var(--yal-ink);
  --bs-btn-disabled-border-color: var(--yal-ink);
}

.btn-outline-primary {
  --bs-btn-color: var(--yal-ink);
  --bs-btn-border-color: var(--yal-ink);
  --bs-btn-hover-bg: var(--yal-ink);
  --bs-btn-hover-border-color: var(--yal-ink);
  --bs-btn-active-bg: var(--yal-ink-soft);
  --bs-btn-active-border-color: var(--yal-ink-soft);
}

.link-primary,
a.link-primary {
  color: var(--yal-ink-soft) !important;
}

/* ============================================
   Auth / login
   ============================================ */
body.auth-body {
  min-height: 100vh;
  background: linear-gradient(
    145deg,
    var(--yal-ink-deep) 0%,
    var(--yal-ink) 48%,
    var(--yal-ink-soft) 100%
  );
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  overflow-x: hidden;
  font-family: var(--yal-font);
}

.bg-animation {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.bg-animation .circle {
  position: absolute;
  border-radius: 50%;
  background: rgba(245, 158, 11, 0.07);
  animation: yal-float 22s infinite;
}

.bg-animation .circle:nth-child(1) {
  width: 300px;
  height: 300px;
  top: -150px;
  left: -150px;
}

.bg-animation .circle:nth-child(2) {
  width: 200px;
  height: 200px;
  bottom: -100px;
  right: -100px;
  animation-delay: -5s;
}

.bg-animation .circle:nth-child(3) {
  width: 150px;
  height: 150px;
  top: 50%;
  left: 50%;
  animation-delay: -10s;
}

.bg-animation .circle:nth-child(4) {
  width: 250px;
  height: 250px;
  top: 20%;
  right: 10%;
  animation-delay: -15s;
}

@keyframes yal-float {
  0%,
  100% {
    transform: translateY(0);
    opacity: 0.28;
  }
  50% {
    transform: translateY(-36px);
    opacity: 0.48;
  }
}

.login-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
}

.login-container.login-container--wide {
  max-width: 520px;
}

.login-card {
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(18px);
  border-radius: 18px;
  box-shadow: 0 18px 48px rgba(7, 40, 38, 0.28), 0 0 0 1px rgba(255, 255, 255, 0.12);
  overflow: hidden;
  animation: yal-slide-up 0.45s ease-out;
}

@keyframes yal-slide-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.login-header {
  background: linear-gradient(145deg, var(--yal-ink-deep), var(--yal-ink-soft));
  padding: 1.5rem 2rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.login-header::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.14) 0%, transparent 68%);
  animation: yal-pulse 10s ease-in-out infinite;
}

@keyframes yal-pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.45;
  }
  50% {
    transform: scale(1.08);
    opacity: 0.75;
  }
}

.login-logo {
  position: relative;
  z-index: 1;
}

.login-logo .logo-icon {
  width: 70px;
  height: 70px;
  background: rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.login-logo .logo-icon i {
  font-size: 2rem;
  color: #ffeccc;
}

.login-logo h1 {
  color: white;
  font-size: 1.85rem;
  font-weight: 650;
  margin-bottom: 0.25rem;
}

.login-logo p {
  color: var(--text-light);
  font-size: 0.9rem;
  margin-bottom: 0;
}

.login-body {
  padding: 2rem;
}

.login-body .form-label {
  font-weight: 600;
  color: var(--yal-text);
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
}

.login-body .form-label i {
  margin-right: 0.5rem;
  color: var(--yal-ink-soft);
}

.login-body .form-control {
  border: 2px solid #e2ebe8;
  border-radius: 12px;
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  background-color: var(--yal-surface);
  transition: border-color var(--yal-ease), box-shadow var(--yal-ease), background-color var(--yal-ease);
}

.login-body .form-control:focus {
  border-color: var(--yal-ink-soft);
  box-shadow: 0 0 0 4px rgba(20, 90, 85, 0.12);
  background-color: white;
}

.login-body .input-group {
  position: relative;
}

.login-body .input-group .form-control {
  padding-left: 2.75rem;
}

.login-body .input-group .form-control[type="password"],
.login-body .input-group .form-control[data-has-toggle] {
  padding-right: 2.75rem;
}

.login-body .input-group-text {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  z-index: 4;
  pointer-events: none;
  background: transparent;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-left: 1rem;
}

.login-body .input-group-text i {
  color: var(--yal-muted);
}

.login-body .password-toggle {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  z-index: 4;
  background: transparent;
  border: none;
  padding: 0 1rem;
  cursor: pointer;
  color: var(--yal-muted);
  display: flex;
  align-items: center;
}

.login-body .password-toggle:hover {
  color: var(--yal-accent);
}

.btn-login {
  background: linear-gradient(135deg, var(--yal-ink), var(--yal-ink-soft));
  border: none;
  border-radius: 12px;
  padding: 0.85rem;
  font-size: 1rem;
  font-weight: 600;
  color: white;
  width: 100%;
  transition: transform var(--yal-ease), box-shadow var(--yal-ease);
}

.btn-login:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(11, 61, 58, 0.3);
  color: white;
}

.login-footer {
  text-align: center;
  padding: 1.25rem;
  background: var(--yal-surface);
  border-top: 1px solid #e2ebe8;
}

.login-footer p {
  color: var(--yal-muted);
  font-size: 0.8rem;
  margin: 0;
}

.login-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid #e2ebe8;
}

.login-tabs button {
  flex: 1;
  border: none;
  background: transparent;
  padding: 0.65rem;
  font-weight: 600;
  color: var(--yal-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color var(--yal-ease), border-color var(--yal-ease);
}

.login-tabs button.active {
  color: var(--yal-ink);
  border-bottom-color: var(--yal-accent);
}

.login-tabs button:hover {
  color: var(--yal-ink);
}

.alert-custom {
  border-radius: 12px;
  border: none;
  font-size: 0.9rem;
}

@media (max-width: 767.98px) {
  .sidebar {
    min-height: auto;
  }
}

/* —— Global labels —— */
.label-color-swatch {
  display: inline-block;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 0.375rem;
  border: 1px solid var(--yal-border);
  vertical-align: middle;
}

.labels-table thead th {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--yal-muted);
  white-space: nowrap;
}

.labels-table tbody td {
  vertical-align: middle;
}

/* —— Account settings tabs —— */
.settings-panel .card-header {
  padding-bottom: 0;
}

.settings-tabs {
  border-bottom: 1px solid var(--yal-border);
  padding: 0 0.25rem;
}

/* —— Project overview —— */
.overview-cta-card {
  border-left: 4px solid var(--yal-accent);
}

.overview-stat-chip {
  border-radius: 0.65rem;
  padding: 0.75rem 0.5rem;
  text-align: center;
}

.overview-stat-chip__value {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.1;
}

.overview-stat-chip__label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.85;
}

.overview-stat-chip--blue {
  background: rgba(11, 61, 58, 0.1);
  color: var(--yal-ink);
}

.overview-stat-chip--green {
  background: #e6f4ea;
  color: #137333;
}

.overview-stat-chip--purple {
  background: rgba(217, 119, 6, 0.12);
  color: #92400e;
}

.overview-stat-chip--amber {
  background: #fef3c7;
  color: #b45309;
}

.transcript-tokens {
  white-space: pre-wrap;
  line-height: 1.8;
  font-size: 1.05rem;
  user-select: none;
}

.transcript-tokens .tok {
  display: inline;
  border-radius: 0.2rem;
  padding: 0.05rem 0.12rem;
  cursor: pointer;
}

.transcript-tokens .tok:hover {
  background: rgba(15, 118, 110, 0.12);
}

.transcript-tokens .tok.is-selected {
  background: rgba(217, 119, 6, 0.35);
  box-shadow: inset 0 0 0 1px rgba(180, 83, 9, 0.55);
}

.transcript-tokens .tok.has-span {
  box-shadow: inset 0 -3px 0 var(--span-color, #d97706);
  font-weight: 600;
}

.span-label-bar {
  padding: 0.75rem 0.85rem;
  background: rgba(217, 119, 6, 0.08);
  border: 1px solid rgba(180, 83, 9, 0.35);
  border-radius: var(--yal-radius);
}

.settings-savebar {
  z-index: 1020;
  padding: 0.65rem 0.85rem;
  background: rgba(244, 247, 246, 0.96);
  border: 1px solid var(--yal-border);
  border-radius: var(--yal-radius);
  box-shadow: var(--yal-shadow);
}
