/*
 * ============================================
 * BASE STYLES & RESET
 * ============================================
 */

/* Modern CSS Reset */
*, *::before, *::after {
  box-sizing: border-box;
}

* {
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--fg-primary);
  background-color: var(--bg-primary);
  min-height: 100vh;
}

img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
}

input, button, textarea, select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: none;
}

a {
  color: inherit;
  text-decoration: none;
}

ul, ol {
  list-style: none;
}

/* Focus visible for accessibility */
:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

/* Selection */
::selection {
  background-color: var(--color-primary-200);
  color: var(--color-primary-900);
}

[data-theme="dark"] ::selection,
.dark ::selection {
  background-color: var(--color-primary-800);
  color: var(--color-primary-100);
}

/* Scrollbar (Webkit) */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--border-secondary);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--fg-tertiary);
}

/* ============================================
 * TYPOGRAPHY UTILITIES
 * ============================================ */

/* Headings */
.h1, h1 {
  font-size: var(--text-4xl);
  font-weight: var(--font-bold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
}

.h2, h2 {
  font-size: var(--text-3xl);
  font-weight: var(--font-semibold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
}

.h3, h3 {
  font-size: var(--text-2xl);
  font-weight: var(--font-semibold);
  line-height: var(--leading-snug);
}

.h4, h4 {
  font-size: var(--text-xl);
  font-weight: var(--font-semibold);
  line-height: var(--leading-snug);
}

.h5, h5 {
  font-size: var(--text-lg);
  font-weight: var(--font-medium);
  line-height: var(--leading-normal);
}

.h6, h6 {
  font-size: var(--text-base);
  font-weight: var(--font-medium);
  line-height: var(--leading-normal);
}

/* Text sizes */
.text-xs { font-size: var(--text-xs); }
.text-sm { font-size: var(--text-sm); }
.text-base { font-size: var(--text-base); }
.text-lg { font-size: var(--text-lg); }
.text-xl { font-size: var(--text-xl); }
.text-2xl { font-size: var(--text-2xl); }
.text-3xl { font-size: var(--text-3xl); }
.text-4xl { font-size: var(--text-4xl); }
.text-5xl { font-size: var(--text-5xl); }

/* Text colors */
.text-primary { color: var(--fg-primary); }
.text-secondary { color: var(--fg-secondary); }
.text-tertiary { color: var(--fg-tertiary); }
.text-brand { color: var(--fg-brand); }
.text-success { color: var(--fg-success); }
.text-warning { color: var(--fg-warning); }
.text-error { color: var(--fg-error); }

/* Font weights */
.font-regular { font-weight: var(--font-regular); }
.font-medium { font-weight: var(--font-medium); }
.font-semibold { font-weight: var(--font-semibold); }
.font-bold { font-weight: var(--font-bold); }

/* ============================================
 * COMPONENT BASE STYLES
 * ============================================ */

/* ----- BUTTONS ----- */
/* Liquid Glass Lite: Soft shadows, no transform animations */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  height: var(--btn-height-md);
  padding: 0 var(--btn-padding-md);
  font-size: var(--text-sm);
  font-weight: var(--btn-font-weight);
  line-height: 1;
  border-radius: var(--btn-radius);
  transition: var(--transition-colors);
  white-space: nowrap;
  user-select: none;
  box-shadow: var(--btn-shadow);
}

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

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

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

.btn-primary:active:not(:disabled) {
  background-color: var(--color-primary-700);
}

.btn-primary:visited {
  color: var(--fg-on-brand);
}

.btn-secondary {
  background-color: var(--bg-secondary);
  color: var(--fg-primary);
  border: 1px solid var(--border-primary);
  box-shadow: var(--shadow-xs);
}

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

.btn-ghost {
  background-color: transparent;
  box-shadow: none;
  color: var(--color-primary-500);
}

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

.btn-danger,
.btn-error {
  background-color: var(--bg-error);
  color: var(--fg-on-brand);
}

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

.btn-success {
  background-color: var(--color-success-500, #22c55e);
  color: white;
}

.btn-success:hover:not(:disabled) {
  background-color: var(--color-success-600, #16a34a);
}

/* Button Sizes */
.btn-sm {
  height: var(--btn-height-sm);
  padding: 0 var(--btn-padding-sm);
  font-size: var(--text-xs);
}

.btn-lg {
  height: var(--btn-height-lg);
  padding: 0 var(--btn-padding-lg);
  font-size: var(--text-base);
}

/* Icon Button */
.btn-icon {
  width: var(--btn-height-md);
  padding: 0;
}

.btn-icon.btn-sm { width: var(--btn-height-sm); }
.btn-icon.btn-lg { width: var(--btn-height-lg); }

/* ----- INPUTS ----- */
.input {
  display: block;
  width: 100%;
  height: var(--input-height-md);
  padding: 0 var(--input-padding-x);
  font-size: var(--text-sm);
  line-height: 1;
  color: var(--fg-primary);
  background-color: var(--bg-primary);
  border: var(--input-border-width) solid var(--border-primary);
  border-radius: var(--input-radius);
  transition: var(--transition-fast);
}

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

.input:hover:not(:disabled) {
  border-color: var(--border-secondary);
}

.input:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: var(--focus-ring);
}

.input:disabled {
  background-color: var(--interactive-disabled);
  cursor: not-allowed;
  opacity: 0.6;
}

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

.input-error:focus {
  border-color: var(--border-error);
  box-shadow: 0 0 0 var(--ring-offset) var(--ring-offset-color), 
              0 0 0 calc(var(--ring-width) + var(--ring-offset)) var(--color-error-500);
}

/* Input sizes */
.input-sm { height: var(--input-height-sm); font-size: var(--text-xs); }
.input-lg { height: var(--input-height-lg); font-size: var(--text-base); }

/* ----- TEXTAREA ----- */
.textarea {
  display: block;
  width: 100%;
  min-height: 100px;
  padding: var(--space-3) var(--input-padding-x);
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
  color: var(--fg-primary);
  background-color: var(--bg-primary);
  border: var(--input-border-width) solid var(--border-primary);
  border-radius: var(--input-radius);
  transition: var(--transition-fast);
  resize: vertical;
}

.textarea:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: var(--focus-ring);
}

/* ----- SELECT ----- */
.select {
  appearance: none;
  display: block;
  width: 100%;
  height: var(--input-height-md);
  padding: 0 var(--space-10) 0 var(--input-padding-x);
  font-size: var(--text-sm);
  color: var(--fg-primary);
  background-color: var(--bg-primary);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23737373' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-3) center;
  border: var(--input-border-width) solid var(--border-primary);
  border-radius: var(--input-radius);
  cursor: pointer;
  transition: var(--transition-fast);
}

.select:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: var(--focus-ring);
}

