/* CSS Reset and Base Styles */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --background: hsl(210, 20%, 98%);
  --foreground: hsl(210, 40%, 11%);
  --card: hsl(0, 0%, 100%);
  --card-foreground: hsl(210, 40%, 11%);
  --primary: hsl(199, 89%, 48%);
  --primary-foreground: hsl(0, 0%, 100%);
  --secondary: hsl(210, 40%, 96%);
  --secondary-foreground: hsl(210, 40%, 11%);
  --muted: hsl(210, 40%, 96%);
  --muted-foreground: hsl(210, 20%, 50%);
  --accent: hsl(174, 72%, 40%);
  --accent-foreground: hsl(0, 0%, 100%);
  --destructive: hsl(0, 84%, 60%);
  --destructive-foreground: hsl(0, 0%, 100%);
  --success: hsl(142, 71%, 45%);
  --success-foreground: hsl(0, 0%, 100%);
  --border: hsl(210, 31%, 91%);
  --radius: 0.75rem;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  /* background-color: var(--background); */
  background-color: #F7F9FC;
  background-image: url(../Flow1-1/images/4350031_10068\ 1.png) !important;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  color: var(--foreground);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* .container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem 1rem;
  min-height: 100vh;
} */


.hidden {
  display: none !important;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(20px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.6;
  }
}

.animate-fade-in {
  animation: fadeIn 0.3s ease-out;
}

.animate-slide-in {
  animation: slideInRight 0.4s ease-out;
}

/* Header */
.header {
    text-align: center;
    margin: 2.5rem 0;
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 1rem;
}

.header p {
    color: #929292;
    font-size: 18px;
    font-weight: 400;
}

/* Case Grid */
.case-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  max-width: 1140px;
  margin: 0 auto;
}

@media (min-width: 640px) {
  .case-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .details-panel {
    left: 2rem;
  }
}

@media (min-width: 1024px) {
  .case-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}


/* Case Card */
.case-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  /* background-color: #F9FAFB; */
  background-color: white;
  /* background: var(--card); */
  /* border: 1px solid var(--border); */
  padding: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.1);
}

.case-card.active {
  border-left: 2px solid #4D81EA;
}


.case-card:hover {
  border-left: 2px solid #4D81EA;
  /* border-color: rgba(14, 165, 233, 0.3); */
  transform: scale(1.04);
}


.case-number {
  position: absolute;
  top: 0.5rem;
  right: 0.75rem;
  font-size: 3.5rem;
  font-weight: 700;
  color: rgba(0, 0, 0, 0.05);
  line-height: 1;
}

.case-card-content {
  position: relative;
  z-index: 1;
}

.case-card h3 {
  font-size: 1.3rem;
  font-weight: 500;
  color: var(--foreground);
  transition: color 0.3s;
}

.case-card:hover h3 {
  color: #4d81ea;
}

.case-card p {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  margin-top: 0.25rem;
}

/* Back Button */
.back-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: none;
  border: none;
  color: #000;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.5rem 0;
  margin-bottom: 1.5rem;
  transition: color 0.2s;
}

.back-button:hover {
  color: var(--foreground);
}

.back-button svg {
  transition: transform 0.2s;
}

.back-button:hover svg {
  transform: translateX(-4px);
}

/* Detail Grid */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 1024px) {
  .detail-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media screen and (max-width: 575px) {
  .details-panel {
    left: 1rem;
    width: 70%;
  }
}

/* Body Panel */
.body-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--card);
  border-radius: 1rem;
  border: 1px solid var(--border);
  padding: 2rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* .details-panel {
  position: fixed;
  top: 0;
  right: -360px;
  width: 360px;
  z-index: 20;
} */

#detailsPanel {
  position: fixed;
  right: -450px;
  transition: right 0.4s ease;
  z-index: 20;
}

#detailsPanel.no-transition {
  transition: none !important;
}

.full-body-view.shifted {
  margin-left: 450px;
}


.body-container {
  width: 100%;
  max-width: 400px;
}

.body-image-wrapper {
  position: relative;
  width: 100%;
  display: inline-block;
}

.human-body-svg {
  width: 100%;
  height: auto;
  max-height: 600px;
  display: block;
}

