/* Custom Styles for Discord Bot Management Dashboard - Minimalist Monochrome */

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: #09090b;
}

code, pre, .font-mono {
  font-family: 'JetBrains Mono', monospace;
}

/* Custom Scrollbar - Clean & Minimal */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
::-webkit-scrollbar-track {
  background: #09090b;
}
::-webkit-scrollbar-thumb {
  background: #27272a;
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: #3f3f46;
}

/* Active Segmented Buttons - Minimalist High Contrast */
.setting-btn.active-btn,
.target-btn.active-btn,
.source-btn.active-btn,
.discord-output-btn.active-btn,
.modal-lang-btn.active-btn,
.modal-mode-btn.active-btn,
.view-mode-btn.active-btn,
.font-size-btn.active-btn {
  border-color: #e4e4e7 !important;
  background-color: #27272a !important;
  box-shadow: none !important;
  color: #ffffff !important;
}

.setting-btn.active-btn span,
.target-btn.active-btn span,
.source-btn.active-btn span,
.discord-output-btn.active-btn span {
  color: #ffffff !important;
}

.setting-btn.active-btn span.text-slate-400,
.setting-btn.active-btn span.text-zinc-400,
.setting-btn.active-btn span.text-\[10px\],
.setting-btn.active-btn span.text-\[9px\] {
  color: #a1a1aa !important;
}

/* Active Tab Navigation - Clean Crisp Pill */
.nav-tab {
  transition: all 0.15s ease;
}

.nav-tab.active-tab {
  background-color: #ffffff !important;
  color: #09090b !important;
  border-color: #ffffff !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) !important;
}

.nav-tab.active-tab i,
.nav-tab.active-tab svg {
  color: #09090b !important;
}

.nav-tab.active-tab span {
  color: #09090b !important;
}

/* Inactive Nav Tab Hover */
.nav-tab:not(.active-tab):hover {
  background-color: rgba(39, 39, 42, 0.6);
  color: #ffffff !important;
}

.nav-tab:not(.active-tab):hover i,
.nav-tab:not(.active-tab):hover svg,
.nav-tab:not(.active-tab):hover span {
  color: #ffffff !important;
}

.nav-tab#tab-btn-admin:not(.active-tab):hover {
  background-color: rgba(245, 158, 11, 0.15);
  color: #fcd34d !important;
}

/* Hide scrollbar for clean horizontal tab scrolling */
.no-scrollbar::-webkit-scrollbar {
  display: none;
}

.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Toast Notifications */
.toast {
  animation: slideIn 0.25s ease-out forwards;
}

.toast.toast-out {
  animation: slideOut 0.2s ease-in forwards;
}

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

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

/* Refresh Spinner */
.spin-anim {
  animation: spin 0.8s linear infinite;
}

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

/* Range input styling - Monochrome Track */
input[type="range"] {
  height: 4px;
  border-radius: 2px;
  accent-color: #ffffff;
}

/* Voice Waveform Equalizer Animation - Subtle Emerald Accent */
.waveform-container {
  display: flex;
  align-items: center;
  gap: 2.5px;
  height: 20px;
}

.waveform-bar {
  width: 2.5px;
  background: #10b981;
  border-radius: 1px;
  animation: waveformPulse 0.9s ease-in-out infinite alternate;
}

.waveform-bar:nth-child(1) { height: 5px; animation-delay: 0.1s; }
.waveform-bar:nth-child(2) { height: 14px; animation-delay: 0.3s; }
.waveform-bar:nth-child(3) { height: 18px; animation-delay: 0.5s; }
.waveform-bar:nth-child(4) { height: 10px; animation-delay: 0.2s; }
.waveform-bar:nth-child(5) { height: 15px; animation-delay: 0.4s; }

@keyframes waveformPulse {
  0% {
    transform: scaleY(0.25);
    opacity: 0.4;
  }
  100% {
    transform: scaleY(1);
    opacity: 1;
  }
}

/* View Panel Transitions */
.view-panel {
  display: none;
  opacity: 0;
  transition: opacity 0.15s ease-out;
}

