/* Try-On Styles */

/* Try-On Button */
.xero-tryon-container {
    margin: 20px 0;
}

.xero-tryon-button {
    display: flex;
    align-items: center;
    background-color: #6366f1;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    padding: 10px 16px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(99, 102, 241, 0.3);
}

.xero-tryon-button svg {
    margin-right: 8px;
    width: 16px;
    height: 16px;
}

.xero-tryon-button:hover {
    background-color: #4f46e5;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(99, 102, 241, 0.4);
}

.xero-tryon-button:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.4);
}

.xero-tryon-button-text {
    margin-left: 5px;
}

/* Try-On Modal */
.xero-tryon-modal {
    display: none;
    position: fixed;
    z-index: 999999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(17, 24, 39, 0);
    backdrop-filter: blur(0px);
    transition: background-color 0.3s ease, backdrop-filter 0.3s ease;
}

.xero-tryon-modal.active {
    background-color: rgba(17, 24, 39, 0.8);
    backdrop-filter: blur(4px);
}

@keyframes xero-tryon-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.xero-tryon-modal-content {
    background-color: #fff;
    margin: 5% auto;
    padding: 20px;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.2), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    position: relative;
    transform: translateY(-30px);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    border: 1px solid rgba(229, 231, 235, 1);
}

.xero-tryon-modal.active .xero-tryon-modal-content {
    transform: translateY(0);
    opacity: 1;
}

.xero-tryon-close {
    position: absolute;
    top: 12px;
    right: 15px;
    color: #6b7280;
    font-size: 24px;
    font-weight: 300;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    z-index: 10;
}

.xero-tryon-close:hover {
    color: #111827;
    background-color: #f3f4f6;
}

.xero-tryon-modal h2 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #111827;
    font-size: 1.4rem;
    text-align: center;
    font-weight: 700;
    letter-spacing: -0.025em;
}

.xero-tryon-modal h3 {
    color: #111827;
    font-size: 1.1rem;
    margin-bottom: 12px;
    font-weight: 600;
}

/* Product Info */
.xero-tryon-product-info {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e5e7eb;
}

.xero-tryon-product-image {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
    margin-right: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.xero-tryon-product-details {
    flex: 1;
}

.xero-tryon-product-details p {
    color: #4b5563;
    margin-top: 4px;
    font-size: 0.85rem;
    line-height: 1.4;
}

.xero-tryon-product-name {
    font-size: 1.05rem;
    margin: 0;
    color: #111827;
    font-weight: 600;
}

/* Tabs */
.xero-tryon-tabs {
    display: flex;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 15px;
}

.xero-tryon-tab {
    flex: 1;
    text-align: center;
    padding: 10px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.95rem;
    color: #6b7280;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
}

.xero-tryon-tab:hover {
    color: #4f46e5;
}

.xero-tryon-tab.active {
    color: #4f46e5;
    border-bottom-color: #4f46e5;
    font-weight: 600;
}

/* Upload Area */
.xero-tryon-upload-area {
    margin-bottom: 0;
    background-color: #f9fafb;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    transition: all 0.3s ease;
}

.xero-tryon-upload-area.dragging {
    background-color: #f0f9ff;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

#xero-tryon-upload {
    display: block;
    width: 100%;
    padding: 12px;
    margin-bottom: 12px;
    border: 2px dashed #d1d5db;
    border-radius: 6px;
    background-color: #ffffff;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    font-size: 0.9rem;
}

#xero-tryon-upload:hover {
    border-color: #6366f1;
    background-color: #f5f5ff;
}

.xero-tryon-preview {
    display: none;
    margin-top: 15px;
    text-align: center;
    animation: xero-tryon-fade-in 0.5s ease;
}

