/* ==========================================================================
   PASO MEDYA AI - LUXURY DARK GLASSMORPHISM DESIGN SYSTEM
   ========================================================================== */

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

:root {
  /* Color Palette */
  --bg-primary: #07090e;
  --bg-secondary: #0d111a;
  --bg-surface: rgba(18, 24, 38, 0.7);
  --bg-surface-elevated: rgba(26, 35, 54, 0.85);
  --bg-surface-glass: rgba(15, 21, 34, 0.65);
  
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-active: rgba(0, 229, 255, 0.4);
  --border-glow: rgba(112, 0, 255, 0.3);
  
  --accent-cyan: #00e5ff;
  --accent-cyan-glow: rgba(0, 229, 255, 0.35);
  --accent-purple: #8a2be2;
  --accent-indigo: #6366f1;
  --accent-emerald: #00ffaa;
  --accent-rose: #ff2a70;
  --accent-amber: #ffb703;
  
  --gradient-primary: linear-gradient(135deg, #00e5ff 0%, #7928ca 50%, #ff0080 100%);
  --gradient-neon: linear-gradient(135deg, #00e5ff 0%, #6366f1 100%);
  --gradient-card: linear-gradient(180deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0.01) 100%);
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-highlight: #ffffff;
  
  /* Radii */
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 9999px;
  
  /* Shadows */
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.6);
  --shadow-neon: 0 0 25px rgba(0, 229, 255, 0.25);
  --shadow-purple-neon: 0 0 30px rgba(112, 0, 255, 0.3);
  
  /* 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.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  color-scheme: dark;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
  overflow-x: hidden;
  position: relative;
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(0, 229, 255, 0.07) 0%, transparent 40%),
    radial-gradient(circle at 85% 20%, rgba(138, 43, 226, 0.08) 0%, transparent 45%),
    radial-gradient(circle at 50% 85%, rgba(99, 102, 241, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse 60% 50% at 50% -20%, rgba(0, 229, 255, 0.15), rgba(255, 255, 255, 0));
  background-attachment: fixed;
}

/* Typography */
h1, h2, h3, h4, .font-display {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-highlight);
}

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

/* Layout Elements */
.app-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.container {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ==========================================================================
   HEADER & NAVIGATION
   ========================================================================== */
.main-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(7, 9, 14, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  transition: var(--transition-normal);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
  gap: 1.5rem;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
}

.logo-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: var(--gradient-neon);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-neon);
  position: relative;
  overflow: hidden;
}

.logo-icon::after {
  content: '';
  position: absolute;
  inset: 1px;
  background: var(--bg-secondary);
  border-radius: calc(var(--radius-sm) - 1px);
  z-index: 1;
}

.logo-icon svg {
  position: relative;
  z-index: 2;
  width: 24px;
  height: 24px;
  color: var(--accent-cyan);
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 1.35rem;
  font-weight: 800;
  background: linear-gradient(135deg, #ffffff 30%, var(--accent-cyan) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.1;
}

.brand-subtitle {
  font-size: 0.72rem;
  color: var(--text-secondary);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Navigation Tabs */
.nav-tabs {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.04);
  padding: 4px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
}

.nav-tab-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.15rem;
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: var(--transition-fast);
  white-space: nowrap;
}

.nav-tab-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.nav-tab-btn.active {
  color: #000;
  background: #ffffff;
  box-shadow: 0 2px 10px rgba(255, 255, 255, 0.25);
}

.nav-tab-btn svg {
  width: 16px;
  height: 16px;
}

/* Status Indicators */
.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.status-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-full);
  background: rgba(0, 255, 170, 0.08);
  border: 1px solid rgba(0, 255, 170, 0.25);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent-emerald);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--accent-emerald);
  box-shadow: 0 0 10px var(--accent-emerald);
  animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 255, 170, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(0, 255, 170, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 255, 170, 0); }
}

/* ==========================================================================
   MAIN CONTENT AREA
   ========================================================================== */
