/* ==========================================================================
   VJRDEV - SISTEMA DE DISEÑO BASE (main.css)
   ========================================================================== */

/* 1. RESET & BASE
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
  width: 100%;
}

:root {
  /* Temas por defecto - se sobreescriben dinámicamente */
  --wedding-primary: #8b6f47;
  --wedding-accent: #6e5430;
  --wedding-surface: #f4f0e6;
  --wedding-surface-soft: #ffffff;
  --wedding-text: #2c2824;
  --wedding-text-muted: #7e766c;
  
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-script: 'Great Vibes', cursive;
  --font-body: 'Lato', sans-serif;
  
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;
  --spacing-xxl: 4rem;
  
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  
  --shadow-sm: 0 2px 5px rgba(110, 84, 48, 0.05);
  --shadow-md: 0 4px 12px rgba(110, 84, 48, 0.08);
  --shadow-lg: 0 15px 35px rgba(110, 84, 48, 0.12);
  
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-spring: 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

body {
  font-family: var(--font-body);
  background-color: var(--wedding-surface);
  color: var(--wedding-text);
  line-height: 1.6;
  overscroll-behavior-y: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  width: 100%;
}

/* 2. TIPOGRAFÍA
   ========================================================================== */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.2;
  color: var(--wedding-primary);
}

.script-text {
  font-family: var(--font-script);
  font-weight: 400;
  color: var(--wedding-primary);
}

/* 3. COMPONENTES COMUNES
   ========================================================================== */
.container {
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  padding: 0 var(--spacing-lg);
}

/* Tarjeta de Vidrio (Glassmorphism) */
.glass-card {
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(139, 111, 71, 0.18);
  border-radius: var(--radius-lg);
  padding: var(--spacing-xl);
  box-shadow: var(--shadow-lg);
  margin-bottom: var(--spacing-xl);
}

/* Botón Elegante */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 28px;
  font-family: var(--font-body);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-size: 0.85rem;
  border-radius: var(--radius-full);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition-fast);
  text-decoration: none;
  gap: 8px;
  outline: none;
}

.btn:disabled {
  background-color: rgba(139, 111, 71, 0.1) !important;
  border-color: rgba(139, 111, 71, 0.15) !important;
  color: var(--wedding-text-muted) !important;
  cursor: not-allowed !important;
  box-shadow: none !important;
  transform: none !important;
  opacity: 0.6;
}

.btn-primary {
  background-color: var(--wedding-accent);
  color: #fff;
  box-shadow: 0 4px 14px rgba(139, 111, 71, 0.4);
}

.btn-primary:hover:not(:disabled) {
  background-color: var(--wedding-primary);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(196, 168, 130, 0.4);
}

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

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

.btn-outline:hover {
  background-color: var(--wedding-primary);
  color: #1a1a1a;
  transform: translateY(-2px);
}

/* Inputs de Formulario */
.form-group {
  margin-bottom: var(--spacing-lg);
  text-align: left;
}

.form-label {
  display: block;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--wedding-primary);
  margin-bottom: var(--spacing-sm);
  font-weight: 600;
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(110, 84, 48, 0.22);
  border-radius: var(--radius-md);
  color: var(--wedding-text);
  font-family: var(--font-body);
  font-size: 1rem;
  transition: var(--transition-fast);
  box-sizing: border-box;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="datetime-local"],
input[type="date"],
input[type="time"],
input[type="url"],
select,
textarea {
  width: 100%;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(110, 84, 48, 0.22);
  border-radius: var(--radius-md);
  color: var(--wedding-text);
  font-family: var(--font-body);
  font-size: 1rem;
  transition: var(--transition-fast);
  box-sizing: border-box;
}

.form-control:focus {
  outline: none;
  border-color: var(--wedding-primary);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(139, 111, 71, 0.15);
}

/* Adornos Visuales */
.divider-ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin: var(--spacing-lg) 0;
  opacity: 0.7;
}

.divider-line {
  flex-grow: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--wedding-primary), transparent);
  max-width: 150px;
}

.divider-dot {
  font-size: 1.2rem;
  color: var(--wedding-primary);
}

/* 4. UTILERÍAS
   ========================================================================== */
.text-center { text-align: center; }
.text-muted { color: var(--wedding-text-muted); }
.hidden { display: none !important; }

/* 5. ACCESIBILIDAD (Reduced Motion)
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-delay: -1ms !important;
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    background-attachment: initial !important;
    scroll-behavior: auto !important;
    transition-duration: 0s !important;
    transition-delay: 0s !important;
  }
}

/* 6. DISEÑO RESPONSIVO (Mobile First)
   ========================================================================== */
.grid-2-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

