/* Custom styles for Thyroid Report Generator */
.thyroid-diagram {
    position: relative;
    width: 300px; /* Keep container size consistent for JS */
    height: 200px;
    margin-left: auto; /* Centering */
    margin-right: auto; /* Centering */
    /* Optional: background for the container area if needed */
    /* background-color: #f8f9fa; */
    overflow: visible; /* Allow parts to visually overflow if needed for shape */
}

/* Hide the old pseudo-element if it exists */
.thyroid-diagram::before {
    display: none;
}

.isthmus {
    position: absolute;
    width: 75px;  /* Width of the connecting part */
    height: 45px; /* How tall the isthmus is */
    background-color: #b2ebf2; /* Fill color */
    bottom: 25px; /* Position from bottom of container */
    left: 50%;
    transform: translateX(-50%);
    /* Rounded top, slight curve bottom to blend */
    border-radius: 50% 50% 15px 15px / 60% 60% 20px 20px;
    z-index: 1; /* Behind lobes */
}

.thyroid-lobe {
    position: absolute;
    width: 130px; /* Lobe width */
    height: 175px; /* Lobe height */
    background-color: #b2ebf2; /* Fill color */
    bottom: 10px; /* Position lobes slightly lower */
    z-index: 2; /* Lobes overlap isthmus */
    /* Complex border-radius for organic shape: */
    /* top-left top-right bottom-right bottom-left / vertical counterparts */
    /* This creates tall rounded tops and more complex lower curves */
    border-radius: 50% 50% 40% 40% / 65% 65% 35% 35%;
}

.left-lobe {
    /* Position left lobe, overlapping isthmus slightly */
    left: 28px;
    /* Rotate slightly for asymmetry */
    /* transform: rotate(-2deg); */
}

.right-lobe {
    /* Position right lobe, overlapping isthmus slightly */
    right: 28px;
    /* Rotate slightly for asymmetry */
    /* transform: rotate(2deg); */
}
/* === END: Insert this new block === */

/* Keep existing .nodule-marker styles below this point */
.nodule-marker {
    /* ... existing nodule styles ... */
    position: absolute;
    width: 12px;
    height: 12px;
    background-color: #ff5722; /* Default color, will be overridden by JS */
    border-radius: 50%;
    transform: translate(-6px, -6px);
    cursor: pointer;
    border: 1px solid rgba(0,0,0,0.2); /* Slight border for visibility */
    /* For displaying number inside */
    color: white;
    font-size: 8px;
    text-align: center;
    line-height: 12px;
    z-index: 10; /* Ensure markers are above lobes/isthmus */
}
.nodule-marker.selected {
    border: 2px solid #000; /* Use Tailwind border-black */
    box-shadow: 0 0 0 2px white; /* Use Tailwind ring-2 ring-white */
}
/* TI-RADS specific colors for markers - applied by JS */
.nodule-marker.tr1 { background-color: #4CAF50; } /* Tailwind bg-tr1 */
.nodule-marker.tr2 { background-color: #8BC34A; } /* Tailwind bg-tr2 */
.nodule-marker.tr3 { background-color: #FFC107; } /* Tailwind bg-tr3 */
.nodule-marker.tr4 { background-color: #FF9800; } /* Tailwind bg-tr4 */
.nodule-marker.tr5 { background-color: #F44336; } /* Tailwind bg-tr5 */

.tirads-indicator {
    width: 100%;
    height: 20px;
    /* Gradient using Tailwind configured colors */
    background: linear-gradient(to right, var(--tw-color-tr1, #4CAF50), var(--tw-color-tr2, #8BC34A), var(--tw-color-tr3, #FFC107), var(--tw-color-tr4, #FF9800), var(--tw-color-tr5, #F44336));
    position: relative;
    border-radius: 4px; /* Optional: rounded corners */
}
.tirads-pointer {
    position: absolute;
    top: -5px;
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 10px solid #333; /* Tailwind text-gray-700 or black */
    transform: translateX(-10px);
    transition: left 0.3s ease; /* Smooth transition */
}
/* Dark mode specific pointer color */
.dark .tirads-pointer {
    border-top-color: #ccc; /* Lighter color for dark mode */
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
    body {
        background-color: white !important;
        color: black !important;
        /* Reset Tailwind dark mode overrides for printing */
        --tw-bg-opacity: 1 !important;
        --tw-text-opacity: 1 !important;
    }
    /* Ensure dark mode styles are reverted for print */
    .dark body, .dark div, .dark input, .dark select, .dark textarea, .dark button, .dark span, .dark p, .dark h1, .dark h2, .dark h3, .dark h4 {
        background-color: white !important;
        color: black !important;
        border-color: #e5e7eb !important; /* Tailwind gray-200 */
    }
    .dark .bg-gray-800, .dark .bg-gray-700, .dark .bg-gray-900 {
        background-color: white !important;
    }
    .dark .text-gray-100 {
        color: black !important;
    }
    .dark .border-gray-600 {
         border-color: #e5e7eb !important; /* Tailwind gray-200 */
    }
    .dark .bg-gray-100 {
         background-color: #f9fafb !important; /* Tailwind gray-50 */
    }
    /* Adjust preview for printing */
     #reportPreview {
        height: auto;
        overflow: visible;
        border: none;
        padding: 0;
        background-color: white !important;
     }
}

/* Custom scrollbar (Optional but nice) */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #f1f1f1; /* Tailwind bg-gray-100 */
}
::-webkit-scrollbar-thumb {
    background: #888; /* Tailwind bg-gray-500 */
    border-radius: 4px;
}
/* Custom scrollbar for dark mode */
.dark ::-webkit-scrollbar-track {
    background: #374151; /* Tailwind bg-gray-700 */
}
.dark ::-webkit-scrollbar-thumb {
    background: #6b7280; /* Tailwind bg-gray-500 */
}
