/**
 * Video Transform Portal - Component Styles
 * Version: 2.0
 * 
 * All component-specific styles
 * Import AFTER design-system.css
 */

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  
  padding: var(--space-3) var(--space-5);
  min-height: 44px;
  
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  line-height: 1;
  white-space: nowrap;
  
  cursor: pointer;
  transition: 
    background-color var(--duration-fast) var(--ease-out),
    border-color var(--duration-fast) var(--ease-out),
    color var(--duration-fast) var(--ease-out),
    box-shadow var(--duration-fast) var(--ease-out),
    transform var(--duration-fast) var(--ease-out);
}

.btn:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
}

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

/* Primary Button */
.btn-primary {
  background: var(--accent-primary);
  color: white;
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-primary-hover);
}

.btn-primary:active:not(:disabled) {
  background: var(--accent-primary-active);
  transform: scale(0.98);
}

/* Secondary Button */
.btn-secondary {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border-default);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--bg-elevated-2);
  border-color: var(--border-strong);
  color: var(--text-primary);
}

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

.btn-ghost:hover:not(:disabled) {
  background: var(--bg-elevated-2);
  color: var(--text-primary);
}

/* Danger Button */
.btn-danger {
  background: var(--error);
  color: white;
}

.btn-danger:hover:not(:disabled) {
  background: #dc2626;
}

/* Success Button */
.btn-success {
  background: var(--success);
  color: white;
}

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

/* Button Sizes */
.btn-sm {
  padding: var(--space-2) var(--space-3);
  min-height: 32px;
  font-size: var(--text-xs);
}

.btn-lg {
  padding: var(--space-4) var(--space-6);
  min-height: 52px;
  font-size: var(--text-base);
}

.btn-full {
  width: 100%;
}

/* Icon Button */
.btn-icon {
  padding: var(--space-2);
  min-height: auto;
  min-width: 40px;
  height: 40px;
}

.btn-icon.btn-sm {
  min-width: 32px;
  height: 32px;
}

.btn-icon.btn-lg {
  min-width: 48px;
  height: 48px;
}

/* Button Icon */
.btn-icon-left {
  margin-right: var(--space-1);
}

.btn-icon-right {
  margin-left: var(--space-1);
}

/* Button Loading State */
.btn-loading {
  position: relative;
  color: transparent;
}

.btn-loading::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--padding-lg);
  transition: 
    background-color var(--duration-fast) var(--ease-out),
    border-color var(--duration-fast) var(--ease-out);
}

.card:hover {
  border-color: var(--border-default);
}

.card-interactive {
  cursor: pointer;
}

.card-interactive:hover {
  background: var(--bg-elevated-2);
  border-color: var(--border-strong);
}

.card-interactive.selected,
.card-interactive[aria-checked="true"] {
  border-color: var(--accent-primary);
  background: var(--accent-glow);
}

.card-interactive:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
}

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

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

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

.card-footer {
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border-subtle);
}

/* Compact Card */
.card-compact {
  padding: var(--padding-md);
}

/* ============================================
   STAT CARD
   ============================================ */

.stat-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--padding-lg);
  min-height: 120px;
  display: flex;
  flex-direction: column;
}

.stat-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: var(--space-3);
}

.stat-card-icon {
  font-size: var(--text-2xl);
}

.stat-card-link {
  font-size: var(--text-xs);
  color: var(--accent-primary);
  transition: color var(--duration-fast) var(--ease-out);
}

.stat-card-link:hover {
  color: var(--accent-primary-hover);
}

.stat-card-value {
  font-size: var(--text-3xl);
  font-weight: var(--font-bold);
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: var(--space-1);
}

.stat-card-label {
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.stat-card-change {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  margin-top: var(--space-2);
  padding: var(--space-1) var(--space-2);
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  border-radius: var(--radius-full);
}

.stat-card-change.positive {
  background: var(--success-bg);
  color: var(--success);
}

.stat-card-change.negative {
  background: var(--error-bg);
  color: var(--error);
}

.stat-card-change.neutral {
  background: var(--bg-elevated-2);
  color: var(--text-muted);
}

/* ============================================
   MODEL CARD
   ============================================ */

.model-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--padding-md);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: 
    background-color var(--duration-fast) var(--ease-out),
    border-color var(--duration-fast) var(--ease-out);
}

.model-card:hover {
  background: var(--bg-elevated-2);
  border-color: var(--border-default);
}

.model-card.selected,
.model-card[aria-checked="true"] {
  border-color: var(--accent-primary);
  background: var(--accent-glow);
}

.model-card:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
}

.model-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.model-card-price {
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--accent-primary);
}

.model-card-name {
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
}

.model-card-description {
  font-size: var(--text-xs);
  color: var(--text-muted);
  line-height: var(--leading-normal);
}

/* ============================================
   GALLERY CARD
   ============================================ */

.gallery-card {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
}

.gallery-card-media {
  position: relative;
  aspect-ratio: 1;
  background: var(--bg-elevated-2);
}

.gallery-card-media img,
.gallery-card-media video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.gallery-card-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  background: rgba(0, 0, 0, 0.7);
  opacity: 0;
  transition: opacity var(--duration-normal) var(--ease-out);
}

.gallery-card:hover .gallery-card-overlay {
  opacity: 1;
}

.gallery-action {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: var(--text-lg);
  transition: 
    background-color var(--duration-fast) var(--ease-out),
    transform var(--duration-fast) var(--ease-out);
}

.gallery-action:hover {
  background: var(--accent-primary);
  transform: scale(1.1);
}

.gallery-action--danger:hover {
  background: var(--error);
}

.gallery-card-info {
  padding: var(--space-3);
}

