/**
 * 3D Model Viewer Styles
 * Full-screen Three.js canvas with sidebar and control overlays
 */

/* ============================================================================
   Full-Screen Layout (Hide footer, make body full viewport)
   ============================================================================ */

/* Hide footer for 3D viewer (like map view) */
footer {
    display: none !important;
}

/* Full-screen layout */
body {
    padding: 0;
    margin: 0;
    overflow: hidden;
}

.content-wrapper {
    padding: 0 !important;
    margin: 0 !important;
}

/* ============================================================================
   Container and Layout
   ============================================================================ */

.container-fluid.h-100 {
    height: 100vh;
    overflow: hidden;
    padding: 0;
}

#model-viewer-container {
    position: relative;
    width: 100%;
    height: 100%;
    background: #000;
}

#threejs-canvas {
    display: block;
    width: 100%;
    height: 100%;
    outline: none;
}

/* ============================================================================
   Sidebar
   ============================================================================ */

.sidebar {
    background: #1e1e1e;
    color: #e0e0e0;
    height: 100vh;
    overflow-y: auto;
    padding: 20px;
    border-right: 1px solid #333;
}

.sidebar h3 {
    color: #fff;
    font-size: 1.25rem;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #4ECDC4;
}

.sidebar h4 {
    color: #4ECDC4;
    font-size: 1rem;
    margin-top: 20px;
    margin-bottom: 10px;
}

.sidebar .btn {
    width: 100%;
    margin-bottom: 10px;
}

.sidebar .btn-primary {
    background: #4ECDC4;
    border-color: #4ECDC4;
}

.sidebar .btn-primary:hover {
    background: #3ba8a0;
    border-color: #3ba8a0;
}

.sidebar .btn-secondary {
    background: #6c757d;
    border-color: #6c757d;
}

/* ============================================================================
   Layer Controls
   ============================================================================ */

.layer-controls {
    margin-top: 20px;
}

.layer-item {
    margin-bottom: 15px;
}

.layer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: #2a2a2a;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

.layer-header:hover {
    background: #333;
}

.layer-header .form-check {
    margin: 0;
}

.layer-header .form-check-label {
    font-weight: 500;
    color: #fff;
    cursor: pointer;
}

.layer-config-panel {
    background: #252525;
    padding: 15px;
    margin-top: 5px;
    border-radius: 4px;
    border-left: 3px solid #4ECDC4;
}

.layer-config-panel .form-group {
    margin-bottom: 15px;
}

.layer-config-panel label {
    font-size: 0.875rem;
    color: #b0b0b0;
    margin-bottom: 5px;
    display: block;
}

.layer-config-panel select,
.layer-config-panel input[type="range"] {
    width: 100%;
    background: #1e1e1e;
    border: 1px solid #444;
    color: #e0e0e0;
    padding: 5px 10px;
    border-radius: 3px;
}

.layer-config-panel input[type="range"] {
    padding: 0;
}

.range-value {
    display: inline-block;
    margin-left: 10px;
    color: #4ECDC4;
    font-weight: 500;
}

/* ============================================================================
   Info Displays
   ============================================================================ */

.info-section {
    background: #252525;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 15px;
}

.info-section h5 {
    color: #4ECDC4;
    font-size: 0.875rem;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    font-size: 0.875rem;
}

.info-item .label {
    color: #b0b0b0;
}

.info-item .value {
    color: #fff;
    font-weight: 500;
}

/* ============================================================================
   Control Overlays
   ============================================================================ */

.controls-overlay {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 100;
}

