/* Marble Visualizer Styles */
.marble-visualizer {
    display: flex;
    height: 100%;
    background: #f5f5f5;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Left Panel - Texture Swatches */
.mv-left-panel {
    width: 280px;
    background: #fff;
    border-right: 1px solid #e0e0e0;
    overflow-y: auto;
    padding: 20px;
    flex-shrink: 0;
}

.mv-texture-section {
    margin-bottom: 30px;
}

.mv-texture-section h3 {
    margin: 0 0 15px 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #007cba;
    padding-bottom: 8px;
}

.mv-texture-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.mv-texture-item {
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.mv-texture-item:hover {
    border-color: #007cba;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 124, 186, 0.2);
}

.mv-texture-item.active {
    border-color: #007cba;
    background: #f0f8ff;
}

.mv-texture-item img {
    width: 100%;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 8px;
}

.mv-texture-item span {
    font-size: 12px;
    color: #666;
    display: block;
    font-weight: 500;
}

/* Center Panel - Preview/Work Area */
.mv-center-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #fff;
    position: relative;
}

.mv-upload-area {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px dashed #ccc;
    border-radius: 8px;
    margin: 20px;
    transition: all 0.3s ease;
    background: #fafafa;
}

.mv-upload-area:hover {
    border-color: #007cba;
    background: #f0f8ff;
}

.mv-upload-area.dragover {
    border-color: #007cba;
    background: #e6f3ff;
    transform: scale(1.02);
}

.mv-upload-content {
    text-align: center;
    padding: 40px;
}

.mv-upload-icon {
    font-size: 48px;
    margin-bottom: 20px;
    display: block;
}

.mv-upload-content h3 {
    margin: 0 0 10px 0;
    font-size: 20px;
    color: #333;
}

.mv-upload-content p {
    margin: 0 0 20px 0;
    color: #666;
    font-size: 14px;
}

.mv-upload-btn {
    background: #007cba;
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mv-upload-btn:hover {
    background: #005a87;
    transform: translateY(-1px);
}

.mv-canvas-container {
    flex: 1;
    position: relative;
    margin: 20px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

#mv-canvas {
    width: 100%;
    height: 100%;
    display: block;
    cursor: crosshair;
}

.mv-canvas-overlay {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
}

.mv-tools {
    padding: 15px 20px;
    background: #f8f9fa;
    border-top: 1px solid #e0e0e0;
}

.mv-tool-group {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.mv-tool-btn {
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    padding: 10px 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
}

.mv-tool-btn:hover {
    border-color: #007cba;
    background: #f0f8ff;
}

.mv-tool-btn.active {
    border-color: #007cba;
    background: #007cba;
    color: #fff;
}

.mv-tool-icon {
    font-size: 16px;
}

/* Right Panel - Control Buttons */
.mv-right-panel {
    width: 200px;
    background: #fff;
    border-left: 1px solid #e0e0e0;
    padding: 20px;
    flex-shrink: 0;
}

.mv-controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.mv-control-btn {
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    padding: 12px 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 500;
    width: 100%;
    justify-content: flex-start;
}

.mv-control-btn:hover {
    border-color: #007cba;
    background: #f0f8ff;
    transform: translateX(2px);
}

.mv-control-btn:active {
    transform: translateX(2px) scale(0.98);
}

.mv-reset-btn {
    border-color: #dc3545;
    color: #dc3545;
}

.mv-reset-btn:hover {
    background: #dc3545;
    color: #fff;
}

.mv-save-btn {
    border-color: #28a745;
    color: #28a745;
    margin-top: auto;
}

.mv-save-btn:hover {
    background: #28a745;
    color: #fff;
}

.mv-control-icon {
    font-size: 18px;
}

.mv-opacity-control {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
}

.mv-opacity-control label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 500;
    color: #333;
}

.mv-opacity-slider {
    width: 100%;
    margin-bottom: 8px;
}

.mv-opacity-value {
    font-size: 12px;
    color: #666;
    text-align: center;
    display: block;
}

/* Loading Overlay */
.mv-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.mv-loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007cba;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Modal Styles */
.mv-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.mv-modal-content {
    background: #fff;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.mv-modal-header {
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mv-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #333;
}

.mv-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mv-modal-close:hover {
    color: #333;
}

.mv-modal-body {
    padding: 20px;
}

.mv-texture-upload,
.mv-texture-type,
.mv-texture-name {
    margin-bottom: 20px;
}

.mv-texture-upload label,
.mv-texture-type label,
.mv-texture-name label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.mv-texture-upload input,
.mv-texture-type select,
.mv-texture-name input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.mv-modal-footer {
    padding: 20px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.mv-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.mv-btn-secondary {
    background: #6c757d;
    color: #fff;
}

.mv-btn-secondary:hover {
    background: #5a6268;
}

.mv-btn-primary {
    background: #007cba;
    color: #fff;
}

.mv-btn-primary:hover {
    background: #005a87;
}

/* Mobile Responsive Design */
@media (max-width: 768px) {
    .marble-visualizer {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
    }
    
    .mv-left-panel {
        width: 100%;
        order: 3;
        border-right: none;
        border-top: 1px solid #e0e0e0;
        padding: 15px;
    }
    
    .mv-center-panel {
        order: 1;
        min-height: 400px;
    }
    
    .mv-right-panel {
        width: 100%;
        order: 2;
        border-left: none;
        border-top: 1px solid #e0e0e0;
        padding: 15px;
    }
    
    .mv-controls {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .mv-control-btn {
        flex: 1;
        min-width: 120px;
        justify-content: center;
        padding: 10px;
        font-size: 13px;
    }
    
    .mv-opacity-control {
        flex: 1;
        min-width: 150px;
    }
    
    .mv-texture-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 10px;
    }
    
    .mv-tool-group {
        flex-wrap: wrap;
    }
    
    .mv-tool-btn {
        flex: 1;
        min-width: 100px;
        justify-content: center;
    }
    
    .mv-upload-area {
        margin: 15px;
        min-height: 300px;
    }
    
    .mv-canvas-container {
        margin: 15px;
        min-height: 300px;
    }
    
    .mv-modal-content {
        width: 95%;
        margin: 20px;
    }
}

/* Landscape Mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .marble-visualizer {
        flex-direction: row;
        height: 100vh;
    }
    
    .mv-left-panel {
        width: 200px;
        order: 1;
        border-right: 1px solid #e0e0e0;
        border-top: none;
    }
    
    .mv-center-panel {
        order: 2;
        flex: 1;
    }
    
    .mv-right-panel {
        width: 150px;
        order: 3;
        border-left: 1px solid #e0e0e0;
        border-top: none;
    }
    
    .mv-controls {
        flex-direction: column;
    }
    
    .mv-control-btn {
        width: 100%;
        justify-content: flex-start;
    }
    
    .mv-texture-grid {
        grid-template-columns: 1fr;
    }
}

/* Tablet Responsive */
@media (min-width: 769px) and (max-width: 1024px) {
    .mv-left-panel {
        width: 240px;
    }
    
    .mv-right-panel {
        width: 180px;
    }
    
    .mv-texture-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .mv-texture-item img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .mv-texture-item,
    .mv-control-btn,
    .mv-tool-btn,
    .mv-upload-btn {
        transition: none;
    }
    
    .mv-loading-spinner {
        animation: none;
    }
}

/* Focus styles for accessibility */
.mv-control-btn:focus,
.mv-tool-btn:focus,
.mv-texture-item:focus,
.mv-upload-btn:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .mv-left-panel,
    .mv-right-panel,
    .mv-tools {
        display: none;
    }
    
    .mv-center-panel {
        width: 100%;
    }
} 