:root {
  
  --color-primary: #3498db;
  --color-primary-hover: #2980b9;
  --color-secondary: #e74c3c;
  --color-secondary-light: #ff7675;
  --color-accent: #f39c12;
  --color-background: #f7f9fc;
  --color-card: #ffffff;
  --color-text: #2c3e50;
  --color-text-light: #7f8c8d;
  --color-border: #ecf0f1;
  --color-shadow: rgba(0, 0, 0, 0.1);
  --color-header: #8e44ad;
  --color-header-text: #ffffff;
  --color-footer: #8e44ad;
  
  
  --color-node-default: #95a5a6;
  --color-family: #f39c12;
  --color-relationship: #3498db;
  --color-friend: #2ecc71;
  --color-conflict: #e74c3c;
  --color-other: #9b59b6;
  --color-bg: #f5f7fa;
  --color-sidebar-bg: #f9f9f9;
  --color-sidebar-border: #ddd;
  --color-card-bg: #ffffff;
  --color-tooltip-bg: rgba(255, 255, 255, 0.9);
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);

  
  --header-height-desktop: 10vh;
  --header-height-mobile: 60px;
  --footer-height-desktop: 10vh;
  --footer-height-mobile: 40px;
  --sidebar-width-desktop: 320px;
  --sidebar-width-mobile: 100%;
  --sidebar-height-mobile: 50vh;
}


.dark-theme {
  --color-primary: #3498db;
  --color-primary-hover: #48dbfb;
  --color-secondary: #ff6b6b;
  --color-secondary-light: #ff9ff3;
  --color-accent: #feca57;
  --color-background: #2c3e50;
  --color-card: #34495e;
  --color-text: #ecf0f1;
  --color-text-light: #bdc3c7;
  --color-border: #4a6380;
  --color-shadow: rgba(0, 0, 0, 0.3);
  --color-header: #1e272e;
  --color-header-text: #ecf0f1;
  --color-footer: #1e272e;
  
  
  --color-node-default: #bdc3c7;
  --color-family: #feca57;
  --color-relationship: #48dbfb;
  --color-friend: #1dd1a1;
  --color-conflict: #ff6b6b;
  --color-other: #c8d6e5;
  --color-bg: #1e272e;
  --color-sidebar-bg: #2c3e50;
  --color-sidebar-border: #34495e;
  --color-card-bg: #34495e;
  --color-tooltip-bg: rgba(44, 62, 80, 0.9);
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}


html, body {
  overflow: hidden;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  -webkit-overflow-scrolling: touch; 
  overscroll-behavior: none; 
}

body {
  font-family: 'Roboto', sans-serif;
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  transition: background-color 0.3s ease, color 0.3s;
  height: 100vh; 
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden; 
  min-height: 100vh;
  min-height: -webkit-fill-available; 
}


@supports (-webkit-touch-callout: none) {
  body {
    height: -webkit-fill-available;
  }
}


header {
  background-color: var(--color-header);
  color: var(--color-header-text);
  padding: 0 max(10px, 2%); 
  text-align: center;
  box-shadow: 0 2px 10px var(--color-shadow);
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  height: var(--header-height-desktop);
  min-height: var(--header-height-mobile);
  flex-shrink: 0; 
}


.header-controls {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 15px; 
  z-index: 10000; 
}


.title-container {
  position: relative;
  text-align: center;
  z-index: 1;
  padding: 10px 0; 
}

header h1 {
  margin: 0;
  font-family: 'Roboto Slab', serif;
  font-weight: 600;
  font-size: 2.2rem; 
  letter-spacing: 0.5px;
  display: inline-flex; 
  align-items: center;
  gap: 15px; 
  justify-content: center;
}


.fixed-title {
  font-family: 'Roboto Slab', serif;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--color-header-text);
  text-transform: uppercase;
}


.language-selector {
  position: relative;
  display: inline-block;
  margin-right: 15px;
  z-index: 10000; 
}

.theme-toggle {
  position: relative;
  display: flex;
  align-items: center;
  z-index: 10000; 
}


.lang-dropdown-btn {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: var(--color-header-text);
  padding: clamp(6px, 2vw, 12px) clamp(8px, 2vw, 16px);
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background-color 0.2s;
  font-size: clamp(11px, 1.5vw, 14px);
}

