﻿/* ========================================================
   MiraLaCarta — Design System (main.css)
   Variables globales, reset, tipografía, utilidades
   ======================================================== */

/* 🎨 CSS Custom Properties */
:root {
  /* Primary Palette */
  --primary: #FF6B35;
  --primary-dark: #E55A2B;
  --secondary: #FFD166;
  --accent: #06D6A0;

  /* Backgrounds */
  --bg: #0D0D0D;
  --bg2: #1A1A1A;
  --bg3: #242424;
  --card: #1E1E1E;

  /* Text */
  --text: #F0F0F0;
  --text2: #A0A0A0;
  --text-muted: #666;

  /* Borders */
  --border: #2E2E2E;
  --border-light: #3A3A3A;

  /* Status */
  --success: #00C853;
  --error: #EF233C;
  --warning: #FFB300;
  --info: #2196F3;

  /* Spacing */
  --radius: 16px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 50px;

  /* Shadows */
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
  --shadow-lg: 0 12px 48px rgba(0,0,0,0.5);
  --shadow-glow: 0 0 30px rgba(255,107,53,0.3);

  /* Transitions */
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: all 0.15s ease;
  --transition-bounce: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Admin-specific aliases */
  --color-primary: var(--primary);
  --color-primary-dark: var(--primary-dark);
  --color-secondary: var(--secondary);
  --color-accent: var(--accent);
  --color-bg: var(--bg);
  --color-bg2: var(--bg2);
  --color-bg3: var(--bg3);
  --color-card: var(--card);
  --color-text: var(--text);
  --color-text-muted: var(--text2);
  --color-border: var(--border);
  --color-success: var(--success);
  --color-error: var(--error);
  --color-warning: var(--warning);
}

/* 🔄 CSS Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Outfit', 'Montserrat', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

img, video {
  max-width: 100%;
  height: auto;
  display: block;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  outline: none;
}

/* 🧱 Utility Classes */
.hidden { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); border: 0;
}

/* 📐 Form Controls (shared) */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text2);
  margin-bottom: 6px;
}
.form-control {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text);
  font-size: 0.9rem;
  transition: var(--transition-fast);
}
.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255,107,53,0.15);
}
.form-control::placeholder { color: var(--text2); }

/* 🔘 Buttons (shared) */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border: 1px solid transparent;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}
.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}
.btn-secondary {
  background: var(--bg3);
  color: var(--text);
  border-color: var(--border);
}
.btn-secondary:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.btn-accent {
  background: var(--accent);
  color: #0D0D0D;
}
.btn-success {
  background: var(--success);
  color: #fff;
}
.btn-danger {
  background: transparent;
  color: var(--error);
  border-color: var(--error);
}
.btn-danger:hover {
  background: var(--error);
  color: #fff;
}
.btn-full { width: 100%; }
.btn-lg { padding: 14px 28px; font-size: 1rem; }
.btn-sm { padding: 6px 14px; font-size: 0.8rem; }

/* 🔔 Toast Notifications */
#toast-container {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.875rem;
  font-weight: 600;
  box-shadow: var(--shadow);
  animation: toastIn 0.3s ease;
  pointer-events: auto;
}
.toast.success { border-left: 3px solid var(--success); }
.toast.error { border-left: 3px solid var(--error); }
.toast.info { border-left: 3px solid var(--info); }
@keyframes toastIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
@keyframes toastOut {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(100%); opacity: 0; }
}

/* 🔄 Toggle Switch */
.toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  cursor: pointer;
}
.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}
.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--bg3);
  border-radius: 24px;
  border: 1px solid var(--border);
  transition: var(--transition);
}
.toggle-slider::before {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  left: 2px;
  bottom: 2px;
  background: var(--text2);
  border-radius: 50%;
  transition: var(--transition);
}
.toggle input:checked + .toggle-slider {
  background: var(--primary);
  border-color: var(--primary);
}
.toggle input:checked + .toggle-slider::before {
  transform: translateX(20px);
  background: #fff;
}

/* 🏷️ Badge / Status */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
}
.badge-success { background: rgba(0,200,83,0.15); color: var(--success); }
.badge-error { background: rgba(239,35,60,0.15); color: var(--error); }
.badge-warning { background: rgba(255,179,0,0.15); color: var(--warning); }
.badge-info { background: rgba(33,150,243,0.15); color: var(--info); }

/* 📱 Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
@keyframes popIn {
  from { transform: scale(0.6); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
@keyframes slideUp {
  from { transform: translateY(100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
@keyframes fadeOut {
  to { opacity: 0; pointer-events: none; }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
.animate-fade-in { animation: fadeIn 0.4s ease-out; }
.animate-pop-in { animation: popIn 0.6s cubic-bezier(0.34,1.56,0.64,1); }

/* 🔄 Loader */
.spinner {
  width: 48px; height: 48px;
  border: 4px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* 📱 Divider */
.divider {
  height: 1px;
  background: var(--border);
  margin: 16px 0;
}

/* Credit Footer */
.credit-footer {
  text-align: center;
  font-size: 0.75rem;
  color: var(--text2);
  padding: 16px;
  border-top: 1px solid var(--border);
  margin-top: auto;
}
.credit-footer a {
  color: var(--primary);
  font-weight: 600;
}
