/* Basic Reset */
body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #000000 0%, #0a1a0a 30%, #0d2a0d 70%, #000000 100%);
    color: #fff;
}

/* Canvas for the 3D scene */
#brain-canvas {
    position: fixed;
    top: 0;
    left: 0;
    outline: none;
    width: 100%;
    height: 100%;
}

/* Container for all UI elements */
#ui-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; /* Allows clicks to pass through to the canvas */
}

/* Health bar (bottom-right, vertical) */
.health-bar {
	position: absolute;
	bottom: 20px;
	right: 20px;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 10px;
	pointer-events: all;
	z-index: 1001;
	--health: 100%;
}

.health-icon {
    width: 20px;
    height: 20px;
    display: block;
    filter: drop-shadow(0 1px 1px rgba(0,0,0,0.5));
}

.health-bar-track {
	width: 14px;
	height: 160px;
	background: rgba(255,255,255,0.15);
	border: 1px solid rgba(255,255,255,0.35);
	border-radius: 999px;
	overflow: hidden;
	backdrop-filter: blur(4px);
	position: relative;
}

.health-bar-fill {
	width: 100%;
	height: var(--health);
	background: linear-gradient(to top, #ef4444, #22c55e);
	transition: height 200ms ease;
	position: absolute;
	bottom: 0;
	left: 0;
}

.health-label {
    font-size: 14px;
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
	min-width: 42px;
	text-align: center;
}

/* General button styling */
button {
    pointer-events: all; /* Make sure buttons are clickable */
    cursor: pointer;
    background: rgba(40, 40, 40, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    border-radius: 8px;
    padding: 10px 15px;
    font-size: 18px;
    transition: background 0.2s;
}

button:hover {
    background: rgba(60, 60, 60, 0.9);
}

/* Zoom controls */
.zoom-controls {
	position: absolute;
	bottom: 20px;
	left: 20px;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

/* Language controls (top-left) */
.language-controls {
	position: absolute;
	top: 20px;
	left: 20px;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.language-controls button {
    width: 44px;
    height: 44px;
    font-size: 20px;
    line-height: 1;
    background: rgba(40, 40, 40, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    border-radius: 8px;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.language-controls button:hover {
    background: rgba(60, 60, 60, 0.9);
}

/* Language Dialog */
.language-dialog {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1002;
    pointer-events: all;
}

.language-dialog.hidden {
    display: none;
}

.language-dialog-content {
    background: rgba(37, 36, 34, 0.95);
    border: 1px solid rgba(17, 228, 2, 0.3);
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    backdrop-filter: blur(10px);
    position: relative;
    min-width: 260px;
}

.language-dialog-content h3 {
    margin: 0 0 20px 0;
    color: #11e402;
    text-align: center;
    font-size: 22px;
}

.language-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.language-option {
    background: rgba(37, 36, 34, 0.8);
    border: 1px solid rgba(17, 228, 2, 0.3);
    color: #fff;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 10px;
}

.language-option:hover {
    background: rgba(37, 36, 34, 0.9);
    border-color: rgba(17, 228, 2, 0.5);
}

.language-option.selected {
    background: rgba(17, 228, 2, 0.2);
    border-color: #11e402;
    color: #11e402;
}

.language-option.selected:hover {
    background: rgba(17, 228, 2, 0.3);
    border-color: #11e402;
}

.close-dialog-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: background 0.2s;
}

.close-dialog-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.zoom-controls button {
    width: 44px;
    height: 44px;
    font-size: 24px;
    line-height: 1;
}

/* Information panel for displaying bias details */
#info-panel {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 500px;
    background: rgba(20, 20, 20, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    pointer-events: all;
    backdrop-filter: blur(10px);
}

#info-panel h2 {
    margin-top: 0;
    color: #4dd0e1; /* Cyan accent color */
}

.info-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

.info-panel-header h2 {
    margin: 0;
    flex: 1;
}

.info-panel-header #language-toggle {
    background: rgba(40, 40, 40, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 16px;
    margin-left: 15px;
    flex-shrink: 0;
}

#info-panel p {
    line-height: 1.6;
    margin-bottom: 15px;
}

#close-panel {
    display: block;
    margin: 20px auto 0;
}

/* Simple CSS loader for API calls */
#loader {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 255, 255, 0.2);
    border-top-color: #4dd0e1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    transform: translate(-50%, -50%);
}

@keyframes spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* Utility class to hide elements */
.hidden {
    display: none;
} 

/* ====================================================== */
/* ==  ISOLATION STYLES FOR NOTIFICATION SYSTEM        == */
/* ====================================================== */

/* 
 * 1. Force box-sizing for the notification and all its children.
 * This is the most critical fix to ensure the layout matches
 * its original design from the second file.
*/
#notification-container *,
#notification-container *::before,
#notification-container *::after {
  box-sizing: border-box;
}

