/**
 * Estilos para el Probador Virtual
 */

/* ===== VARIABLES CSS ===== */
:root {
    --mpv-primary-color: #6366f1;
    --mpv-primary-hover: #5855eb;
    --mpv-secondary-color: #6b7280;
    --mpv-success-color: #10b981;
    --mpv-error-color: #ef4444;
    --mpv-warning-color: #f59e0b;
    --mpv-background: #ffffff;
    --mpv-surface: #f9fafb;
    --mpv-border: #e5e7eb;
    --mpv-text-primary: #111827;
    --mpv-text-secondary: #6b7280;
    --mpv-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --mpv-shadow-lg: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --mpv-radius: 12px;
    --mpv-radius-sm: 8px;
    --mpv-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== BOTÓN PRINCIPAL ===== */
.mpv-try-on-container {
    margin: 20px 0;
    text-align: center;
}

.mpv-try-on-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 32px;
    background: linear-gradient(135deg, var(--mpv-primary-color), var(--mpv-primary-hover));
    color: white;
    border: none;
    border-radius: var(--mpv-radius);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--mpv-transition);
    box-shadow: var(--mpv-shadow);
    text-decoration: none;
    min-width: 200px;
}

.mpv-try-on-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--mpv-shadow-lg);
    background: linear-gradient(135deg, var(--mpv-primary-hover), #4f46e5);
}

.mpv-try-on-btn:active {
    transform: translateY(0);
}

.mpv-btn-icon {
    font-size: 18px;
    line-height: 1;
}

/* ===== MODAL BASE ===== */
.mpv-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.mpv-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
}

.mpv-modal-container {
    position: relative;
    background: var(--mpv-background);
    border-radius: var(--mpv-radius);
    box-shadow: var(--mpv-shadow-lg);
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    animation: mpvModalSlideIn 0.3s ease-out;
}

@keyframes mpvModalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* ===== HEADER DEL MODAL ===== */
.mpv-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 32px;
    border-bottom: 1px solid var(--mpv-border);
}

.mpv-modal-title {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    color: var(--mpv-text-primary);
}

.mpv-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: var(--mpv-text-secondary);
    cursor: pointer;
    padding: 4px;
    border-radius: var(--mpv-radius-sm);
    transition: var(--mpv-transition);
}

.mpv-modal-close:hover {
    background: var(--mpv-surface);
    color: var(--mpv-text-primary);
}

/* ===== BODY DEL MODAL ===== */
.mpv-modal-body {
    padding: 32px;
    min-height: 400px;
}

/* ===== PASOS ===== */
.mpv-step {
    display: none;
    animation: mpvFadeIn 0.3s ease-in-out;
}

.mpv-step-active {
    display: block;
}

@keyframes mpvFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.mpv-step-header {
    text-align: center;
    margin-bottom: 32px;
}

.mpv-step-header h4 {
    margin: 0 0 8px 0;
    font-size: 20px;
    font-weight: 600;
    color: var(--mpv-text-primary);
}

.mpv-step-description {
    margin: 0;
    color: var(--mpv-text-secondary);
    font-size: 16px;
    line-height: 1.6;
}

/* ===== ZONA DE UPLOAD ===== */
.mpv-upload-area {
    margin-bottom: 32px;
}

.mpv-drop-zone {
    border: 2px dashed var(--mpv-border);
    border-radius: var(--mpv-radius);
    padding: 48px 24px;
    text-align: center;
    background: var(--mpv-surface);
    transition: var(--mpv-transition);
    cursor: pointer;
}

.mpv-drop-zone:hover,
.mpv-drag-over {
    border-color: var(--mpv-primary-color);
    background: rgba(99, 102, 241, 0.05);
}

.mpv-drop-zone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.mpv-upload-icon {
    font-size: 48px;
    opacity: 0.6;
}

.mpv-upload-text {
    margin: 0;
    font-size: 18px;
    font-weight: 500;
    color: var(--mpv-text-primary);
}

.mpv-upload-requirements {
    margin: 0;
    font-size: 14px;
    color: var(--mpv-text-secondary);
}

.mpv-upload-btn {
    padding: 12px 24px;
    background: var(--mpv-primary-color);
    color: white;
    border: none;
    border-radius: var(--mpv-radius-sm);
    font-weight: 500;
    cursor: pointer;
    transition: var(--mpv-transition);
}

.mpv-upload-btn:hover {
    background: var(--mpv-primary-hover);
}

/* ===== PREVIEW DE IMAGEN ===== */
.mpv-image-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    padding: 24px;
    border: 1px solid var(--mpv-border);
    border-radius: var(--mpv-radius);
    background: var(--mpv-surface);
}

.mpv-image-preview img {
    max-width: 300px;
    max-height: 400px;
    border-radius: var(--mpv-radius-sm);
    box-shadow: var(--mpv-shadow);
    object-fit: cover;
}