.gallery-card-prompt {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gallery-card-meta {
  display: flex;
  justify-content: space-between;
  margin-top: var(--space-2);
  font-size: var(--text-xs);
  color: var(--text-muted);
}

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

.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-2);
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-error { background: var(--error-bg); color: var(--error); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-neutral { background: var(--bg-elevated-2); color: var(--text-muted); }
.badge-premium { background: rgba(168, 85, 247, 0.15); color: #a855f7; }
.badge-fast { background: rgba(34, 197, 94, 0.15); color: #22c55e; }
.badge-budget { background: rgba(234, 179, 8, 0.15); color: #eab308; }
.badge-standard { background: rgba(59, 130, 246, 0.15); color: #3b82f6; }
.badge-ultra { background: rgba(236, 72, 153, 0.15); color: #ec4899; }

/* Status Dot */
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
}

.status-dot-success { background: var(--success); }
.status-dot-warning { background: var(--warning); }
.status-dot-error { background: var(--error); }
.status-dot-info { background: var(--info); }
.status-dot-processing { 
  background: var(--info);
  animation: pulse 2s infinite;
}

/* ============================================
   FORM ELEMENTS
   ============================================ */

.form-group {
  margin-bottom: var(--space-4);
}

.form-label {
  display: block;
  margin-bottom: var(--space-2);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--text-primary);
}

.form-hint {
  margin-top: var(--space-1);
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.form-error {
  margin-top: var(--space-1);
  font-size: var(--text-xs);
  color: var(--error);
}

/* Input */
.input {
  display: block;
  width: 100%;
  padding: var(--space-3) var(--space-4);
  min-height: 44px;
  background: var(--bg-elevated-2);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: var(--text-sm);
  transition: 
    border-color var(--duration-fast) var(--ease-out),
    box-shadow var(--duration-fast) var(--ease-out);
}

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

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

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

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

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

.input--error:focus {
  box-shadow: 0 0 0 3px var(--error-bg);
}

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

/* Select */
.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2371717a'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-3) center;
  background-size: 20px;
  padding-right: var(--space-10);
}

/* ============================================
   TOGGLE GROUP
   ============================================ */

.toggle-group {
  display: flex;
  gap: var(--space-2);
  padding: var(--space-1);
  background: var(--bg-elevated-2);
  border-radius: var(--radius-md);
}

.toggle-group--full {
  width: 100%;
}

.toggle-option {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  cursor: pointer;
  transition: 
    background-color var(--duration-fast) var(--ease-out),
    color var(--duration-fast) var(--ease-out),
    box-shadow var(--duration-fast) var(--ease-out);
}

.toggle-option:hover {
  color: var(--text-secondary);
}

.toggle-option.active,
.toggle-option[aria-checked="true"] {
  background: var(--bg-elevated);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

.toggle-option:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
}

.toggle-icon {
  font-size: var(--text-lg);
}

/* Toggle Group Sizes */
.toggle-group--sm .toggle-option {
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
}

.toggle-group--lg .toggle-option {
  padding: var(--space-3) var(--space-5);
  font-size: var(--text-base);
}

/* ============================================
   SLIDER
   ============================================ */

.slider-container {
  width: 100%;
}

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

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

.slider-value {
  font-weight: var(--font-semibold);
  color: var(--accent-primary);
}

.slider-input {
  width: 100%;
  height: 6px;
  background: var(--bg-elevated-2);
  border-radius: var(--radius-full);
  appearance: none;
  cursor: pointer;
}

.slider-input::-webkit-slider-thumb {
  appearance: none;
  width: 20px;
  height: 20px;
  background: var(--accent-primary);
  border-radius: 50%;
  cursor: pointer;
  transition: transform var(--duration-fast) var(--ease-out);
}

.slider-input::-webkit-slider-thumb:hover {
  transform: scale(1.1);
}

.slider-input::-moz-range-thumb {
  width: 20px;
  height: 20px;
  background: var(--accent-primary);
  border: none;
  border-radius: 50%;
  cursor: pointer;
}

.slider-marks {
  display: flex;
  justify-content: space-between;
  margin-top: var(--space-1);
  font-size: var(--text-xs);
  color: var(--text-muted);
}

/* ============================================
   PROGRESS BAR
   ============================================ */

.progress-container {
  width: 100%;
}

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

.progress-label {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.progress-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid var(--accent-primary);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.progress-count {
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.progress-current {
  color: var(--text-primary);
  font-weight: var(--font-semibold);
}

.progress-track {
  height: 8px;
  background: var(--bg-elevated-2);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--accent-primary);
  border-radius: var(--radius-full);
  transition: width var(--duration-slow) var(--ease-out);
}

.progress-fill--success {
  background: var(--success);
}

.progress-fill--warning {
  background: var(--warning);
}

.progress-fill--error {
  background: var(--error);
}

.progress-fill--indeterminate {
  width: 30% !important;
  animation: indeterminate 1.5s ease-in-out infinite;
}

@keyframes indeterminate {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(400%); }
}

/* ============================================
   COST DISPLAY
   ============================================ */

.cost-display {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--padding-md);
  background: var(--bg-elevated-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.cost-display-title {
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--text-primary);
}

.cost-display-breakdown {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: var(--space-1);
}

.cost-display-amount {
  text-align: right;
}

.cost-display-value {
  font-size: var(--text-xl);
  font-weight: var(--font-bold);
  color: var(--text-primary);
}

.cost-value {
  color: var(--accent-primary);
}

.cost-display-balance {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: var(--space-1);
}

.cost-display--warning {
  border-color: var(--warning-border);
  background: var(--warning-bg);
}

.cost-display--warning .cost-value {
  color: var(--warning);
}

/* ============================================
   MODAL
   ============================================ */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
  z-index: var(--z-modal-backdrop);
  opacity: 0;
  visibility: hidden;
  transition: 
    opacity var(--duration-normal) var(--ease-out),
    visibility var(--duration-normal) var(--ease-out);
}

.modal-overlay.open,
.modal-overlay[aria-hidden="false"] {
  opacity: 1;
  visibility: visible;
}

.modal {
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-xl);
  transform: translateY(20px);
  transition: transform var(--duration-normal) var(--ease-out);
}

.modal-overlay.open .modal,
.modal-overlay[aria-hidden="false"] .modal {
  transform: translateY(0);
}

.modal--sm { max-width: 400px; }
.modal--lg { max-width: 800px; }
.modal--xl { max-width: 1000px; }
.modal--full { max-width: calc(100vw - var(--space-8)); }

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

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

.modal-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  transition: 
    background-color var(--duration-fast) var(--ease-out),
    color var(--duration-fast) var(--ease-out);
}

.modal-close:hover {
  background: var(--bg-elevated-2);
  color: var(--text-primary);
}

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

.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-subtle);
}

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

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-4);
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  min-height: 60px;
}

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

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

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.nav-link {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-2) var(--space-3);
  color: var(--text-muted);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  border-radius: var(--radius-sm);
  transition: 
    color var(--duration-fast) var(--ease-out),
    background-color var(--duration-fast) var(--ease-out);
}

.nav-link:hover {
  color: var(--text-primary);
  background: var(--bg-elevated-2);
}

.nav-link.active {
  color: var(--text-primary);
  background: var(--bg-elevated-2);
}

/* Nav Dropdown */
.nav-dropdown {
  position: relative;
}

.nav-dropdown-trigger {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.nav-dropdown-arrow {
  width: 16px;
  height: 16px;
  transition: transform var(--duration-fast) var(--ease-out);
}

.nav-dropdown:hover .nav-dropdown-arrow {
  transform: rotate(180deg);
}

.nav-dropdown-content {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: var(--space-2);
  min-width: 200px;
  padding: var(--space-2);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: 
    opacity var(--duration-normal) var(--ease-out),
    visibility var(--duration-normal) var(--ease-out),
    transform var(--duration-normal) var(--ease-out);
}

.nav-dropdown:hover .nav-dropdown-content {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav-dropdown-content--right {
  left: auto;
  right: 0;
}

.nav-dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  color: var(--text-secondary);
  font-size: var(--text-sm);
  border-radius: var(--radius-sm);
  transition: 
    color var(--duration-fast) var(--ease-out),
    background-color var(--duration-fast) var(--ease-out);
}

.nav-dropdown-item:hover {
  color: var(--text-primary);
  background: var(--bg-elevated-2);
}

.nav-dropdown-item--danger {
  color: var(--error);
}

.nav-dropdown-item--danger:hover {
  background: var(--error-bg);
  color: var(--error);
}

.nav-dropdown-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: var(--space-2) 0;
  border: none;
}

