/**
 * Norvana Component Library
 * Reusable UI components
 * Version: 2.0.0
 */

/* ===== GLOBAL FOUNDATION ===== */

body.design-system-v2 {
  font-family: var(--font-family-base);
  font-size: var(--font-size-base);
  line-height: var(--line-height-normal);
  color: var(--color-text-primary);
  background: var(--color-bg-secondary);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  scroll-behavior: smooth;
}

body.design-system-v2::selection {
  background: var(--color-primary-200);
  color: var(--color-primary-900);
}

body.design-system-v2 main,
.page-shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: clamp(var(--spacing-8), 5vw, var(--spacing-16)) clamp(var(--spacing-4), 4vw, var(--spacing-10));
}

body.design-system-v2 section {
  margin-bottom: clamp(var(--spacing-10), 8vw, var(--spacing-20));
}

body.design-system-v2 h1,
body.design-system-v2 h2,
body.design-system-v2 h3,
body.design-system-v2 h4,
body.design-system-v2 h5,
body.design-system-v2 h6 {
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
  letter-spacing: -0.01em;
  margin-bottom: var(--spacing-3);
}

body.design-system-v2 h1 {
  font-size: clamp(var(--font-size-3xl), 3vw, var(--font-size-5xl));
  line-height: var(--line-height-relaxed);
}

body.design-system-v2 h2 {
  font-size: clamp(var(--font-size-2xl), 2.2vw, var(--font-size-4xl));
}

body.design-system-v2 h3 {
  font-size: clamp(var(--font-size-xl), 1.8vw, var(--font-size-3xl));
}

body.design-system-v2 p {
  font-size: var(--font-size-base);
  line-height: var(--line-height-relaxed);
  color: var(--color-text-secondary);
  margin-bottom: var(--spacing-4);
}

body.design-system-v2 a {
  color: var(--color-primary-600);
  transition: color var(--transition-base);
}

body.design-system-v2 a:hover {
  color: var(--color-primary-700);
}

body.design-system-v2 img {
  max-width: 100%;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

body.design-system-v2 hr {
  border: none;
  border-top: 1px solid var(--color-gray-200);
  margin: var(--spacing-6) 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ===== LAYOUT UTILITIES ===== */

.layout-stack {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-6);
}

.layout-stack--lg {
  gap: var(--spacing-10);
}

.layout-grid {
  display: grid;
  gap: var(--spacing-6);
}

.layout-grid--two {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.layout-grid--three {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.layout-grid--auto {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.layout-flex {
  display: flex;
  gap: var(--spacing-4);
  align-items: center;
}

.layout-flex--between {
  justify-content: space-between;
}

.layout-flex--wrap {
  flex-wrap: wrap;
}

.page-header {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-3);
  margin-bottom: var(--spacing-10);
}

.page-header__eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  color: var(--color-primary-600);
}

.page-header__content {
  max-width: 720px;
}

.section-title {
  font-size: clamp(var(--font-size-2xl), 2.4vw, var(--font-size-4xl));
  font-weight: var(--font-weight-bold);
  color: var(--color-text-primary);
  margin-bottom: var(--spacing-3);
}

.section-subtitle {
  font-size: clamp(var(--font-size-base), 1.6vw, var(--font-size-xl));
  color: var(--color-text-secondary);
  margin-bottom: var(--spacing-6);
  max-width: 680px;
}

.section-meta {
  display: flex;
  align-items: center;
  gap: var(--spacing-3);
  font-size: var(--font-size-sm);
  color: var(--color-text-tertiary);
}

.section-divider {
  width: 64px;
  height: 4px;
  border-radius: var(--radius-full);
  background: var(--color-primary-400);
  margin-bottom: var(--spacing-4);
}

.surface {
  background: var(--color-bg-primary);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  padding: var(--spacing-6);
}

.surface-muted {
  background: var(--color-bg-tertiary);
  border-radius: var(--radius-xl);
  padding: var(--spacing-6);
}

.surface-glass {
  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(--spacing-6);
  box-shadow: var(--shadow-glass);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--spacing-4);
}

.stat-card {
  padding: var(--spacing-5);
  border-radius: var(--radius-xl);
  background: var(--color-bg-primary);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-gray-100);
}

.stat-card__label {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  margin-bottom: var(--spacing-1);
}

