/**
 * Room Visualizer Frontend Styles
 */

/* Reset and Base Styles */
.rv-container {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    color: #333;
    background: #f8f9fa;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* Main Interface Layout */
.rv-main-interface {
    display: flex;
    height: 100%;
    background: #fff;
}

/* Sidebar Styles */
.rv-sidebar {
    width: 280px;
    background: #f8f9fa;
    border-right: 1px solid #e9ecef;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.rv-sidebar-header {
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
    background: #fff;
}

.rv-sidebar-header h3 {
    margin: 0 0 15px 0;
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
}

.rv-category-filter select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    font-size: 14px;
    color: #333;
}

.rv-designs-catalog {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
}

.rv-loading {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
}

.rv-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #e9ecef;
    border-top: 3px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Category Groups */
.rv-category-group {
    margin-bottom: 25px;
}

.rv-category-group h4 {
    margin: 0 0 12px 0;
    font-size: 14px;
    font-weight: 600;
    color: #495057;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.rv-designs-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

/* Design Items */
.rv-design-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    border: 2px solid transparent;
    transition: all 0.2s ease;
    cursor: pointer;
}

.rv-design-item:hover {
    border-color: #007bff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.15);
}

.rv-design-item img {
    width: 100%;
    height: 80px;
    object-fit: cover;
    display: block;
}

.rv-design-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.rv-design-item:hover .rv-design-overlay {
    opacity: 1;
}

/* Canvas Area */
.rv-canvas-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #fff;
}

.rv-canvas-header {
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
}

.rv-upload-section {
    display: flex;
    gap: 10px;
}

.rv-comparison-controls {
    display: flex;
    gap: 10px;
}

/* Canvas Container */
.rv-canvas-container {
    flex: 1;
    position: relative;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
}

.rv-canvas-wrapper {
    position: relative;
    max-width: 100%;
    max-height: 100%;
}

.rv-canvas {
    display: block;
    max-width: 100%;
    max-height: 100%;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Button Styles */
.rv-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.rv-btn-primary {
    background: #007bff;
    color: #fff;
}

.rv-btn-primary:hover {
    background: #0056b3;
    transform: translateY(-1px);
}

.rv-btn-secondary {
    background: #6c757d;
    color: #fff;
}

.rv-btn-secondary:hover {
    background: #545b62;
    transform: translateY(-1px);
}

.rv-btn-outline {
    background: transparent;
    color: #007bff;
    border: 1px solid #007bff;
}

.rv-btn-outline:hover {
    background: #007bff;
    color: #fff;
}

.rv-btn-success {
    background: #28a745;
    color: #fff;
}

.rv-btn-success:hover {
    background: #1e7e34;
}

.rv-btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* Floor Selection Tools */
.rv-floor-selection {
    position: absolute;
    top: 20px;
    left: 20px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
}

.rv-selection-tools {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
}

.rv-tool-btn {
    width: 40px;
    height: 40px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    color: #6c757d;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rv-tool-btn:hover {
    border-color: #007bff;
    color: #007bff;
}

.rv-tool-btn.active {
    background: #007bff;
    border-color: #007bff;
    color: #fff;
}

.rv-selection-actions {
    display: flex;
    gap: 8px;
}

/* Design Controls */
.rv-design-controls {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
    min-width: 250px;
}

.rv-control-group {
    margin-bottom: 15px;
}

.rv-control-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #495057;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.rv-slider {
    width: 100%;
    height: 4px;
    border-radius: 2px;
    background: #e9ecef;
    outline: none;
    -webkit-appearance: none;
}

.rv-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #007bff;
    cursor: pointer;
}

.rv-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #007bff;
    cursor: pointer;
    border: none;
}

.rv-value {
    font-size: 12px;
    color: #6c757d;
    margin-left: 10px;
}

.rv-control-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Modal Styles */
.rv-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: 1000;
    backdrop-filter: blur(5px);
}

.rv-modal-content {
    background: #fff;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.rv-modal-header {
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.rv-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
}

.rv-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #6c757d;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.rv-modal-close:hover {
    background: #f8f9fa;
    color: #333;
}

.rv-modal-body {
    padding: 20px;
}

.rv-modal-footer {
    padding: 20px;
    border-top: 1px solid #e9ecef;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* Upload Area */
.rv-upload-area {
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.rv-upload-area:hover {
    border-color: #007bff;
    background: #f8f9ff;
}

.rv-upload-area.rv-drag-over {
    border-color: #007bff;
    background: #f8f9ff;
}

.rv-upload-area svg {
    color: #6c757d;
    margin-bottom: 15px;
}

.rv-upload-area p {
    margin: 0;
    color: #6c757d;
    font-size: 14px;
}

/* Camera Video */
#rv-camera-video {
    width: 100%;
    border-radius: 8px;
    background: #000;
}

#rv-camera-canvas {
    width: 100%;
    border-radius: 8px;
}

/* Error States */
.rv-error {
    color: #dc3545;
    text-align: center;
    padding: 20px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .rv-main-interface {
        flex-direction: column;
    }
    
    .rv-sidebar {
        width: 100%;
        height: 200px;
        border-right: none;
        border-bottom: 1px solid #e9ecef;
    }
    
    .rv-designs-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .rv-canvas-header {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .rv-upload-section,
    .rv-comparison-controls {
        justify-content: center;
    }
    
    .rv-floor-selection,
    .rv-design-controls {
        position: relative;
        top: auto;
        left: auto;
        right: auto;
        margin: 10px;
    }
    
    .rv-modal-content {
        width: 95%;
        margin: 20px;
    }
    
    .rv-control-actions {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .rv-designs-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .rv-btn {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    .rv-selection-tools {
        flex-wrap: wrap;
    }
    
    .rv-selection-actions {
        flex-direction: column;
    }
}

/* Loading States */
.rv-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

/* Accessibility */
.rv-btn:focus,
.rv-tool-btn:focus,
.rv-modal-close:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

.rv-slider:focus {
    outline: none;
}

.rv-slider:focus::-webkit-slider-thumb {
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

/* Print Styles */
@media print {
    .rv-sidebar,
    .rv-canvas-header,
    .rv-floor-selection,
    .rv-design-controls {
        display: none !important;
    }
    
    .rv-canvas {
        box-shadow: none;
        border: 1px solid #ccc;
    }
} 