/* ═══════════════════════════════════════════════════════════════ */
/* NAV BAR                                                        */
/* ═══════════════════════════════════════════════════════════════ */

.nav__brand {
  display: none;
}

.nav__items {
  display: flex;
  align-items: center;
  justify-content: space-around;
  height: var(--nav-height);
  padding: 0 var(--space-sm);
}

.nav__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  flex: 1;
  padding: 8px 0;
  color: var(--text-muted);
  font-weight: 500;
  transition: all var(--transition-fast);
  background: none;
  border-radius: var(--radius-md);
}

.nav__item--active {
  color: var(--color-primary);
  font-weight: 700;
}

.nav__icon {
  font-size: 24px;
  line-height: 1;
}

.nav__label {
  font-size: 11px;
  line-height: 1;
}

/* Desktop-only items: hidden on mobile/tablet */
.nav__item--desktop-only {
  display: none;
}

/* Tablet: larger nav */
@media (min-width: 640px) {
  .nav__icon {
    font-size: 26px;
  }

  .nav__label {
    font-size: 12px;
  }
}

/* Desktop: sidebar nav */
@media (min-width: 1024px) {
  .nav__item--desktop-only {
    display: flex;
  }

  .nav__brand {
    display: flex;
    align-items: center;
    padding: var(--space-lg) var(--space-lg) var(--space-xl);
  }

  .nav__brand-text {
    font-family: var(--font-heading);
    font-weight: 900;
    font-size: var(--text-2xl);
  }

  .nav__items {
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    height: auto;
    gap: var(--space-xs);
    padding: 0 var(--space-md);
  }

  .nav__item {
    flex-direction: row;
    flex: none;
    gap: var(--space-md);
    padding: 14px var(--space-md);
    border-radius: var(--radius-lg);
    text-align: left;
    justify-content: flex-start;
  }

  .nav__item:hover {
    background: var(--color-primary-50);
    color: var(--color-primary);
  }

  .nav__item--active {
    background: var(--color-primary-100);
    color: var(--color-primary-700);
  }

  .nav__icon {
    font-size: 24px;
    width: 28px;
    text-align: center;
  }

  .nav__label {
    font-size: var(--text-base);
    font-weight: 600;
  }
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 12px 24px;
  border-radius: var(--radius-lg);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: var(--text-base);
  line-height: 1;
  transition: all var(--transition-fast);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0);
  transition: background var(--transition-fast);
}

.btn:active::after {
  background: rgba(0,0,0,0.1);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn--primary {
  background: var(--gradient-primary);
  color: var(--text-white);
  box-shadow: var(--shadow-purple);
}

.btn--primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(124, 58, 237, 0.4);
}

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

.btn--secondary {
  background: var(--gradient-secondary);
  color: var(--text-white);
  box-shadow: var(--shadow-orange);
}

.btn--outline {
  background: transparent;
  color: var(--color-primary);
  border: 2px solid var(--color-primary);
}

.btn--outline:hover:not(:disabled) {
  background: var(--color-primary-50);
}

.btn--ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn--ghost:hover:not(:disabled) {
  background: var(--color-primary-50);
  color: var(--color-primary);
}

.btn--sm {
  padding: 8px 16px;
  font-size: var(--text-sm);
  border-radius: var(--radius-md);
}

.btn--lg {
  padding: 16px 32px;
  font-size: var(--text-lg);
  border-radius: var(--radius-xl);
}

.btn--block {
  width: 100%;
}

.btn--round {
  width: 48px;
  height: 48px;
  padding: 0;
  border-radius: var(--radius-full);
}

@media (min-width: 640px) {
  .btn--lg {
    padding: 18px 40px;
    font-size: var(--text-xl);
  }
}

/* ═══════════════════════════════════════════════════════════════ */
/* CARDS                                                          */
/* ═══════════════════════════════════════════════════════════════ */

.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  transition: all var(--transition-fast);
}

.card--interactive:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--color-primary-200);
}

.card--interactive:active {
  transform: scale(0.98);
}

.card--accent {
  border-left: 4px solid var(--color-primary);
}

.card--gradient {
  background: var(--gradient-primary);
  color: var(--text-white);
  border: none;
}

@media (min-width: 640px) {
  .card {
    padding: var(--space-lg);
    border-radius: var(--radius-xl);
  }
}

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

.toast-container {
  position: fixed;
  top: var(--space-md);
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - var(--space-xl));
  max-width: 480px;
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  box-shadow: var(--shadow-lg);
  font-size: var(--text-sm);
  font-weight: 500;
  pointer-events: auto;
  animation: toastIn 300ms ease forwards;
  border-left: 4px solid var(--color-primary);
}

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