.stat-card__value {
  font-size: var(--font-size-3xl);
  font-weight: var(--font-weight-bold);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-2);
  padding: var(--spacing-2) var(--spacing-4);
  border-radius: var(--radius-full);
  background: var(--color-primary-50);
  color: var(--color-primary-700);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
}

.chip--success {
  background: var(--color-success-50);
  color: var(--color-success-700);
}

.chip--warning {
  background: var(--color-warning-50);
  color: var(--color-warning-700);
}

.chip--danger {
  background: var(--color-danger-50);
  color: var(--color-danger-600);
}

/* ===== FORMS ===== */

.form-grid {
  display: grid;
  gap: var(--spacing-5);
}

.form-grid--two {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-2);
}

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

.input,
.textarea,
.select {
  width: 100%;
  padding: var(--spacing-3) var(--spacing-4);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-gray-200);
  background: var(--color-bg-primary);
  color: var(--color-text-primary);
  font-size: var(--font-size-base);
  line-height: var(--line-height-normal);
  transition: border-color var(--transition-base), box-shadow var(--transition-base);
}

.input:focus,
.textarea:focus,
.select:focus {
  border-color: var(--color-primary-500);
  box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.15);
  outline: none;
}

.input--inline {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-2);
  width: auto;
}

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

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

.input-error + .input-helper {
  color: var(--color-danger-600);
}

/* ===== TABLES ===== */

.table {
  width: 100%;
  border-collapse: collapse;
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.table thead {
  background: var(--color-primary-50);
  text-align: left;
}

.table th,
.table td {
  padding: var(--spacing-4) var(--spacing-5);
  font-size: var(--font-size-sm);
  border-bottom: 1px solid var(--color-gray-200);
}

.table tbody tr:hover {
  background: var(--color-gray-100);
}

.table tbody tr:last-child td {
  border-bottom: none;
}

.table--compact th,
.table--compact td {
  padding: var(--spacing-3) var(--spacing-4);
}

/* ===== PANELS & MODALS ===== */

.panel {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-4);
  border-radius: var(--radius-xl);
  padding: var(--spacing-6);
  background: var(--color-bg-primary);
  border: 1px solid var(--color-gray-200);
  box-shadow: var(--shadow-sm);
}

.panel__header {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-2);
}

.panel__title {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-semibold);
}

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

.panel__actions {
  margin-left: auto;
  display: inline-flex;
  gap: var(--spacing-3);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: var(--z-index-modal-backdrop);
  opacity: 0;
  visibility: hidden;
  transition: var(--transition-base);
}

.modal-backdrop.is-visible {
  opacity: 1;
  visibility: visible;
}

.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: var(--spacing-12) var(--spacing-4);
  z-index: var(--z-index-modal);
  opacity: 0;
  visibility: hidden;
  transition: var(--transition-base);
}

.modal.is-visible {
  opacity: 1;
  visibility: visible;
}

.modal__content {
  width: min(640px, 100%);
  background: var(--color-bg-primary);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  transform: translateY(20px);
  transition: transform var(--transition-base);
}

.modal.is-visible .modal__content {
  transform: translateY(0);
}

.modal__header,
.modal__footer {
  padding: var(--spacing-6);
  background: var(--color-gray-50);
}

.modal__body {
  padding: var(--spacing-6);
}

/* ===== NAVIGATION ===== */

.norvana-nav {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-index-sticky);
  background: var(--glass-bg-heavy);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--glass-border);
  box-shadow: var(--shadow-sm);
}

.nav-container {
  max-width: 1800px;
  margin: 0 auto;
  padding: var(--spacing-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--spacing-6);
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: var(--spacing-3);
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-primary-600);
  text-decoration: none;
  transition: color var(--transition-base);
}

.nav-logo:hover {
  color: var(--color-primary-700);
}

.nav-logo i {
  font-size: var(--font-size-3xl);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: var(--spacing-1);
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--spacing-2);
}

.hamburger-line {
  width: 24px;
  height: 3px;
  background: var(--color-primary-600);
  border-radius: var(--radius-full);
  transition: var(--transition-base);
}