.view-panel.active-panel {
  display: block;
  opacity: 1;
}

/* Reader Card Styling & Accents */
.reader-card {
  transition: all 0.2s ease;
  border-left: 3px solid transparent;
}

.reader-card.card-highlight {
  border-left-color: #71717a;
  background-color: rgba(39, 39, 42, 0.4);
}

.reader-card.card-ongoing {
  border-left-color: #10b981;
  background-color: rgba(16, 185, 129, 0.04);
}

.reader-font-sm .reader-text-trans { font-size: 0.9375rem; line-height: 1.5; }
.reader-font-sm .reader-text-orig { font-size: 0.8125rem; }

.reader-font-md .reader-text-trans { font-size: 1.125rem; line-height: 1.6; }
.reader-font-md .reader-text-orig { font-size: 0.875rem; }

.reader-font-lg .reader-text-trans { font-size: 1.375rem; line-height: 1.5; font-weight: 600; }
.reader-font-lg .reader-text-orig { font-size: 0.9375rem; }

/* Translation-only mode */
.reader-trans-only .reader-orig-block {
  display: none !important;
}

/* Fullscreen Reader Mode */
body.fullscreen-mode header,
body.fullscreen-mode footer,
body.fullscreen-mode #server-banner,
body.fullscreen-mode .hide-in-fullscreen {
  display: none !important;
}

body.fullscreen-mode #tab-client {
  max-width: 100% !important;
  padding: 1rem 2rem !important;
}

/* Form Validation & Input Error States */
.input-invalid {
  border-color: #ef4444 !important;
  background-color: rgba(239, 68, 68, 0.05) !important;
  box-shadow: 0 0 0 1px #ef4444 !important;
}
.input-invalid:focus {
  border-color: #f87171 !important;
  outline: none !important;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.3) !important;
}
@keyframes shakeError {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-5px); }
  40%, 80% { transform: translateX(5px); }
}
.shake-anim {
  animation: shakeError 0.35s ease-in-out;
}

/* Modal Animations & Backdrop */
.modal-backdrop-anim {
  animation: fadeIn 0.15s ease-out forwards;
}
.modal-dialog-anim {
  animation: zoomIn 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes zoomIn {
  from { opacity: 0; transform: scale(0.95) translateY(6px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

/* Toast Close Button & Interactions */
.toast-close-btn {
  opacity: 0.6;
  transition: opacity 0.15s ease;
}
.toast-close-btn:hover {
  opacity: 1;
}

/* Network Offline Pulse Alert */
.pulse-border-red {
  box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5);
  animation: pulseBorderRed 2s infinite;
}
@keyframes pulseBorderRed {
  0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5); }
  70% { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* Accessible High-Contrast Focus Ring */
:focus-visible {
  outline: 2px solid #6366f1 !important;
  outline-offset: 2px !important;
}

/* SVG Flags Utility */
.svg-flag {
  display: inline-block;
  width: 16px;
  height: 12px;
  border-radius: 2px;
  vertical-align: -1px;
  flex-shrink: 0;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.15);
}

/* High Legibility Subtitle Typography */
.reader-card .reader-text-trans,
.feed-card .reader-text-trans {
  color: #f4f4f5;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.reader-card .reader-text-orig,
.feed-card .reader-text-orig {
  color: #a1a1aa;
}

/* Accessibility: prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  *, ::before, ::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .pulse-border-red,
  .waveform-bar,
  .spin-anim,
  .shake-anim {
    animation: none !important;
  }
}

/* Unauthenticated Mode: Completely hide header & active speaker bar, center login card */
body.unauthenticated-mode #main-header,
body.unauthenticated-mode #active-speaker-bar {
  display: none !important;
}

body.unauthenticated-mode {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

body.unauthenticated-mode main {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 100%;
  margin: auto;
  padding: 2rem 1rem;
}

body.unauthenticated-mode #tab-dashboard {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

body.unauthenticated-mode #login-required-screen {
  margin: 0 auto;
  width: 100%;
}