.main-content {
  flex: 1;
  padding: 2rem 0 3rem;
}

.tab-pane {
  display: none;
  animation: fadeIn 0.35s ease-out;
}

.tab-pane.active {
  display: block;
}

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

/* Hero Section */
.hero-banner {
  text-align: center;
  margin-bottom: 2.25rem;
  position: relative;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.9rem;
  border-radius: var(--radius-full);
  background: rgba(0, 229, 255, 0.08);
  border: 1px solid rgba(0, 229, 255, 0.25);
  color: var(--accent-cyan);
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.hero-title {
  font-size: clamp(2rem, 3.5vw, 3.25rem);
  line-height: 1.15;
  margin-bottom: 0.65rem;
}

.hero-title .gradient-text {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-desc {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 680px;
  margin: 0 auto;
}

/* ==========================================================================
   UPSCALER STUDIO LAYOUT
   ========================================================================== */
.upscaler-grid {
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 1.75rem;
  align-items: start;
}

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

/* Glass Card */
.glass-card {
  background: var(--bg-surface-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.glass-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
}

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

.card-title {
  font-size: 1.15rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.card-title svg {
  color: var(--accent-cyan);
}

/* Upload Area */
.dropzone-container {
  margin-bottom: 1.5rem;
}

.dropzone {
  border: 2px dashed rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  padding: 2.25rem 1.5rem;
  text-align: center;
  background: rgba(0, 0, 0, 0.25);
  cursor: pointer;
  transition: var(--transition-normal);
  position: relative;
}

.dropzone:hover, .dropzone.dragover {
  border-color: var(--accent-cyan);
  background: rgba(0, 229, 255, 0.04);
  box-shadow: var(--shadow-neon);
}

.dropzone-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 0.85rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-cyan);
  transition: var(--transition-fast);
}

.dropzone:hover .dropzone-icon {
  transform: scale(1.1);
  background: rgba(0, 229, 255, 0.15);
}

.dropzone-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.dropzone-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.file-input-hidden {
  display: none;
}

/* Sample Images Strip */
.sample-strip {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.85rem;
}

.sample-strip-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.sample-thumbs {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
}

.sample-thumb-btn {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-subtle);
  overflow: hidden;
  cursor: pointer;
  background: none;
  padding: 0;
  transition: var(--transition-fast);
  position: relative;
}

.sample-thumb-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sample-thumb-btn:hover {
  border-color: var(--accent-cyan);
  transform: scale(1.08);
}

/* Control Groups */
.control-group {
  margin-bottom: 1.35rem;
}

.control-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.65rem;
}

.control-label-value {
  color: var(--accent-cyan);
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
}

/* Scale Selector Buttons */
.scale-selector-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.65rem;
}

.scale-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.85rem 0.5rem;
  text-align: center;
  cursor: pointer;
  transition: var(--transition-fast);
  color: var(--text-secondary);
}

.scale-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

.scale-btn.active {
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.15), rgba(99, 102, 241, 0.2));
  border-color: var(--accent-cyan);
  color: var(--text-highlight);
  box-shadow: var(--shadow-neon);
}

.scale-btn-val {
  font-size: 1.25rem;
  font-weight: 800;
  font-family: 'Outfit', sans-serif;
  display: block;
}

.scale-btn-tag {
  font-size: 0.7rem;
  color: var(--text-muted);
  display: block;
  margin-top: 0.15rem;
}

.scale-btn.active .scale-btn-tag {
  color: var(--accent-cyan);
}

/* Feature Switches / Toggles */
.toggles-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.toggle-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0.9rem;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  transition: var(--transition-fast);
}

.toggle-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.toggle-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.toggle-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.toggle-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  display: block;
}

.toggle-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
  display: block;
}