.nav-toggle[aria-expanded="true"] .hamburger-line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .hamburger-line:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] .hamburger-line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--spacing-2);
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: var(--spacing-2);
  padding: var(--spacing-3) var(--spacing-4);
  border-radius: var(--radius-lg);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-secondary);
  text-decoration: none;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: var(--transition-base);
}

.nav-link:hover {
  color: var(--color-primary-600);
  background: var(--color-primary-50);
}

.nav-link:focus-visible {
  outline: 2px solid var(--color-primary-500);
  outline-offset: 2px;
}

.nav-link.active {
  color: var(--color-primary-600);
  background: var(--color-primary-50);
  font-weight: var(--font-weight-semibold);
}

.nav-user {
  display: flex;
  align-items: center;
  gap: var(--spacing-3);
  position: relative;
}

.user-name {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-primary);
  display: none;
}

.user-menu-trigger {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--color-primary-50);
  border: none;
  color: var(--color-primary-600);
  font-size: var(--font-size-2xl);
  cursor: pointer;
  transition: var(--transition-base);
}

.user-menu-trigger:hover {
  background: var(--color-primary-100);
  transform: scale(1.05);
}

.user-menu-trigger:focus-visible {
  outline: 2px solid var(--color-primary-500);
  outline-offset: 2px;
}

.user-menu {
  position: absolute;
  top: calc(100% + var(--spacing-2));
  right: 0;
  min-width: 220px;
  background: var(--glass-bg-heavy);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  padding: var(--spacing-2);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: var(--transition-base);
}

.user-menu[aria-hidden="false"] {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.user-menu-item {
  display: flex;
  align-items: center;
  gap: var(--spacing-3);
  padding: var(--spacing-3) var(--spacing-4);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  color: var(--color-text-primary);
  text-decoration: none;
  background: transparent;
  border: none;
  width: 100%;
  cursor: pointer;
  transition: var(--transition-base);
}

.user-menu-item:hover {
  background: var(--color-primary-50);
  color: var(--color-primary-600);
}

.user-menu-divider {
  margin: var(--spacing-2) 0;
  border: none;
  border-top: 1px solid var(--color-gray-200);
}

.ai-chat-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: var(--z-index-modal);
  display: flex;
  justify-content: flex-end;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition-base);
}

.ai-chat-modal[aria-hidden="false"] {
  opacity: 1;
  visibility: visible;
}

.ai-chat-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  cursor: pointer;
}

.ai-chat-panel {
  position: relative;
  width: 100%;
  max-width: 500px;
  background: var(--color-bg-primary);
  box-shadow: var(--shadow-2xl);
  transform: translateX(100%);
  transition: transform var(--transition-slow);
  display: flex;
  flex-direction: column;
}

.ai-chat-modal[aria-hidden="false"] .ai-chat-panel {
  transform: translateX(0);
}

.ai-chat-header {
  padding: var(--spacing-6);
  background: var(--color-bg-gradient);
  color: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.ai-chat-header h2 {
  display: flex;
  align-items: center;
  gap: var(--spacing-3);
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  margin: 0;
}

.ai-chat-close {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-base);
}

.ai-chat-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

.ai-chat-body {
  flex: 1;
  overflow: hidden;
}

.ai-chat-body iframe {
  width: 100%;
  height: 100%;
}

/* ===== RESPONSIVE ADJUSTMENTS ===== */

@media (max-width: 1023px) {
  .nav-toggle {
    display: flex;
  }

  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--glass-bg-heavy);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--glass-border);
    box-shadow: var(--shadow-lg);
    padding: var(--spacing-4);
    gap: var(--spacing-1);
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-slow);
  }

  .nav-toggle[aria-expanded="true"] ~ .nav-links {
    max-height: 500px;
  }

  .nav-link {
    width: 100%;
    justify-content: flex-start;
  }

  body.design-system-v2 main,
  .page-shell {
    padding: clamp(var(--spacing-6), 6vw, var(--spacing-12)) var(--spacing-4);
  }

  .layout-grid {
    gap: var(--spacing-5);
  }

  .ai-chat-panel {
    max-width: 100%;
  }
}

@media (min-width: 768px) {
  .user-name {
    display: block;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ===== BUTTONS ===== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-2);
  padding: var(--spacing-3) var(--spacing-6);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-tight);
  border-radius: var(--radius-lg);
  border: none;
  cursor: pointer;
  transition: all var(--transition-base);
  text-decoration: none;
  font-family: var(--font-family-base);
}