.lang-dropdown-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

.current-lang {
  font-weight: 600;
}


.lang-dropdown {
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  background-color: var(--color-card);
  border-radius: 4px;
  box-shadow: var(--shadow);
  min-width: max(120px, 10vw);
  width: max-content;
  z-index: 10000; 
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
  border: 1px solid var(--color-border);
}


.lang-dropdown.show {
  opacity: 1;
  visibility: visible;
  z-index: 10001; 
}

.lang-option {
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: var(--color-text);
  transition: background-color 0.2s;
}

.lang-option:hover {
  background-color: var(--color-background);
}

.lang-option img {
  width: 16px;
  height: 12px;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.lang-option.active {
  background-color: var(--color-primary);
  color: white;
}

.lang-dropdown-btn .fa-chevron-down {
  font-size: 10px;
  transition: transform 0.2s;
}

.language-selector .fa-chevron-down.rotated {
  transform: rotate(180deg);
}


.language-selector.active .lang-dropdown {
  display: none;
}


@media (max-width: 768px) {
  .language-selector {
    position: absolute;
    left: 15px;
    top: 15px;
    transform: none;
  }
  
  .language-selector .lang-dropdown {
    top: calc(100% + 5px);
    left: 0;
  }
}


.lang-btn {
  display: none;
}

.lang-btn {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: var(--color-header-text);
  padding: 5px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: background-color 0.2s;
}

.lang-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

.lang-btn.active {
  background: rgba(255, 255, 255, 0.4);
  font-weight: bold;
}

.lang-btn img {
  width: 16px;
  height: 12px;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

#theme-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-header-text);
  width: 44px; 
  height: 44px; 
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.3s;
}

#theme-btn:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.sun-icon, .moon-icon {
  fill: currentColor;
}

.light-theme .moon-icon {
  display: block;
}

.light-theme .sun-icon {
  display: none;
}

.dark-theme .moon-icon {
  display: none;
}

.dark-theme .sun-icon {
  display: block;
}

main {
  display: flex;
  flex-direction: row;
  height: calc(100vh - var(--header-height-desktop) - var(--footer-height-desktop));
  position: relative;
  overflow: hidden;
  flex: 1; 
  max-height: 80vh; 
}

.visualization-container {
  flex: 1;
  position: relative;
  padding: max(8px, 1vw);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 100%;
}


.sidebar-open .visualization-container {
  flex: 0.7;
}

.fixed-legend {
  position: absolute;
  top: 15px;
  left: 15px;
  z-index: 940; 
  background-color: var(--color-card);
  padding: 10px;
  border-radius: 8px;
  box-shadow: 0 3px 12px var(--color-shadow);
  transition: all 0.3s ease;
  max-width: min(250px, 95vw);
  opacity: 0.9; 
  transform-origin: top left;
}

.fixed-legend.collapsed {
  max-height: 40px;
  overflow: hidden;
}

.fixed-legend h3 {
  margin-bottom: 10px;
  font-size: 14px;
  color: var(--color-primary);
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent; 
}


.legend-toggle {
  margin-left: 8px;
  font-size: 12px;
  color: var(--color-text-light);
  transition: transform 0.3s;
  cursor: pointer;
  padding: 5px; 
  -webkit-tap-highlight-color: transparent; 
}

.collapsed .legend-toggle {
  transform: rotate(180deg);
}


.legend-items {
  transition: max-height 0.2s ease, opacity 0.2s ease;
  max-height: 200px; 
  overflow: hidden;
  opacity: 1;
}

.collapsed .legend-items {
  max-height: 0;
  opacity: 0;
}

.legend-item {
  display: flex;
  align-items: center;
  margin: 5px 0;
  font-size: 13px;
  color: var(--color-text);  
  white-space: nowrap; 
  overflow: hidden; 
  text-overflow: ellipsis; 
}

.legend-item span:first-child {
  width: 12px;
  height: 12px;
  margin-right: 6px;
  display: inline-block;
  border-radius: 3px;
  flex-shrink: 0; 
}

.legend-item i {
  margin-right: 6px;
  width: 14px;
  text-align: center;
  color: var(--color-text);  
  flex-shrink: 0; 
}

