/**
 * BEFORE & AFTER MODULE CSS - VERSIÓN MEJORADA
 * Diseño moderno oscuro con efectos 3D
 * Optimizado para imágenes como protagonistas
 */

:root {
    --ba-bg-dark: #0f0f0f;
    --ba-bg-darker: #1a1a1a;
    --ba-bg-gray: #2a2a2a;
    --ba-bg-light: #ffffff;
    --ba-accent-gold: #fbbf24;
    --ba-accent-orange: #f59e0b;
    --ba-text-primary: #ffffff;
    --ba-text-secondary: #b0b0b0;
    --ba-text-muted: #888888;
    --ba-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --ba-shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
    --ba-shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.5);
    --ba-border: #333333;
}

* {
    box-sizing: border-box;
}

/* ═══════════════════════════════════════════════════════════════
   📦 CONTENEDOR PRINCIPAL
   ═══════════════════════════════════════════════════════════════ */
#app-container {
    background: linear-gradient(135deg, var(--ba-bg-dark) 0%, var(--ba-bg-darker) 100%);
    min-height: 100vh;
    padding: 2rem;
}

.before-after-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    max-width: 1500px;
    margin: 0 auto;
    padding: 0;
}

@media (max-width: 1024px) {
    .before-after-container {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

/* ═══════════════════════════════════════════════════════════════
   🎨 SECCIÓN DE FORMULARIO
   ═══════════════════════════════════════════════════════════════ */
.ba-form-section {
    background: rgba(42, 42, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 2.5rem;
    backdrop-filter: blur(10px);
    box-shadow: var(--ba-shadow-lg);
    height: fit-content;
    transition: all 0.3s ease;
}

.ba-form-section:hover {
    border-color: rgba(251, 191, 36, 0.3);
    box-shadow: 0 20px 60px rgba(251, 191, 36, 0.1);
}

/* ═══════════════════════════════════════════════════════════════
   ✨ BADGE PREMIUM
   ═══════════════════════════════════════════════════════════════ */
.ba-premium-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    background: linear-gradient(135deg, var(--ba-accent-gold), var(--ba-accent-orange));
    color: #000;
    padding: 1rem 1.5rem;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 15px rgba(251, 191, 36, 0.3);
    animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 4px 15px rgba(251, 191, 36, 0.3); }
    50% { box-shadow: 0 6px 20px rgba(251, 191, 36, 0.5); }
}

.ba-premium-badge .icon {
    font-size: 1.1rem;
}

/* ═══════════════════════════════════════════════════════════════
   📝 TÍTULOS Y TEXTOS
   ═══════════════════════════════════════════════════════════════ */
.ba-form-title {
    font-size: 2rem;
    font-weight: 800;
    color: var(--ba-text-primary);
    margin: 0 0 0.5rem 0;
    background: linear-gradient(135deg, #ffffff, #c0c0c0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.ba-form-subtitle {
    font-size: 1rem;
    color: var(--ba-text-secondary);
    margin: 0 0 2rem 0;
}

.ba-section-header {
    font-size: 1rem;
    font-weight: 700;
    color: var(--ba-text-primary);
    margin: 1.5rem 0 1rem 0;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ═══════════════════════════════════════════════════════════════
   🖼️ CARGA DE IMÁGENES
   ═══════════════════════════════════════════════════════════════ */
.ba-images-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 2rem;
}

.ba-image-upload {
    position: relative;
    border: 2px dashed rgba(251, 191, 36, 0.3);
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.03);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    overflow: hidden;
}

.ba-image-upload:hover {
    border-color: rgba(251, 191, 36, 0.6);
    background: rgba(251, 191, 36, 0.05);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(251, 191, 36, 0.15);
}

.ba-image-upload.has-image {
    border-color: rgba(16, 185, 129, 0.5);
    background: rgba(16, 185, 129, 0.05);
}

.ba-upload-icon {
    font-size: 3rem;
    margin-bottom: 0.75rem;
    opacity: 0.8;
}

.ba-upload-text {
    font-size: 0.95rem;
    color: var(--ba-text-primary);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.ba-upload-hint {
    font-size: 0.85rem;
    color: var(--ba-text-secondary);
}

.ba-image-preview {
    width: 100%;
    height: 250px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 0.75rem;
}

.ba-image-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--ba-accent-gold);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 1rem;
}

.ba-image-remove {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.8);
    color: white;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex !important;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.ba-image-remove:hover {
    background: rgba(239, 68, 68, 1);
    transform: scale(1.1);
}

/* ═══════════════════════════════════════════════════════════════
   📐 FORMATOS
   ═══════════════════════════════════════════════════════════════ */
.ba-formats-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

@media (max-width: 768px) {
    .ba-formats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.ba-format-card {
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1.25rem;
    text-align: center;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.ba-format-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(251, 191, 36, 0.2), transparent);
    transition: left 0.5s;
}

.ba-format-card:hover::before {
    left: 100%;
}

.ba-format-card:hover {
    border-color: var(--ba-accent-gold);
    background: rgba(251, 191, 36, 0.1);
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(251, 191, 36, 0.2);
}

.ba-format-card.active {
    border-color: var(--ba-accent-gold);
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.15), rgba(245, 158, 11, 0.1));
    box-shadow: 0 8px 24px rgba(251, 191, 36, 0.25);
}

.ba-format-preview {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.ba-format-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--ba-text-primary);
    margin-bottom: 0.25rem;
}

.ba-format-size {
    font-size: 0.75rem;
    color: var(--ba-text-secondary);
}

