/* WooCommerce Virtual Try-On - Frontend Styles */

:root {
    --wc-vto-primary: #6366f1;
    --wc-vto-primary-dark: #4f46e5;
    --wc-vto-success: #10b981;
    --wc-vto-error: #ef4444;
    --wc-vto-border: #e5e7eb;
    --wc-vto-text: #1f2937;
    --wc-vto-text-light: #6b7280;
    --wc-vto-bg: #ffffff;
    --wc-vto-bg-light: #f9fafb;
    --wc-vto-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --wc-vto-shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Upload Widget */
.wc-vto-upload-widget {
    margin: 30px 0;
    padding: 24px;
    background: var(--wc-vto-bg);
    border: 2px solid var(--wc-vto-border);
    border-radius: 12px;
    box-shadow: var(--wc-vto-shadow);
}

.wc-vto-section-title h3 {
    margin: 0 0 8px 0;
    font-size: 24px;
    font-weight: 700;
    color: var(--wc-vto-text);
}

.wc-vto-section-title p {
    margin: 0 0 20px 0;
    color: var(--wc-vto-text-light);
    font-size: 14px;
}

/* Saved Photo */
.wc-vto-saved-photo {
    text-align: center;
    margin-bottom: 20px;
}

.wc-vto-saved-photo img {
    max-width: 200px;
    height: auto;
    border-radius: 12px;
    box-shadow: var(--wc-vto-shadow);
    margin-bottom: 12px;
}

.wc-vto-change-photo {
    background: var(--wc-vto-bg-light);
    border: 1px solid var(--wc-vto-border);
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.wc-vto-change-photo:hover {
    background: #e5e7eb;
}

/* Dropzone */
.wc-vto-dropzone {
    border: 2px dashed var(--wc-vto-border);
    border-radius: 12px;
    padding: 48px 24px;
    text-align: center;
    background: var(--wc-vto-bg-light);
    transition: all 0.3s ease;
    cursor: pointer;
}

.wc-vto-dropzone:hover,
.wc-vto-dropzone.dragover {
    border-color: var(--wc-vto-primary);
    background: rgba(99, 102, 241, 0.05);
}

.wc-vto-upload-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 16px;
    color: var(--wc-vto-primary);
}

.wc-vto-dropzone-text {
    font-size: 16px;
    font-weight: 600;
    color: var(--wc-vto-text);
    margin: 0 0 8px 0;
}

.wc-vto-dropzone-subtext {
    font-size: 14px;
    color: var(--wc-vto-text-light);
    margin: 0 0 16px 0;
}

.wc-vto-browse-btn {
    background: var(--wc-vto-primary);
    color: white;
    border: none;
    padding: 12px 32px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.wc-vto-browse-btn:hover {
    background: var(--wc-vto-primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.wc-vto-file-info {
    font-size: 12px;
    color: var(--wc-vto-text-light);
    margin: 16px 0 0 0;
}

/* Preview */
.wc-vto-preview {
    position: relative;
    margin-top: 20px;
    text-align: center;
}

.wc-vto-preview img {
    max-width: 300px;
    height: auto;
    border-radius: 12px;
    box-shadow: var(--wc-vto-shadow);
}

.wc-vto-remove-preview {
    position: absolute;
    top: -10px;
    right: calc(50% - 160px);
    background: var(--wc-vto-error);
    color: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    line-height: 1;
    transition: all 0.3s ease;
}

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

/* Consent & Options */
.wc-vto-consent,
.wc-vto-save-option {
    margin-top: 16px;
}

.wc-vto-consent label,
.wc-vto-save-option label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--wc-vto-text);
    cursor: pointer;
}

.wc-vto-consent input,
.wc-vto-save-option input {
    cursor: pointer;
}

/* Try-On Button */
.wc-vto-tryon-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--wc-vto-button-color, var(--wc-vto-primary));
    color: white;
    border: none;
    padding: 16px 32px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 16px;
    transition: all 0.3s ease;
    width: 100%;
    justify-content: center;
}

.wc-vto-tryon-btn:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

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

.wc-vto-btn-icon svg {
    width: 20px;
    height: 20px;
}

.wc-vto-spinner {
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
}

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

/* Modal */
.wc-vto-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999999;
}

.wc-vto-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.wc-vto-modal-content {
    position: relative;
    max-width: 800px;
    margin: 50px auto;
    background: white;
    border-radius: 16px;
    box-shadow: var(--wc-vto-shadow-lg);
    max-height: calc(100vh - 100px);
    overflow-y: auto;
}

.wc-vto-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(0, 0, 0, 0.1);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
}

.wc-vto-modal-close:hover {
    background: rgba(0, 0, 0, 0.2);
}

.wc-vto-modal-header {
    padding: 24px;
    border-bottom: 1px solid var(--wc-vto-border);
}

.wc-vto-modal-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
}

.wc-vto-modal-body {
    padding: 32px 24px;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wc-vto-result-loading,
.wc-vto-result-error {
    text-align: center;
}

.wc-vto-spinner-large {
    width: 64px;
    height: 64px;
    color: var(--wc-vto-primary);
    animation: spin 1s linear infinite;
}

.wc-vto-result-loading p {
    font-size: 18px;
    font-weight: 600;
    margin: 16px 0 8px 0;
}

.wc-vto-loading-subtext {
    font-size: 14px;
    color: var(--wc-vto-text-light);
}

.wc-vto-result-image img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
}

.wc-vto-error-icon {
    width: 64px;
    height: 64px;
    color: var(--wc-vto-error);
    margin: 0 auto 16px;
}

.wc-vto-retry-btn {
    background: var(--wc-vto-primary);
    color: white;
    border: none;
    padding: 12px 32px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 16px;
    transition: all 0.3s ease;
}

.wc-vto-retry-btn:hover {
    background: var(--wc-vto-primary-dark);
}

.wc-vto-modal-footer {
    padding: 24px;
    border-top: 1px solid var(--wc-vto-border);
    display: flex;
    gap: 12px;
    justify-content: center;
}

.wc-vto-download-btn,
.wc-vto-share-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.wc-vto-download-btn {
    background: var(--wc-vto-primary);
    color: white;
    border: none;
}

.wc-vto-download-btn:hover {
    background: var(--wc-vto-primary-dark);
}

.wc-vto-share-btn {
    background: white;
    color: var(--wc-vto-primary);
    border: 2px solid var(--wc-vto-primary);
}

.wc-vto-share-btn:hover {
    background: var(--wc-vto-bg-light);
}

.wc-vto-download-btn svg,
.wc-vto-share-btn svg {
    width: 18px;
    height: 18px;
}

/* Upload Status Messages */
.wc-vto-upload-status {
    margin-top: 16px;
    padding: 12px;
    border-radius: 8px;
    font-size: 14px;
}

.wc-vto-upload-status.success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--wc-vto-success);
    border: 1px solid var(--wc-vto-success);
}

.wc-vto-upload-status.error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--wc-vto-error);
    border: 1px solid var(--wc-vto-error);
}

/* Responsive */
@media (max-width: 768px) {
    .wc-vto-modal-content {
        margin: 20px;
        max-height: calc(100vh - 40px);
    }
    
    .wc-vto-upload-widget {
        padding: 16px;
    }
    
    .wc-vto-dropzone {
        padding: 32px 16px;
    }
    
    .wc-vto-modal-footer {
        flex-direction: column;
    }
    
    .wc-vto-download-btn,
    .wc-vto-share-btn {
        width: 100%;
        justify-content: center;
    }
}