.legend-item span:last-of-type {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--color-text); 
  flex: 1;  
  font-weight: normal; 
}

.family-color { background-color: var(--color-family); }
.relationship-color { background-color: var(--color-relationship); }
.friend-color { background-color: var(--color-friend); }
.conflict-color { background-color: var(--color-conflict); }
.other-color { background-color: var(--color-other); }

.legend-item i {
  margin-right: 6px;
  width: 14px; 
  text-align: center;
  color: var(--color-text-light);
}

.legend-item span:last-child {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px; 
}

.graph-controls {
  position: absolute;
  bottom: 15px; 
  left: 15px; 
  z-index: 930; 
}

.btn {
  padding: 8px 16px;
  background-color: var(--color-primary);
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.3s, transform 0.1s;
  font-family: 'Roboto', sans-serif;
  font-weight: 500;
  box-shadow: 0 2px 5px var(--color-shadow);
  opacity: 0.9; 
}

.btn:hover {
  background-color: var(--color-primary-hover);
  opacity: 1;
}

.btn:active {
  transform: scale(0.98);
}

#graph-container {
  width: 100%;
  height: 100%; 
  background-color: var(--color-card);
  border-radius: 12px;
  box-shadow: 0 3px 15px var(--color-shadow);
  overflow: hidden;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
  position: relative; 
}

svg {
  width: 100%;
  height: 100%;
  transition: background-color 0.3s ease;
}

.node circle {
  cursor: pointer;
  stroke-width: 2px;
  transition: fill 0.3s, stroke 0.3s;
}

.node text {
  font-size: 12px;
  font-family: 'Roboto', sans-serif;
  pointer-events: none;
  fill: var(--color-text);
  transition: fill 0.3s;
}

.link {
  stroke-opacity: 0.6;
  transition: stroke 0.3s;
}

.link-label {
  font-family: 'Roboto', sans-serif;
  font-size: 11px;
  fill: var(--color-text-light);
  transition: fill 0.3s;
}


.sidebar {
  width: var(--sidebar-width-desktop);
  background-color: var(--color-card);
  box-shadow: -2px 0 15px var(--color-shadow);
  overflow-x: hidden;
  overflow-y: auto; 
  transition: width 0.3s ease, background-color 0.3s;
  min-height: calc(100vh - 140px); 
  max-height: calc(100vh - 140px); 
  position: absolute;
  top: 0;
  right: -320px;
  height: 100%;
  background-color: var(--color-sidebar-bg);
  border-left: 1px solid var(--color-sidebar-border);
  box-shadow: var(--shadow);
  overflow-y: auto;
  transition: right 0.3s ease;
  z-index: 900; 
  max-height: 100%; 
}

.sidebar.open {
  width: 30%;
  min-width: 320px;
  right: 0;
}

.visualization-container.sidebar-open {
  width: calc(100% - 320px);
}

.sidebar-content {
  padding: 25px;
  width: 100%;
  overflow-y: auto;
  height: 100%;
  padding: 1rem;
}

.sidebar h2 {
  color: var(--color-primary);
  border-bottom: 2px solid var(--color-border);
  padding-bottom: 12px;
  margin-bottom: 20px;
  font-family: 'Roboto Slab', serif;
  font-weight: 600;
}

.sidebar h3 {
  color: var(--color-text);
  margin: 15px 0 8px;
  font-family: 'Roboto Slab', serif;
}

.sidebar h4 {
  color: var(--color-primary);
  margin: 22px 0 12px;
  padding-top: 15px;
  border-top: 1px solid var(--color-border);
}

.close-btn {
  float: right;
  font-size: 28px;
  cursor: pointer;
  color: var(--color-text-light);
  transition: color 0.3s;
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: transparent;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  color: var(--color-text);
}

.close-btn:hover {
  color: var(--color-secondary);
}

#node-details {
  padding: 10px 0;
}

#node-details .select-node {
  color: var(--color-text-light);
  font-style: italic;
  text-align: center;
  margin-top: 80px;
}

#node-details .detail-item {
  margin-bottom: 18px;
  padding-bottom: 10px;
  border-bottom: 1px dashed var(--color-border);
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--color-border);
}

#node-details .detail-item:last-child {
  border-bottom: none;
}

