/* Medical theme customization */
:root {
    --medical-blue: #2c3e50;
    --medical-light: #ecf0f1;
    --highlight: #3498db;
}

/* Layout */
.main-container {
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

/* Case Header Styling */
.case-header {
    background: var(--bs-dark);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.case-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 0.5rem;
}

.stats-card {
    border: 1px solid var(--bs-border-color);
}

.stats-card ul li {
    display: flex;
    align-items: center;
    padding: 0.5rem 0;
}

/* Image viewer */
.viewer-container {
    position: relative;
    width: 100%;
    height: 500px;
    background: var(--bs-dark);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 1rem;
    display: flex;
    cursor: crosshair;
    align-items: center;
    justify-content: center;
}

.dicom-view {
    width: 100%;
    height: 100%;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dicom-view canvas {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Add slice navigation styling */
.slice-nav {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    height: 80%;
    background: rgba(0, 0, 0, 0.7);
    padding: 10px;
    border-radius: 4px;
    z-index: 1000;
    display: flex;
    align-items: center;
}

.form-range-vertical {
    -webkit-appearance: slider-vertical;
    writing-mode: bt-lr;
    width: 8px;
    height: 100%;
    padding: 0 5px;
    background: transparent;
}

.form-range-vertical::-webkit-slider-runnable-track {
    width: 8px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.form-range-vertical::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--highlight);
    cursor: pointer;
    margin-left: -4px;
}

.form-range-vertical::-moz-range-track {
    width: 8px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.form-range-vertical::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border: none;
    border-radius: 50%;
    background: var(--highlight);
    cursor: pointer;
}

/* Crosshair lines */
.crosshair {
    position: absolute;
    background: var(--highlight);
    opacity: 0.5;
    pointer-events: none;
}

.crosshair-h {
    width: 100%;
    height: 1px;
}

.crosshair-v {
    width: 1px;
    height: 100%;
}

/* Annotation markers */
.annotation-marker {
    position: absolute;
    width: 12px;
    height: 12px;
    background: var(--highlight);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    cursor: pointer;
    z-index: 1001;
}

.annotation-label {
    position: absolute;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    transform: translateY(-100%);
    margin-top: -8px;
    z-index: 1002;
}

/* Tools panel */
.tools-panel {
    position: absolute;
    right: 1rem;
    top: 1rem;
    background: rgba(0, 0, 0, 0.8);
    padding: 0.5rem;
    border-radius: 4px;
    z-index: 1000;
}

.tool-button {
    background: transparent;
    border: 1px solid var(--bs-border-color);
    color: white;
    padding: 0.25rem 0.5rem;
    margin: 0.25rem;
    border-radius: 4px;
    cursor: pointer;
}

.tool-button.active {
    background: var(--highlight);
}

/* Case cards */
.case-card {
    border: 1px solid var(--bs-border-color);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    transition: transform 0.2s;
}

.case-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Progress indicators */
.progress-indicator {
    height: 4px;
    background: var(--bs-gray-200);
    border-radius: 2px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--highlight);
    transition: width 0.3s ease;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .case-header {
        padding: 1rem;
    }
    .viewer-container {
        height: 300px;
        margin-bottom: 1rem;
    }
    .tools-panel {
        bottom: 1rem;
        top: auto;
        right: 50%;
        transform: translateX(50%);
    }
    .panel-container {
        margin-top: 1rem;
    }
    .structures-panel,
    .pathology-panel {
        position: static;
        width: 100%;
        transform: none;
        margin-bottom: 1rem;
    }
    .structures-list,
    .pathology-list {
        max-height: none;
    }
    .slice-nav {
        right: 10px;
    }

    /* Image controls responsive adjustments */
    .image-controls {
        padding: 0.75rem;
    }

    .controls-labels {
        padding: 0 0.5rem;
    }

    .controls-inputs {
        flex-direction: column;
        gap: 0.75rem;
    }

    .btn-group, .form-range {
        width: 100%;
    }

    .btn-group .btn {
        flex: 1;
        padding: 0.375rem;
        font-size: 0.875rem;
    }
    .form-range {
        height: 38px;
    }
}

/* Add colormap controls styling */
.colormap-controls {
    position: absolute;
    top: 1rem;
    left: 1rem;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.7);
    padding: 0.5rem;
    border-radius: 4px;
}

.colormap-controls .btn-group {
    display: flex;
    gap: 0.5rem;
}

