/* ==========================================================================
   TypeeTesting - Main Design System & Global Stylesheet
   Color Palette, Typography, CSS Variables, Glassmorphism, Layout & Components
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600;700&family=Noto+Sans+Devanagari:wght@400;600&family=Noto+Sans+Gujarati:wght@400;600&family=Poppins:wght@400;600;700&display=swap');

:root {
  /* Dark Theme Palette (Default) */
  --bg-primary: #0b0f19;
  --bg-secondary: #111827;
  --bg-tertiary: #1f2937;
  --bg-glass: rgba(17, 24, 39, 0.75);
  --bg-glass-card: rgba(31, 41, 55, 0.5);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(79, 70, 229, 0.4);
  
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-light: rgba(79, 70, 229, 0.15);
  --accent: #22c55e;
  --accent-light: rgba(34, 197, 94, 0.15);
  --danger: #ef4444;
  --danger-light: rgba(239, 68, 68, 0.15);
  --warning: #f59e0b;
  
  --text-main: #ffffff;
  --text-muted: #94a3b8;
  --text-subtle: #64748b;
  --text-untyped: #475569;
  
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.3);
  --shadow-md: 0 10px 25px -5px rgba(0,0,0,0.4), 0 8px 10px -6px rgba(0,0,0,0.4);
  --shadow-glow: 0 0 25px rgba(79, 70, 229, 0.35);

  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --font-gujarati: 'Noto Sans Gujarati', 'Inter', sans-serif;
  --font-hindi: 'Noto Sans Devanagari', 'Inter', sans-serif;
  --current-font: var(--font-mono);

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --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-bounce: 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Light Theme Variables */
[data-theme="light"] {
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f1f5f9;
  --bg-glass: rgba(255, 255, 255, 0.85);
  --bg-glass-card: rgba(241, 245, 249, 0.7);
  --border-color: rgba(0, 0, 0, 0.08);
  --border-hover: rgba(79, 70, 229, 0.5);

  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-subtle: #94a3b8;
  --text-untyped: #cbd5e1;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 10px 25px -5px rgba(0,0,0,0.08), 0 8px 10px -6px rgba(0,0,0,0.04);
  --shadow-glow: 0 0 20px rgba(79, 70, 229, 0.2);
}

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

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  line-height: 1.5;
  transition: background-color var(--transition-normal), color var(--transition-normal);
  position: relative;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  border: 2px solid var(--bg-primary);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-subtle);
}

/* App Container Layout */
#app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

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

/* Studio Ambient Lighting System */
.studio-light {
  position: fixed;
  pointer-events: none;
  z-index: 0;
  transition: opacity 0.5s ease, background 0.5s ease;
}

.studio-spotlight-top {
  top: -160px;
  left: 50%;
  transform: translateX(-50%);
  width: 900px;
  height: 550px;
  background: radial-gradient(ellipse at center, rgba(79, 70, 229, 0.35) 0%, rgba(139, 92, 246, 0.15) 45%, transparent 75%);
  filter: blur(90px);
  animation: studioSpotlightPulse 8s ease-in-out infinite alternate;
}

.studio-spotlight-bottom {
  bottom: -220px;
  right: 10%;
  width: 750px;
  height: 550px;
  background: radial-gradient(circle at center, rgba(34, 197, 94, 0.25) 0%, rgba(16, 185, 129, 0.1) 50%, transparent 75%);
  filter: blur(100px);
  animation: studioSpotlightPulse 10s ease-in-out infinite alternate-reverse;
}

/* Background Ambient Glow Effects */
.bg-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.45;
}
.bg-glow-1 {
  top: -100px;
  left: 20%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(79, 70, 229, 0.6) 0%, rgba(0, 0, 0, 0) 70%);
}
.bg-glow-2 {
  bottom: -150px;
  right: 15%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(34, 197, 94, 0.3) 0%, rgba(0, 0, 0, 0) 70%);
}

/* Light Theme Studio Lighting Adjustments */
[data-theme="light"] .studio-spotlight-top {
  background: radial-gradient(ellipse at center, rgba(79, 70, 229, 0.2) 0%, rgba(147, 51, 234, 0.08) 50%, transparent 75%);
  filter: blur(90px);
}
[data-theme="light"] .studio-spotlight-bottom {
  background: radial-gradient(circle at center, rgba(14, 165, 233, 0.18) 0%, rgba(59, 130, 246, 0.06) 50%, transparent 75%);
  filter: blur(90px);
}