/* Nav Right Section */
.nav-right {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

/* Credit Badge */
.credit-badge {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: var(--accent-glow);
  border: 1px solid var(--accent-primary);
  border-radius: var(--radius-full);
  color: var(--text-primary);
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  transition: 
    background-color var(--duration-fast) var(--ease-out),
    transform var(--duration-fast) var(--ease-out);
}

.credit-badge:hover {
  background: var(--accent-primary);
  transform: scale(1.02);
}

/* Mobile Toggle */
.nav-mobile-toggle {
  display: none;
  padding: var(--space-2);
  color: var(--text-secondary);
}

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

/* Hide nav-right content on mobile, but keep hamburger visible */
@media (max-width: 768px) {
  .nav-right {
    display: none;
  }
}

/* ============================================
   TOAST
   ============================================ */

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

.toast {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  min-width: 300px;
  max-width: 400px;
  padding: var(--padding-md);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  animation: slideUp var(--duration-normal) var(--ease-out);
}

.toast--success { border-left: 3px solid var(--success); }
.toast--error { border-left: 3px solid var(--error); }
.toast--warning { border-left: 3px solid var(--warning); }
.toast--info { border-left: 3px solid var(--info); }

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

.toast-content {
  flex: 1;
}

.toast-title {
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
}

.toast-message {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-top: var(--space-1);
}

.toast-close {
  flex-shrink: 0;
  padding: var(--space-1);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
}

.toast-close:hover {
  background: var(--bg-elevated-2);
  color: var(--text-primary);
}

/* ============================================
   FLASH MESSAGES
   ============================================ */

.flash-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: var(--space-4) var(--page-padding) 0;
}

.flash {
  padding: var(--padding-md);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-3);
  font-size: var(--text-sm);
}

.flash--success {
  background: var(--success-bg);
  border: 1px solid var(--success-border);
  color: var(--success);
}

.flash--error {
  background: var(--error-bg);
  border: 1px solid var(--error-border);
  color: var(--error);
}

.flash--warning {
  background: var(--warning-bg);
  border: 1px solid var(--warning-border);
  color: var(--warning);
}

.flash--info {
  background: var(--info-bg);
  border: 1px solid var(--info-border);
  color: var(--info);
}

/* ============================================
   FILE UPLOAD
   ============================================ */

.file-upload {
  border: 2px dashed var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--padding-xl);
  text-align: center;
  cursor: pointer;
  transition: 
    border-color var(--duration-fast) var(--ease-out),
    background-color var(--duration-fast) var(--ease-out);
}

.file-upload:hover {
  border-color: var(--accent-primary);
  background: var(--accent-glow);
}

.file-upload.dragover {
  border-color: var(--accent-primary);
  background: var(--accent-glow);
}

.file-upload-icon {
  font-size: var(--text-4xl);
  margin-bottom: var(--space-3);
}

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

.file-upload-hint {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: var(--space-2);
}

/* ============================================
   IMAGE PREVIEW
   ============================================ */

.image-preview {
  position: relative;
  display: inline-block;
  margin-top: var(--space-3);
}

.image-preview img {
  max-width: 200px;
  max-height: 200px;
  border-radius: var(--radius-md);
  object-fit: contain;
}

.image-preview-remove {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--error);
  color: white;
  border-radius: 50%;
  font-size: var(--text-sm);
  font-weight: var(--font-bold);
  cursor: pointer;
  transition: transform var(--duration-fast) var(--ease-out);
}

.image-preview-remove:hover {
  transform: scale(1.1);
}

/* ============================================
   TABLE
   ============================================ */

.table-container {
  overflow-x: auto;
}

.table-container.card {
  padding: 0;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

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

.table th {
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--bg-elevated-2);
}

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

.table tr:hover td {
  background: var(--bg-elevated-2);
}

/* Table column alignments */
.table th.text-right,
.table td.text-right {
  text-align: right;
}

.table td.text-mono {
  font-family: var(--font-mono);
}

.table td.text-warning {
  color: var(--warning);
}

/* Job title cell */
.table .job-title {
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
}

/* ============================================
   EMPTY STATE
   ============================================ */

.empty-state {
  text-align: center;
  padding: var(--space-12) var(--space-6);
}

.empty-state-icon {
  font-size: var(--text-5xl);
  margin-bottom: var(--space-4);
}

.empty-state-title {
  font-size: var(--text-xl);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

.empty-state-description {
  font-size: var(--text-sm);
  color: var(--text-muted);
  max-width: 400px;
  margin: 0 auto var(--space-6);
}

/* ============================================
   ICON SIZING
   ============================================ */

.icon-xs { width: 16px; height: 16px; }
.icon-sm { width: 20px; height: 20px; }
.icon-md { width: 24px; height: 24px; }
.icon-lg { width: 32px; height: 32px; }
.icon-xl { width: 48px; height: 48px; }

/* ============================================
   RESPONSIVE COMPONENT STYLES
   ============================================ */

/* === TABLET (768px - 1023px) === */
@media (max-width: 1023px) and (min-width: 768px) {
  /* Grid adjustments */
  .grid-stats {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .grid-models {
    grid-template-columns: repeat(2, 1fr);
  }
  
  /* Card adjustments */
  .card {
    padding: var(--padding-lg);
  }
  
  /* Modal adjustments */
  .modal-content {
    max-width: 90%;
    max-height: 85vh;
  }
}

/* === MOBILE (below 768px) === */
@media (max-width: 767px) {
  /* Grid stacking */
  .grid-stats {
    grid-template-columns: 1fr;
    gap: var(--space-3);
  }
  
  .grid-models {
    grid-template-columns: 1fr;
    gap: var(--space-3);
  }
  
  .grid-gallery {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-3);
  }
  
  /* Card adjustments */
  .card {
    padding: var(--padding-md);
    border-radius: var(--radius-md);
  }
  
  .stat-card {
    flex-direction: row;
    align-items: center;
    gap: var(--space-3);
  }
  
  .stat-card-icon {
    font-size: var(--text-2xl);
  }
  
  .stat-card-value {
    font-size: var(--text-xl);
  }
  
  /* Button full width on mobile */
  .btn-full-mobile {
    width: 100%;
    justify-content: center;
  }
  
  /* Form adjustments */
  .form-group {
    margin-bottom: var(--space-4);
  }
  
  .toggle-group {
    flex-wrap: wrap;
  }
  
  .toggle-option {
    flex: 1 1 auto;
    min-width: 80px;
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-xs);
  }
  
  /* Cost display */
  .cost-display {
    flex-direction: column;
    gap: var(--space-3);
    text-align: center;
  }
  
  .cost-display-amount {
    align-items: center;
  }
  
  /* Modal full screen on mobile */
  .modal-content {
    margin: 0;
    max-width: 100%;
    max-height: 100%;
    width: 100%;
    height: 100%;
    border-radius: 0;
  }
  
  .modal-header {
    padding: var(--space-4);
    position: sticky;
    top: 0;
    background: var(--bg-elevated);
    z-index: 1;
  }
  
  .modal-body {
    padding: var(--space-4);
  }
  
  /* Gallery items */
  .gallery-item {
    aspect-ratio: 1;
  }
  
  /* Toast positioning */
  .toast-container {
    left: var(--space-3);
    right: var(--space-3);
    bottom: var(--space-3);
  }
  
  .toast {
    min-width: auto;
    max-width: none;
  }
  
  /* Table horizontal scroll */
  .table-container {
    margin: 0 calc(-1 * var(--page-padding));
    padding: 0 var(--page-padding);
  }
  
  /* File upload */
  .file-upload {
    padding: var(--padding-lg);
  }
  
  .file-upload-icon {
    font-size: var(--text-3xl);
  }
  
  /* Empty state */
  .empty-state {
    padding: var(--space-8) var(--space-4);
  }
  
  .empty-state-icon {
    font-size: var(--text-4xl);
  }
  
  /* Typography scaling */
  .heading-display {
    font-size: var(--text-3xl);
  }
  
  .heading-section {
    font-size: var(--text-xl);
  }
}