.mpv-preview-actions {
    display: flex;
    gap: 16px;
}

/* ===== BOTONES ===== */
.mpv-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--mpv-radius-sm);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--mpv-transition);
    text-decoration: none;
    min-height: 44px;
}

.mpv-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

.mpv-btn-primary {
    background: var(--mpv-primary-color);
    color: white;
}

.mpv-btn-primary:hover {
    background: var(--mpv-primary-hover);
}

.mpv-btn-secondary {
    background: var(--mpv-secondary-color);
    color: white;
}

.mpv-btn-secondary:hover {
    background: #4b5563;
}

.mpv-btn-outline {
    background: transparent;
    color: var(--mpv-primary-color);
    border: 1px solid var(--mpv-primary-color);
}

.mpv-btn-outline:hover {
    background: var(--mpv-primary-color);
    color: white;
}

/* ===== CONSEJOS DE UPLOAD ===== */
.mpv-upload-tips {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: var(--mpv-radius-sm);
    padding: 20px;
    margin-top: 24px;
}

.mpv-upload-tips h5 {
    margin: 0 0 12px 0;
    color: var(--mpv-success-color);
    font-size: 16px;
    font-weight: 600;
}

.mpv-upload-tips ul {
    margin: 0;
    padding-left: 16px;
    color: var(--mpv-text-secondary);
}

.mpv-upload-tips li {
    margin-bottom: 4px;
    line-height: 1.5;
}

/* ===== PROCESAMIENTO ===== */
.mpv-processing-container {
    text-align: center;
    padding: 48px 24px;
}

.mpv-processing-animation {
    margin-bottom: 24px;
}

.mpv-spinner {
    width: 64px;
    height: 64px;
    border: 4px solid var(--mpv-border);
    border-top: 4px solid var(--mpv-primary-color);
    border-radius: 50%;
    animation: mpvSpin 1s linear infinite;
    margin: 0 auto;
}

.mpv-spinner-small {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: mpvSpin 0.8s linear infinite;
}

@keyframes mpvSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.mpv-processing-container h4 {
    margin: 0 0 8px 0;
    font-size: 20px;
    color: var(--mpv-text-primary);
}

.mpv-processing-container p {
    margin: 0 0 24px 0;
    color: var(--mpv-text-secondary);
}

.mpv-progress-bar {
    width: 100%;
    height: 8px;
    background: var(--mpv-border);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 24px;
}

.mpv-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--mpv-primary-color), var(--mpv-success-color));
    border-radius: 4px;
    width: 0%;
    transition: width 0.3s ease;
}

/* ===== RESULTADO ===== */
.mpv-result-container {
    text-align: center;
}

.mpv-result-header {
    margin-bottom: 32px;
}

.mpv-result-header h4 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    color: var(--mpv-text-primary);
}

.mpv-result-comparison {
    margin-bottom: 32px;
}

.mpv-result-images {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 32px;
    flex-wrap: wrap;
}

.mpv-result-image-container {
    flex: 1;
    min-width: 250px;
    max-width: 300px;
}

.mpv-result-image-container h5 {
    margin: 0 0 16px 0;
    font-size: 16px;
    font-weight: 500;
    color: var(--mpv-text-secondary);
}

.mpv-result-image-container img {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
    border-radius: var(--mpv-radius-sm);
    box-shadow: var(--mpv-shadow);
}

.mpv-result-image-container {
    position: relative;
}

.mpv-result-overlay {
    position: absolute;
    top: 16px;
    right: 16px;
}

.mpv-fullscreen-btn {
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    font-size: 16px;
    transition: var(--mpv-transition);
}

.mpv-fullscreen-btn:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.1);
}

.mpv-result-arrow {
    font-size: 32px;
    color: var(--mpv-primary-color);
    font-weight: bold;
    align-self: center;
}

.mpv-result-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ===== ERROR ===== */
.mpv-error-container {
    text-align: center;
    padding: 48px 24px;
}

.mpv-error-icon {
    font-size: 64px;
    margin-bottom: 24px;
}

.mpv-error-container h4 {
    margin: 0 0 16px 0;
    font-size: 20px;
    color: var(--mpv-error-color);
}

.mpv-error-container p {
    margin: 0 0 32px 0;
    color: var(--mpv-text-secondary);
    line-height: 1.6;
}

.mpv-error-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ===== FOOTER DEL MODAL ===== */
.mpv-modal-footer {
    padding: 24px 32px;
    border-top: 1px solid var(--mpv-border);
    background: var(--mpv-surface);
}

.mpv-step-indicators {
    display: flex;
    justify-content: center;
    gap: 32px;
}

.mpv-step-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    opacity: 0.5;
    transition: var(--mpv-transition);
}