@keyframes studioSpotlightPulse {
  0% { transform: translateX(-50%) scale(1) translateY(0); opacity: 0.8; }
  50% { transform: translateX(-50%) scale(1.15) translateY(20px); opacity: 1; }
  100% { transform: translateX(-48%) scale(1.05) translateY(-10px); opacity: 0.85; }
}

/* Header & Navigation Bar */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  transition: all var(--transition-normal);
}
.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-main);
  font-weight: 800;
  font-size: 1.4rem;
  letter-spacing: -0.02em;
}
.brand-logo-img {
  width: 42px;
  height: 42px;
  object-fit: contain;
  background: transparent;
  filter: drop-shadow(0 0 10px rgba(79, 70, 229, 0.5));
}
.logo-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--primary) 0%, #818cf8 100%);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  box-shadow: var(--shadow-glow);
  position: relative;
  overflow: hidden;
}

/* Right Aligned Navigation Group */
.nav-right-group {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-left: auto;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  list-style: none;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.85rem;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.92rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  cursor: pointer;
}
.nav-link:hover, .nav-link.active {
  color: var(--text-main);
  background: var(--bg-tertiary);
}
.nav-link.active {
  color: var(--primary);
  font-weight: 600;
}

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

/* Glassmorphism Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  outline: none;
  user-select: none;
  white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, #4338ca 100%);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.4);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(79, 70, 229, 0.6);
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
}
.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}
.btn-secondary:hover {
  background: var(--border-hover);
  border-color: var(--primary);
  color: #fff;
}

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

.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: var(--radius-md);
  background: var(--bg-tertiary);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
}
.btn-icon:hover {
  color: var(--text-main);
  border-color: var(--primary);
  background: var(--primary-light);
}

/* Section Header Shared Component */
.section-header {
  text-align: center;
  margin-bottom: 2.5rem;
}
.section-tag {
  display: inline-block;
  padding: 0.25rem 0.85rem;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.75rem;
  border: 1px solid rgba(79, 70, 229, 0.3);
}
.section-title {
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 0.75rem;
  color: var(--text-main);
}
.section-subtitle {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 600px;
  margin: 0 auto;
}

/* Dynamic Views Shell */
.view-section {
  display: none;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  padding: 2rem 0 4rem;
  flex: 1;
}
.view-section.active {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

/* Cards & Glass Containers */
.glass-card {
  background: var(--bg-glass-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  transition: all var(--transition-normal);
}
.glass-card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-md);
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
}
.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}
.modal-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 620px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 2rem;
  box-shadow: var(--shadow-md);
  transform: scale(0.95);
  transition: all var(--transition-bounce);
  position: relative;
}
.modal-overlay.active .modal-card {
  transform: scale(1);
}
.modal-close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  transition: color var(--transition-fast);
}
.modal-close:hover {
  color: var(--text-main);
}

/* Form Controls */
.form-group {
  margin-bottom: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.form-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
}
.form-input {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  outline: none;
  transition: border-color var(--transition-fast);
}
.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

/* Toast Notifications */
#toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.toast {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1.25rem;
  background: var(--bg-secondary);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  color: var(--text-main);
  font-size: 0.9rem;
  font-weight: 500;
  animation: slideInRight 0.3s ease forwards;
}
.toast.toast-success { border-color: var(--accent); }
.toast.toast-error { border-color: var(--danger); }
.toast.toast-warning { border-color: var(--warning); }

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

/* Footer */
.footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 3rem 0 2rem;
  margin-top: auto;
  position: relative;
  z-index: 10;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr repeat(2, 1fr);
  gap: 3rem;
  margin-bottom: 2.5rem;
}
.footer-brand p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 0.75rem;
  max-width: 300px;
}
.footer-col h4 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text-main);
}
.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.88rem;
  transition: color var(--transition-fast);
}
.footer-links a:hover {
  color: var(--primary);
}
.footer-bottom {
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-subtle);
  font-size: 0.85rem;
}

/* Responsive Utilities & Mobile Nav */
@media (max-width: 992px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .section-title { font-size: 1.85rem; }
}
@media (max-width: 768px) {
  .navbar .container { height: 64px; }
  #mobile-menu-toggle { display: flex !important; }
  .nav-menu {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    flex-direction: column;
    padding: 1rem;
    gap: 0.5rem;
    box-shadow: var(--shadow-md);
  }
  .nav-menu.mobile-open {
    display: flex !important;
  }
  .footer-grid { grid-template-columns: 1fr; gap: 2rem; }
  .footer-bottom { flex-direction: column; gap: 1rem; text-align: center; }
}