/* ----- CHECKBOX & RADIO ----- */
.checkbox,
.radio {
  appearance: none;
  width: 18px;
  height: 18px;
  background-color: var(--bg-primary);
  border: 2px solid var(--border-secondary);
  cursor: pointer;
  transition: var(--transition-fast);
  flex-shrink: 0;
}

.checkbox { border-radius: var(--radius-default); }
.radio { border-radius: var(--radius-full); }

.checkbox:hover,
.radio:hover {
  border-color: var(--border-brand);
}

.checkbox:checked,
.radio:checked {
  background-color: var(--bg-brand);
  border-color: var(--bg-brand);
}

.checkbox:checked {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
}

.radio:checked {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'%3E%3Ccircle cx='4' cy='4' r='4' fill='white'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
}

.checkbox:focus-visible,
.radio:focus-visible {
  box-shadow: var(--focus-ring);
}

/* ----- TOGGLE/SWITCH ----- */
/* Liquid Glass Lite: Uses left position instead of transform */
/* Only applies to input.toggle (not label.toggle wrapper) */
input.toggle {
  appearance: none;
  position: relative;
  width: 44px;
  height: 24px;
  background-color: var(--border-secondary);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition-colors);
}

input.toggle::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background-color: white;
  border-radius: var(--radius-full);
  transition: left var(--duration-fast) var(--ease-out);
  box-shadow: var(--shadow-sm);
}

input.toggle:checked {
  background-color: var(--bg-brand);
}

input.toggle:checked::after {
  left: 22px;
}

input.toggle:focus-visible {
  box-shadow: var(--focus-ring);
}

/* ----- CARD ----- */
/* Liquid Glass Lite: Larger radius, soft glow shadows */
.card {
  background-color: var(--bg-primary);
  border: var(--card-border);
  border-radius: var(--card-radius);
  padding: var(--card-padding);
  box-shadow: var(--card-shadow);
  transition: var(--transition-colors);
}

.card:hover {
  box-shadow: var(--card-shadow-hover);
}