/* === SMALL MOBILE (below 375px) === */
@media (max-width: 374px) {
  .grid-gallery {
    grid-template-columns: 1fr;
  }
  
  .toggle-group {
    flex-direction: column;
  }
  
  .toggle-option {
    width: 100%;
  }
  
  .btn-sm {
    padding: var(--space-2);
    font-size: var(--text-xs);
  }
  
  .stat-card {
    padding: var(--space-3);
  }
}

/* === LARGE DESKTOP (1920px+) === */
@media (min-width: 1920px) {
  .page-container {
    max-width: 1600px;
  }
  
  .grid-stats {
    grid-template-columns: repeat(4, 1fr);
  }
  
  .grid-models {
    grid-template-columns: repeat(4, 1fr);
  }
  
  .grid-gallery {
    grid-template-columns: repeat(5, 1fr);
  }
}

/* ============================================
   COMPREHENSIVE RESPONSIVE COMPONENT STYLES
   Mobile-First Approach
   ============================================ */

/* === AUTH PAGES (Login, Register) === */
.auth-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 80px);
  padding: var(--space-4);
}

.auth-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  width: 100%;
  max-width: 100%;
}

.auth-title {
  font-size: var(--text-2xl);
  font-weight: var(--font-bold);
  color: var(--text-primary);
  text-align: center;
  margin-bottom: var(--space-6);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.auth-footer {
  margin-top: var(--space-6);
  text-align: center;
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.auth-footer p {
  margin-bottom: var(--space-1);
}

.auth-footer .mono {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  background: var(--bg-elevated-2);
  padding: var(--space-2);
  border-radius: var(--radius-sm);
  display: inline-block;
  margin-top: var(--space-2);
}

@media (min-width: 640px) {
  .auth-card {
    max-width: 440px;
    padding: var(--space-8);
  }
  
  .auth-title {
    font-size: var(--text-3xl);
  }
}

@media (min-width: 768px) {
  .auth-card {
    max-width: 480px;
  }
}

/* === BUTTON RESPONSIVE === */
.btn {
  padding: var(--space-3) var(--space-4);
  min-height: 44px; /* Touch target */
  font-size: var(--text-sm);
}

.btn-sm {
  padding: var(--space-2) var(--space-3);
  min-height: 36px;
  font-size: var(--text-xs);
}

.btn-lg {
  padding: var(--space-4) var(--space-6);
  min-height: 52px;
  font-size: var(--text-base);
}

/* Full-width buttons on mobile */
.btn-responsive {
  width: 100%;
}

@media (min-width: 640px) {
  .btn-responsive {
    width: auto;
  }
}

/* Button group - stack on mobile */
.btn-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  width: 100%;
}

@media (min-width: 640px) {
  .btn-group {
    flex-direction: row;
    width: auto;
  }
  
  .btn-group .btn {
    flex: none;
  }
}

/* === CARD RESPONSIVE === */
.card {
  padding: var(--space-4);
  border-radius: var(--radius-md);
}

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

@media (min-width: 1024px) {
  .card {
    padding: var(--space-6);
  }
}

/* Card header - stack on small screens */
.card-header {
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-2);
}

@media (min-width: 480px) {
  .card-header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

/* === STAT CARD RESPONSIVE === */
.stat-card {
  padding: var(--space-4);
}

.stat-card-value {
  font-size: var(--text-2xl);
}

@media (min-width: 640px) {
  .stat-card {
    padding: var(--space-5);
  }
  
  .stat-card-value {
    font-size: var(--text-3xl);
  }
}

@media (min-width: 1024px) {
  .stat-card {
    padding: var(--space-6);
  }
}

/* === MODEL CARD RESPONSIVE === */
.model-card {
  padding: var(--space-3);
}

@media (min-width: 640px) {
  .model-card {
    padding: var(--space-4);
  }
}

/* === NAVIGATION RESPONSIVE === */
.nav-container {
  padding: var(--space-3) var(--space-4);
}

@media (min-width: 768px) {
  .nav-container {
    padding: var(--space-3) var(--space-6);
  }
}

/* Mobile menu overlay */
.mobile-menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
  z-index: var(--z-modal-backdrop);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--duration-normal), visibility var(--duration-normal);
}

.mobile-menu-overlay.open {
  opacity: 1;
  visibility: visible;
}

.mobile-menu {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(320px, 85vw);
  background: var(--bg-elevated);
  border-left: 1px solid var(--border-subtle);
  z-index: var(--z-modal);
  transform: translateX(100%);
  transition: transform var(--duration-slow) var(--ease-out);
  overflow-y: auto;
  padding: var(--space-6);
}

.mobile-menu-overlay.open .mobile-menu {
  transform: translateX(0);
}

.mobile-menu-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-6);
}

.mobile-menu-close {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
}

.mobile-menu-close:hover {
  background: var(--bg-elevated-2);
  color: var(--text-primary);
}

.mobile-menu-section {
  margin-bottom: var(--space-6);
}

.mobile-menu-section-title {
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-3);
}

.mobile-menu-link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  margin: 0 calc(-1 * var(--space-4));
  color: var(--text-secondary);
  font-size: var(--text-base);
  border-radius: var(--radius-sm);
  transition: background-color var(--duration-fast), color var(--duration-fast);
}

.mobile-menu-link:hover,
.mobile-menu-link.active {
  background: var(--bg-elevated-2);
  color: var(--text-primary);
}

.mobile-menu-link-icon {
  font-size: var(--text-lg);
  width: 24px;
  text-align: center;
}

/* Hamburger button */
.hamburger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: var(--space-2);
  background: none;
  border: none;
  cursor: pointer;
}

.hamburger-line {
  width: 100%;
  height: 2px;
  background: var(--text-secondary);
  border-radius: var(--radius-full);
  transition: transform var(--duration-normal), opacity var(--duration-normal);
}

.hamburger.active .hamburger-line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.hamburger.active .hamburger-line:nth-child(2) {
  opacity: 0;
}

.hamburger.active .hamburger-line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* === FORM RESPONSIVE === */
.form-group {
  margin-bottom: var(--space-4);
}

.input {
  min-height: 44px; /* Touch target */
  font-size: 16px; /* Prevents iOS zoom */
}

textarea.input {
  min-height: 120px;
}

@media (min-width: 640px) {
  .input {
    font-size: var(--text-sm);
  }
}

/* Form row - stack on mobile */
.form-row {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

@media (min-width: 640px) {
  .form-row {
    flex-direction: row;
  }
  
  .form-row > * {
    flex: 1;
  }
}

/* === TOGGLE GROUP RESPONSIVE === */
.toggle-group {
  flex-wrap: wrap;
}

.toggle-option {
  flex: 1 1 auto;
  min-width: 0;
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-xs);
}

@media (min-width: 480px) {
  .toggle-option {
    padding: var(--space-2) var(--space-4);
    font-size: var(--text-sm);
  }
}

/* Small screen - stack if more than 3 options */
@media (max-width: 479px) {
  .toggle-group--stack-mobile {
    flex-direction: column;
  }
  
  .toggle-group--stack-mobile .toggle-option {
    width: 100%;
  }
}

/* === MODAL RESPONSIVE === */
.modal-overlay {
  padding: var(--space-4);
}

.modal {
  max-height: calc(100vh - var(--space-8));
  max-width: calc(100vw - var(--space-8));
}