/* Custom Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: rgba(255, 255, 255, 0.15);
  transition: 0.3s;
  border-radius: 24px;
}

.slider::before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 50%;
}

input:checked + .slider {
  background: var(--gradient-neon);
}

input:checked + .slider::before {
  transform: translateX(20px);
}

/* Custom Range Slider */
.range-input {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.1);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.range-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent-cyan);
  cursor: pointer;
  box-shadow: 0 0 10px var(--accent-cyan);
  transition: transform 0.1s;
}

.range-input::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

/* Format Picker */
.format-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.format-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  padding: 0.55rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  text-align: center;
  transition: var(--transition-fast);
}

.format-btn.active {
  background: rgba(0, 229, 255, 0.15);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

/* Primary Action Buttons */
.btn-primary-glow {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  background: var(--gradient-neon);
  color: #000;
  font-size: 1rem;
  font-weight: 700;
  padding: 0.95rem 1.5rem;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: var(--transition-normal);
  box-shadow: var(--shadow-neon);
  margin-top: 1.25rem;
}

.btn-primary-glow:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 30px rgba(0, 229, 255, 0.5);
}

.btn-primary-glow:active {
  transform: translateY(0);
}

.btn-primary-glow:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ==========================================================================
   VIEWER & COMPARISON PANEL
   ========================================================================== */
.viewer-card {
  min-height: 600px;
  display: flex;
  flex-direction: column;
}

.viewer-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
}

.viewer-stats-strip {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  font-size: 0.8rem;
}

.stat-pill {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-secondary);
}

.stat-pill strong {
  color: var(--text-primary);
  font-family: 'JetBrains Mono', monospace;
}

.viewer-tools {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tool-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  padding: 0.4rem 0.65rem;
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  transition: var(--transition-fast);
}

.tool-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.tool-btn.active {
  background: var(--accent-cyan);
  color: #000;
  border-color: var(--accent-cyan);
}

/* Viewer Screen Area */
.viewer-screen {
  flex: 1;
  background: #000;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 480px;
}

/* Empty State */
.viewer-empty {
  text-align: center;
  padding: 3rem 1.5rem;
  max-width: 400px;
}

.empty-icon-pulse {
  width: 72px;
  height: 72px;
  margin: 0 auto 1.25rem;
  border-radius: 50%;
  background: rgba(0, 229, 255, 0.08);
  border: 1px solid rgba(0, 229, 255, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-cyan);
}

.viewer-empty h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.viewer-empty p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Loading Overlay */
.viewer-loader {
  position: absolute;
  inset: 0;
  background: rgba(7, 9, 14, 0.85);
  backdrop-filter: blur(8px);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

.viewer-loader.active {
  display: flex;
}

.spinner-neon {
  width: 54px;
  height: 54px;
  border: 3px solid rgba(0, 229, 255, 0.15);
  border-top-color: var(--accent-cyan);
  border-right-color: var(--accent-purple);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 1.25rem;
}

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

.loader-status-text {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
}

.loader-step-text {
  font-size: 0.8rem;
  color: var(--accent-cyan);
  font-family: 'JetBrains Mono', monospace;
}

/* Download Bar Bottom */
.viewer-bottombar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle);
  flex-wrap: wrap;
  gap: 1rem;
}

.res-comparison-badge {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.85rem;
}

.badge-tag {
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-xs);
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
}

.badge-before {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
}

.badge-after {
  background: rgba(0, 229, 255, 0.15);
  color: var(--accent-cyan);
  border: 1px solid rgba(0, 229, 255, 0.3);
}

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

.btn-download {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--accent-emerald);
  color: #000;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0.75rem 1.4rem;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: var(--transition-normal);
  text-decoration: none;
  box-shadow: 0 0 20px rgba(0, 255, 170, 0.3);
}

.btn-download:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 30px rgba(0, 255, 170, 0.5);
}

/* ==========================================================================
   AI ASSISTANT CHAT TAB
   ========================================================================== */
.chat-container-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 1.75rem;
  height: 720px;
}

@media (max-width: 900px) {
  .chat-container-layout {
    grid-template-columns: 1fr;
    height: auto;
  }
}

