/* ==========================================================================
   DEEPL PRO TRANSLATE - CORE DESIGN SYSTEM & MAIN STYLES
   ========================================================================== */

:root {
  /* Font Families */
  --font-display: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Transitions */
  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 0.35s cubic-bezier(0.16, 1, 0.3, 1);

  /* Border Radii */
  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;
}

/* ================= DARK THEME (DEFAULT) ================= */
[data-theme="dark"] {
  --bg-primary: #0a0e17;
  --bg-secondary: #111827;
  --bg-card: rgba(17, 24, 39, 0.75);
  --bg-card-hover: rgba(31, 41, 55, 0.85);
  --bg-elevated: #1f2937;
  --bg-input: #0d131f;
  --bg-glass: rgba(17, 24, 39, 0.65);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(0, 102, 255, 0.6);
  --border-glow: rgba(0, 212, 178, 0.4);

  --text-primary: #f9fafb;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  --text-inverse: #0f172a;

  --accent-primary: #0066ff;
  --accent-primary-hover: #1a75ff;
  --accent-primary-glow: rgba(0, 102, 255, 0.25);
  --accent-teal: #00d4b2;
  --accent-teal-glow: rgba(0, 212, 178, 0.25);
  --accent-purple: #8b5cf6;
  --accent-gold: #f59e0b;
  --accent-danger: #ef4444;

  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 16px -2px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 30px -4px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 25px rgba(0, 102, 255, 0.2);

  --scrollbar-thumb: #374151;
  --scrollbar-track: #111827;
}

/* ================= LIGHT THEME (DEFAULT) ================= */
[data-theme="light"] {
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --bg-elevated: #ffffff;
  --bg-input: #f8fafc;
  --bg-glass: #ffffff;
  --border-subtle: #e2e8f0;
  --border-focus: rgba(0, 102, 255, 0.5);
  --border-glow: rgba(0, 102, 255, 0.2);

  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --text-inverse: #ffffff;

  --accent-primary: #0052cc;
  --accent-primary-hover: #0043a6;
  --accent-primary-glow: rgba(0, 82, 204, 0.15);
  --accent-teal: #008775;
  --accent-teal-glow: rgba(0, 135, 117, 0.15);
  --accent-purple: #7c3aed;
  --accent-gold: #d97706;
  --accent-danger: #dc2626;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 3px 12px -2px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 8px 24px -4px rgba(0, 0, 0, 0.08);
  --shadow-glow: 0 0 18px rgba(0, 82, 204, 0.1);

  --scrollbar-thumb: #cbd5e1;
  --scrollbar-track: #f1f5f9;
}

/* ================= CSS RESET & BASE ================= */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 14px;
  scroll-behavior: smooth;
  height: 100%;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.45;
  min-height: 100%;
  position: relative;
  overflow-x: hidden;
  transition: background-color var(--transition-normal), color var(--transition-normal);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Background Ambient Glows */
.app-background-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.2;
  transition: opacity var(--transition-normal);
}

.glow-1 {
  top: -10%;
  left: 20%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, var(--accent-primary) 0%, transparent 70%);
}

.glow-2 {
  bottom: 5%;
  right: 15%;
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, var(--accent-teal) 0%, transparent 70%);
}

/* Main Container Shell - Full Screen */
.app-container {
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0.75rem 2rem 2rem 2rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
}

/* ================= HEADER NAVIGATION ================= */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0;
  margin-bottom: 1.75rem;
  border-bottom: 1px solid var(--border-subtle);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 2.25rem;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-primary);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
}

.logo-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-teal) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  box-shadow: 0 4px 12px var(--accent-primary-glow);
}

.logo-icon svg {
  width: 22px;
  height: 22px;
}

.logo-highlight {
  color: var(--accent-primary);
}

.pro-badge {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  padding: 2px 6px;
  margin-left: 6px;
  border-radius: var(--radius-xs);
  background: linear-gradient(135deg, var(--accent-teal) 0%, var(--accent-primary) 100%);
  color: #ffffff;
}

/* Mode Switcher Tabs */
.mode-nav {
  display: flex;
  background: var(--bg-card);
  padding: 4px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
  backdrop-filter: blur(12px);
}

.mode-tab {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 1.1rem;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.mode-tab svg {
  width: 17px;
  height: 17px;
}

.mode-tab:hover {
  color: var(--text-primary);
}

.mode-tab.active {
  background: var(--accent-primary);
  color: #ffffff;
  box-shadow: 0 2px 8px var(--accent-primary-glow);
}

.badge-new {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  background: rgba(0, 212, 178, 0.2);
  color: var(--accent-teal);
  border-radius: var(--radius-full);
  margin-left: 4px;
}

.mode-tab.active .badge-new {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

/* Header Right Controls */
.header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.header-btn {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: all var(--transition-fast);
  position: relative;
}

.header-btn svg {
  width: 17px;
  height: 17px;
}

.header-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: var(--border-focus);
}

.history-count-badge {
  background: var(--accent-primary);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: var(--radius-full);
}

/* Theme Toggle Button */
.theme-toggle-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.theme-toggle-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.theme-toggle-btn svg {
  width: 18px;
  height: 18px;
}

[data-theme="dark"] .sun-icon { display: block; }
[data-theme="dark"] .moon-icon { display: none; }
[data-theme="light"] .sun-icon { display: none; }
[data-theme="light"] .moon-icon { display: block; }

/* ================= TOAST NOTIFICATIONS ================= */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  z-index: 9999;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1.25rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-left: 4px solid var(--accent-primary);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  animation: toastIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  backdrop-filter: blur(12px);
  min-width: 260px;
}

.toast.toast-success {
  border-left-color: var(--accent-teal);
}

.toast.toast-error {
  border-left-color: var(--accent-danger);
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toastOut {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(10px) scale(0.95);
  }
}

/* ================= CUSTOM SCROLLBARS ================= */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-primary);
}

/* ================= MEDIA QUERIES ================= */
@media (max-width: 900px) {
  .app-container {
    padding: 1rem;
  }
  .app-header {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }
  .header-left {
    justify-content: space-between;
  }
  .header-right {
    justify-content: flex-end;
  }
  .header-btn .btn-text {
    display: none;
  }
}