#node-details .detail-label {
  font-weight: 500;
  color: var(--color-text-light);
  margin-bottom: 5px;
  font-size: clamp(12px, 1.5vw, 14px);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
}

#node-details .detail-value {
  color: var(--color-text);
  font-size: clamp(14px, 1.5vw, 16px);
  line-height: 1.5;
  padding-left: 1.5rem;
  color: var(--color-text);
}

.connections-list {
  list-style-type: none;
  padding: 0;
}

.connections-list li {
  padding: 10px;
  margin-bottom: 8px;
  background-color: var(--color-background);
  border-radius: 6px;
  transition: background-color 0.3s;
  cursor: pointer; 
  padding: 0.75rem;
  margin-bottom: 0.5rem;
  background-color: var(--color-card-bg);
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.3s;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  border: 1px solid var(--color-border);
}

.connections-list li:hover {
  background-color: rgba(52, 152, 219, 0.2);
  background-color: var(--color-primary);
  color: white;
}

.connections-list li:active {
  transform: scale(0.98);
}

.connections-list li:hover {
  background-color: rgba(52, 152, 219, 0.1);
}

.connections-list li i {
  margin-right: 0.5rem;
}

.connections-list li strong {
  margin-right: 0.5rem;
}

.connection-type-icon {
  margin-left: 0.5rem;
  margin-right: 0.3rem;
  color: var(--color-text-light);
}

.connections-list li:hover .connection-type-icon {
  color: rgba(255, 255, 255, 0.8);
}

.relation-type {
  font-size: 0.85rem;
  color: var(--color-text-light);
}

.connections-list li:hover .relation-type {
  color: rgba(255, 255, 255, 0.9);
}


.tooltip {
  position: absolute;
  background-color: var(--color-card);
  border: none;
  border-radius: 6px;
  padding: 8px 12px;
  box-shadow: 0 3px 12px var(--color-shadow);
  display: none;
  max-width: min(200px, 80vw);
  z-index: 9500; 
  font-size: clamp(11px, 1.5vw, 13px);
  transition: background-color 0.3s, box-shadow 0.3s;
  display: none;
  background-color: var(--color-tooltip-bg);
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 12px;
  box-shadow: var(--shadow);
  pointer-events: none;
  z-index: 1000;
  max-width: 200px;
  border: 1px solid var(--color-border);
}

.tooltip strong {
  color: var(--color-primary);
  display: block;
  margin-bottom: 3px;
}

footer {
  text-align: center;
  padding: 0 15px;
  background-color: var(--color-footer);
  color: var(--color-header-text);
  transition: background-color 0.3s ease;
  font-size: 14px;
  height: 10vh; 
  min-height: 40px; 
  display: flex;
  justify-content: center;
  align-items: center;
  flex-shrink: 0; 
}


@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

.pulse {
  animation: pulse 1s ease-in-out;
}


@media (max-width: 768px) {
  main {
    flex-direction: column;
    height: 80vh; 
    max-height: 80vh;
  }
  
  .sidebar.open {
    width: 100%;
    height: 350px;
    z-index: 950; 
  }
  
  .visualization-container, .sidebar-open .visualization-container {
    flex: auto;
  }
  
  header h1 {
    font-size: 1.8rem; 
    margin-bottom: 15px; 
  }
  
  .theme-toggle {
    top: 15px;
    right: 15px;
    transform: none;
  }
  
  .fixed-legend {
    bottom: auto;
    top: auto;
    left: 10px;
    bottom: 10px;
    max-width: 180px;
    padding: 8px;
    font-size: 11px;
    transform: scale(0.9);
  }
  
  .graph-controls {
    bottom: 10px; 
    left: 10px;
  }
  
  #graph-container {
    height: 100%;
    min-height: 200px; 
  }

  header {
    flex-direction: row;
    justify-content: space-between;
    padding: 0 10px;
    height: var(--header-height-mobile);
    position: relative;
  }
  
  header h1 {
    font-size: clamp(1.2rem, 5vw, 1.6rem);
    padding: 0;
    margin: 0;
    flex: 1;
    text-align: center;
  }
  
  .header-controls {
    position: static;
    transform: none;
    display: flex;
    gap: 10px;
  }
  
  .language-selector {
    margin-right: 0;
  }
  
  
  main {
    flex-direction: column;
    height: calc(100vh - var(--header-height-mobile) - var(--footer-height-mobile));
  }
  
  
  .sidebar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100% !important;
    height: 0;
    min-height: 0;
    max-height: 80vh;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    border-radius: 15px 15px 0 0;
    z-index: 1000;
  }
  
  .sidebar.open {
    transform: translateY(0);
    height: var(--sidebar-height-mobile);
  }
  
  
  .graph-controls {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 500;
  }
  
  .fixed-legend {
    position: fixed;
    bottom: 20px;
    right: 20px;
    top: auto;
    left: auto;
    z-index: 500;
    max-width: 140px;
    transform-origin: bottom right;
  }
  
  
  .sidebar-content {
    padding: 10px 15px 20px;
  }
  
  
  .sidebar h2 {
    font-size: 1.3rem;
    padding-right: 30px; 
  }
  
  .connections-list li {
    padding: 10px;
    margin-bottom: 8px;
  }
}


