/**
 * Visualize in My Room - Styles
 * Electrimancy.com - AI Lighting Fixture Visualization
 */

/* ========================================
   1. VISUALIZE BUTTON
   ======================================== */

.visualize-btn {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 10px 0;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.visualize-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.visualize-btn:active {
    transform: translateY(0);
}

.visualize-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    box-shadow: none;
}

/* ========================================
   2. MODAL BASE STYLES
   ======================================== */

.visualize-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 999999;
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

.visualize-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 16px;
    padding: 30px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    transition: color 0.2s;
    background: none;
    border: none;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.modal-close:hover {
    color: #333;
    background: #f0f0f0;
}

.modal-header h2 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 24px;
}

.modal-header p {
    color: #666;
    margin: 0 0 20px 0;
    font-size: 14px;
}

.modal-header .product-name {
    color: #667eea;
    font-weight: 600;
}

/* ========================================
   3. FILE UPLOAD AREA
   ======================================== */

.file-upload-area {
    border: 3px dashed #ddd;
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    background: #fafafa;
    transition: all 0.3s ease;
    cursor: pointer;
    margin: 20px 0;
}

.file-upload-area:hover {
    border-color: #667eea;
    background: #f0f3ff;
}

.file-upload-area.dragover {
    border-color: #667eea;
    background: #e8edff;
    transform: scale(1.02);
}

.file-upload-area input[type="file"] {
    display: none;
}

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

.upload-label {
    display: inline-block;
    background: #667eea;
    color: white;
    padding: 12px 30px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s;
}

.upload-label:hover {
    background: #5568d3;
}

.upload-instructions {
    margin-top: 15px;
    color: #666;
    font-size: 14px;
}

.preview-container {
    margin-top: 20px;
    display: none;
}

.preview-container.active {
    display: block;
}

.preview-image {
    max-width: 100%;
    max-height: 300px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* ========================================
   4. LOADING ANIMATION
   ======================================== */

.loading-container {
    display: none;
    text-align: center;
    padding: 40px 20px;
}

.loading-container.active {
    display: block;
}

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

.loading-text {
    color: #666;
    font-size: 16px;
    margin-top: 15px;
}

.loading-subtext {
    color: #999;
    font-size: 14px;
    margin-top: 8px;
}

/* ========================================
   5. MODAL ACTIONS (BUTTONS)
   ======================================== */

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 25px;
}

.btn-secondary {
    background: #e0e0e0;
    color: #333;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-secondary:hover {
    background: #d0d0d0;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

/* ========================================
   6. RESULT DISPLAY
   ======================================== */

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

.result-image {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.result-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
    flex-wrap: wrap;
}

.btn-download {
    background: #4CAF50;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-download:hover {
    background: #45a049;
    transform: translateY(-2px);
}

.btn-checkout {
    background: linear-gradient(135deg, #FF6B6B 0%, #FF8E53 100%);
    color: white;
    padding: 14px 28px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}

.btn-checkout:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
}

/* ========================================
   7. GALLERY VIEW
   ======================================== */

.gallery-toggle {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
    text-align: center;
}

.btn-gallery {
    background: transparent;
    color: #667eea;
    padding: 10px 20px;
    border: 2px solid #667eea;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-gallery:hover {
    background: #667eea;
    color: white;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.gallery-item {
    position: relative;
    cursor: pointer;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s;
}

.gallery-item:hover {
    transform: scale(1.05);
}

.gallery-item img {
    width: 100%;
    height: 150px;
    object-fit: cover;
}

.gallery-item-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    color: white;
    padding: 10px;
    font-size: 12px;
}

/* ========================================
   8. ERROR MESSAGES
   ======================================== */

.error-message {
    background: #fee;
    border-left: 4px solid #f44336;
    padding: 15px;
    margin: 15px 0;
    border-radius: 4px;
    color: #c62828;
    display: none;
}

.error-message.active {
    display: block;
    animation: shake 0.5s;
}

.success-message {
    background: #e8f5e9;
    border-left: 4px solid #4CAF50;
    padding: 15px;
    margin: 15px 0;
    border-radius: 4px;
    color: #2e7d32;
    display: none;
}

.success-message.active {
    display: block;
}

/* ========================================
   9. ANIMATIONS
   ======================================== */

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

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

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}

/* ========================================
   10. RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        padding: 20px;
        max-height: 95vh;
    }

    .modal-header h2 {
        font-size: 20px;
    }

    .file-upload-area {
        padding: 30px 15px;
    }

    .upload-icon {
        font-size: 36px;
    }

    .modal-actions {
        flex-direction: column;
    }

    .btn-secondary,
    .btn-primary {
        width: 100%;
    }

    .result-actions {
        flex-direction: column;
    }

    .btn-download,
    .btn-checkout {
        width: 100%;
        justify-content: center;
    }

    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .visualize-btn {
        width: 100%;
        text-align: center;
    }

    .modal-content {
        padding: 15px;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   11. UTILITY CLASSES
   ======================================== */

.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}