.mpv-step-indicator-active {
    opacity: 1;
}

.mpv-step-indicator-completed {
    opacity: 0.8;
}

.mpv-step-indicator-completed .mpv-step-number {
    background: var(--mpv-success-color);
    color: white;
}

.mpv-step-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--mpv-border);
    color: var(--mpv-text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    transition: var(--mpv-transition);
}

.mpv-step-indicator-active .mpv-step-number {
    background: var(--mpv-primary-color);
    color: white;
}

.mpv-step-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--mpv-text-secondary);
}

/* ===== MODAL PANTALLA COMPLETA ===== */
.mpv-fullscreen-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.95);
}

.mpv-fullscreen-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.mpv-fullscreen-container {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mpv-fullscreen-close {
    position: absolute;
    top: -50px;
    right: -50px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 24px;
    cursor: pointer;
    transition: var(--mpv-transition);
}

.mpv-fullscreen-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.mpv-fullscreen-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: var(--mpv-radius-sm);
}

/* ===== NOTIFICACIONES ===== */
.mpv-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000001;
    background: white;
    border-radius: var(--mpv-radius-sm);
    box-shadow: var(--mpv-shadow-lg);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    max-width: 500px;
    transform: translateX(100%);
    transition: var(--mpv-transition);
}

.mpv-notification-show {
    transform: translateX(0);
}

.mpv-notification-success {
    border-left: 4px solid var(--mpv-success-color);
}

.mpv-notification-error {
    border-left: 4px solid var(--mpv-error-color);
}

.mpv-notification-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.mpv-notification-message {
    flex: 1;
    color: var(--mpv-text-primary);
    font-weight: 500;
}

.mpv-notification-close {
    background: none;
    border: none;
    font-size: 18px;
    color: var(--mpv-text-secondary);
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mpv-notification-close:hover {
    color: var(--mpv-text-primary);
}

/* ===== PREVENIR SCROLL DEL BODY ===== */
.mpv-modal-open {
    overflow: hidden;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .mpv-modal {
        padding: 10px;
        align-items: flex-start;
        padding-top: 20px;
    }
    
    .mpv-modal-container {
        max-height: 95vh;
    }
    
    .mpv-modal-header,
    .mpv-modal-body,
    .mpv-modal-footer {
        padding-left: 20px;
        padding-right: 20px;
    }
    
    .mpv-modal-body {
        padding-top: 20px;
        padding-bottom: 20px;
    }
    
    .mpv-result-images {
        flex-direction: column;
        gap: 20px;
    }
    
    .mpv-result-arrow {
        transform: rotate(90deg);
        font-size: 24px;
    }
    
    .mpv-step-indicators {
        gap: 16px;
    }
    
    .mpv-result-actions,
    .mpv-error-actions,
    .mpv-preview-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .mpv-btn {
        width: 100%;
        max-width: 300px;
    }
    
    .mpv-notification {
        left: 10px;
        right: 10px;
        min-width: auto;
        max-width: none;
    }
    
    .mpv-fullscreen-close {
        top: 20px;
        right: 20px;
    }
}

@media (max-width: 480px) {
    .mpv-try-on-btn {
        width: 100%;
        max-width: 280px;
        padding: 14px 24px;
    }
    
    .mpv-modal-title {
        font-size: 20px;
    }
    
    .mpv-step-header h4 {
        font-size: 18px;
    }
    
    .mpv-drop-zone {
        padding: 32px 16px;
    }
    
    .mpv-upload-text {
        font-size: 16px;
    }
    
    .mpv-image-preview img {
        max-width: 250px;
        max-height: 300px;
    }
}

/* ===== DARK MODE (OPCIONAL) ===== */
@media (prefers-color-scheme: dark) {
    :root {
        --mpv-background: #1f2937;
        --mpv-surface: #374151;
        --mpv-border: #4b5563;
        --mpv-text-primary: #f9fafb;
        --mpv-text-secondary: #d1d5db;
    }
    
    .mpv-notification {
        background: var(--mpv-surface);
        color: var(--mpv-text-primary);
    }
}

/* ===== ANIMACIONES ADICIONALES ===== */
@keyframes mpvPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.mpv-loading {
    animation: mpvPulse 1.5s ease-in-out infinite;
}

@keyframes mpvSlideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mpv-slide-up {
    animation: mpvSlideUp 0.4s ease-out;
}

/* ===== UTILIDADES ===== */
.mpv-text-center { text-align: center; }
.mpv-hidden { display: none !important; }
.mpv-visible { display: block !important; }
.mpv-mt-1 { margin-top: 8px; }
.mpv-mt-2 { margin-top: 16px; }
.mpv-mb-1 { margin-bottom: 8px; }
.mpv-mb-2 { margin-bottom: 16px; }