/* ============================
   Virtual Try-On - Frontend CSS
   ============================ */

/* Try-On Button */
.vto-button-wrapper {
    margin: 15px 0;
}

.vto-tryon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 28px;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(108, 99, 255, 0.3);
}

.vto-tryon-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(108, 99, 255, 0.4);
    filter: brightness(1.1);
}

.vto-tryon-button:active {
    transform: translateY(0);
}

/* Modal Overlay */
.vto-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: vtoFadeIn 0.3s ease;
}

@keyframes vtoFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes vtoSlideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.vto-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
}

.vto-modal-container {
    position: relative;
    background: #fff;
    border-radius: 16px;
    width: 90%;
    max-width: 750px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 32px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
    animation: vtoSlideUp 0.4s ease;
}

.vto-modal-close {
    position: absolute;
    top: 16px;
    right: 20px;
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #666;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.vto-modal-close:hover {
    background: #f0f0f0;
    color: #333;
}

.vto-modal-header {
    text-align: center;
    margin-bottom: 24px;
}

.vto-modal-header h2 {
    margin: 0 0 8px;
    font-size: 24px;
    color: #1a1a2e;
}

.vto-modal-subtitle {
    color: #666;
    margin: 0;
    font-size: 14px;
}

/* Upload Area */
.vto-upload-area {
    border: 2px dashed #d0d0e0;
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fafafe;
}

.vto-upload-area:hover,
.vto-upload-area.vto-dragover {
    border-color: #6c63ff;
    background: #f0eeff;
}

.vto-upload-icon {
    margin-bottom: 16px;
}

.vto-upload-text {
    font-size: 16px;
    font-weight: 500;
    color: #333;
    margin: 0 0 8px;
}

.vto-upload-or {
    color: #999;
    font-size: 13px;
    margin: 8px 0;
}

.vto-upload-btn {
    display: inline-block;
    padding: 10px 24px;
    background: #6c63ff;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.vto-upload-btn:hover {
    background: #5a52d5;
}

.vto-upload-hint {
    color: #999;
    font-size: 12px;
    margin: 12px 0 0;
}

/* Tips */
.vto-tips {
    margin-top: 20px;
    padding: 16px;
    background: #f8f9ff;
    border-radius: 10px;
    border-left: 4px solid #6c63ff;
}

.vto-tips h4 {
    margin: 0 0 10px;
    font-size: 14px;
    color: #333;
}

.vto-tips ul {
    margin: 0;
    padding-left: 20px;
}

.vto-tips li {
    font-size: 13px;
    color: #555;
    margin-bottom: 6px;
    line-height: 1.4;
}

/* Preview Grid */
.vto-preview-grid {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 24px;
}

.vto-preview-card {
    text-align: center;
    flex: 1;
}

.vto-preview-card h4 {
    margin: 0 0 10px;
    font-size: 14px;
    color: #555;
}

.vto-image-frame {
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 3/4;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
}

.vto-image-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.vto-preview-plus {
    font-size: 32px;
    color: #ccc;
    font-weight: 300;
    flex-shrink: 0;
}

/* Buttons */
.vto-generate-btn {
    display: block;
    width: 100%;
    padding: 16px;
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #6c63ff, #e91e8c);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 20px rgba(108, 99, 255, 0.35);
}

.vto-generate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 30px rgba(108, 99, 255, 0.5);
}

.vto-change-photo {
    display: block;
    margin: 12px auto 0;
    background: none;
    border: none;
    color: #6c63ff;
    cursor: pointer;
    font-size: 14px;
    padding: 8px;
}

.vto-change-photo:hover {
    text-decoration: underline;
}

/* Loading */
.vto-loading-container {
    text-align: center;
    padding: 40px 20px;
}

.vto-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid #eee;
    border-top-color: #6c63ff;
    border-radius: 50%;
    animation: vtoSpin 0.8s linear infinite;
    margin: 0 auto 24px;
}

@keyframes vtoSpin {
    to {
        transform: rotate(360deg);
    }
}

.vto-loading-container h3 {
    margin: 0 0 8px;
    color: #333;
}

.vto-loading-sub {
    color: #999;
    font-size: 14px;
    margin: 0 0 20px;
}

.vto-progress-bar {
    width: 100%;
    height: 6px;
    background: #eee;
    border-radius: 3px;
    overflow: hidden;
    max-width: 300px;
    margin: 0 auto;
}

.vto-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #6c63ff, #e91e8c);
    border-radius: 3px;
    transition: width 0.5s ease;
}

/* Result / Comparison */
.vto-result-container {
    text-align: center;
}

.vto-result-container h3 {
    margin: 0 0 20px;
    font-size: 20px;
}

.vto-comparison {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 24px;
}

.vto-comparison-item {
    flex: 1;
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid #e0e0e0;
}

.vto-comparison-item img {
    width: 100%;
    aspect-ratio: 3/4;
    object-fit: cover;
    display: block;
}

.vto-label {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.vto-label-after {
    background: rgba(108, 99, 255, 0.85);
}

.vto-comparison-arrow {
    font-size: 24px;
    flex-shrink: 0;
}

/* Result Actions */
.vto-result-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.vto-btn {
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
}

.vto-btn-primary {
    background: #6c63ff;
    color: #fff;
}

.vto-btn-primary:hover {
    background: #5a52d5;
}

.vto-btn-secondary {
    background: #f0f0f0;
    color: #333;
}

.vto-btn-secondary:hover {
    background: #e0e0e0;
}

.vto-btn-outline {
    background: transparent;
    color: #6c63ff;
    border-color: #6c63ff;
}

.vto-btn-outline:hover {
    background: #6c63ff;
    color: #fff;
}

/* Error */
.vto-error-container {
    text-align: center;
    padding: 40px 20px;
}

.vto-error-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.vto-error-container h3 {
    margin: 0 0 8px;
    color: #e74c3c;
}

.vto-error-container p {
    color: #666;
    margin: 0 0 20px;
}

/* Responsive */
@media (max-width: 600px) {
    .vto-modal-container {
        width: 95%;
        padding: 20px;
        max-height: 95vh;
    }

    .vto-preview-grid {
        flex-direction: column;
    }

    .vto-preview-plus {
        transform: rotate(90deg);
    }

    .vto-comparison {
        flex-direction: column;
    }

    .vto-comparison-arrow {
        transform: rotate(90deg);
    }

    .vto-result-actions {
        flex-direction: column;
    }

    .vto-btn {
        width: 100%;
    }
}