.human-body-container {
    position: relative;
    width: 100%;
    height: calc(100vh - 72px);
    background-color: #000;
    overflow: hidden;
}

#human-body-canvas-container {
    width: 100%;
    height: 100%;
    display: block;
}

#human-body-canvas-container:active {
    cursor: grabbing;
}

/* Info Card UI overlay */
.bone-info-card {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 320px;
    z-index: 30;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    background: rgba(15, 15, 15, 0.85);
    border: 1px solid #333;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    pointer-events: auto;
    color: #e0e0e0;
    font-family: 'Roboto', sans-serif;
    transition: opacity 0.3s ease;
    padding: 0;
}

.bone-info-card .info-header {
    margin: 0;
    padding: 15px 20px;
    border-bottom: 1px solid #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.4);
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

.bone-info-card h3 {
    margin: 0;
    color: #60a5fa;
    font-weight: 600;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-close-custom {
    background: none;
    border: none;
    color: #888;
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.btn-close-custom:hover {
    color: #fff;
}

.bone-info-card .info-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#bone-details-content {
    max-height: 40vh;
    overflow-y: auto;
    padding-right: 8px;
    font-size: 0.95rem;
    color: #ccc;
    line-height: 1.5;
}

/* Scrollbar styles for the details section */
#bone-details-content::-webkit-scrollbar {
    width: 6px;
}
#bone-details-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}
#bone-details-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}
#bone-details-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.4);
}

.latin-name {
    margin: 0 0 15px 0;
    font-style: italic;
    color: #666;
    font-size: 13px;
}

.bone-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 15px;
}

.btn-action {
    background: rgba(40, 40, 40, 0.9);
    border: 1px solid #444;
    color: #fff;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-family: 'Roboto', sans-serif;
    transition: background 0.2s, border-color 0.2s;
    flex: 1;
    text-align: center;
}

.btn-action:hover {
    background: rgba(60, 60, 60, 0.9);
    border-color: #666;
}

/* Controls Sidebar */
.controls-sidebar {
    position: absolute;
    top: 50%;
    left: 20px;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 15px;
    z-index: 20;
}

.model-selector {
    padding: 10px;
    background: rgba(20, 20, 20, 0.85);
    border: 1px solid #444;
    border-radius: 8px;
    color: #fff;
    outline: none;
    font-size: 14px;
    font-family: 'Roboto', sans-serif;
    backdrop-filter: blur(5px);
    transition: border-color 0.2s;
}

.model-selector:hover {
    border-color: #666;
}

.model-selector option {
    background: #1a1a1a;
    color: #fff;
}

.tool-btn {
    width: 45px;
    height: 45px;
    background: rgba(20, 20, 20, 0.8);
    border: 1px solid #444;
    color: #fff;
    border-radius: 50px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

.tool-btn:hover {
    background: rgba(40, 40, 40, 0.9);
    border-color: #666;
}

.tool-btn.active {
    background-color: rgba(96, 165, 250, 0.2) !important;
    border-color: #60a5fa !important;
    color: #60a5fa;
}

/* Manual Sidebar */
.manual-sidebar {
    position: absolute;
    right: 20px;
    top: 20px;
    width: 280px;
    z-index: 30;
    backdrop-filter: blur(8px);
    background: rgba(15, 15, 15, 0.85);
    border: 1px solid #333;
    border-radius: 8px;
    color: #e0e0e0;
    font-family: 'Roboto', sans-serif;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    pointer-events: none;
    /* Let clicks pass through to 3D model */
    padding: 0;
}

/* Tooltip Flotante Estilo Glassmorphism */
.glass-tooltip {
    background: rgba(25, 25, 30, 0.75);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(100, 165, 255, 0.2);
    color: #60a5fa;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-family: 'Roboto', sans-serif;
    font-weight: 500;
    pointer-events: none;
    z-index: 1500;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    white-space: nowrap;
    text-shadow: 0 1px 3px rgba(0,0,0,0.8);
}

.manual-sidebar h4 {
    margin: 0;
    padding: 15px 20px;
    border-bottom: 1px solid #333;
    color: #60a5fa;
    font-weight: 600;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.4);
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

.manual-sidebar ul {
    list-style: none;
    padding: 15px 20px;
    margin: 0;
    font-size: 0.9rem;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.manual-sidebar ul li {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #ccc;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 8px;
}

.manual-sidebar ul li i {
    color: #888;
    width: 20px;
    text-align: center;
}

.manual-sidebar ul li b {
    color: #fff;
    font-weight: 500;
}

.manual-sidebar ul li:last-child {
    margin-bottom: 0;
    border-bottom: none;
    padding-bottom: 0;
}

/* Loading Overlay */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 100;
    color: #fff;
    font-family: 'Roboto', sans-serif;
}

.loader-spinner {
    border: 4px solid #333;
    border-top: 4px solid #60a5fa;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

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

    100% {
        transform: rotate(360deg);
    }
}

/* Dark theme overrides are no longer strictly needed as we unified to the dark space theme default */
body.dark-theme .human-body-container {
    background-color: #1a1a24;
}

body.dark-theme .bone-info-card,
body.dark-theme .controls-sidebar {
    background: rgba(42, 42, 53, 0.85);
    backdrop-filter: blur(12px);
    border-color: rgba(255, 255, 255, 0.1);
    color: #eee;
}

body.dark-theme .bone-info-card h3 {
    color: #fff;
}

body.dark-theme .latin-name {
    color: #aaa;
}

body.dark-theme .model-selector {
    background-color: #333;
    color: #eee;
    border-color: #555;
}

body.dark-theme .tool-btn {
    background: rgba(42, 42, 53, 0.85);
    backdrop-filter: blur(12px);
    border-color: rgba(255, 255, 255, 0.1);
    color: #ccc;
}

body.dark-theme .tool-btn:hover {
    background: rgba(58, 58, 69, 0.95);
    color: #fff;
}

body.dark-theme .tool-btn.active {
    background: #007bff;
    color: #fff;
    border-color: #007bff;
}

body.dark-theme .manual-sidebar {
    background: rgba(42, 42, 53, 0.85);
    backdrop-filter: blur(12px);
    border-color: rgba(255, 255, 255, 0.1);
    color: #eee;
}

body.dark-theme .manual-sidebar h4 {
    color: #4da3ff;
}

body.dark-theme .btn-action {
    background: #3b3b4a;
    border-color: #4b4b5a;
    color: #eee;
}

body.dark-theme .btn-action:hover {
    background: #4b4b5a;
}

body.dark-theme .loading-overlay {
    background: rgba(26, 26, 36, 0.9);
    color: #eee;
}

@media (max-width: 768px) {
    .manual-sidebar {
        width: auto;
        min-width: 150px;
        top: 10px;
        right: 10px;
    }
    .fun-facts-sidebar {
        top: auto !important;
        bottom: 10px !important;
        right: 10px !important;
    }
    .manual-sidebar h4 {
        padding: 8px 12px;
        font-size: 0.9rem;
    }
    .manual-sidebar ul {
        padding: 8px 12px;
        gap: 6px;
    }
    .manual-sidebar ul li {
        font-size: 0.8rem;
    }
    .bone-info-card {
        top: auto;
        bottom: 10px;
        left: 50%;
        transform: translateX(-50%);
        width: 90%;
        max-width: 400px;
    }
    .controls-sidebar {
        left: 10px;
    }
}