/* ═══════════════════════════════════════════════════════════
   UNITED AGI - Main Styles
   ═══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Plus+Jakarta+Sans:wght@600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');
@import url('variables.css');

/* ═══════════════════════════════════════════════════════════
   RESET & BASE
   ═══════════════════════════════════════════════════════════ */

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-primary);
  transition: background var(--transition-base), color var(--transition-base);
  overflow-x: hidden;
}

::selection {
  background: var(--primary-500);
  color: white;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

/* ═══════════════════════════════════════════════════════════
   LAYOUT
   ═══════════════════════════════════════════════════════════ */

.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--space-xl);
}

.section {
  padding: var(--space-4xl) 0;
  position: relative;
}

/* ═══════════════════════════════════════════════════════════
   NAVIGATION
   ═══════════════════════════════════════════════════════════ */

.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-sticky);
  padding: var(--space-md) 0;
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-light);
  transition: all var(--transition-base);
}

.navbar.scrolled {
  padding: var(--space-sm) 0;
  box-shadow: var(--shadow-md);
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.nav-brand-logo {
  width: 42px;
  height: 42px;
  transition: transform var(--transition-slow);
}

.nav-brand:hover .nav-brand-logo {
  transform: rotate(360deg);
}

.nav-brand-text {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: var(--space-xl);
  list-style: none;
}

.nav-link {
  position: relative;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color var(--transition-fast);
  padding: var(--space-sm) 0;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--gradient-primary);
  transition: width var(--transition-base);
}

.nav-link:hover,
.nav-link.active {
  color: var(--text-primary);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

/* Theme Toggle */
.theme-toggle {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-light);
  transition: all var(--transition-fast);
}

.theme-toggle:hover {
  color: var(--primary-500);
  border-color: var(--primary-500);
  background: var(--primary-50);
}

[data-theme="dark"] .theme-toggle:hover {
  background: rgba(139, 92, 246, 0.1);
}

.theme-toggle .icon-sun,
[data-theme="dark"] .theme-toggle .icon-moon {
  display: none;
}

[data-theme="dark"] .theme-toggle .icon-sun {
  display: block;
}

/* Mobile Menu */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 28px;
  padding: var(--space-sm);
}

.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--text-primary);
  border-radius: var(--radius-full);
  transition: all var(--transition-fast);
}

@media (max-width: 1024px) {
  .nav-menu {
    display: none;
  }
  
  .nav-toggle {
    display: flex;
  }
}

/* ═══════════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════════ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-xl);
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius-lg);
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.btn-primary {
  background: var(--gradient-primary);
  color: white;
  box-shadow: var(--shadow-md), 0 0 20px rgba(139, 92, 246, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg), 0 0 30px rgba(139, 92, 246, 0.4);
}

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-medium);
}

.btn-secondary:hover {
  border-color: var(--primary-500);
  color: var(--primary-600);
}

.btn-ghost {
  color: var(--text-secondary);
  padding: var(--space-sm) var(--space-md);
}

.btn-ghost:hover {
  color: var(--primary-500);
  background: var(--primary-50);
}

[data-theme="dark"] .btn-ghost:hover {
  background: rgba(139, 92, 246, 0.1);
}

.btn-lg {
  padding: var(--space-lg) var(--space-2xl);
  font-size: 1.05rem;
}

.btn-icon {
  width: 44px;
  height: 44px;
  padding: 0;
}

/* ═══════════════════════════════════════════════════════════
   HERO SECTION
   ═══════════════════════════════════════════════════════════ */

.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 100px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--gradient-mesh);
  opacity: 0.5;
  pointer-events: none;
}

.hero-bg-grid {
  position: absolute;
  inset: 0;
  background-image: 
    linear-gradient(var(--border-light) 1px, transparent 1px),
    linear-gradient(90deg, var(--border-light) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 70%);
  opacity: 0.5;
}

.hero-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.4;
  animation: float 20s ease-in-out infinite;
}

.hero-orb-1 {
  width: 600px;
  height: 600px;
  background: var(--primary-500);
  top: -200px;
  right: -200px;
  animation-delay: 0s;
}

.hero-orb-2 {
  width: 400px;
  height: 400px;
  background: var(--accent-pink);
  bottom: -100px;
  left: -100px;
  animation-delay: -10s;
}

.hero-orb-3 {
  width: 300px;
  height: 300px;
  background: var(--accent-cyan);
  top: 50%;
  left: 50%;
  animation-delay: -5s;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(30px, -30px) scale(1.05); }
  50% { transform: translate(-20px, 20px) scale(0.95); }
  75% { transform: translate(20px, 10px) scale(1.02); }
}

.hero .container {
  position: relative;
  z-index: 1;
}

.hero-content {
  max-width: 800px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: var(--space-xl);
  animation: fadeInUp 0.6s ease-out;
}

