/* AI Try-On Assistant - Frontend Styles */

/* Try-on Badge Button */
.aitoa-try-on-badge {
    position: absolute !important;
    top: 25px !important;
    right: 60px !important;
    background: white !important;
    color: #333 !important;
    border: 1px solid #ddd !important;
    border-radius: 25px !important;
    padding: 8px 16px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15) !important;
    z-index: 10 !important;
    text-transform: none !important;
}

.aitoa-try-on-badge:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2) !important;
    background: #f8f9fa !important;
    border-color: #bbb !important;
}

.aitoa-try-on-badge:active {
    transform: translateY(0) !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15) !important;
}

.aitoa-badge-icon {
    font-size: 16px !important;
    line-height: 1 !important;
}

.aitoa-badge-text {
    font-size: 13px !important;
    font-weight: 600 !important;
    white-space: nowrap !important;
}

/* Responsive design for badge */
@media (max-width: 768px) {
    .aitoa-try-on-badge {
        top: 20px !important;
        right: 50px !important;
        padding: 6px 12px !important;
        font-size: 12px !important;
    }
    
    .aitoa-badge-icon {
        font-size: 14px !important;
    }
    
    .aitoa-badge-text {
        font-size: 11px !important;
    }
}

/* Adjust for very small screens */
@media (max-width: 480px) {
    .aitoa-try-on-badge {
        padding: 6px 10px !important;
        font-size: 11px !important;
        min-width: auto !important;
    }
    
    .aitoa-badge-text {
        font-size: 10px !important;
    }
}

/* Modal styles */
.aitoa-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
}

.aitoa-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
}

.aitoa-modal-content {
    position: relative;
    background: white;
    max-width: 900px;
    width: 90%;
    max-height: 90vh;
    margin: 5vh auto;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.aitoa-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    background: #f8f9fa;
    color: #333;
    border-bottom: 1px solid #e9ecef;
}

.aitoa-modal-header h3 {
    margin: 0;
    font-size: 20px;
}

.aitoa-modal-close {
    background: none;
    border: none;
    color: #6c757d;
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.aitoa-modal-close:hover {
    color: #343a40;
}

.aitoa-modal-body {
    padding: 30px;
    max-height: calc(90vh - 100px);
    overflow-y: auto;
}

/* Step indicator */
.aitoa-step-indicator {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
    gap: 20px;
}

.aitoa-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    opacity: 0.4;
    transition: opacity 0.3s ease;
}

.aitoa-step.active,
.aitoa-step.completed {
    opacity: 1;
}

.aitoa-step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
    transition: background 0.3s ease;
}

.aitoa-step.active .aitoa-step-number {
    background: #667eea;
}

.aitoa-step.completed .aitoa-step-number {
    background: #28a745;
}

.aitoa-step-label {
    font-size: 14px;
    color: #666;
}

/* Image selection grid */
.aitoa-image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.aitoa-image-option {
    position: relative;
    border: 3px solid transparent;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
}

.aitoa-image-option:hover {
    border-color: #667eea;
    transform: translateY(-2px);
}

.aitoa-image-option.selected {
    border-color: #28a745;
}

.aitoa-image-option img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    display: block;
}

.aitoa-image-option .aitoa-select-indicator {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.aitoa-image-option.selected .aitoa-select-indicator {
    opacity: 1;
    background: #28a745;
    color: white;
}

/* Step action buttons */
.aitoa-step-actions {
    text-align: center;
    margin-top: 20px;
}

/* Processing animation */
.aitoa-processing {
    text-align: center;
    padding: 60px 40px;
}

.aitoa-processing h4 {
    color: #495057;
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 10px;
}

.aitoa-processing p {
    color: #6c757d;
    font-size: 14px;
    margin: 0;
}

/* No photo message */
.aitoa-no-photo-message {
    text-align: center;
    padding: 60px 40px;
}

.aitoa-no-photo-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.6;
}

.aitoa-no-photo-message h4 {
    color: #495057;
    font-size: 20px;
    font-weight: 500;
    margin-bottom: 15px;
}

.aitoa-no-photo-message p {
    color: #6c757d;
    font-size: 16px;
    line-height: 1.5;
    margin-bottom: 30px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.aitoa-no-photo-actions {
    margin-top: 30px;
}

.aitoa-no-photo-actions .button {
    background: #007cba;
    color: white;
    padding: 12px 30px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    display: inline-block;
    transition: background 0.2s ease;
}

.aitoa-no-photo-actions .button:hover {
    background: #005a87;
    color: white;
}

.aitoa-processing-animation {
    margin-bottom: 20px;
}

.aitoa-spinner-large {
    width: 60px;
    height: 60px;
    border: 4px solid #f0f0f0;
    border-top: 4px solid #6c757d;
    border-radius: 50%;
    margin: 0 auto;
    animation: aitoa-spin 1s linear infinite;
}

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

.aitoa-progress-bar {
    width: 100%;
    height: 6px;
    background: #f0f0f0;
    border-radius: 3px;
    margin-top: 20px;
    overflow: hidden;
}

.aitoa-progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    animation: aitoa-progress 3s ease-in-out infinite;
}

@keyframes aitoa-progress {
    0% { width: 0%; }
    50% { width: 80%; }
    100% { width: 100%; }
}

/* Result display */
.aitoa-result-display {
    padding: 20px 0;
}

.aitoa-result-header {
    text-align: center;
    margin-bottom: 25px;
}

