/* ==========================================================================
   BURMESE AUTO SUBTITLES - PREMIUM ADMIN UI DESIGN SYSTEM
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&family=Pyidaungsu:wght@400;700&display=swap');

:root {
  --bg-base: #080b11;
  --bg-card: rgba(16, 22, 34, 0.85);
  --bg-surface: #121826;
  --bg-input: rgba(10, 14, 22, 0.75);
  
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-focus: #6366f1;
  --border-card: rgba(255, 255, 255, 0.06);

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --accent-primary: #6366f1;
  --accent-hover: #4f46e5;
  --accent-cyan: #06b6d4;
  --accent-gradient: linear-gradient(135deg, #6366f1 0%, #3b82f6 50%, #06b6d4 100%);

  --danger: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.12);
  --success: #10b981;
  --success-bg: rgba(16, 185, 129, 0.12);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-full: 9999px;

  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: 'Outfit', 'Pyidaungsu', -apple-system, sans-serif;
  background-color: var(--bg-base);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  position: relative;
  overflow-x: hidden;
}

.myanmar-font {
  font-family: 'Pyidaungsu', 'Outfit', sans-serif !important;
}

/* Ambient Background Glow */
.bg-ambient {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 900px;
  height: 500px;
  background: radial-gradient(circle at 50% 30%, rgba(99, 102, 241, 0.15), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
  position: relative;
  z-index: 1;
}

/* ==========================================================================
   PASSWORD LOGIN GATE (CENTERED FULL-SCREEN CARD)
   ========================================================================== */

.login-gate-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 80vh;
}

.login-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  max-width: 440px;
  width: 100%;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
  text-align: center;
  animation: fadeIn 0.3s ease-out;
}

.login-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.9rem;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  color: #a5b4fc;
  margin-bottom: 1.25rem;
}

.login-card h1 {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.login-card p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1.75rem;
}

/* ==========================================================================
   HEADER & NAVBAR
   ========================================================================== */

.app-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
}

.brand-badge {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  font-size: 1.05rem;
}

.brand-flag {
  font-size: 1.25rem;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.admin-tag {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
}

/* ==========================================================================
   CARDS & SECTIONS
   ========================================================================== */

.card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 1.75rem 2rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.5rem;
}

.card-header h2 {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #fff;
}

.card-header p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

/* Form Controls */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.45rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-input, select.form-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  color: var(--text-main);
  font-family: inherit;
  outline: none;
  transition: var(--transition);
}

.form-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.7rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  text-decoration: none;
}

.btn-primary {
  background: var(--accent-gradient);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
}

.btn-primary:hover {
  opacity: 0.92;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

.btn-secondary {
  background: #1e293b;
  color: #f1f5f9;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-secondary:hover {
  background: #334155;
  color: #fff;
}

.btn-outline {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-sm {
  padding: 0.4rem 0.8rem;
  font-size: 0.82rem;
}

.btn-danger {
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.25);
}

/* ==========================================================================
   ONE-TIME SLUGS LIST & TABLE
   ========================================================================== */

.slug-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.slug-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1.1rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.slug-item:hover {
  border-color: rgba(99, 102, 241, 0.35);
}

.slug-meta {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.slug-url {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.88rem;
  color: #818cf8;
  font-weight: 600;
}

.slug-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-full);
}

.slug-tag.ready {
  background: var(--success-bg);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.slug-tag.claimed {
  background: var(--danger-bg);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.slug-actions {
  display: flex;
  gap: 0.4rem;
}

/* ==========================================================================
   PLAYGROUND & TESTER
   ========================================================================== */

.editor-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1rem;
}

.editor-box {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.code-area {
  width: 100%;
  height: 160px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.9rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  color: #e2e8f0;
  resize: vertical;
  outline: none;
}

.code-area:focus {
  border-color: var(--border-focus);
}

/* Toast */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  background: #1e293b;
  border: 1px solid var(--border-subtle);
  border-left: 4px solid var(--accent-primary);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1.25rem;
  color: #fff;
  font-size: 0.88rem;
  font-weight: 500;
  box-shadow: 0 10px 25px rgba(0,0,0,0.5);
  animation: slideIn 0.2s ease-out;
}

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

@keyframes slideIn {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: translateX(0); }
}