.body-overlays {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.body-region {
  position: absolute;
  background: transparent;
  border: 2px solid transparent;
  border-radius: 50%;
  transition: all 0.3s ease;
  cursor: pointer;
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.body-region:hover {
  background: rgba(14, 165, 233, 0.15);
  border-color: rgba(14, 165, 233, 0.4);
  transform: scale(1.05);
}

.body-region.active {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.6);
  animation: pulse 2s infinite;
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.4);
}


/* Specific region shapes */
.body-region[data-region="intestines"],
.body-region[data-region="skin"],
.body-region[data-region="blood"] {
  border-radius: 20%;
}

.body-region[data-region="arm"],
.body-region[data-region="muscles"] {
  border-radius: 40%;
}

.body-region[data-region="feet"] {
  border-radius: 60%;
}

.body-info {
  text-align: center;
  margin-top: 1.5rem;
}

.case-label {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--foreground);
}

.case-subtitle {
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

.affected-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1rem;
}

.legend-tag {
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
  color: white;
  text-transform: capitalize;
}

/* Results Panel */
.results-panel {
  background: var(--card);
  border-radius: 1rem;
  border: 1px solid var(--border);
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  animation: slideInRight 0.4s ease-out;
}

.panel-header-section {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.panel-header-section h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--foreground);
}

.panel-subtitle {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  margin-top: 0.25rem;
}

.reveal-btn {
  padding: 0.5rem 1rem;
  margin-bottom: 1rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  background: #4D81EA;
  color: var(--primary-foreground);
}

.reveal-btn:hover {
  opacity: 0.9;
}

.reveal-btn.revealed {
  background: var(--destructive);
  color: var(--destructive-foreground);
}

/* Diagnosis Box */
.diagnosis-box {
  margin-bottom: 1rem;
  padding: 1rem;
  border-radius: 15px;
  background: rgba(20, 184, 166, 0.1);
  border: 1px solid rgba(20, 184, 166, 0.3);
  animation: fadeIn 0.3s ease-out;
}

.diagnosis-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 5px;
}

.diagnosis-text {
  font-size: 15px;
  font-weight: 600;
  color: var(--foreground);
}

/* Sections */
.section {
  margin-bottom: 1.5rem;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 22px;
  font-weight: 600;
  color: var(--foreground);
  margin-bottom: 0.75rem;
}

.section-header svg {
  color: #4d81ea;
}

.history-text {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  line-height: 1.6;
  background: #F6F6F6;
  padding: 1rem;
  border-radius: 15px;
}

/* Symptoms List */
.symptoms-list {
  list-style: none;
  background: #F7F9FC;
  padding: 1rem;
  border-radius: 15px;
}

.symptoms-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--foreground);
  margin-bottom: 0.5rem;
}

.symptoms-list li::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4d81ea;
  margin-top: 0.5rem;
  flex-shrink: 0;
}

/* Lab Results */
.lab-section .section-header {
  flex-wrap: wrap;
}

.result-badges {
  display: flex;
  gap: 0.5rem;
  margin-left: auto;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.75rem;
  border-radius: 15px;
  font-size: 0.75rem;
  font-weight: 500;
}