@media (max-height: 500px) {
  header {
    height: 15vh;
    min-height: 50px; 
    padding: 5px 20px;
  }
  
  main {
    height: 75vh;
    max-height: 75vh;
  }
  
  footer {
    height: 10vh;
    min-height: 30px; 
  }
  
  .fixed-legend, .graph-controls {
    transform: scale(0.9);
    transform-origin: top left;
  }
}


.fas, .fab, .far {
  margin-right: 5px;
}

.btn .fas {
  font-size: 14px;
}

.close-btn .fas {
  margin-right: 0;
}

.sidebar h2 .fas,
.sidebar h3 .fas,
.sidebar h4 .fas {
  color: var(--color-primary);
}

.legend-item .fas {
  font-size: 12px;
  width: 16px;
  text-align: center;
  color: var(--color-text-light);
}

.detail-label .fas {
  color: var(--color-primary);
  width: 16px;
  text-align: center;
}

.connections-list li .fas {
  margin-right: 5px;
}

header h1 .fas {
  color: var(--color-accent);
  font-size: 1.8rem; 
}

.connection-type-icon {
  margin-right: 5px;
  margin-left: 3px;
}


@media (max-width: 480px) {
  .fixed-legend {
    max-width: 160px; 
    font-size: 11px;
  }
  
  .legend-item {
    font-size: 0.75rem;
  }
  
  .legend-item span:first-child {
    width: 10px;
    height: 10px;
  }
  
  .legend-item i {
    font-size: 11px;
  }

  header h1 {
    font-size: 1.1rem;
    gap: 5px;
  }
  
  .lang-dropdown-btn, #theme-btn {
    padding: 5px 8px;
  }
  
  .lang-dropdown {
    min-width: 100px;
  }
  
  .sidebar-content {
    padding: 10px;
  }
  
  
  #node-details .detail-label {
    font-size: 11px;
  }
  
  #node-details .detail-value {
    font-size: 13px;
    padding-left: 15px;
  }
  
  
  .fixed-legend, .graph-controls {
    transform: scale(0.9);
  }
  
  .fixed-legend {
    max-width: 120px;
    font-size: 10px;
  }
  
  .btn {
    padding: 6px 10px;
    font-size: 12px;
  }
}


body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

main {
  flex: 1;
  position: relative;
  min-height: 0; 
  overflow: hidden;
  display: flex;
  flex-direction: row;
}


@media (max-width: 768px) {
  header {
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    padding: 10px;
  }

  header h1 {
    font-size: 1.8rem; 
    margin-bottom: 15px; 
  }

  .language-selector {
    position: relative;
    left: auto;
    transform: none;
    top: auto;
    margin-right: 20px;
  }

  .theme-toggle {
    position: relative;
    right: auto;
    transform: none;
    top: auto;
  }
}


@media (max-width: 768px) {
  .visualization-container {
    padding: 10px;
  }
  
  #graph-container {
    height: calc(100% - 20px); 
    min-height: 250px;
  }
  
  .fixed-legend {
    top: 10px;
    left: 10px;
    font-size: 11px;
    padding: 8px;
    max-width: 150px;
    z-index: 150;
  }
  
  .fixed-legend h3 {
    font-size: 12px;
    margin-bottom: 5px;
  }
  
  .legend-item {
    margin: 3px 0;
    font-size: 10px;
  }
  
  .graph-controls {
    bottom: 10px; 
    left: 10px;
  }
  
  .graph-controls .btn {
    padding: 6px 10px;
    font-size: 12px;
  }
}


