/* Supreme Intelligence — Components
   Glassmorphism, Apple-clean, violet accent */

/* ══════════════════════════════════════
   NAVIGATION
   ══════════════════════════════════════ */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-light);
  padding: var(--space-4) 0;
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--container-xl);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-family: var(--font-heading);
  font-weight: var(--weight-bold);
  font-size: var(--text-lg);
  color: var(--text-primary);
  text-decoration: none;
}

.nav-logo img {
  height: 36px;
  width: auto;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-8);
  list-style: none;
}

.nav-links a {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-smooth);
}

.nav-links a:hover {
  color: var(--text-primary);
  opacity: 1;
}

/* ══════════════════════════════════════
   BUTTONS
   ══════════════════════════════════════ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  line-height: 1;
  padding: 14px 28px;
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  text-decoration: none;
  transition: all var(--duration-normal) var(--ease-spring);
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: var(--white);
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(124, 58, 237, 0.3);
  color: var(--white);
  opacity: 1;
}

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

.btn-secondary {
  background: var(--white);
  color: var(--text-primary);
  border: 1px solid var(--border-default);
}

.btn-secondary:hover {
  background: var(--gray-50);
  border-color: var(--gray-300);
  transform: translateY(-1px);
  color: var(--text-primary);
  opacity: 1;
}

.btn-ghost {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}

.btn-ghost:hover {
  background: var(--accent-light);
  transform: translateY(-1px);
  color: var(--accent);
  opacity: 1;
}

.btn-lg {
  font-size: var(--text-base);
  padding: 18px 36px;
}

.btn-sm {
  font-size: var(--text-xs);
  padding: 10px 20px;
}

.btn-icon {
  padding: 12px;
  border-radius: var(--radius-md);
}

/* ══════════════════════════════════════
   GLASS CARD
   ══════════════════════════════════════ */

.glass-card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  box-shadow: var(--glass-shadow);
  transition: all var(--duration-normal) var(--ease-smooth);
}

.glass-card:hover {
  background: var(--glass-bg-hover);
  box-shadow: var(--glass-shadow-lg);
  transform: translateY(-2px);
}

.glass-card-flat {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  box-shadow: var(--glass-shadow);
}

/* ══════════════════════════════════════
   INPUTS
   ══════════════════════════════════════ */

.input-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.input-label {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--text-primary);
}

.input {
  font-family: var(--font-body);
  font-size: var(--text-base);
  padding: 14px 16px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--white);
  color: var(--text-primary);
  outline: none;
  transition: border-color var(--duration-fast) var(--ease-smooth),
              box-shadow var(--duration-fast) var(--ease-smooth);
}

.input::placeholder {
  color: var(--text-tertiary);
}

.input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.input-error {
  border-color: var(--error);
}

.input-error:focus {
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.input-helper {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
}

.input-error-text {
  font-size: var(--text-xs);
  color: var(--error);
}

textarea.input {
  resize: vertical;
  min-height: 100px;
}

/* ══════════════════════════════════════
   MODAL
   ══════════════════════════════════════ */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration-normal) var(--ease-smooth);
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: var(--space-10);
  max-width: 480px;
  width: 90%;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.12);
  transform: scale(0.95) translateY(8px);
  transition: transform var(--duration-normal) var(--ease-spring);
}

.modal-overlay.active .modal {
  transform: scale(1) translateY(0);
}

.modal-title {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  margin-bottom: var(--space-3);
}

.modal-body {
  color: var(--text-secondary);
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--space-6);
}

.modal-actions {
  display: flex;
  gap: var(--space-3);
  justify-content: flex-end;
}

/* ══════════════════════════════════════
   CHAT BUBBLES
   ══════════════════════════════════════ */

.chat-container {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  max-width: 480px;
}

.chat-bubble {
  max-width: 80%;
  padding: 12px 16px;
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
  border-radius: 18px;
}