.badge-normal {
  /* background: rgba(34, 197, 94, 0.1); */
  background: #FBFBFB;
  color: var(--success);
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.badge-abnormal {
  /* background: rgba(239, 68, 68, 0.1); */
  background: #FBFBFB;
  color: var(--destructive);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.lab-results-list {
  max-height: 300px;
  overflow-y: auto;
  padding-right: 0.5rem;
}

.lab-results-list::-webkit-scrollbar {
  width: 6px;
}

.lab-results-list::-webkit-scrollbar-track {
  background: transparent;
}

.lab-results-list::-webkit-scrollbar-thumb {
  background: var(--muted);
  border-radius: 3px;
}

.lab-result-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem;
  border-radius: 15px;
  border: 1px solid;
  margin-bottom: 0.5rem;
  margin-left: 5px;
  margin-right: 5px;
  transition: transform 0.2s;
}

.lab-result-item:hover {
  transform: scale(1.01);
}

.lab-result-item.normal {
  /* background: #e8f9ef52; */
  background-color: #FBFBFB;
  color: var(--success);
  border-color: rgba(34, 197, 94, 0.3);
  border-left: 2px solid;
}

.lab-result-item.abnormal {
  background: #fdecec54;
  background-color: #FBFBFB;
  color: var(--destructive);
  border-color: rgba(239, 68, 68, 0.3);
  border-left: 2px solid;
}

.lab-result-info {
  flex: 1;
  color: #000000;
}

.lab-result-name {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
  font-size: 1rem;
}

.lab-result-range {
  font-size: 12px;
  opacity: 0.8;
  margin-left: 1.5rem;
  margin-top: 0.25rem;
}

.lab-result-value {
  font-weight: 700;
  font-size: 14px;
}

/* Hints */
.hints-section {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.hints-label {
  font-size: 0.75rem;
  color: var(--muted-foreground);
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.hints-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.hint-tag {
  padding: 0.375rem 0.75rem;
  background: #F7F9FC;
  border-radius: 15px;
  font-size: 0.75rem;
  color: var(--muted-foreground);
}


/* Full Screen Body View */
.full-body-view {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 80vh;
  position: relative;
  transition: margin-left 0.1s ease;
}

.body-display-container {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Shift only the body image when panel is open */
/* .details-panel.open~.full-body-view .body-display-container {
  transform: translateX(240px);
} */

.body-image-wrapper {
  position: relative;
  width: 100%;
  max-width: 500px;
}

.human-body-svg {
  width: 100%;
  height: auto;
  display: block;
}

/* Case Navigation */
.case-navigation {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
  padding: 1rem 2rem;
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 100;
}

.nav-button {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.nav-button:hover {
  background: #00000078;
  border-color: var(--card);
  color: white;
  transform: scale(1.05);
}

.nav-button:hover svg {
  stroke: white;
}

.nav-button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.case-nav-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  align-items: center;
  gap: 0.25rem;
}

.nav-label {
  font-size: 0.75rem;
  color: #000000;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
}

#currentCaseNumber {
  font-size: 1rem;
  font-weight: 600;
  color: var(--foreground);
}

/* Sliding Details Panel - Contained Card Style */
.details-panel {
  position: fixed;
  top: 50%;
  left: 5rem;
  transform: translateY(-50%) translateX(-120%);
  width: 90%;
  max-width: 520px;
  max-height: 75vh;
  background: var(--card);
  border-radius: 1.5rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1000;
  overflow-y: auto;
  border: 1px solid var(--border);
}

.details-panel.open {
  transform: translateY(-50%) translateX(0);
}

.close-panel-button {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: #EF4444;
  border: none;
  /* border: 3px solid #EF4444; */
  cursor: pointer;
  padding: 0;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  transition: all 0.2s;
  color: white;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
}

.close-panel-button:hover {
  background: #DC2626;
  border-color: #2563EB;
  transform: scale(1.05);
}

.close-panel-button svg {
  stroke-width: 2;
  width: 18px;
}

.panel-content {
  padding: 2rem;
}

.panel-content h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--foreground);
  margin-bottom: 1.3rem;
}

/* Updated Body Region Markers */
.body-region {
  position: absolute;
  background: transparent;
  border: none;
  transition: all 0.3s ease;
  cursor: default;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.body-region.active {
  background: transparent;
  border: none;
  cursor: pointer;
  pointer-events: auto;
}


.region-marker {
  font-size: 15px;
  font-weight: 300;
  color: #000;
  background: rgba(255, 255, 255, 0.95);
  width: 17px;
  height: 17px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
  opacity: 0;
  transform: scale(0);
  transition: all 0.3s ease;
  pointer-events: none;
  border: 1px solid black;
}

.body-region.active .region-marker {
  opacity: 1;
  transform: scale(1);
  animation: markerPop 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  pointer-events: auto;
  cursor: pointer;
}

.body-region.active .region-marker:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  background: rgba(255, 255, 255, 1);
}

@keyframes markerPop {
  0% {
    transform: scale(0);
    opacity: 0;
  }

  50% {
    transform: scale(1.2);
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .details-panel {
    max-width: 100%;
  }

  .case-navigation {
    bottom: 1rem;
    right: 1rem;
  }

  .body-display-container {
    max-width: 90%;
  }

  #detailsPanel {
    left: 2rem;
    width: 450px;
  }
}