.btn:focus-visible {
  outline: 2px solid var(--color-primary-500);
  outline-offset: 2px;
}

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

/* Button Variants */
.btn-primary {
  background: var(--color-bg-gradient);
  color: white;
  box-shadow: var(--shadow-primary);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: var(--shadow-primary-lg);
}

.btn-secondary {
  background: var(--color-gray-100);
  color: var(--color-gray-900);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--color-gray-200);
}

.btn-success {
  background: var(--color-success-500);
  color: white;
}

.btn-success:hover:not(:disabled) {
  background: var(--color-success-600);
  transform: translateY(-2px);
}

.btn-danger {
  background: var(--color-danger-500);
  color: white;
}

.btn-danger:hover:not(:disabled) {
  background: var(--color-danger-600);
  transform: translateY(-2px);
}

.btn-warning {
  background: var(--color-warning-500);
  color: white;
}

.btn-warning:hover:not(:disabled) {
  background: var(--color-warning-600);
}

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

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

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

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

/* Button Sizes */
.btn-sm {
  padding: var(--spacing-2) var(--spacing-4);
  font-size: var(--font-size-xs);
}

.btn-lg {
  padding: var(--spacing-4) var(--spacing-8);
  font-size: var(--font-size-base);
}

.btn-xl {
  padding: var(--spacing-5) var(--spacing-10);
  font-size: var(--font-size-lg);
}

.btn-block {
  width: 100%;
}

/* ===== CARDS ===== */

.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);
  box-shadow: var(--shadow-glass);
  padding: var(--spacing-6);
  transition: all var(--transition-base);
}

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

.card-header {
  margin-bottom: var(--spacing-4);
  padding-bottom: var(--spacing-4);
  border-bottom: 1px solid var(--color-gray-200);
}

.card-title {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-text-primary);
  margin: 0;
}

.card-subtitle {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  margin-top: var(--spacing-1);
}

.card-body {
  color: var(--color-text-primary);
}

.card-footer {
  margin-top: var(--spacing-6);
  padding-top: var(--spacing-4);
  border-top: 1px solid var(--color-gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Card Variants */
.card-flat {
  background: var(--color-bg-primary);
  backdrop-filter: none;
  box-shadow: var(--shadow-md);
}

.card-bordered {
  border: 2px solid var(--color-gray-200);
}

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

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

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

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

/* ===== INPUTS ===== */

.input,
.textarea,
.select {
  width: 100%;
  padding: var(--spacing-3) var(--spacing-4);
  font-size: var(--font-size-sm);
  font-family: var(--font-family-base);
  color: var(--color-text-primary);
  background: var(--color-bg-primary);
  border: 2px solid var(--color-gray-300);
  border-radius: var(--radius-md);
  transition: all var(--transition-base);
  -webkit-text-fill-color: var(--color-text-primary);
}

/* Fix password input dots visibility */
.input[type="password"] {
  color: var(--color-text-primary) !important;
  -webkit-text-fill-color: var(--color-text-primary) !important;
}

.input:focus,
.textarea:focus,
.select:focus {
  outline: none;
  border-color: var(--color-primary-500);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

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

.input:disabled,
.textarea:disabled,
.select:disabled {
  background: var(--color-gray-100);
  cursor: not-allowed;
  opacity: 0.6;
}

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

/* Input Groups */
.input-group {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-2);
  margin-bottom: var(--spacing-4);
}

.input-label {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
  display: flex;
  align-items: center;
  gap: var(--spacing-1);
}

.input-required {
  color: var(--color-danger-500);
}

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

/* Input with Icon */
.input-with-icon {
  position: relative;
}

.input-with-icon .input {
  padding-left: var(--spacing-10);
}

.input-icon {
  position: absolute;
  left: var(--spacing-4);
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-tertiary);
  pointer-events: none;
}

/* ===== BADGES ===== */

.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-1);
  padding: var(--spacing-1) var(--spacing-3);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  border-radius: var(--radius-full);
  line-height: 1;
}

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

.badge-success {
  background: var(--color-success-50);
  color: var(--color-success-700);
}

.badge-danger {
  background: var(--color-danger-50);
  color: var(--color-danger-700);
}