.aitoa-result-header h4 {
    color: #333;
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
}

.aitoa-result-header p {
    color: #6c757d;
    font-size: 14px;
    margin: 0;
}

.aitoa-analysis-content {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    line-height: 1.6;
    color: #495057;
    font-size: 15px;
}

.aitoa-image-result {
    text-align: center;
    margin: 20px 0;
}

.aitoa-image-result img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.aitoa-info-note {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 6px;
    padding: 15px;
    margin: 20px 0;
}

.aitoa-info-note p {
    color: #856404;
    font-size: 13px;
    margin: 0;
}

.aitoa-result-content {
    padding: 20px;
    text-align: center;
    color: #495057;
}

.aitoa-result-actions {
    text-align: center;
    margin-top: 30px;
    display: flex;
    gap: 15px;
    justify-content: center;
}

.aitoa-result-actions .button {
    padding: 12px 24px;
    border-radius: 6px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    border: none;
    background: #007cba;
    color: white;
    transition: background 0.2s ease;
}

.aitoa-result-actions .button:hover {
    background: #005a87;
    color: white;
}

/* Legacy result styles */
.aitoa-before-after {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin: 20px 0;
}

.aitoa-before,
.aitoa-after {
    text-align: center;
}

.aitoa-before h5,
.aitoa-after h5 {
    margin-bottom: 15px;
    font-size: 16px;
    color: #333;
}

.aitoa-image-container {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.aitoa-image-container img {
    width: 100%;
    height: auto;
    display: block;
}

/* Error messages */
.aitoa-error-message {
    text-align: center;
    padding: 40px 20px;
    color: #dc3545;
}

.aitoa-error-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.aitoa-error-message h4 {
    color: #dc3545;
    margin-bottom: 15px;
}

/* Profile photo section styles */
.aitoa-profile-photo-section {
    border: 1px solid #ddd;
    padding: 20px;
    margin: 20px 0;
    border-radius: 8px;
    background: #f9f9f9;
}
.aitoa-profile-photo-section legend {
    padding: 0 10px;
    font-weight: bold;
    color: #333;
}
.aitoa-current-photo h4 {
    margin-bottom: 15px;
    color: #495057;
    font-size: 16px;
}
.aitoa-photo-preview {
    margin-bottom: 15px;
    text-align: center;
}
.aitoa-photo-preview img {
    max-width: 200px;
    max-height: 250px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    object-fit: cover;
}
.aitoa-photo-status {
    margin: 15px 0;
    padding: 10px 15px;
    border-radius: 6px;
}
.aitoa-status-good {
    color: #28a745;
    background: #d4edda;
    display: inline-block;
    padding: 8px 12px;
    border-radius: 4px;
    border: 1px solid #c3e6cb;
    font-weight: 500;
}
.aitoa-status-missing {
    color: #856404;
    background: #fff3cd;
    display: inline-block;
    padding: 8px 12px;
    border-radius: 4px;
    border: 1px solid #ffeaa7;
    font-weight: 500;
}
.aitoa-replace-photo-btn {
    background: #007cba;
    color: white !important;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    display: inline-block;
    text-decoration: none;
    font-weight: 500;
    transition: background 0.2s ease;
}
.aitoa-replace-photo-btn:hover {
    background: #005a87;
    color: white !important;
}
.aitoa-photo-placeholder {
    text-align: center;
    padding: 40px 20px;
    border: 2px dashed #ddd;
    border-radius: 8px;
    margin-bottom: 15px;
    background: white;
}
.aitoa-placeholder-icon {
    font-size: 48px;
    opacity: 0.5;
    display: block;
    margin-bottom: 10px;
}
.aitoa-photo-placeholder p {
    color: #6c757d;
    margin: 0;
    font-style: italic;
}

/* User photo management page */
.aitoa-user-photos {
    max-width: 800px;
}

.aitoa-photo-section {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin: 20px 0;
}

.aitoa-photo-display {
    text-align: center;
    margin: 20px 0;
}

.aitoa-photo-img {
    max-width: 300px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.aitoa-photo-actions {
    margin-top: 15px;
}

.aitoa-no-photo {
    text-align: center;
    padding: 40px;
    color: #666;
}

.aitoa-upload-area {
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 20px 0;
}

.aitoa-upload-area:hover,
.aitoa-upload-area.dragover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.05);
}

.aitoa-upload-icon {
    font-size: 48px;
    display: block;
    margin-bottom: 15px;
}

.aitoa-upload-note {
    color: #666;
    font-size: 14px;
    margin-top: 10px;
}

.aitoa-photo-tips {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
}

.aitoa-photo-tips ul {
    margin: 10px 0;
    padding-left: 20px;
}

.aitoa-photo-tips li {
    margin: 8px 0;
    color: #555;
}

/* Loading overlay */
.aitoa-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.aitoa-loading-content {
    background: white;
    padding: 40px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.aitoa-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f0f0f0;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: aitoa-spin 1s linear infinite;
}

/* Responsive design */
@media (max-width: 768px) {
    .aitoa-modal-content {
        width: 95%;
        margin: 2.5vh auto;
        max-height: 95vh;
    }
    
    .aitoa-modal-body {
        padding: 20px;
    }
    
    .aitoa-before-after {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .aitoa-image-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 10px;
    }
    
    .aitoa-result-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .aitoa-photo-section {
        padding: 20px;
    }
}