/* Full screen modal on mobile */
@media (max-width: 639px) {
  .modal-overlay {
    padding: 0;
  }
  
  .modal {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    border-radius: 0;
  }
  
  .modal-header {
    position: sticky;
    top: 0;
    background: var(--bg-elevated);
    z-index: 1;
  }
  
  .modal-footer {
    position: sticky;
    bottom: 0;
    background: var(--bg-elevated);
  }
}

@media (min-width: 640px) {
  .modal {
    max-width: 500px;
    border-radius: var(--radius-xl);
  }
  
  .modal--lg {
    max-width: 700px;
  }
  
  .modal--xl {
    max-width: 900px;
  }
}

@media (min-width: 1024px) {
  .modal {
    max-width: 600px;
  }
  
  .modal--lg {
    max-width: 800px;
  }
  
  .modal--xl {
    max-width: 1000px;
  }
}

/* === TOAST RESPONSIVE === */
.toast-container {
  position: fixed;
  z-index: var(--z-toast);
}

/* Mobile - bottom full width */
@media (max-width: 639px) {
  .toast-container {
    left: var(--space-3);
    right: var(--space-3);
    bottom: var(--space-3);
  }
  
  .toast {
    min-width: 0;
    max-width: none;
    width: 100%;
  }
}

/* Desktop - bottom right */
@media (min-width: 640px) {
  .toast-container {
    right: var(--space-6);
    bottom: var(--space-6);
    left: auto;
  }
  
  .toast {
    min-width: 300px;
    max-width: 400px;
  }
}

/* === TABLE RESPONSIVE === */
.table-container {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Mobile table scroll hint */
@media (max-width: 767px) {
  .table-container {
    margin: 0 calc(-1 * var(--space-4));
    padding: 0 var(--space-4);
  }
  
  .table-container::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 20px;
    background: linear-gradient(to left, var(--bg-base), transparent);
    pointer-events: none;
    opacity: 0.5;
  }
  
  .table th,
  .table td {
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-xs);
  }
}

/* Card-style table on mobile (alternative) */
.table-cards {
  display: none;
}

@media (max-width: 767px) {
  .table--cards-mobile .table {
    display: none;
  }
  
  .table--cards-mobile .table-cards {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
  }
  
  .table-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: var(--space-4);
  }
  
  .table-card-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-2) 0;
    border-bottom: 1px solid var(--border-subtle);
  }
  
  .table-card-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
  }
  
  .table-card-label {
    font-size: var(--text-xs);
    color: var(--text-muted);
    text-transform: uppercase;
  }
  
  .table-card-value {
    font-size: var(--text-sm);
    color: var(--text-primary);
  }
}

/* === FILE UPLOAD RESPONSIVE === */
.file-upload {
  padding: var(--space-6);
}

.file-upload-icon {
  font-size: var(--text-3xl);
}

@media (min-width: 640px) {
  .file-upload {
    padding: var(--space-8);
  }
  
  .file-upload-icon {
    font-size: var(--text-4xl);
  }
}

/* === EMPTY STATE RESPONSIVE === */
.empty-state {
  padding: var(--space-8) var(--space-4);
}

.empty-state-icon {
  font-size: var(--text-4xl);
}

.empty-state-title {
  font-size: var(--text-lg);
}

@media (min-width: 640px) {
  .empty-state {
    padding: var(--space-12) var(--space-6);
  }
  
  .empty-state-icon {
    font-size: var(--text-5xl);
  }
  
  .empty-state-title {
    font-size: var(--text-xl);
  }
}

/* === COST DISPLAY RESPONSIVE === */
.cost-display {
  flex-direction: column;
  gap: var(--space-3);
  text-align: center;
}

.cost-display-amount {
  text-align: center;
}

@media (min-width: 640px) {
  .cost-display {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
  
  .cost-display-amount {
    text-align: right;
  }
}

/* === PROGRESS BAR RESPONSIVE === */
.progress-header {
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-2);
}

@media (min-width: 480px) {
  .progress-header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

/* === GALLERY CARD RESPONSIVE === */
.gallery-card-media {
  aspect-ratio: 1;
}

@media (min-width: 640px) {
  .gallery-card-media {
    aspect-ratio: 16/9;
  }
}

/* Touch-friendly gallery actions */
@media (max-width: 1023px) {
  .gallery-card-overlay {
    opacity: 1;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, transparent 100%);
    align-items: flex-end;
    padding: var(--space-3);
  }
  
  .gallery-action {
    width: 36px;
    height: 36px;
  }
}

/* === SLIDER RESPONSIVE === */
.slider-input {
  height: 8px;
}

.slider-input::-webkit-slider-thumb {
  width: 24px;
  height: 24px;
}

@media (min-width: 640px) {
  .slider-input {
    height: 6px;
  }
  
  .slider-input::-webkit-slider-thumb {
    width: 20px;
    height: 20px;
  }
}

/* === CREDIT BADGE RESPONSIVE === */
.credit-badge {
  padding: var(--space-1) var(--space-2);
  font-size: var(--text-xs);
}

@media (min-width: 640px) {
  .credit-badge {
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-sm);
  }
}

/* === STUDIO LAYOUT RESPONSIVE === */
.studio-container {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.studio-main {
  order: 2;
}

.studio-sidebar {
  order: 1;
}

@media (min-width: 1024px) {
  .studio-container {
    flex-direction: row;
    gap: var(--space-8);
  }
  
  .studio-main {
    flex: 1;
    order: 1;
  }
  
  .studio-sidebar {
    width: 360px;
    flex-shrink: 0;
    order: 2;
    position: sticky;
    top: var(--space-6);
    align-self: start;
  }
}

@media (min-width: 1280px) {
  .studio-sidebar {
    width: 400px;
  }
}

/* === LOADING STATES === */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 11, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-modal);
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border-default);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.loading-text {
  margin-top: var(--space-4);
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

/* Button loading state */
.btn.is-loading {
  position: relative;
  color: transparent;
  pointer-events: none;
}

.btn.is-loading::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  top: 50%;
  left: 50%;
  margin: -8px 0 0 -8px;
  border: 2px solid white;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

/* Skeleton loading */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--bg-elevated-2) 25%,
    var(--bg-elevated-3) 50%,
    var(--bg-elevated-2) 75%
  );
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: var(--radius-sm);
}

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

.skeleton-title {
  height: 1.5em;
  width: 60%;
}

.skeleton-card {
  height: 200px;
}

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

/* === FOCUS VISIBLE STATES === */
:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

/* Remove default focus for mouse users */
:focus:not(:focus-visible) {
  outline: none;
}

/* === SKIP LINK (Accessibility) === */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  padding: var(--space-3) var(--space-4);
  background: var(--accent-primary);
  color: white;
  border-radius: var(--radius-sm);
  z-index: 9999;
  transition: top var(--duration-fast);
}

.skip-link:focus {
  top: var(--space-4);
}

/* ============================================
   PROFESSIONAL POLISH ADDITIONS
   ============================================ */

/* === TYPOGRAPHY POLISH === */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary);
  font-weight: var(--font-semibold);
  line-height: var(--leading-tight);
  letter-spacing: -0.01em;
}