.card-elevated {
  border: none;
  box-shadow: var(--shadow-lg);
}

.card-elevated:hover {
  box-shadow: var(--shadow-xl);
}

/* Card with glow effect */
.card-glow {
  box-shadow: var(--shadow-glow-sm);
}

.card-glow:hover {
  box-shadow: var(--shadow-glow-md);
}

/* ----- BADGE ----- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  height: var(--badge-height-md);
  padding: 0 var(--badge-padding);
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  line-height: 1;
  border-radius: var(--badge-radius);
  white-space: nowrap;
}

.badge-default {
  background-color: var(--bg-tertiary);
  color: var(--fg-secondary);
}

.badge-primary {
  background-color: var(--bg-brand-subtle);
  color: var(--fg-brand);
}

.badge-success {
  background-color: var(--bg-success-subtle);
  color: var(--fg-success);
}

.badge-warning {
  background-color: var(--bg-warning-subtle);
  color: var(--fg-warning);
}

.badge-error {
  background-color: var(--bg-error-subtle);
  color: var(--fg-error);
}

.badge-secondary {
  background-color: var(--bg-secondary);
  color: var(--fg-secondary);
}

/* Badge sizes */
.badge-sm { height: var(--badge-height-sm); font-size: var(--text-xs); }
.badge-lg { height: var(--badge-height-lg); }

/* ----- TAG ----- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  height: 28px;
  padding: 0 var(--space-3);
  font-size: var(--text-sm);
  background-color: var(--bg-tertiary);
  color: var(--fg-primary);
  border-radius: var(--radius-md);
}

.tag-removable {
  padding-right: var(--space-1);
}

/* ----- AVATAR ----- */
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--avatar-size-md);
  height: var(--avatar-size-md);
  border-radius: var(--radius-full);
  background-color: var(--bg-tertiary);
  color: var(--fg-secondary);
  font-weight: var(--font-medium);
  overflow: hidden;
  flex-shrink: 0;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

/* ----- TOOLTIP ----- */
/* Liquid Glass Lite: Light background with border, consistent with design system */
.tooltip {
  position: relative;
}

.tooltip-content {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-xs);
  font-weight: var(--font-regular);
  line-height: 1.5;
  background: #1e293b;
  border: none;
  color: rgba(255, 255, 255, 0.95);
  border-radius: var(--radius-md);
  white-space: normal;
  width: max-content;
  max-width: 280px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, visibility 0.15s ease;
  z-index: var(--z-tooltip);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  pointer-events: none;
}

.tooltip-content::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #1e293b;
}

.tooltip:hover .tooltip-content {
  opacity: 1;
  visibility: visible;
}

/* ----- PROGRESS BAR ----- */
.progress {
  width: 100%;
  height: 8px;
  background-color: var(--bg-tertiary);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background-color: var(--bg-brand);
  border-radius: var(--radius-full);
  transition: width var(--duration-slow) var(--ease-out);
}

.progress-success .progress-bar { background-color: var(--bg-success); }
.progress-warning .progress-bar { background-color: var(--bg-warning); }
.progress-error .progress-bar { background-color: var(--bg-error); }

/* ----- MODAL/DIALOG ----- */
.modal {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
}

.modal.active {
  display: flex;
}

/* When modal-overlay is inside .modal (standard pattern) */
.modal .modal-overlay {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-color: var(--modal-backdrop);
  /* Liquid Glass Lite: No backdrop-filter for performance */
}

/* When modal-overlay is used as standalone container (legacy pattern) */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: var(--modal-backdrop);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-modal);
  padding: var(--space-4);
}

.modal-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--size-lg);
  max-height: 90vh;
  background-color: var(--bg-primary);
  border-radius: var(--modal-radius);
  box-shadow: var(--modal-shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  /* Liquid Glass Lite: Simple fade animation only */
  animation: modalFadeIn var(--duration-normal) var(--ease-out);
}

/* Liquid Glass Lite: No transform animations */
@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Modal Sizes */
.modal-sm .modal-container { max-width: var(--size-sm); }
.modal-md .modal-container { max-width: var(--size-md); }
.modal-lg .modal-container { max-width: var(--size-lg); }
.modal-xl .modal-container { max-width: 900px; }
.modal-full .modal-container {
  max-width: calc(100vw - var(--space-8));
  max-height: calc(100vh - var(--space-8));
}