.badge-warning {
  background: var(--color-warning-50);
  color: var(--color-warning-700);
}

.badge-info {
  background: var(--color-info-50);
  color: var(--color-info-700);
}

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

/* ===== MODALS ===== */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: var(--z-index-modal-backdrop);
  opacity: 0;
  transition: opacity var(--transition-base);
}

.modal-overlay.active {
  display: flex;
  opacity: 1;
}

.modal {
  background: var(--glass-bg-heavy);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-2xl);
  max-width: 600px;
  width: calc(100% - 2rem);
  max-height: calc(100vh - 4rem);
  display: flex;
  flex-direction: column;
  transform: scale(0.9) translateY(20px);
  transition: transform var(--transition-base);
}

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

.modal-header {
  padding: var(--spacing-6);
  border-bottom: 1px solid var(--color-gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  margin: 0;
}

.modal-close {
  background: transparent;
  border: none;
  font-size: var(--font-size-2xl);
  color: var(--color-text-tertiary);
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  transition: all var(--transition-base);
}

.modal-close:hover {
  background: var(--color-gray-100);
  color: var(--color-text-primary);
}

.modal-body {
  padding: var(--spacing-6);
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: var(--spacing-6);
  border-top: 1px solid var(--color-gray-200);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--spacing-3);
}

/* ===== ALERTS ===== */

.alert {
  padding: var(--spacing-4) var(--spacing-5);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: flex-start;
  gap: var(--spacing-3);
  margin-bottom: var(--spacing-4);
}

.alert-icon {
  flex-shrink: 0;
  font-size: var(--font-size-lg);
}

.alert-content {
  flex: 1;
}

.alert-title {
  font-weight: var(--font-weight-semibold);
  margin-bottom: var(--spacing-1);
}

.alert-message {
  font-size: var(--font-size-sm);
}

.alert-success {
  background: var(--color-success-50);
  color: var(--color-success-900);
  border-left: 4px solid var(--color-success-500);
}

.alert-danger {
  background: var(--color-danger-50);
  color: var(--color-danger-900);
  border-left: 4px solid var(--color-danger-500);
}

.alert-warning {
  background: var(--color-warning-50);
  color: var(--color-warning-900);
  border-left: 4px solid var(--color-warning-500);
}

.alert-info {
  background: var(--color-info-50);
  color: var(--color-info-900);
  border-left: 4px solid var(--color-info-500);
}

/* ===== UTILITY CLASSES ===== */

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.font-bold { font-weight: var(--font-weight-bold); }
.font-semibold { font-weight: var(--font-weight-semibold); }
.font-medium { font-weight: var(--font-weight-medium); }
.font-normal { font-weight: var(--font-weight-normal); }

.text-xs { font-size: var(--font-size-xs); }
.text-sm { font-size: var(--font-size-sm); }
.text-base { font-size: var(--font-size-base); }
.text-lg { font-size: var(--font-size-lg); }
.text-xl { font-size: var(--font-size-xl); }
.text-2xl { font-size: var(--font-size-2xl); }
.text-3xl { font-size: var(--font-size-3xl); }

.text-primary { color: var(--color-primary-600); }
.text-secondary { color: var(--color-text-secondary); }
.text-tertiary { color: var(--color-text-tertiary); }
.text-success { color: var(--color-success-600); }
.text-danger { color: var(--color-danger-600); }
.text-warning { color: var(--color-warning-600); }

.mt-0 { margin-top: 0; }
.mt-2 { margin-top: var(--spacing-2); }
.mt-4 { margin-top: var(--spacing-4); }
.mt-6 { margin-top: var(--spacing-6); }
.mt-8 { margin-top: var(--spacing-8); }

.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: var(--spacing-2); }
.mb-4 { margin-bottom: var(--spacing-4); }
.mb-6 { margin-bottom: var(--spacing-6); }
.mb-8 { margin-bottom: var(--spacing-8); }

.flex { display: flex; }
.inline-flex { display: inline-flex; }
.grid { display: grid; }

.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }

.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }

.gap-2 { gap: var(--spacing-2); }
.gap-4 { gap: var(--spacing-4); }
.gap-6 { gap: var(--spacing-6); }

.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }
.shadow-xl { box-shadow: var(--shadow-xl); }