h1 { font-size: var(--text-3xl); margin-bottom: var(--space-4); }
h2 { font-size: var(--text-2xl); margin-bottom: var(--space-3); }
h3 { font-size: var(--text-xl); margin-bottom: var(--space-2); }
h4 { font-size: var(--text-lg); margin-bottom: var(--space-2); }
h5 { font-size: var(--text-base); margin-bottom: var(--space-1); }
h6 { font-size: var(--text-sm); margin-bottom: var(--space-1); }

p {
  margin-bottom: var(--space-4);
  color: var(--text-secondary);
}

p:last-child {
  margin-bottom: 0;
}

/* Code/Mono styling */
code, pre, .mono {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--bg-elevated-2);
  border-radius: var(--radius-sm);
}

code {
  padding: 0.125em 0.375em;
}

pre {
  padding: var(--space-4);
  overflow-x: auto;
  white-space: pre-wrap;
  word-wrap: break-word;
}

/* === CONSISTENT HOVER STATES === */
a:not(.btn):not(.nav-link):not(.card):hover {
  opacity: 0.85;
}

.card:hover {
  border-color: var(--border-default);
}

.card-interactive:hover {
  border-color: var(--border-strong);
  background: var(--bg-elevated-2);
}

/* === CONSISTENT TRANSITIONS === */
a, button, input, textarea, select, .card, .badge, .btn {
  transition-property: background-color, border-color, color, box-shadow, opacity, transform;
  transition-duration: var(--duration-fast);
  transition-timing-function: var(--ease-out);
}

/* === SELECTION STYLING === */
::selection {
  background: var(--accent-primary);
  color: white;
}

::-moz-selection {
  background: var(--accent-primary);
  color: white;
}

/* === PLACEHOLDER CONSISTENCY === */
::placeholder {
  color: var(--text-muted);
  opacity: 1;
}

::-webkit-input-placeholder {
  color: var(--text-muted);
}

::-moz-placeholder {
  color: var(--text-muted);
}

/* === DISABLED STATES === */
[disabled],
.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* === INPUT FOCUS POLISH === */
input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-glow);
  outline: none;
}

/* === BUTTON ACTIVE STATE === */
.btn:active:not(:disabled) {
  transform: scale(0.98);
}

/* === LINK STYLING === */
.link,
a.text-accent {
  color: var(--accent-primary);
  text-decoration: none;
  transition: color var(--duration-fast);
}

.link:hover,
a.text-accent:hover {
  color: var(--accent-primary-hover);
  text-decoration: underline;
}

/* === DIVIDERS === */
hr, .divider {
  border: none;
  height: 1px;
  background: var(--border-subtle);
  margin: var(--space-6) 0;
}

/* === MAIN CONTENT AREA === */
.main-content {
  min-height: calc(100vh - 140px);
  padding-bottom: var(--space-12);
}

/* === FOOTER === */
.footer {
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
}

/* === ICON ALIGNMENT === */
.icon-inline {
  display: inline-flex;
  vertical-align: middle;
  margin-right: var(--space-1);
}

/* === TRUNCATE TEXT === */
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* === SUBTLE SHADOW ON ELEVATED ELEMENTS === */
.card,
.modal,
.nav-dropdown-content,
.toast {
  box-shadow: var(--shadow-md);
}

/* === SMOOTH SCROLL === */
@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

/* === REDUCED MOTION === */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* === HIGH CONTRAST MODE === */
@media (prefers-contrast: high) {
  :root {
    --border-subtle: rgba(255, 255, 255, 0.2);
    --border-default: rgba(255, 255, 255, 0.3);
    --border-strong: rgba(255, 255, 255, 0.5);
  }
}

/* === PRINT STYLES === */
@media print {
  .nav,
  .footer,
  .btn,
  .toast-container,
  .modal-overlay {
    display: none !important;
  }
  
  body {
    background: #080808;
    color: black;
  }
  
  .card {
    border: 1px solid #ccc;
    box-shadow: none;
  }
}

/* === ERROR BOUNDARY === */
.error-boundary {
  padding: var(--space-8);
  text-align: center;
  background: var(--error-bg);
  border: 1px solid var(--error-border);
  border-radius: var(--radius-lg);
}

.error-boundary-icon {
  font-size: var(--text-4xl);
  margin-bottom: var(--space-4);
}

.error-boundary-title {
  font-size: var(--text-xl);
  color: var(--error);
  margin-bottom: var(--space-2);
}

.error-boundary-message {
  color: var(--text-secondary);
  margin-bottom: var(--space-4);
}

/* === MAINTENANCE MODE === */
.maintenance-banner {
  background: var(--warning-bg);
  border-bottom: 1px solid var(--warning-border);
  padding: var(--space-3) var(--space-4);
  text-align: center;
  font-size: var(--text-sm);
  color: var(--warning);
}

/* === SUCCESS CONFIRMATION === */
.success-message {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--space-8);
}

.success-icon {
  font-size: var(--text-5xl);
  margin-bottom: var(--space-4);
}

.success-title {
  font-size: var(--text-2xl);
  color: var(--success);
  margin-bottom: var(--space-2);
}

.success-description {
  color: var(--text-secondary);
  max-width: 400px;
}

/* ============================================
   REFERENCE LIBRARY
   ============================================ */

.reference-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
  padding: var(--space-2);
}

@media (max-width: 1024px) {
  .reference-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .reference-grid {
    grid-template-columns: 1fr;
  }
}

.ref-card {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  background: var(--bg-elevated-2);
  border: 1px solid var(--border-subtle);
}

.ref-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
  border-color: var(--accent-primary);
}

.ref-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  display: block;
  background: var(--bg-elevated);
}

.ref-info {
  padding: var(--space-3);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-elevated);
}

.ref-number {
  font-weight: var(--font-semibold);
  color: var(--text-primary);
  font-size: var(--text-sm);
  font-family: var(--font-mono);
}

.ref-size {
  color: var(--text-muted);
  font-size: var(--text-xs);
}

/* ============================================
   FULLSCREEN VIEWER
   ============================================ */

.fullscreen-viewer {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.95);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
}

.fullscreen-viewer img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  cursor: default;
}

.fullscreen-close {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  color: var(--text-primary);
  font-size: 24px;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  z-index: 1;
}

.fullscreen-close:hover {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
}

.fullscreen-nav {
  position: absolute;
  bottom: var(--space-6);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: var(--space-4);
  background: var(--bg-elevated);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-full);
  border: 1px solid var(--border-default);
}

.fullscreen-prev,
.fullscreen-next {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 20px;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.fullscreen-prev:hover,
.fullscreen-next:hover {
  background: var(--bg-elevated-2);
}

.fullscreen-counter {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  min-width: 60px;
  text-align: center;
  font-family: var(--font-mono);
}

/* ============================================
   CHARACTER CARD - Professional Mini Cards
   ============================================ */

/* Character Grid - Responsive */
.characters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-5);
  margin-top: var(--space-4);
}

@media (max-width: 640px) {
  .characters-grid {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }
}

@media (min-width: 1280px) {
  .characters-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Character Card - Base */
.character-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: 
    transform 0.2s var(--ease-out),
    border-color 0.2s var(--ease-out),
    box-shadow 0.2s var(--ease-out);
}

.character-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-lg);
}

/* Thumbnail Container - CRITICAL: position relative for overlay */
.character-card .character-thumbnail {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  background: var(--bg-elevated-2);
  overflow: hidden;
}

.character-card .character-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.3s var(--ease-out);
}

.character-card:hover .character-thumbnail img {
  transform: scale(1.02);
}