.hero-badge-dot {
  width: 8px;
  height: 8px;
  background: var(--accent-emerald);
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.2); }
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: var(--space-xl);
  animation: fadeInUp 0.6s ease-out 0.1s both;
}

.hero-title-gradient {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-description {
  font-size: 1.25rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin-bottom: var(--space-2xl);
  animation: fadeInUp 0.6s ease-out 0.2s both;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  animation: fadeInUp 0.6s ease-out 0.3s both;
}

.hero-stats {
  display: flex;
  gap: var(--space-3xl);
  margin-top: var(--space-4xl);
  padding-top: var(--space-2xl);
  border-top: 1px solid var(--border-light);
  animation: fadeInUp 0.6s ease-out 0.4s both;
}

.hero-stat {
  text-align: left;
}

.hero-stat-value {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 700;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-stat-label {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: var(--space-xs);
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ═══════════════════════════════════════════════════════════
   CARDS
   ═══════════════════════════════════════════════════════════ */

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: var(--space-2xl);
  transition: all var(--transition-base);
}

.card:hover {
  border-color: var(--primary-300);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  transform: translateY(-4px);
}

.card-icon {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gradient-primary);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-lg);
  color: white;
}

.card-icon svg {
  width: 28px;
  height: 28px;
}

.card-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: var(--space-md);
}

.card-description {
  color: var(--text-secondary);
  line-height: 1.7;
}

/* ═══════════════════════════════════════════════════════════
   SERVICES GRID
   ═══════════════════════════════════════════════════════════ */

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: var(--space-xl);
}

/* ═══════════════════════════════════════════════════════════
   SECTION HEADERS
   ═══════════════════════════════════════════════════════════ */

.section-header {
  max-width: 700px;
  margin: 0 auto var(--space-3xl);
  text-align: center;
}

.section-label {
  display: inline-block;
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--primary-500);
  margin-bottom: var(--space-md);
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  margin-bottom: var(--space-lg);
}

.section-description {
  font-size: 1.125rem;
  color: var(--text-secondary);
}

/* ═══════════════════════════════════════════════════════════
   FEATURES SECTION
   ═══════════════════════════════════════════════════════════ */

.features-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-xl);
}

@media (max-width: 1024px) {
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .features-grid {
    grid-template-columns: 1fr;
  }
}

.feature-card {
  text-align: center;
  padding: var(--space-2xl);
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  transition: all var(--transition-base);
}

.feature-card:hover {
  border-color: var(--primary-300);
  background: var(--bg-secondary);
}

.feature-value {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 800;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: var(--space-sm);
}

.feature-label {
  font-weight: 600;
  margin-bottom: var(--space-sm);
}

.feature-description {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* ═══════════════════════════════════════════════════════════
   CTA SECTION
   ═══════════════════════════════════════════════════════════ */

.cta-section {
  background: var(--gradient-dark);
  position: relative;
  overflow: hidden;
}

.cta-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--gradient-mesh);
  opacity: 0.3;
}

.cta-content {
  position: relative;
  z-index: 1;
  text-align: center;
  color: white;
  max-width: 700px;
  margin: 0 auto;
}

.cta-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  margin-bottom: var(--space-lg);
}

.cta-description {
  font-size: 1.125rem;
  opacity: 0.9;
  margin-bottom: var(--space-2xl);
}

/* ═══════════════════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════════════════ */

.footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-light);
  padding: var(--space-4xl) 0 var(--space-xl);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr repeat(3, 1fr);
  gap: var(--space-3xl);
  margin-bottom: var(--space-3xl);
}

@media (max-width: 1024px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }
}

.footer-brand {
  max-width: 300px;
}

.footer-brand-logo {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.footer-brand-logo img {
  width: 40px;
  height: 40px;
}

.footer-brand-logo span {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
}

.footer-brand-description {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: var(--space-lg);
}

.footer-social {
  display: flex;
  gap: var(--space-sm);
}

.footer-social a {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-lg);
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.footer-social a:hover {
  background: var(--primary-500);
  color: white;
}

.footer-column h4 {
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-lg);
  color: var(--text-primary);
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: var(--space-md);
}

.footer-links a {
  color: var(--text-secondary);
  font-size: 0.95rem;
  transition: color var(--transition-fast);
}

.footer-links a:hover {
  color: var(--primary-500);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: var(--space-xl);
  border-top: 1px solid var(--border-light);
  font-size: 0.875rem;
  color: var(--text-muted);
}

@media (max-width: 640px) {
  .footer-bottom {
    flex-direction: column;
    gap: var(--space-md);
    text-align: center;
  }
}

.footer-legal {
  display: flex;
  gap: var(--space-xl);
}

.footer-legal a {
  color: var(--text-muted);
  transition: color var(--transition-fast);
}