@media (max-width: 768px) {
  .grid-2-col {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .container {
    max-width: 100%;
  }
  
  .form-control,
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="number"],
  input[type="datetime-local"],
  input[type="date"],
  input[type="time"],
  input[type="url"],
  select,
  textarea {
    font-size: 16px !important; /* Mínimo 16px para evitar el zoom automático de iOS */
    padding: 10px 14px;
  }
  
  .form-label {
    font-size: 0.9rem;
  }
  
  h1, h2, h3, h4, h5, h6 {
    font-size: 1.2rem;
  }
}

@media (max-width: 480px) {
  .container {
    max-width: 100%;
    padding: 0 var(--spacing-md) !important;
  }
  
  .form-control,
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="number"],
  input[type="datetime-local"],
  input[type="date"],
  input[type="time"],
  input[type="url"],
  select,
  textarea {
    font-size: 16px !important; /* Mínimo 16px para evitar el zoom automático de iOS */
    padding: 14px 16px;
    line-height: 1.5;
  }
  
  .form-label {
    font-size: 0.8rem;
  }
  
  .btn {
    font-size: 0.85rem;
    padding: 0.5rem 0.8rem;
  }
}

/* ==========================================================================
   VJRDEV - PALETAS DE COLORES INTERACTIVAS Y DRESSCODE PREMIUM
   ========================================================================== */
.color-palette-container {
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(139, 111, 71, 0.15);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-top: 6px;
  margin-bottom: 18px;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}
.color-list {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  min-height: 42px;
  margin-bottom: 10px;
}
.color-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  position: relative;
  border: 2px solid #ffffff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.color-circle:hover {
  transform: scale(1.15);
}
.color-circle .btn-remove-color {
  position: absolute;
  top: -6px;
  right: -6px;
  background: #e53935;
  color: #ffffff;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  font-size: 11px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #ffffff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
  transition: background-color 0.2s ease;
}
.color-circle .btn-remove-color:hover {
  background-color: #c62828;
}
.color-circle-avoid::after {
  content: "";
  position: absolute;
  top: 50%;
  left: -2px;
  width: calc(100% + 4px);
  height: 3px;
  background: #e53935;
  transform: translateY(-50%) rotate(-45deg);
  border-radius: 2px;
  box-shadow: 0 0 2px rgba(255,255,255,0.9);
}
.btn-save-indicator {
  transition: all 0.3s ease;
}
.btn-save-indicator:not(:disabled) {
  animation: pulse-gold 2s infinite ease-in-out;
  background: var(--wedding-primary) !important;
  color: #fff !important;
  box-shadow: 0 4px 15px rgba(139, 111, 71, 0.35) !important;
}
@keyframes pulse-gold {
  0%, 100% { opacity: 0.95; }
  50% { opacity: 1; transform: scale(1.01); }
}

/* ==========================================================================
   SISTEMA DE NOTIFICACIONES PREMIUM (TOASTS Y MODALES GLASSMORPHIC)
   ========================================================================== */

/* Contenedor de Toasts */
#toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 999999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

@media (max-width: 480px) {
  #toast-container {
    top: 15px;
    right: 15px;
    left: 15px;
  }
}

/* El Toast */
.custom-toast {
  pointer-events: auto;
  min-width: 280px;
  max-width: 400px;
  padding: 14px 18px;
  border-radius: 12px;
  background: rgba(30, 30, 30, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #ffffff;
  font-family: inherit;
  font-size: 0.9rem;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  gap: 12px;
  transform: translateX(120%);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease;
  opacity: 0;
}

.custom-toast.show {
  transform: translateX(0);
  opacity: 1;
}

.custom-toast.error {
  border-left: 5px solid #ff5252;
}

.custom-toast.success {
  border-left: 5px solid #4caf50;
}

.custom-toast.info {
  border-left: 5px solid #2196f3;
}

/* Modales de Confirmación y Acciones */
.custom-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 999998;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.custom-modal-overlay.show {
  opacity: 1;
}

.custom-modal-box {
  background: rgba(26, 26, 26, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 18px;
  width: 90%;
  max-width: 460px;
  padding: var(--spacing-xl);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  transform: scale(0.85);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  color: #ffffff;
  text-align: center;
}

.custom-modal-overlay.show .custom-modal-box {
  transform: scale(1);
}

.custom-modal-title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--wedding-primary);
  margin-bottom: var(--spacing-md);
}

.custom-modal-text {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.5;
  margin-bottom: var(--spacing-lg);
}

.custom-modal-buttons {
  display: flex;
  gap: var(--spacing-md);
  justify-content: center;
  margin-top: var(--spacing-lg);
}

.custom-modal-buttons .btn {
  min-width: 100px;
  border-radius: 8px;
}

/* Modal del Compartir Invitado */
.share-modal-box {
  max-width: 500px;
  text-align: left;
}
.share-modal-title {
  text-align: center;
  margin-bottom: 20px;
}
.share-modal-details {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 15px;
  border-radius: 10px;
  margin-bottom: 20px;
}
.share-modal-details p {
  margin: 5px 0;
  font-size: 0.95rem;
}
.share-action-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.share-action-buttons .btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px;
  font-weight: bold;
}