.controls-overlay .btn {
    background: rgba(30, 30, 30, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 10px 15px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    backdrop-filter: blur(10px);
}

.controls-overlay .btn:hover {
    background: rgba(78, 205, 196, 0.9);
    border-color: #4ECDC4;
}

.controls-overlay .btn i {
    margin-right: 5px;
}

/* ============================================================================
   Stats Overlay
   ============================================================================ */

.stats-overlay {
    position: absolute;
    bottom: 20px;
    left: 20px;
    background: rgba(30, 30, 30, 0.9);
    color: #e0e0e0;
    padding: 15px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.75rem;
    z-index: 100;
    min-width: 200px;
    backdrop-filter: blur(10px);
}

.stats-overlay h6 {
    color: #4ECDC4;
    font-size: 0.875rem;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.stats-overlay .stat-item {
    display: flex;
    justify-content: space-between;
    padding: 3px 0;
}

.stats-overlay .stat-label {
    color: #b0b0b0;
}

.stats-overlay .stat-value {
    color: #fff;
    font-weight: 500;
}

/* ============================================================================
   Loading Indicator
   ============================================================================ */

#loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(30, 30, 30, 0.95);
    color: #fff;
    padding: 30px 50px;
    border-radius: 8px;
    text-align: center;
    font-size: 1.1rem;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

#loading::after {
    content: '';
    display: block;
    width: 40px;
    height: 40px;
    margin: 20px auto 0;
    border: 4px solid #4ECDC4;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

#loading.hidden {
    display: none;
}

/* ============================================================================
   Error Display
   ============================================================================ */

#error-display {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(220, 53, 69, 0.95);
    color: #fff;
    padding: 15px 30px;
    border-radius: 4px;
    font-size: 0.95rem;
    z-index: 1000;
    max-width: 600px;
    text-align: center;
    display: none;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

#error-display.show {
    display: block;
}

/* ============================================================================
   Modals
   ============================================================================ */

.modal-content {
    background: #1e1e1e;
    color: #e0e0e0;
}

.modal-header {
    border-bottom: 1px solid #333;
}

.modal-title {
    color: #4ECDC4;
}

.modal-body {
    background: #252525;
}

.modal-footer {
    border-top: 1px solid #333;
}

.modal .form-control {
    background: #1e1e1e;
    border: 1px solid #444;
    color: #e0e0e0;
}

.modal .form-control:focus {
    background: #252525;
    border-color: #4ECDC4;
    color: #fff;
}

.modal .list-group-item {
    background: #1e1e1e;
    border: 1px solid #333;
    color: #e0e0e0;
    cursor: pointer;
    transition: background 0.2s;
}

.modal .list-group-item:hover {
    background: #2a2a2a;
}

.modal .list-group-item.active {
    background: #4ECDC4;
    border-color: #4ECDC4;
    color: #fff;
}

/* ============================================================================
   Scrollbar Styling (Webkit)
   ============================================================================ */

.sidebar::-webkit-scrollbar {
    width: 8px;
}

.sidebar::-webkit-scrollbar-track {
    background: #1e1e1e;
}

.sidebar::-webkit-scrollbar-thumb {
    background: #4ECDC4;
    border-radius: 4px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: #3ba8a0;
}

/* ============================================================================
   Responsive Adjustments
   ============================================================================ */

@media (max-width: 768px) {
    .sidebar {
        position: absolute;
        top: 0;
        left: 0;
        width: 300px;
        height: 100vh;
        z-index: 1000;
        transform: translateX(-100%);
        transition: transform 0.3s;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .controls-overlay {
        top: 10px;
        right: 10px;
    }

    .stats-overlay {
        bottom: 10px;
        left: 10px;
        font-size: 0.65rem;
        padding: 10px;
    }
}

/* ============================================================================
   Animations
   ============================================================================ */

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.slide-in-right {
    animation: slideInRight 0.3s ease-out;
}

/* ============================================================================
   Utility Classes
   ============================================================================ */

.text-muted {
    color: #6c757d !important;
}

.text-primary {
    color: #4ECDC4 !important;
}

.text-success {
    color: #28a745 !important;
}

.text-danger {
    color: #dc3545 !important;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

.hidden {
    display: none !important;
}