/* Placeholder when no image */
.character-card .character-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.5rem;
  background: linear-gradient(135deg, var(--bg-elevated-2) 0%, var(--bg-elevated-3) 100%);
  color: var(--text-muted);
}

/* Overlay - CRITICAL: Must be inside thumbnail, position absolute */
.character-card .character-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  opacity: 0;
  visibility: hidden;
  transition: 
    opacity 0.25s var(--ease-out),
    visibility 0.25s var(--ease-out);
}

.character-card:hover .character-overlay {
  opacity: 1;
  visibility: visible;
}

/* Actions in overlay */
.character-card .character-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-4);
  width: 100%;
  max-width: 200px;
}

.character-card .character-actions .btn {
  width: 100%;
  justify-content: center;
}

/* Info Section - Below thumbnail */
.character-card .character-info {
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  flex: 1;
}

/* Character Name */
.character-card .character-name {
  font-size: var(--text-base);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
  margin: 0;
  line-height: var(--leading-tight);
}

/* Character Niche/Style */
.character-card .character-niche {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin: 0;
}

/* Stats Row */
.character-card .character-stats {
  display: flex;
  gap: var(--space-4);
  margin-top: var(--space-1);
}

.character-card .stat-item {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-xs);
  color: var(--text-secondary);
}

.character-card .stat-icon {
  font-size: var(--text-sm);
}

.character-card .stat-value {
  font-weight: var(--font-semibold);
  color: var(--text-primary);
}

.character-card .stat-label {
  color: var(--text-muted);
}

/* Cost Badge */
.character-card .character-cost {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: var(--space-3);
  border-top: 1px solid var(--border-subtle);
  font-size: var(--text-xs);
}

.character-card .cost-label {
  color: var(--text-muted);
}

.character-card .cost-value {
  font-weight: var(--font-semibold);
  color: var(--accent-primary);
  font-family: var(--font-mono);
}

/* ============================================
   CHARACTER CARDS - APPLE-STYLE LANDSCAPE
   Premium horizontal layout with image left, info right
   ============================================ */

/* Grid Layout for Landscape Cards */
.characters-grid-landscape {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(520px, 1fr));
  gap: var(--space-5);
  margin-top: var(--space-4);
}

@media (max-width: 640px) {
  .characters-grid-landscape {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }
}

/* Mobile: stack image above info to prevent cramping */
@media (max-width: 480px) {
  .character-card-landscape {
    flex-direction: column !important;
    height: auto !important;
  }
  .character-card-landscape .character-image-container {
    flex: 0 0 200px !important;
    width: 100%;
  }
  .character-card-landscape .character-info-landscape {
    padding: 1rem 1.25rem !important;
  }
}

/* Character Card - Landscape Layout */
.character-card-landscape {
  display: flex;
  flex-direction: row;
  background: #111111 !important;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  overflow: hidden;
  transition: all 0.3s ease;
  height: 220px;
}

.character-card-landscape:hover {
  background: #181818 !important;
  border-color: rgba(232, 255, 71, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

/* Image Container - Left 50% */
.character-card-landscape .character-image-container {
  flex: 0 0 50%;
  position: relative;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.2);
}

.character-card-landscape .character-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  transition: transform 0.3s ease;
}

.character-card-landscape:hover .character-image {
  transform: scale(1.05);
}

/* Placeholder for missing images */
.character-placeholder-landscape {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  background: linear-gradient(135deg, rgba(20, 20, 20, 1) 0%, rgba(30, 30, 30, 1) 100%);
  color: rgba(255, 255, 255, 0.3);
}

/* Info Section - Right 50% */
.character-card-landscape .character-info-landscape {
  flex: 1;
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
}