.chat-bubble-user {
  align-self: flex-end;
  background: var(--accent);
  color: var(--white);
  border-bottom-right-radius: 4px;
}

.chat-bubble-ai {
  align-self: flex-start;
  background: var(--gray-100);
  color: var(--text-primary);
  border-bottom-left-radius: 4px;
}

.chat-bubble-time {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  margin-top: var(--space-1);
}

/* ══════════════════════════════════════
   CREDIT WIDGET
   ══════════════════════════════════════ */

.credit-widget {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-6);
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--glass-shadow);
}

.credit-count {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
  color: var(--text-primary);
}

.credit-label {
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.credit-bar {
  flex: 1;
  height: 6px;
  background: var(--gray-100);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.credit-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: var(--radius-full);
  transition: width var(--duration-slow) var(--ease-smooth);
}

/* ══════════════════════════════════════
   PRICING TABLE
   ══════════════════════════════════════ */

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
  align-items: start;
}

.pricing-card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: var(--space-10);
  box-shadow: var(--glass-shadow);
  text-align: center;
  transition: all var(--duration-normal) var(--ease-smooth);
  position: relative;
}

.pricing-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--glass-shadow-lg);
}

.pricing-card.featured {
  border-color: var(--accent);
  box-shadow: 0 8px 32px rgba(124, 58, 237, 0.12);
}

.pricing-badge {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: var(--white);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  padding: 6px 16px;
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.pricing-name {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  margin-bottom: var(--space-2);
}

.pricing-price {
  font-family: var(--font-heading);
  font-size: var(--text-4xl);
  font-weight: var(--weight-bold);
  color: var(--text-primary);
  margin-bottom: var(--space-1);
}

.pricing-price span {
  font-size: var(--text-base);
  font-weight: var(--weight-regular);
  color: var(--text-secondary);
}

.pricing-credits {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-bottom: var(--space-8);
}

.pricing-features {
  list-style: none;
  text-align: left;
  margin-bottom: var(--space-8);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.pricing-features li {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  padding-left: var(--space-6);
  position: relative;
}

.pricing-features li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 5px;
  width: 16px;
  height: 16px;
  background: var(--accent-light);
  border-radius: var(--radius-full);
}

.pricing-features li::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 10px;
  width: 6px;
  height: 3px;
  border-left: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: rotate(-45deg);
}

/* ══════════════════════════════════════
   TOAST
   ══════════════════════════════════════ */

.toast-container {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 14px 20px;
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  border-left: 3px solid var(--accent);
  font-size: var(--text-sm);
  min-width: 280px;
  animation: toast-in 0.4s var(--ease-spring);
}

.toast-success { border-left-color: var(--success); }
.toast-error { border-left-color: var(--error); }
.toast-warning { border-left-color: var(--warning); }

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateX(24px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ══════════════════════════════════════
   BADGE / TAG
   ══════════════════════════════════════ */

.badge {
  display: inline-flex;
  align-items: center;
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: var(--accent-light);
  color: var(--accent);
}

.badge-outline {
  background: transparent;
  border: 1px solid var(--border-default);
  color: var(--text-secondary);
}

/* ══════════════════════════════════════
   DIVIDER
   ══════════════════════════════════════ */

.divider {
  height: 1px;
  background: var(--border-light);
  border: none;
  margin: var(--space-8) 0;
}

/* ══════════════════════════════════════
   AVATAR
   ══════════════════════════════════════ */

.avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  object-fit: cover;
  border: 2px solid var(--white);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.avatar-sm { width: 32px; height: 32px; }
.avatar-lg { width: 56px; height: 56px; }

/* ══════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════ */

@media (max-width: 768px) {
  .pricing-grid {
    grid-template-columns: 1fr;
    max-width: 400px;
    margin: 0 auto;
  }
  .nav-links {
    display: none;
  }
  .modal {
    width: 95%;
    padding: var(--space-6);
  }
  .chat-bubble {
    max-width: 90%;
  }
}