@media (max-width: 768px) {
  .container { padding: 1.5rem 1rem; }
  .editor-grid { grid-template-columns: 1fr; }
  .slug-item { flex-direction: column; align-items: flex-start; }
}

/* ==========================================================================
   SUBTITLE CACHE STUDIO & MODAL STYLES
   ========================================================================== */

.cache-list {
  display: flex;
  flex-direction: column;
}

.cache-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 1.1rem;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-card);
  transition: var(--transition);
  flex-wrap: wrap;
  gap: 0.75rem;
}

.cache-item:last-child {
  border-bottom: none;
}

.cache-item:hover {
  background: rgba(255, 255, 255, 0.02);
}

.cache-meta {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.cache-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: #f1f5f9;
}

.cache-path {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  color: #94a3b8;
}

.studio-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(10, 15, 29, 0.85);
  backdrop-filter: blur(8px);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.studio-modal-content {
  width: 100%;
  max-width: 1360px;
  height: 92vh;
  background: var(--bg-card);
  border: 1px solid var(--border-focus);
  border-radius: var(--radius-md);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: fadeIn 0.2s ease-out;
}

.studio-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.2rem 1.5rem;
  background: rgba(15, 23, 42, 0.9);
  border-bottom: 1px solid var(--border-subtle);
  flex-wrap: wrap;
  gap: 1rem;
}

.studio-table th {
  position: sticky;
  top: 0;
  background: #111827;
  z-index: 2;
}

.studio-table td {
  padding: 0.6rem 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  vertical-align: top;
}

.studio-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.cue-time-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.cue-time-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  padding: 0.35rem 0.5rem;
  color: #a5b4fc;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  outline: none;
}

.cue-time-input:focus {
  border-color: var(--accent-primary);
}

.cue-english-box {
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-left: 3px solid #38bdf8;
  border-radius: 4px;
  padding: 0.5rem 0.75rem;
  font-family: var(--font-sans);
  font-size: 0.88rem;
  color: #cbd5e1;
  line-height: 1.45;
  min-height: 44px;
  user-select: text;
  display: flex;
  align-items: center;
}

.cue-english-box.empty {
  color: var(--text-dim);
  font-style: italic;
  border-left-color: rgba(255, 255, 255, 0.2);
}

.cue-text-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-left: 3px solid #6366f1;
  border-radius: 4px;
  padding: 0.45rem 0.65rem;
  color: #fff;
  font-family: 'Pyidaungsu', var(--font-sans);
  font-size: 0.95rem;
  line-height: 1.5;
  resize: vertical;
  min-height: 44px;
  outline: none;
}

.cue-text-input:focus {
  border-color: var(--accent-primary);
  background: #0f172a;
}

.burmese-only .col-english {
  display: none !important;
}

/* ==========================================================================
   VISUAL HOVER TOOLTIPS SYSTEM
   ========================================================================== */

[data-tooltip] {
  position: relative;
}

[data-tooltip]::before {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: #0f172a;
  color: #f8fafc;
  font-family: var(--font-sans);
  font-size: 0.76rem;
  font-weight: 500;
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1), transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 10000;
}

[data-tooltip]::after {
  content: '';
  position: absolute;
  bottom: calc(100% + 2px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  border-width: 5px 5px 0 5px;
  border-style: solid;
  border-color: #0f172a transparent transparent transparent;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1), transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 10000;
}

[data-tooltip]:hover::before,
[data-tooltip]:hover::after {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* Tooltip position modifier: bottom */
[data-tooltip-pos="bottom"]::before {
  bottom: auto;
  top: calc(100% + 8px);
  transform: translateX(-50%) translateY(-4px);
}

[data-tooltip-pos="bottom"]::after {
  bottom: auto;
  top: calc(100% + 2px);
  border-width: 0 5px 5px 5px;
  border-color: transparent transparent #0f172a transparent;
  transform: translateX(-50%) translateY(-4px);
}

[data-tooltip-pos="bottom"]:hover::before,
[data-tooltip-pos="bottom"]:hover::after {
  transform: translateX(-50%) translateY(0);
}

/* Circular Close Button */
.close-btn-round {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #94a3b8;
  font-size: 1rem;
  cursor: pointer;
  transition: var(--transition);
  padding: 0;
}

.close-btn-round:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.5);
  color: #f87171;
  transform: rotate(90deg);
}