/* 
 * 2. Protect the notification's close button from global styles.
 * We override the border, padding, and background set by File 1's
 * generic 'button' selector.
*/
#notification-container .notification-close {
  background: none;
  border: none;
  padding: 0;
  width: 20px;
  height: 20px;
  font-size: 18px;
  color: #9ca3af;
  line-height: 1; /* Fix for potential line-height inheritance */
}

#notification-container .notification-close:hover {
  background: #f3f4f6; /* Restore the original hover effect */
  color: #374151;
}

/* 
 * 3. Ensure paragraphs inside the notification don't inherit
 * conflicting margins or line-heights from File 1.
*/
#notification-container p {
    line-height: 1.4;
    margin-bottom: 0; /* Let the notification's own styles control spacing */
}




.notification-container {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  width: 100%;
  max-width: 400px; /* This is the base max-width for mobile/small screens */
  pointer-events: none;
}

.notification {
  background: white;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  margin-bottom: 10px;
  padding: 16px; /* Base padding */
  display: flex;
  align-items: flex-start;
  gap: 12px; /* Base gap */
  position: relative;
  pointer-events: all;
  transform: translateY(-100px);
  opacity: 0;
  animation: slideIn 0.3s ease-out forwards;
  max-width: 100%;
  margin-left: 20px;
  margin-right: 20px;
}

.notification.removing {
  animation: slideOut 0.3s ease-in forwards;
}

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

@keyframes slideOut {
  to {
    transform: translateY(-100px);
    opacity: 0;
  }
}

.notification-icon {
  width: 24px; /* Base size */
  height: 24px; /* Base size */
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 14px; /* Base font size */
  font-weight: bold;
  color: white;
}

.notification.success .notification-icon {
  background: #10b981;
}

.notification.error .notification-icon {
  background: #ef4444;
}

.notification.warning .notification-icon {
  background: #f59e0b;
}

.notification.info .notification-icon {
  background: #3b82f6;
}

.notification-content {
  flex: 1;
  min-width: 0;
}

.notification-title {
  font-weight: 600;
  font-size: 14px; /* Base font size */
  color: #1f2937;
  margin-bottom: 4px;
}

.notification-message {
  font-size: 13px; /* Base font size */
  color: #6b7280;
  line-height: 1.4;
  word-wrap: break-word;
}

.notification-close {
  background: none;
  border: none;
  font-size: 18px; /* Base size */
  color: #9ca3af;
  cursor: pointer;
  padding: 0;
  width: 20px; /* Base size */
  height: 20px; /* Base size */
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.notification-close:hover {
  background: #f3f4f6;
  color: #374151;
}

.notification-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: rgba(0, 0, 0, 0.1);
  border-radius: 0 0 12px 12px;
  overflow: hidden;
}

.notification-progress-bar {
  height: 100%;
  background: currentColor;
  width: 100%;
  transform-origin: left;
  animation: progress linear;
}

.notification.success .notification-progress-bar {
  color: #10b981;
}

.notification.error .notification-progress-bar {
  color: #ef4444;
}

.notification.warning .notification-progress-bar {
  color: #f59e0b;
}

.notification.info .notification-progress-bar {
  color: #3b82f6;
}

@keyframes progress {
  from {
    transform: scaleX(1);
  }
  to {
    transform: scaleX(0);
  }
}

/* Mobile Responsiveness */
@media (max-width: 480px) {
  .notification-container {
    max-width: calc(100% - 40px);
  }

  .notification {
    margin-left: 0;
    margin-right: 0;
  }
}


/* --- NEW: PC / Desktop Styles --- */
/* Apply these styles for screens 768px and wider */
@media (min-width: 768px) {
  .notification-container {
    max-width: 500px; /* Widen the container */
  }

  .notification {
    padding: 20px; /* Increase inner spacing */
    gap: 16px;     /* Increase space between icon and text */
    border-radius: 16px; /* Optional: slightly larger radius */
  }

  .notification-icon {
    width: 28px;   /* Make icon bigger */
    height: 28px;  /* Make icon bigger */
    font-size: 16px; /* Make icon font bigger */
  }

  .notification-title {
    font-size: 16px; /* Increase title font size */
  }

  .notification-message {
    font-size: 14px; /* Increase message font size */
  }

  .notification-close {
    width: 24px;   /* Make close button bigger */
    height: 24px;  /* Make close button bigger */
    font-size: 20px; /* Make close icon bigger */
  }
}