/* ═══════════════════════════════════════════════════════════════
   🎨 PERSONALIZACIÓN
   ═══════════════════════════════════════════════════════════════ */
.ba-customization-section {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    padding: 1.5rem;
    margin: 2rem 0;
}

.ba-option-group {
    margin-bottom: 1.5rem;
}

.ba-option-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--ba-text-primary);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ba-option-input,
.ba-option-select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--ba-text-primary);
    font-size: 0.95rem;
    transition: all 0.2s;
    font-family: inherit;
}

.ba-option-input:focus,
.ba-option-select:focus {
    outline: none;
    border-color: var(--ba-accent-gold);
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 0 12px rgba(251, 191, 36, 0.2);
}

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

/* Color picker */
.ba-color-picker-wrapper {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.ba-color-input {
    width: 60px;
    height: 60px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.ba-color-input:hover {
    border-color: var(--ba-accent-gold);
    box-shadow: 0 0 12px rgba(251, 191, 36, 0.3);
}

.ba-color-values {
    display: flex;
    gap: 0.75rem;
}

.ba-color-preset {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    cursor: pointer;
    border: 2px solid rgba(255, 255, 255, 0.1);
    transition: all 0.2s;
}

.ba-color-preset:hover {
    border-color: var(--ba-accent-gold);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(251, 191, 36, 0.2);
}

/* Toggle buttons */
.ba-toggle-group {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.ba-toggle-btn {
    padding: 0.75rem 1.25rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--ba-text-secondary);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.ba-toggle-btn:hover {
    border-color: var(--ba-accent-gold);
    color: var(--ba-text-primary);
}

.ba-toggle-btn.active {
    background: linear-gradient(135deg, var(--ba-accent-gold), var(--ba-accent-orange));
    border-color: var(--ba-accent-gold);
    color: #000;
    box-shadow: 0 4px 12px rgba(251, 191, 36, 0.3);
}

/* ═══════════════════════════════════════════════════════════════
   🔘 BOTONES DE ACCIÓN
   ═══════════════════════════════════════════════════════════════ */
.ba-action-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 2rem;
}

.ba-btn {
    padding: 1rem;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.ba-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.2);
    transition: left 0.4s;
    z-index: 0;
}

.ba-btn:hover::before {
    left: 100%;
}

.ba-btn span,
.ba-btn > * {
    position: relative;
    z-index: 1;
}

.ba-btn-primary {
    background: linear-gradient(135deg, #1a1a1a, #2a2a2a);
    color: var(--ba-text-primary);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.ba-btn-primary:hover {
    border-color: var(--ba-accent-gold);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    transform: translateY(-2px);
}

.ba-btn-premium {
    background: linear-gradient(135deg, var(--ba-accent-gold), var(--ba-accent-orange));
    color: #000;
    font-weight: 800;
    box-shadow: 0 8px 24px rgba(251, 191, 36, 0.3);
}

.ba-btn-premium:hover {
    box-shadow: 0 12px 32px rgba(251, 191, 36, 0.5);
    transform: translateY(-2px);
}

.ba-btn-secondary {
    background: rgba(75, 85, 99, 0.3);
    color: var(--ba-text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.ba-btn-secondary:hover {
    background: rgba(75, 85, 99, 0.5);
    color: var(--ba-text-primary);
    border-color: rgba(255, 255, 255, 0.3);
}

/* ═══════════════════════════════════════════════════════════════
   👁️ SECCIÓN DE VISTA PREVIA
   ═══════════════════════════════════════════════════════════════ */
.ba-preview-section {
    background: rgba(42, 42, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 2.5rem;
    backdrop-filter: blur(10px);
    box-shadow: var(--ba-shadow-lg);
    position: sticky;
    top: 2rem;
}

@media (max-width: 1024px) {
    .ba-preview-section {
        position: static;
    }
}

.ba-preview-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--ba-text-primary);
    margin: 0 0 1.5rem 0;
    background: linear-gradient(135deg, #ffffff, #c0c0c0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.ba-preview-content {
    background: linear-gradient(135deg, #1a1a1a, #2a2a2a);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 1.5rem;
    min-height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.ba-preview-content canvas {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.ba-empty-preview {
    text-align: center;
    color: var(--ba-text-secondary);
}

.ba-empty-preview-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.4;
}

.ba-empty-preview-text {
    font-size: 1rem;
    line-height: 1.6;
}

.ba-loading-text {
    color: var(--ba-text-secondary);
    font-size: 0.95rem;
    animation: pulse 1.5s infinite;
}

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

/* ═══════════════════════════════════════════════════════════════
   🔔 NOTIFICACIONES
   ═══════════════════════════════════════════════════════════════ */
.ba-toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    z-index: 9999;
    animation: ba-slide-in 0.3s ease;
    backdrop-filter: blur(10px);
    border: 1px solid;
}

@keyframes ba-slide-in {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.ba-toast.success {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border-color: rgba(16, 185, 129, 0.3);
}

.ba-toast.error {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.3);
}

.ba-toast.info {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
    border-color: rgba(59, 130, 246, 0.3);
}

.ba-toast-icon {
    font-size: 1.25rem;
    font-weight: 800;
}

.ba-toast-message {
    font-size: 0.95rem;
}

@media (max-width: 640px) {
    .ba-toast {
        bottom: 1rem;
        right: 1rem;
        left: 1rem;
    }
}

/* ═══════════════════════════════════════════════════════════════
   🎬 ANIMACIONES
   ═══════════════════════════════════════════════════════════════ */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

.ba-form-section,
.ba-preview-section {
    animation: float 3s ease-in-out infinite;
}