@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100% !important;
    min-width: 100% !important;
    height: 0;
    min-height: 0;
    max-height: 60vh;
    border-radius: 15px 15px 0 0;
    border-top: 2px solid var(--color-border);
    border-left: none;
    transform: translateY(100%);
    transition: transform 0.3s ease, height 0.3s ease;
    z-index: 1000;
  }
  
  .sidebar.open {
    transform: translateY(0);
    height: 50vh;
  }
  
  .sidebar-content {
    padding: 15px;
    padding-top: 10px;
    overflow-y: auto;
  }
  
  .visualization-container.sidebar-open {
    width: 100%;
  }
  
  .close-btn {
    top: 10px;
    right: 10px;
  }
  
  
  .sidebar::before {
    content: "";
    position: absolute;
    top: 5px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 5px;
    background-color: var(--color-border);
    border-radius: 10px;
  }
  
  
  .sidebar h2 {
    font-size: 18px;
    margin-top: 5px;
    margin-bottom: 15px;
  }
  
  #node-details .detail-item {
    margin-bottom: 10px;
    padding-bottom: 10px;
  }
  
  #node-details .detail-label {
    font-size: 12px;
  }
  
  #node-details .detail-value {
    font-size: 14px;
    padding-left: 20px;
  }
  
  .connections-list li {
    padding: 8px;
    margin-bottom: 5px;
    font-size: 13px;
  }
}


@media (max-width: 480px) {
  header h1 {
    font-size: 1.2rem;
  }
  
  .fixed-legend,
  .graph-controls {
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    margin-bottom: 10px;
    max-width: 100%;
    width: 100%;
  }
  
  .fixed-legend {
    order: 2;
  }
  
  .graph-controls {
    order: 1;
    display: flex;
    justify-content: center;
  }
  
  .visualization-container {
    display: flex;
    flex-direction: column;
  }
  
  #graph-container {
    order: 3;
    height: calc(100% - 80px); 
    min-height: 200px;
  }
}


@media (max-height: 750px) and (max-width: 480px) {
  .sidebar.open {
    height: 40vh;
    max-height: 350px;
  }
  
  #graph-container {
    height: calc(100% - 250px);
    min-height: 250px;
  }
}


@media (max-height: 500px) and (orientation: landscape) {
  header {
    height: 15vh; 
  }
  
  main {
    height: 75vh; 
  }
  
  footer {
    height: 10vh; 
  }
  
  #graph-container {
    height: calc(100% - 10px);
  }
}


.fixed-title {
  font-family: 'Roboto Slab', serif;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--color-header-text);
  text-transform: uppercase;
}

body, html {
  overflow-x: hidden;
  overflow-y: hidden;
}




@media (max-width: 1024px) {
  header h1 {
    font-size: clamp(1.6rem, 3vw, 2.2rem);
  }
  
  .sidebar {
    width: min(350px, 40%);
  }
  
  .sidebar.open {
    min-width: min(320px, 100%);
  }
}


@media (max-height: 500px) and (orientation: landscape) {
  header {
    height: 15vh;
    min-height: 40px;
  }
  
  main {
    height: 75vh;
  }
  
  footer {
    height: 10vh;
    min-height: 30px;
  }
  
  
  .sidebar.open {
    height: 85vh;
    top: 15vh;
    bottom: auto;
  }
  
  
  .graph-controls {
    bottom: 10px;
    left: 10px;
  }
  
  .fixed-legend {
    bottom: 10px;
    right: 10px;
    max-height: 120px;
    overflow-y: auto;
  }
}


@media (min-height: 800px) and (max-width: 480px) {
  .sidebar.open {
    height: 60vh;
    max-height: 70vh;
  }
}


.btn, 
.lang-dropdown-btn, 
#theme-btn, 
.close-btn, 
.lang-option, 
.connections-list li {
  min-height: 44px; 
  min-width: 44px;
  display: flex;
  align-items: center;
}


.sidebar-content, 
.connections-list {
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}