/* Liquid Glass Lite: Modal header with spacious padding */
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--border-primary);
  flex-shrink: 0;
}

.modal-title {
  font-size: var(--text-xl);
  font-weight: var(--font-semibold);
  color: var(--fg-primary);
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}

.modal-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  border-radius: var(--radius-xl);
  color: var(--fg-secondary);
  cursor: pointer;
  transition: var(--transition-colors);
  flex-shrink: 0;
  margin-left: var(--space-3);
}

.modal-close:hover {
  background-color: var(--interactive-hover);
  color: var(--fg-primary);
}

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

/* Modal body variants */
.modal-body-centered {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
}

.modal-body-flush {
  padding: 0;
}

/* Liquid Glass Lite: Modal footer with spacious padding */
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
  padding: var(--space-5) var(--space-6);
  border-top: 1px solid var(--border-primary);
  flex-shrink: 0;
}

.modal-footer-between {
  justify-content: space-between;
}

/* Modal Loading State */
.modal-loading {
  color: var(--fg-secondary);
  font-size: var(--text-base);
  text-align: center;
  padding: var(--space-8);
}

/* Responsive */
@media (max-width: 639px) {
  .modal {
    padding: var(--space-2);
  }

  .modal-container {
    max-height: 95vh;
  }

  .modal-header {
    padding: var(--space-3) var(--space-4);
  }

  .modal-body {
    padding: var(--space-4);
  }

  .modal-footer {
    padding: var(--space-3) var(--space-4);
  }
}

/* ----- TOAST/NOTIFICATION ----- */
/* Liquid Glass Lite: Consistent with modals and cards */
.toast {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-5);
  background-color: var(--bg-primary);
  border: var(--card-border);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-lg);
  max-width: 420px;
}

.toast-success {
  border-left: 4px solid var(--color-success-500);
  box-shadow: var(--shadow-success);
}
.toast-warning {
  border-left: 4px solid var(--color-warning-500);
  box-shadow: var(--shadow-warning);
}
.toast-error {
  border-left: 4px solid var(--color-error-500);
  box-shadow: var(--shadow-error);
}
.toast-info {
  border-left: 4px solid var(--color-info-500);
  box-shadow: var(--shadow-info);
}

/* ----- TABS ----- */
.tabs {
  display: flex;
  gap: var(--space-1);
  border-bottom: 1px solid var(--border-primary);
}

.tab {
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--fg-secondary);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: var(--transition-fast);
}

.tab:hover {
  color: var(--fg-primary);
}

.tab.active,
.tab[aria-selected="true"] {
  color: var(--fg-brand);
  border-bottom-color: var(--border-brand);
}

/* ----- TABLE ----- */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.table th,
.table td {
  padding: var(--space-3) var(--space-4);
  text-align: left;
  border-bottom: 1px solid var(--border-primary);
}

.table th {
  font-weight: var(--font-medium);
  color: var(--fg-secondary);
  background-color: var(--bg-secondary);
}

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

/* ----- SKELETON/LOADING ----- */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--bg-tertiary) 25%,
    var(--bg-secondary) 50%,
    var(--bg-tertiary) 75%
  );
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: var(--radius-md);
}

@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-text {
  height: 1em;
  margin-bottom: var(--space-2);
}

.skeleton-title {
  height: 1.5em;
  width: 60%;
  margin-bottom: var(--space-3);
}

.skeleton-avatar {
  border-radius: var(--radius-full);
}

/* ----- DIVIDER ----- */
.divider {
  height: 1px;
  background-color: var(--border-primary);
  margin: var(--space-4) 0;
}

.divider-vertical {
  width: 1px;
  height: auto;
  align-self: stretch;
  margin: 0 var(--space-4);
}

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

/* Flex */
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-start { align-items: flex-start; }
.items-center { align-items: center; }
.items-end { align-items: flex-end; }
.justify-start { justify-content: flex-start; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }

/* Grid */
.grid { display: grid; }
.grid-cols-1 { grid-template-columns: repeat(1, 1fr); }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }

/* Spacing */
.m-0 { margin: 0; }
.m-auto { margin: auto; }
.mx-auto { margin-left: auto; margin-right: auto; }
.p-0 { padding: 0; }
.p-4 { padding: var(--space-4); }
.p-6 { padding: var(--space-6); }
.p-8 { padding: var(--space-8); }

/* Width/Height */
.w-full { width: 100%; }
.h-full { height: 100%; }
.min-h-screen { min-height: 100vh; }

