/**
 * Marble 3D Configurator - Styles
 */

:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --accent-color: #e74c3c;
    --background-color: #ecf0f1;
    --text-color: #2c3e50;
    --border-color: #bdc3c7;
    --success-color: #27ae60;
    --hover-color: #34495e;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-color);
    background-color: var(--background-color);
}

.marble-configurator-wrapper {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.configurator-header {
    text-align: center;
    margin-bottom: 30px;
}

.configurator-header h1 {
    font-size: 2.5em;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.configurator-header p {
    font-size: 1.1em;
    color: #7f8c8d;
}

.configurator-container {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 20px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* Sidebar */
.configurator-sidebar {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--hover-color) 100%);
    padding: 30px 20px;
    color: white;
}

.control-section {
    margin-bottom: 35px;
}

.control-section h3 {
    font-size: 1.2em;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Marble Types Grid */
.marble-types-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.marble-type-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 12px 15px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.95em;
    font-weight: 500;
    text-align: left;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.marble-type-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateX(5px);
}

.marble-type-btn.active {
    background: var(--secondary-color);
    border-color: var(--secondary-color);
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.4);
}

.marble-type-btn::after {
    content: '✓';
    opacity: 0;
    transition: opacity 0.3s ease;
}

.marble-type-btn.active::after {
    opacity: 1;
}

/* Environment Buttons */
.environment-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.environment-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 12px 15px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.95em;
    font-weight: 500;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 10px;
}

.environment-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateX(5px);
}

.environment-btn.active {
    background: var(--success-color);
    border-color: var(--success-color);
    box-shadow: 0 4px 15px rgba(39, 174, 96, 0.4);
}

.environment-btn::before {
    content: '🏠';
    font-size: 1.2em;
}

.environment-btn[data-environment="bathroom"]::before {
    content: '🚿';
}

.environment-btn[data-environment="livingroom"]::before {
    content: '🛋️';
}

.environment-btn[data-environment="office"]::before {
    content: '💼';
}

/* File Upload */
.file-upload-section {
    background: rgba(255, 255, 255, 0.1);
    border: 2px dashed rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.file-upload-section:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.5);
}

.file-upload-section label {
    display: block;
    cursor: pointer;
}

.file-upload-section .upload-icon {
    font-size: 2em;
    margin-bottom: 10px;
}

.file-upload-section p {
    font-size: 0.9em;
    margin-top: 5px;
    opacity: 0.9;
}

#obj-upload {
    display: none;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: var(--secondary-color);
    color: white;
}

.btn-primary:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.3);
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-success:hover {
    background: #229954;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(39, 174, 96, 0.3);
}

.btn-ai {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-ai:hover:not(:disabled) {
    background: linear-gradient(135deg, #5568d3 0%, #6a3f8f 100%);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-ai:disabled {
    background: #95a5a6;
    cursor: not-allowed;
    opacity: 0.6;
}

.btn-secondary {
    background: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background: #7f8c8d;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(149, 165, 166, 0.3);
}

/* AI Image Container */
.ai-image-container {
    text-align: center;
    margin: 20px 0;
}

.ai-prompt-section h3 {
    color: var(--primary-color);
    font-size: 1.1em;
    margin-bottom: 10px;
}

.ai-prompt-text {
    font-family: 'Courier New', monospace;
    font-size: 0.95em;
    line-height: 1.6;
    color: #2c3e50;
}

.ai-message {
    text-align: center;
    font-weight: 500;
}

.ai-message p {
    margin: 0;
    color: #1976d2;
}

/* AI Modal Styles */
.ai-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    animation: fadeIn 0.3s ease;
}

.ai-modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 15px;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideDown 0.3s ease;
}

.ai-modal-content h2 {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-size: 1.8em;
}

.ai-modal-close {
    color: #aaa;
    float: right;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    line-height: 20px;
}

.ai-modal-close:hover {
    color: #000;
}

.ai-modal-body {
    margin: 20px 0;
}

.ai-description {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #667eea;
    line-height: 1.8;
    font-size: 1.05em;
    color: #2c3e50;
    white-space: pre-wrap;
}

.ai-tip {
    background: linear-gradient(135deg, #667eea15 0%, #764ba215 100%);
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
    border: 2px dashed #667eea;
}

.ai-tip strong {
    color: #667eea;
}

.ai-modal-footer {
    margin-top: 20px;
    text-align: right;
}

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

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

/* Notification Styles */
.marble-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    color: #2c3e50;
    padding: 15px 25px;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    z-index: 9999;
    min-width: 300px;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s ease;
}

.marble-notification.show {
    opacity: 1;
    transform: translateX(0);
}

.marble-notification-success {
    border-left: 4px solid var(--success-color);
}

.marble-notification-error {
    border-left: 4px solid var(--accent-color);
}

.marble-notification-info {
    border-left: 4px solid var(--secondary-color);
}

/* Canvas Container */
.configurator-canvas-container {
    position: relative;
    background: #f8f9fa;
    border-radius: 0 15px 15px 0;
    overflow: hidden;
}

#marble-configurator-canvas {
    width: 100%;
    height: 700px;
    display: block;
}

.canvas-overlay {
    position: absolute;
    top: 20px;
    left: 20px;
    background: rgba(255, 255, 255, 0.95);
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.canvas-overlay h4 {
    font-size: 0.9em;
    color: var(--primary-color);
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.canvas-overlay p {
    font-size: 0.85em;
    color: #7f8c8d;
    margin: 2px 0;
}

/* Loading Spinner */
.loading-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.spinner {
    border: 4px solid rgba(52, 152, 219, 0.2);
    border-top: 4px solid var(--secondary-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

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

/* Responsive Design */
@media (max-width: 1024px) {
    .configurator-container {
        grid-template-columns: 1fr;
    }
    
    .configurator-sidebar {
        border-radius: 15px 15px 0 0;
    }
    
    .configurator-canvas-container {
        border-radius: 0 0 15px 15px;
    }
    
    #marble-configurator-canvas {
        height: 500px;
    }
}

@media (max-width: 768px) {
    .configurator-header h1 {
        font-size: 1.8em;
    }
    
    .marble-types-grid,
    .environment-grid {
        grid-template-columns: 1fr;
    }
    
    #marble-configurator-canvas {
        height: 400px;
    }
    
    .canvas-overlay {
        top: 10px;
        left: 10px;
        padding: 10px 15px;
    }
}

/* Tooltip */
.tooltip {
    position: relative;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.85em;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    margin-bottom: 5px;
}

.tooltip:hover::after {
    opacity: 1;
}

/* Success Message */
.success-message {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--success-color);
    color: white;
    padding: 15px 25px;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    animation: slideIn 0.3s ease, slideOut 0.3s ease 2.7s;
    z-index: 1000;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

/* Info Cards */
.info-card {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 15px;
    margin-top: 20px;
}

.info-card h4 {
    font-size: 0.95em;
    margin-bottom: 8px;
    color: rgba(255, 255, 255, 0.9);
}

.info-card p {
    font-size: 0.85em;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.7);
}

/* Color Swatches */
.color-swatch {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.marble-type-btn .color-swatch {
    flex-shrink: 0;
}