.footer-legal a:hover {
  color: var(--primary-500);
}

/* ═══════════════════════════════════════════════════════════
   UTILITIES
   ═══════════════════════════════════════════════════════════ */

.text-gradient {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.glass {
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-light);
}

/* ═══════════════════════════════════════════════════════════
   CHAT WIDGET
   ═══════════════════════════════════════════════════════════ */

.chat-widget {
  position: fixed;
  bottom: var(--space-xl);
  right: var(--space-xl);
  z-index: var(--z-modal);
}

.chat-toggle {
  width: 60px;
  height: 60px;
  border-radius: var(--radius-full);
  background: var(--gradient-primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  transition: all var(--transition-fast);
}

.chat-toggle:hover {
  transform: scale(1.1);
}

.chat-toggle svg {
  width: 28px;
  height: 28px;
}

.chat-window {
  position: absolute;
  bottom: 80px;
  right: 0;
  width: 400px;
  height: 550px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-xl);
  display: none;
  flex-direction: column;
  overflow: hidden;
}

.chat-window.open {
  display: flex;
  animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.chat-header {
  padding: var(--space-lg);
  background: var(--gradient-primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chat-header-info {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.chat-header-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-header-name {
  font-weight: 600;
}

.chat-header-status {
  font-size: 0.75rem;
  opacity: 0.9;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.chat-message {
  max-width: 80%;
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-xl);
  font-size: 0.95rem;
  line-height: 1.5;
}

.chat-message.bot {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  align-self: flex-start;
  border-bottom-left-radius: var(--radius-sm);
}

.chat-message.user {
  background: var(--gradient-primary);
  color: white;
  align-self: flex-end;
  border-bottom-right-radius: var(--radius-sm);
}

.chat-input-container {
  padding: var(--space-md);
  border-top: 1px solid var(--border-light);
  display: flex;
  gap: var(--space-sm);
}

.chat-input {
  flex: 1;
  padding: var(--space-md) var(--space-lg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-full);
  font-family: inherit;
  font-size: 0.95rem;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  outline: none;
  transition: border-color var(--transition-fast);
}

.chat-input:focus {
  border-color: var(--primary-500);
}

.chat-send {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background: var(--gradient-primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--transition-fast);
}

.chat-send:hover {
  transform: scale(1.1);
}

@media (max-width: 480px) {
  .chat-window {
    width: calc(100vw - 32px);
    right: -8px;
    height: 70vh;
  }
}

/* ═══════════════════════════════════════════════════════════
   PAGE TRANSITIONS
   ═══════════════════════════════════════════════════════════ */

.page-transition {
  animation: pageIn 0.5s ease-out;
}

@keyframes pageIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* ═══════════════════════════════════════════════════════════
   USER MENU
   ═══════════════════════════════════════════════════════════ */

.user-menu {
  display: none;
  align-items: center;
  gap: var(--space-md);
  position: relative;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  cursor: pointer;
  border: 2px solid var(--border-light);
  transition: border-color var(--transition-fast);
}

.user-avatar:hover {
  border-color: var(--primary-500);
}

.user-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: var(--space-sm);
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  min-width: 200px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all var(--transition-fast);
  z-index: var(--z-dropdown);
}

.user-menu:hover .user-dropdown,
.user-dropdown.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.user-dropdown-header {
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--border-light);
}

.user-dropdown-name {
  font-weight: 600;
  font-size: 0.95rem;
}

.user-dropdown-email {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  width: 100%;
  text-align: left;
  color: var(--text-primary);
  font-size: 0.9rem;
  transition: background var(--transition-fast);
}

.user-dropdown-item:hover {
  background: var(--bg-tertiary);
}

.user-dropdown-item svg {
  width: 18px;
  height: 18px;
  color: var(--text-muted);
}

.user-dropdown-divider {
  height: 1px;
  background: var(--border-light);
  margin: var(--space-xs) 0;
}

/* ═══════════════════════════════════════════════════════════
   LOGIN MODAL
   ═══════════════════════════════════════════════════════════ */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-modal);
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
}

.modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-2xl);
  padding: var(--space-2xl);
  max-width: 420px;
  width: 90%;
  transform: scale(0.9);
  transition: transform var(--transition-base);
}

.modal-overlay.open .modal {
  transform: scale(1);
}

.modal-header {
  text-align: center;
  margin-bottom: var(--space-xl);
}

.modal-logo {
  width: 60px;
  height: 60px;
  margin: 0 auto var(--space-lg);
}

.modal-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: var(--space-sm);
}

.modal-subtitle {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.modal-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.modal-divider {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  color: var(--text-muted);
  font-size: 0.85rem;
}

.modal-divider::before,
.modal-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-light);
}