.colormap-controls .btn {
    font-size: 0.875rem;
    padding: 0.25rem 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.colormap-controls .btn.active {
    background-color: var(--highlight);
    border-color: var(--highlight);
}

/* Add coordinates display styling */
.coords-display {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 14px;
    z-index: 1000;
}

/* Add ROI controls styling */
.tools-controls {
    position: absolute;
    top: 60px;
    left: 1rem;
    background: rgba(0, 0, 0, 0.7);
    padding: 0.5rem;
    border-radius: 4px;
    z-index: 1000;
    color: white;
}

.form-check-input {
    cursor: pointer;
}

/* ROI overlay styling */
.roi-overlay {
    position: absolute;
    pointer-events: none;
    border: 2px solid;
    border-radius: 50%;
    z-index: 1001;
    opacity: 1; /* This line is the edited part */
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.4);
}

/* Update viewer container and panels layout */
.panel-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.structures-panel,
.pathology-panel {
    background: rgba(0, 0, 0, 0.8);
    padding: 1rem;
    border-radius: 4px;
    width: 100%;
}

.structures-list,
.pathology-list {
    max-height: 300px;
    overflow-y: auto;
}

/* Structures panel styling */

.structures-panel {
}

.structure-item {
    margin-bottom: 1rem;
}

.structure-item:last-child {
    margin-bottom: 0;
}

/* Hide radio buttons but keep them functional */
.structure-item input[type="radio"],
.pathology-item input[type="radio"] {
    display: none;
}

.structure-item label {
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: background-color 0.2s;
}

/* Highlight selected items */
.structure-item input[type="radio"]:checked + label,
.pathology-item input[type="radio"]:checked + label {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    padding: 4px 8px;
}

/* Color dots for structures and pathologies */
.color-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.roi-label {
    position: absolute;
    background: rgba(0, 0, 0, 0.75);
    color: white;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    pointer-events: none;
    z-index: 1002;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    text-shadow: none;
    border: 2px solid transparent;
    backdrop-filter: blur(2px);
}

/* Update structure description style */
.structure-item small {
    font-size: 0.75rem;
    opacity: 0.7;
    line-height: 1.2;
}

/* Update pathology panel styling */
.pathology-panel {
}

.pathology-item {
    margin-bottom: 1rem;
}

.pathology-item:last-child {
    margin-bottom: 0;
}


.pathology-item label {
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
}

.pathology-marker {
    position: absolute;
    pointer-events: none;
    border: 2px solid;
    border-radius: 50%;
    z-index: 1001;
    opacity: 0.7;
}

.pathology-input {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 0.5rem;
    border-radius: 4px;
    width: 100%;
    margin-top: 0.5rem;
}

.pathology-color-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Image controls styling - Compact version */
.image-controls {
    background: var(--bs-dark);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.modern-controls {
    position: absolute;
    top: 15px;
    left: 15px;
    background: rgba(33, 37, 41, 0.85);
    border-radius: 8px;
    padding: 0.75rem;
    z-index: 1000;
    backdrop-filter: blur(4px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
    width: auto;
    max-width: 320px;
    opacity: 0.9;
    transition: opacity 0.3s;
}

.modern-controls:hover {
    opacity: 1;
}

.controls-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.control-pill {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 0.4rem;
    display: flex;
    flex-direction: row;
    align-items: center;
    min-width: 100px;
    margin-bottom: 0.25rem;
}

.control-label {
    color: var(--bs-light);
    font-size: 0.75rem;
    opacity: 0.8;
    display: block;
    margin-bottom: 0.25rem;
}

.control-content {
    display: flex;
    align-items: center;
}

.btn-icon {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.2);
}

.btn-icon.active {
    background: var(--highlight, #007bff);
}

.zoom-control {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.zoom-btn {
    padding: 0.15rem 0.35rem;
}

.form-range {
    width: 60px;
    margin: 0 0.25rem;
}

.custom-select {
    position: relative;
}

.custom-select .form-select-sm {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    font-size: 0.75rem;
    padding-right: 1.5rem;
    padding-left: 0.5rem;
    height: 28px;
    appearance: none;
}

/* Fix pour dropdown options - fond foncé avec texte blanc */
.custom-select .form-select-sm option {
    background-color: #2c3e50 !important;
    color: #fff !important;
    padding: 0.5rem;
}

.custom-select .form-select-sm:focus option {
    background-color: #34495e !important;
    color: #fff !important;
}

.custom-select i {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.625rem;
}


/* Responsive adjustments */
@media (max-width: 768px) {
    .image-controls {
        padding: 0.75rem;
    }

    .control-group {
        margin-bottom: 1rem;
    }

    .control-group:last-child {
        margin-bottom: 0;
    }

    .viewer-container {
        height: 300px;
    }

    /* Ensure image stays centered */
    .dicom-view canvas {
        max-width: 100%;
        max-height: 100%;
        margin: auto;
    }
}