.toast.toast--exit {
  animation: toastOut 200ms ease forwards;
}

.toast__icon {
  font-size: var(--text-lg);
  flex-shrink: 0;
}

.toast__message {
  flex: 1;
}

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

@keyframes toastOut {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(-20px); }
}

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

.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-overlay);
  z-index: var(--z-modal);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: fadeIn 200ms ease;
}

.modal {
  background: var(--bg-card);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: var(--space-lg);
  width: 100%;
  max-width: 540px;
  max-height: 85vh;
  overflow-y: auto;
  animation: slideUp 300ms ease;
}

.modal--center {
  border-radius: var(--radius-xl);
  margin: var(--space-md);
  max-width: 480px;
  align-self: center;
  animation: scaleIn 200ms ease;
}

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}

.modal__title {
  font-size: var(--text-xl);
  font-weight: 800;
}

.modal__close {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: all var(--transition-fast);
}

.modal__close:hover {
  background: var(--color-primary-50);
  color: var(--text-primary);
}

@media (min-width: 640px) {
  .modal-overlay {
    align-items: center;
  }

  .modal {
    border-radius: var(--radius-xl);
    margin: var(--space-lg);
  }
}

@keyframes fadeIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes scaleIn { from { opacity: 0; transform: scale(0.9); } to { opacity: 1; transform: scale(1); } }

/* ═══════════════════════════════════════════════════════════════ */
/* LOADING SPINNER                                                */
/* ═══════════════════════════════════════════════════════════════ */

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--color-primary-200);
  border-top-color: var(--color-primary);
  border-radius: var(--radius-full);
  animation: spin 600ms linear infinite;
}

.spinner--sm { width: 20px; height: 20px; border-width: 2px; }
.spinner--lg { width: 48px; height: 48px; border-width: 4px; }

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

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

.avatar {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-white);
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: var(--text-lg);
  flex-shrink: 0;
}

.avatar--sm { width: 32px; height: 32px; font-size: var(--text-sm); }
.avatar--lg { width: 64px; height: 64px; font-size: var(--text-2xl); }
.avatar--xl { width: 96px; height: 96px; font-size: var(--text-4xl); }

@media (min-width: 640px) {
  .avatar--xl { width: 120px; height: 120px; font-size: var(--text-5xl); }
}

/* ═══════════════════════════════════════════════════════════════ */
/* PROGRESS BAR                                                   */
/* ═══════════════════════════════════════════════════════════════ */

.progress {
  width: 100%;
  height: 8px;
  background: var(--color-primary-100);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress__fill {
  height: 100%;
  background: var(--gradient-primary);
  border-radius: var(--radius-full);
  transition: width var(--transition-base);
}

.progress--lg { height: 12px; }

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

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 700;
  font-family: var(--font-heading);
}

.badge--primary {
  background: var(--color-primary-100);
  color: var(--color-primary-700);
}

.badge--success {
  background: rgba(16, 185, 129, 0.1);
  color: var(--color-success);
}

.badge--warning {
  background: rgba(245, 158, 11, 0.1);
  color: var(--color-warning);
}

/* ═══════════════════════════════════════════════════════════════ */
/* TABS                                                           */
/* ═══════════════════════════════════════════════════════════════ */

.tabs {
  display: flex;
  gap: 4px;
  background: var(--color-primary-50);
  padding: 4px;
  border-radius: var(--radius-lg);
}

.tab {
  flex: 1;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-secondary);
  text-align: center;
  transition: all var(--transition-fast);
}

.tab--active {
  background: var(--bg-card);
  color: var(--color-primary);
  box-shadow: var(--shadow-sm);
}

@media (min-width: 640px) {
  .tab {
    padding: 12px 24px;
    font-size: var(--text-base);
  }
}

/* ═══════════════════════════════════════════════════════════════ */
/* EMPTY STATE                                                    */
/* ═══════════════════════════════════════════════════════════════ */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-3xl) var(--space-md);
  text-align: center;
}

.empty-state__icon {
  font-size: 48px;
  margin-bottom: var(--space-md);
}

.empty-state__title {
  font-size: var(--text-lg);
  font-weight: 700;
  margin-bottom: var(--space-sm);
}

.empty-state__text {
  color: var(--text-muted);
  font-size: var(--text-sm);
  max-width: 320px;
}

@media (min-width: 640px) {
  .empty-state__icon {
    font-size: 64px;
  }

  .empty-state__title {
    font-size: var(--text-xl);
  }

  .empty-state__text {
    font-size: var(--text-base);
    max-width: 400px;
  }
}