.modal-close {
  position: absolute;
  top: var(--space-lg);
  right: var(--space-lg);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  color: var(--text-muted);
  transition: all var(--transition-fast);
}

.modal-close:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

#google-signin-button {
  display: flex;
  justify-content: center;
}

/* ═══════════════════════════════════════════════════════════
   MESSAGES PANEL
   ═══════════════════════════════════════════════════════════ */

.messages-btn {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-light);
  transition: all var(--transition-fast);
}

.messages-btn:hover {
  color: var(--primary-500);
  border-color: var(--primary-500);
}

.messages-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: var(--accent-pink);
  color: white;
  font-size: 0.7rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  display: none;
  align-items: center;
  justify-content: center;
}

.messages-panel {
  position: fixed;
  top: 70px;
  right: var(--space-xl);
  width: 380px;
  max-height: calc(100vh - 100px);
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  z-index: var(--z-dropdown);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all var(--transition-fast);
  overflow: hidden;
}

.messages-panel.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.messages-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-lg);
  border-bottom: 1px solid var(--border-light);
}

.messages-header h3 {
  font-size: 1rem;
  font-weight: 600;
}

.messages-header-actions {
  display: flex;
  gap: var(--space-sm);
}

.messages-header button {
  padding: var(--space-xs) var(--space-sm);
  font-size: 0.75rem;
  color: var(--primary-500);
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast);
}

.messages-header button:hover {
  background: var(--primary-50);
}

[data-theme="dark"] .messages-header button:hover {
  background: rgba(139, 92, 246, 0.1);
}

#messages-list {
  max-height: 400px;
  overflow-y: auto;
}

.messages-empty {
  padding: var(--space-3xl) var(--space-xl);
  text-align: center;
  color: var(--text-muted);
}

.messages-empty svg {
  margin-bottom: var(--space-md);
  opacity: 0.5;
}

.message-item {
  display: flex;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--border-light);
  transition: background var(--transition-fast);
}

.message-item:hover {
  background: var(--bg-secondary);
}

.message-item.unread {
  background: var(--primary-50);
}

[data-theme="dark"] .message-item.unread {
  background: rgba(139, 92, 246, 0.1);
}

.message-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
}

.message-icon.system {
  background: var(--primary-100);
  color: var(--primary-600);
}

.message-icon.success {
  background: rgba(16, 185, 129, 0.1);
  color: var(--accent-emerald);
}

.message-icon.warning {
  background: rgba(245, 158, 11, 0.1);
  color: var(--accent-amber);
}

.message-content {
  flex: 1;
  min-width: 0;
}

.message-title {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 2px;
}

.message-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.message-time {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: var(--space-xs);
}

.message-actions {
  display: flex;
  gap: var(--space-xs);
  align-items: flex-start;
}

.message-actions button {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: all var(--transition-fast);
}

.message-actions button:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.message-delete:hover {
  color: #ef4444 !important;
}

/* ═══════════════════════════════════════════════════════════
   NOTIFICATIONS
   ═══════════════════════════════════════════════════════════ */

.notification {
  position: fixed;
  bottom: var(--space-xl);
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-xl);
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: var(--z-toast);
  opacity: 0;
  transition: all var(--transition-base);
}

.notification.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.notification-success {
  border-color: var(--accent-emerald);
}

.notification-success .notification-icon {
  color: var(--accent-emerald);
}

.notification-error {
  border-color: #ef4444;
}

.notification-error .notification-icon {
  color: #ef4444;
}

.notification-info .notification-icon {
  color: var(--primary-500);
}

.notification-icon {
  display: flex;
}

.notification-text {
  font-size: 0.95rem;
}

/* ═══════════════════════════════════════════════════════════
   CHAT ERROR STATE
   ═══════════════════════════════════════════════════════════ */

.chat-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-2xl);
  color: var(--text-muted);
}

.chat-error svg {
  width: 48px;
  height: 48px;
  margin-bottom: var(--space-md);
  opacity: 0.5;
}

.chat-error p {
  font-size: 0.9rem;
  line-height: 1.6;
}

.chat-error a {
  color: var(--primary-500);
}

/* ═══════════════════════════════════════════════════════════
   TYPING INDICATOR
   ═══════════════════════════════════════════════════════════ */

.chat-message.typing {
  display: flex;
  gap: 4px;
  padding: var(--space-md) var(--space-lg);
}

.chat-message.typing .dot {
  width: 8px;
  height: 8px;
  background: var(--text-muted);
  border-radius: 50%;
  animation: typingDot 1.4s infinite;
}

.chat-message.typing .dot:nth-child(2) {
  animation-delay: 0.2s;
}

.chat-message.typing .dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typingDot {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-4px); }
}

@media (max-width: 480px) {
  .messages-panel {
    right: var(--space-md);
    left: var(--space-md);
    width: auto;
  }
}