.xero-tryon-preview img {
    max-width: 100%;
    max-height: 200px;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.xero-tryon-preview img:hover {
    transform: scale(1.02);
}

/* Result Area */
.xero-tryon-result-area {
    margin-bottom: 0;
    text-align: center;
    background-color: #f9fafb;
    padding: 15px;
    border-radius: 8px;
    animation: xero-tryon-fade-in 0.5s ease;
    transition: opacity 0.3s ease;
    border: 1px solid #e5e7eb;
}

.xero-tryon-result img {
    max-width: 100%;
    max-height: 250px;
    border-radius: 6px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.xero-tryon-result img:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

/* Controls */
.xero-tryon-controls {
    display: flex;
    justify-content: center;
    margin-top: 15px;
    gap: 12px;
}

.xero-tryon-controls button {
    padding: 10px 18px;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.xero-tryon-controls button svg {
    width: 14px;
    height: 14px;
    margin-right: 6px;
}

#xero-tryon-generate {
    background-color: #6366f1;
    color: white;
    border: none;
    box-shadow: 0 2px 4px rgba(99, 102, 241, 0.3);
}

#xero-tryon-generate:hover:not(:disabled) {
    background-color: #4f46e5;
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(99, 102, 241, 0.4);
}

#xero-tryon-generate:disabled {
    background-color: #9ca3af;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

#xero-tryon-reset {
    background-color: #ffffff;
    color: #4b5563;
    border: 1px solid #d1d5db;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

#xero-tryon-reset:hover {
    background-color: #f3f4f6;
    color: #111827;
    border-color: #9ca3af;
}

/* Loader */
.xero-tryon-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 20px 0;
    animation: xero-tryon-fade-in 0.3s ease;
}

.xero-tryon-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(99, 102, 241, 0.2);
    border-top: 3px solid #6366f1;
    border-radius: 50%;
    animation: xero-tryon-spin 1s linear infinite;
    margin-bottom: 10px;
}

@keyframes xero-tryon-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.xero-tryon-loader p {
    color: #4b5563;
    font-size: 0.95rem;
    font-weight: 500;
}

/* Error Message */
.xero-tryon-error {
    color: #b91c1c;
    background-color: #fee2e2;
    padding: 12px;
    border-radius: 6px;
    margin-top: 15px;
    text-align: center;
    font-size: 0.9rem;
    border-left: 3px solid #ef4444;
    animation: xero-tryon-fade-in 0.3s ease;
}

/* Footer */
.xero-tryon-footer {
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px solid #e5e7eb;
    text-align: center;
}

.xero-tryon-footer p {
    color: #6b7280;
    font-size: 0.8rem;
    margin: 0;
}

/* Scrollbar Styling */
.xero-tryon-modal-content::-webkit-scrollbar {
    width: 6px;
}

.xero-tryon-modal-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.xero-tryon-modal-content::-webkit-scrollbar-thumb {
    background: #c7c7c7;
    border-radius: 10px;
}

.xero-tryon-modal-content::-webkit-scrollbar-thumb:hover {
    background: #a0a0a0;
}

/* Responsive Adjustments */
@media screen and (max-width: 768px) {
    .xero-tryon-modal-content {
        margin: 0;
        padding: 16px;
        width: 100%;
        height: 100%;
        border-radius: 0;
        max-height: 100vh;
    }

    .xero-tryon-product-info {
        flex-direction: row;
        text-align: left;
        align-items: center;
    }

    .xero-tryon-product-image {
        margin-right: 12px;
        margin-bottom: 0;
        width: 50px;
        height: 50px;
    }

    .xero-tryon-upload-area,
    .xero-tryon-result-area {
        padding: 12px;
    }

    .xero-tryon-modal h2 {
        font-size: 1.2rem;
    }
}

/* Compact View for Small Screens */
@media screen and (max-height: 700px) {
    .xero-tryon-modal-content {
        margin: 2% auto;
        padding: 16px;
        max-height: 96vh;
    }

    .xero-tryon-product-info {
        margin-bottom: 12px;
        padding-bottom: 10px;
    }

    .xero-tryon-product-image {
        width: 50px;
        height: 50px;
    }

    .xero-tryon-preview img {
        max-height: 180px;
    }

    .xero-tryon-result img {
        max-height: 200px;
    }

    .xero-tryon-modal h2 {
        margin-bottom: 12px;
        font-size: 1.2rem;
    }
}