.chat-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.quick-prompts-card {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.quick-prompts-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  overflow-y: auto;
}

.quick-prompt-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.85rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition-fast);
  text-align: left;
  line-height: 1.4;
}

.quick-prompt-item:hover {
  background: rgba(0, 229, 255, 0.08);
  border-color: rgba(0, 229, 255, 0.3);
  color: var(--text-primary);
  transform: translateX(4px);
}

.chat-main-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.chat-messages-area {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.chat-msg {
  display: flex;
  gap: 0.85rem;
  max-width: 85%;
  animation: fadeIn 0.25s ease-out;
}

.chat-msg.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.chat-msg.ai {
  align-self: flex-start;
}

.chat-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.chat-msg.ai .chat-avatar {
  background: var(--gradient-neon);
  color: #000;
  box-shadow: var(--shadow-neon);
}

.chat-msg.user .chat-avatar {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.chat-bubble {
  padding: 0.9rem 1.15rem;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  line-height: 1.6;
}

.chat-msg.ai .chat-bubble {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
}

.chat-msg.user .chat-bubble {
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.2), rgba(99, 102, 241, 0.3));
  border: 1px solid var(--border-active);
  color: #fff;
}

.chat-bubble p {
  margin-bottom: 0.5rem;
}
.chat-bubble p:last-child {
  margin-bottom: 0;
}
.chat-bubble code {
  background: rgba(0, 0, 0, 0.4);
  padding: 0.15rem 0.35rem;
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8em;
}

/* Chat Input Bar */
.chat-input-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle);
}

.chat-input {
  flex: 1;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.15rem;
  font-size: 0.9rem;
  color: var(--text-primary);
  outline: none;
  transition: var(--transition-fast);
}

.chat-input:focus {
  border-color: var(--accent-cyan);
  box-shadow: var(--shadow-neon);
}

.btn-send {
  background: var(--gradient-neon);
  border: none;
  border-radius: var(--radius-md);
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #000;
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-send:hover {
  transform: scale(1.05);
}

/* ==========================================================================
   MEDIA TOOLBOX & SYSTEM TABS
   ========================================================================== */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.tool-card {
  background: var(--bg-surface-glass);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: var(--transition-normal);
  cursor: pointer;
}

.tool-card:hover {
  border-color: var(--accent-cyan);
  transform: translateY(-4px);
  box-shadow: var(--shadow-neon);
}

.tool-card-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  background: rgba(0, 229, 255, 0.1);
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

.tool-card h4 {
  font-size: 1.1rem;
  margin-bottom: 0.35rem;
}

.tool-card p {
  font-size: 0.825rem;
  color: var(--text-muted);
}

/* System Diagnostic Cards */
.diagnostic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
}

.diag-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  margin-bottom: 0.65rem;
}

.diag-item span:first-child {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.diag-item span:last-child {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-cyan);
}

/* ==========================================================================
   TOAST NOTIFICATION SYSTEM
   ========================================================================== */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.toast {
  background: rgba(18, 24, 38, 0.95);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.9rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-primary);
  font-size: 0.875rem;
  box-shadow: var(--shadow-lg);
  animation: slideInRight 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  max-width: 380px;
}

.toast.success {
  border-color: rgba(0, 255, 170, 0.4);
}
.toast.success svg {
  color: var(--accent-emerald);
}

.toast.error {
  border-color: rgba(255, 42, 112, 0.4);
}
.toast.error svg {
  color: var(--accent-rose);
}

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

/* ==========================================================================
   FOOTER
   ========================================================================== */
.main-footer {
  border-top: 1px solid var(--border-subtle);
  background: rgba(7, 9, 14, 0.8);
  padding: 1.75rem 0;
  margin-top: auto;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-copy {
  font-size: 0.825rem;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.footer-link {
  font-size: 0.825rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: var(--transition-fast);
}

.footer-link:hover {
  color: var(--accent-cyan);
}