/* Container */
.container {
  width: 100%;
  max-width: var(--size-7xl);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-4);
  padding-right: var(--space-4);
}

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

/* ============================================
 * RESPONSIVE UTILITIES
 * ============================================ */

@media (min-width: 640px) {
  .sm\:flex { display: flex; }
  .sm\:hidden { display: none; }
  .sm\:grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 768px) {
  .md\:flex { display: flex; }
  .md\:hidden { display: none; }
  .md\:grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
  .md\:grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 1024px) {
  .lg\:flex { display: flex; }
  .lg\:hidden { display: none; }
  .lg\:grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
  .lg\:grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
}

/* ============================================
 * ICON UTILITIES (Nucleo React Components)
 * Default: 24x24px, stroke-width: 2px
 * ============================================ */

/* Icon wrapper class (optional - for legacy support) */
.icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.icon svg {
  width: 100%;
  height: 100%;
  stroke-width: 2px;
}

/* 
 * Nucleo React icons render as SVG directly.
 * Use these utilities for sizing and colors.
 */

/* Icon Sizes - apply to icon wrapper or directly to SVG */
.icon-xs { width: 12px; height: 12px; }
.icon-sm { width: 16px; height: 16px; }
.icon-md { width: 20px; height: 20px; }
.icon-base { width: 24px; height: 24px; } /* default */
.icon-lg { width: 28px; height: 28px; }
.icon-xl { width: 32px; height: 32px; }
.icon-2xl { width: 40px; height: 40px; }
.icon-3xl { width: 48px; height: 48px; }

/* Icon Colors - inherits currentColor by default */
.icon-primary { color: var(--fg-brand); }
.icon-secondary { color: var(--fg-secondary); }
.icon-tertiary { color: var(--fg-tertiary); }
.icon-success { color: var(--fg-success); }
.icon-warning { color: var(--fg-warning); }
.icon-error { color: var(--fg-error); }
.icon-info { color: var(--fg-info); }
.icon-inverse { color: var(--fg-inverse); }

/* Icon in buttons - auto sizing for Nucleo React components */
.btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.btn-lg svg {
  width: 20px;
  height: 20px;
}

.btn-sm svg {
  width: 14px;
  height: 14px;
}

/* Icon button - centered icon */
.btn-icon svg {
  width: 20px;
  height: 20px;
}

/* Icon with text alignment */
.icon-text {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

/* Spinning icon (for loaders) */
.icon-spin,
svg.animate-spin {
  animation: spin 1s linear infinite;
}

/* ============================================
 * FEATURE ICONS (Nucleo Glass - React Components)
 * Package: nucleo-glass
 * For decorations: empty states, illustrations
 * ============================================ */

/*
 * Nucleo Glass icons are React components that render SVG directly.
 * Use size prop or CSS classes for sizing.
 * 
 * Example:
 * import { IconInbox } from "nucleo-glass";
 * <IconInbox size={96} />
 */

/* Legacy wrapper support */
.feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  flex-shrink: 0;
}

.feature-icon svg {
  width: 100%;
  height: 100%;
}

/* Feature Icon Sizes */
.feature-icon-sm { width: 48px; height: 48px; }
.feature-icon-md { width: 64px; height: 64px; } /* default */
.feature-icon-lg { width: 80px; height: 80px; }
.feature-icon-xl { width: 96px; height: 96px; }
.feature-icon-2xl { width: 128px; height: 128px; }
.feature-icon-3xl { width: 160px; height: 160px; }

/* Empty State Container */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-12) var(--space-6);
  gap: var(--space-4);
}

/* Feature icon spacing in empty states */
.empty-state > svg,
.empty-state .feature-icon {
  margin-bottom: var(--space-2);
}

.empty-state-title {
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  color: var(--fg-primary);
}

.empty-state-description {
  font-size: var(--text-sm);
  color: var(--fg-secondary);
  max-width: 320px;
}

/* ============================================
 * ANIMATION UTILITIES
 * Liquid Glass Lite: Minimal animations, no transforms
 * ============================================ */

/* Spinner - kept for loading indicators */
.animate-spin {
  animation: spin 1s linear infinite;
}

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

/* Pulse - opacity only */
.animate-pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Fade In - primary animation for Liquid Glass Lite */
.animate-fade-in {
  animation: fadeIn var(--duration-normal) var(--ease-out);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
