/* Body Map CSS - Official Fucoidan Brand */
:root {
    --cb-primary: #5E3E30; /* Dark Brown */
    --cb-secondary: #3E2920;
    --cb-accent: #8B7368;
    --body-bg: #F5F2EC; /* Official Beige */
    --text-main: #5E3E30;
    --glass-bg: rgba(255, 255, 255, 0.9);
    --glass-border: rgba(94, 62, 48, 0.1);
}

.body-map-wrapper {
    padding: 60px 0;
    background-color: var(--body-bg);
    min-height: 100vh;
    font-family: 'Outfit', sans-serif;
    color: var(--text-main);
}

.interactive-layout {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
}

/* Sidebars */
.organ-sidebar {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.left-sidebar { text-align: right; }
.right-sidebar { text-align: left; }

.organ-label {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    padding: 15px 20px;
    border-radius: 12px;
    position: relative;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.organ-label:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(20, 164, 132, 0.15);
    border-color: var(--cb-primary);
}

.organ-label.active {
    background: var(--cb-primary);
    color: white;
    border-color: var(--cb-primary);
}

.label-name {
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 2px;
}

.label-sub {
    font-size: 0.8rem;
    opacity: 0.7;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* SVG Container */
.body-map-container {
    flex: 2.5;
    position: relative;
    max-width: 750px;
    height: 1000px;
    background-image: url('../images/medical_skeleton_white.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.svg-wrapper {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
}

.human-body-svg {
    width: 100%;
    height: 100%;
    position: relative;
    z-index: 2;
}

.body-outline {
    fill: none;
    stroke: none;
}

.organ-group {
    cursor: pointer;
    transition: all 0.3s;
}

.organ-group circle {
    transition: all 0.3s;
    filter: drop-shadow(0 0 5px var(--cb-primary));
}

.organ-group:hover circle, 
.organ-group.active circle {
    r: 20;
    fill: var(--cb-accent);
    filter: drop-shadow(0 0 15px var(--cb-accent));
}

/* Canvas for Lines */
#map-lines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

/* Modal */
.body-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(8px);
    z-index: 11000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 30px;
}

.modal-content {
    background: white;
    max-width: 900px;
    width: 100%;
    max-height: 85vh;
    border-radius: 24px;
    overflow-y: auto;
    position: relative;
    animation: modalSlide 0.5s cubic-bezier(0.19, 1, 0.22, 1);
}

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

.modal-close {
    position: absolute;
    top: 25px;
    right: 30px;
    font-size: 2rem;
    cursor: pointer;
    color: #999;
}

.modal-header {
    padding: 40px 50px 20px;
    border-bottom: 1px solid #eee;
}

.modal-header h2 {
    color: var(--cb-secondary);
    font-weight: 800;
    margin-bottom: 5px;
}

.modal-body {
    padding: 20px 50px 50px;
}

/* Studies List */
.studies-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.study-item {
    background: #fdfdfd;
    border: 1px solid #eee;
    padding: 20px;
    border-radius: 15px;
    transition: all 0.3s;
}

.study-item:hover {
    border-color: var(--cb-primary);
    transform: translateX(10px);
}

.study-title {
    font-weight: 700;
    color: #333;
    margin-bottom: 8px;
    display: block;
    text-decoration: none;
}

.study-content {
    font-size: 0.9rem;
    color: #666;
    line-height: 1.5;
}

/* Mobile Responsive */
@media (max-width: 991px) {
    .interactive-layout {
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }
    
    .body-map-container {
        order: 1;
        width: 100%;
        height: 500px; /* Reinforced height for mobile */
        min-height: 500px;
        max-width: 100%;
        display: block !important;
        background-position: center top;
        z-index: 5;
    }
    
    .organ-sidebar {
        order: 2;
        width: 100%;
        text-align: center !important;
        gap: 15px;
    }
    
    .left-sidebar, .right-sidebar { text-align: center; }
    
    #map-lines { 
        display: block; /* Keep lines on mobile for better UX */
        height: 100%;
    }
}