/* Header with Name + Badges */
.character-header-landscape {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.character-name-landscape {
  font-family: 'Syne', var(--font-display), sans-serif;
  font-size: 1.125rem;
  font-weight: 600;
  color: #ffffff;
  margin: 0;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Badges - Subtle and Small */
.character-badges-landscape {
  display: flex;
  gap: 0.375rem;
  flex-shrink: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.badge-landscape {
  padding: 0.1875rem 0.5rem;
  border-radius: 5px;
  font-size: 0.6875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.badge-landscape.badge-active {
  background: rgba(74, 222, 128, 0.15);
  color: #4ade80;
  border: 1px solid rgba(74, 222, 128, 0.25);
}

.badge-landscape.badge-learning {
  background: rgba(251, 191, 36, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.25);
}

.badge-landscape.badge-style {
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Description - 2 lines max */
.character-description-landscape {
  font-size: 0.8125rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.55);
  margin: 0;
  flex-grow: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* YouTube Badge - Landscape */
.youtube-badge-landscape {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.625rem;
  background: rgba(255, 0, 0, 0.15);
  color: #ff4444;
  border-radius: 5px;
  font-size: 0.6875rem;
  text-decoration: none;
  transition: all 0.2s;
  width: fit-content;
  margin-bottom: 0.5rem;
}

.youtube-badge-landscape:hover {
  background: rgba(255, 0, 0, 0.25);
  color: #ff6666;
}

/* Stats Row - Only shown if > 0 */
.character-stats-landscape {
  display: flex;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.stat-item-landscape {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.45);
}

/* Action Buttons */
.character-actions-landscape {
  display: flex;
  gap: 0.625rem;
  margin-top: auto;
}

.btn-select-character {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.625rem 1rem;
  background: transparent;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  font-weight: 500;
  font-size: 0.875rem;
  text-decoration: none;
  transition: all 0.2s ease;
}

.btn-select-character:hover {
  background: rgba(232, 255, 71, 0.1);
  border-color: #e8ff47;
  color: #e8ff47;
}

.btn-view-details {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.625rem 1rem;
  background: transparent;
  color: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  font-weight: 500;
  font-size: 0.875rem;
  text-decoration: none;
  transition: all 0.2s ease;
}

.btn-view-details:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

/* Mobile Responsive - Stack Vertically */
@media (max-width: 640px) {
  .character-card-landscape {
    flex-direction: column;
    height: auto;
  }
  
  .character-card-landscape .character-image-container {
    flex: 0 0 180px;
  }
  
  .character-card-landscape .character-info-landscape {
    padding: 1rem 1.25rem 1.25rem;
  }
  
  .character-header-landscape {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .character-badges-landscape {
    justify-content: flex-start;
  }
  
  .character-actions-landscape {
    flex-direction: column;
  }
  
  .btn-select-character,
  .btn-view-details {
    width: 100%;
  }
}

/* ============================================
   YOUTUBE BADGE
   ============================================ */

.youtube-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-3);
  background: #FF0000;
  color: white;
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  text-decoration: none;
  transition: opacity 0.2s;
  margin-bottom: var(--space-2);
}

.youtube-badge:hover {
  opacity: 0.85;
  color: white;
}

.youtube-icon {
  flex-shrink: 0;
}

/* ============================================
   MODAL ENHANCEMENTS
   ============================================ */

.modal--lg {
  max-width: 1200px;
  width: 95vw;
}

.modal-header-content {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex: 1;
}

.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-12);
  gap: var(--space-4);
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border-default);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* Emergency fix - ensure nav links are clickable */
nav.nav-main a.nav-link {
  pointer-events: auto !important;
  z-index: 100 !important;
  position: relative !important;
}

/* ================================
   Manual Prompts Import Mode
   ================================ */

.paste-section .prompts-textarea {
    width: 100%;
    min-height: 300px;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.6;
    padding: 15px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    background: #0a0a0a !important;
    color: #ffffff !important;
    resize: vertical;
}

.paste-section .prompts-textarea:focus {
    border-color: #e8ff47;
    outline: none;
    background: #0a0a0a !important;
}

.paste-section .prompts-textarea::placeholder {
    color: rgba(255, 255, 255, 0.35);
    opacity: 1;
}

.help-text {
    color: #999999;
    font-size: 14px;
    margin-bottom: 10px;
}

.error-box {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.5);
    color: #fca5a5;
    padding: 15px;
    border-radius: 8px;
    margin-top: 15px;
}

.error-box ul {
    margin: 10px 0 0 20px;
    padding: 0;
}

.mode-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.mode-option {
    display: flex;
    align-items: flex-start;
    padding: 20px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.mode-option:hover {
    border-color: #2563eb;
    background: #eff6ff;
}

.mode-option input[type="radio"] {
    margin-right: 15px;
    margin-top: 5px;
    width: 20px;
    height: 20px;
}

.mode-option input[type="radio"]:checked {
    accent-color: #2563eb;
}

.mode-content {
    flex: 1;
}

.mode-label {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
    display: block;
    margin-bottom: 5px;
}

.mode-description {
    font-size: 14px;
    color: #6b7280;
    margin: 5px 0 10px 0;
}

.mode-dropdown {
    width: 100%;
    padding: 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    margin-top: 10px;
}

.mode-dropdown:disabled {
    background: #f3f4f6;
    cursor: not-allowed;
}

.voice-section {
    padding: 20px;
    background: #f9fafb;
    border-radius: 8px;
}

.voice-section label {
    display: block;
    font-weight: 600;
    margin-bottom: 10px;
    color: #111827;
}

.voice-dropdown {
    width: 100%;
    padding: 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
}

.preview-stats {
    display: flex;
    gap: 30px;
    padding: 15px;
    background: #eff6ff;
    border-radius: 8px;
    margin-bottom: 20px;
}

.preview-stats span {
    font-size: 14px;
    color: #1e40af;
}

.preview-table-container {
    overflow-x: auto;
}

.preview-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.preview-table thead {
    background: #181818;
}

.preview-table th,
.preview-table td {
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-align: left;
    color: #ffffff;
}

.preview-table th {
    font-weight: 600;
    color: #e8ff47;
}

.preview-table tbody tr:hover {
    background: rgba(232, 255, 71, 0.05);
}

.preview-table .prompt-text {
    max-width: 500px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.script-section .script-textarea {
    width: 100%;
    min-height: 200px;
    font-family: Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    padding: 15px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    background: #0a0a0a !important;
    color: #ffffff !important;
    resize: vertical;
}

.script-section .script-textarea:focus {
    border-color: #e8ff47;
    outline: none;
    background: #0a0a0a !important;
}

.script-section .script-textarea::placeholder {
    color: rgba(255, 255, 255, 0.35);
    opacity: 1;
}

.script-stats {
    display: flex;
    gap: 20px;
    margin-top: 10px;
    font-size: 14px;
    color: #6b7280;
}

.cost-breakdown {
    background: #f9fafb;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.cost-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 14px;
}

.cost-total {
    display: flex;
    justify-content: space-between;
    font-size: 18px;
    padding-top: 15px;
    margin-top: 15px;
    border-top: 2px solid #e5e7eb;
}

.submit-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.submit-form label {
    font-weight: 600;
    color: #111827;
}

.submit-form input[type="text"] {
    padding: 12px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
}

.card {
    background: var(--bg-elevated);
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-bottom: 24px;
}

.btn-success {
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    background: #16a34a;
    color: white;
}

.btn-success:hover {
    background: #15803d;
}

/* ================================
   Mobile Navigation
   ================================ */

/* Hamburger button - hidden by default, shown on mobile */
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 10px;
  z-index: 1002;
  position: relative;
}

.nav-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-primary, #e5e7eb);
  border-radius: 2px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transform-origin: center;
}

/* Hamburger to X animation */
.nav-hamburger.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-hamburger.active span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.nav-hamburger.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Overlay for closing menu when clicking outside */
.nav-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 99; /* BELOW menu, ABOVE page content */
  opacity: 0;
  transition: opacity 0.3s ease;
}

.nav-overlay.active {
  opacity: 1;
}

/* Mobile breakpoint */
@media (max-width: 768px) {
  /* Show hamburger on mobile */
  .nav-hamburger {
    display: flex !important;
  }
  
  /* Show overlay when menu is open */
  .nav-overlay.active {
    display: block;
  }
  
  /* Nav wrapper - needs flex for proper layout */
  .nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
  }
  
  /* Mobile menu - HIDDEN by default, slide from right when active */
  .nav-links {
    display: none !important; /* CRITICAL: Hidden by default on mobile */
    position: fixed !important;
    top: 60px !important;
    right: 0 !important;
    width: min(300px, 85vw) !important;
    height: calc(100vh - 60px) !important;
    height: calc(100dvh - 60px) !important;
    background: var(--bg-elevated, rgba(15, 15, 25, 0.98)) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    flex-direction: column !important;
    align-items: stretch !important;
    padding: 24px 20px !important;
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.5);
    transform: translateX(100%) !important;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    z-index: 1000 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    gap: 0 !important;
  }
  
  /* Menu open state - show and slide in */
  .nav-links[data-open="true"],
  .nav-links.active {
    display: flex !important;
    transform: translateX(0) !important;
  }
  
  /* Nav links inside mobile menu */
  .nav-links .nav-link,
  .nav-links .nav-dropdown > .nav-link {
    width: 100%;
    padding: 14px 16px;
    border-radius: 8px;
    margin-bottom: 4px;
    font-size: 15px;
  }
  
  .nav-links .nav-link:hover,
  .nav-links .nav-link.active {
    background: var(--bg-elevated-2, rgba(255,255,255,0.08));
  }
  
  /* Dropdown in mobile */
  .nav-links .nav-dropdown {
    width: 100%;
  }
  
  .nav-links .dropdown-menu {
    position: static !important;
    width: 100%;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    box-shadow: none !important;
    border: none;
    border-left: 2px solid var(--accent-primary, rgba(96, 165, 250, 0.4));
    margin: 4px 0 8px 12px;
    padding: 0 0 0 8px;
    background: transparent !important;
  }
  
  .nav-links .dropdown-item {
    padding: 12px 16px;
    font-size: 14px;
    border-radius: 6px;
  }
  
  .nav-links .dropdown-item:hover {
    background: var(--bg-elevated-2, rgba(255,255,255,0.05));
  }
  
  /* Hide dropdown arrow on mobile (always expanded) */
  .nav-links .dropdown-arrow {
    display: none;
  }
  
  /* User section in mobile menu */
  .nav-user-menu {
    width: 100%;
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--border-subtle, rgba(100, 100, 150, 0.2));
  }
}
/* FORCE overlay to be clickable */
.mobile-menu-overlay {
  pointer-events: auto !important;
  cursor: pointer !important;
}

.mobile-menu-overlay .mobile-menu {
  pointer-events: auto !important;
  cursor: default !important;
}

/* MOBILE MENU VISIBILITY FIX */
@media (max-width: 768px) {
  .mobile-menu {
    background: #1a1a1a !important;
    border-left: 2px solid rgba(232,255,71,0.3) !important;
    box-shadow: -4px 0 20px rgba(0,0,0,0.5) !important;
  }
}
