* {
    box-sizing: border-box;
    border-radius: 15px;
  }
  
  body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    background-color: #cac3f262;
    color: #333;
    text-align: left; /* Align text to the left */
  }

  .tooltip {
    position: absolute;
    background-color: #fff;
    border: 1px solid #ccc;
    padding: 8px 12px;
    font-size: 14px;
    pointer-events: none;
    border-radius: 5px;
    box-shadow: 0 0 8px rgba(0,0,0,0.1);
    display: none;
    z-index: 10;
  }

 rect {
    fill: #f9f5f5;
    margin: 20px;
    gap: 10px;
    opacity: 0.65;
  }
  
  #controls {
    margin: 20px 0;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
  }
  
  select, button {
    padding: 8px 16px;
    font-size: 16px;
    border-radius: 6px;
    border: 1px solid #ccc;
    background-color: white;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
  }
  
  select:hover, button:hover {
    border-color: #999;
    background-color: #f0f0f0;
  }

  #pageHeader {
    position: sticky;
    top: 0;
    z-index: 999;
    padding: 20px;
    background-color: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    text-align: center;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.10);
    transition: transform 0.3s ease;
  }
  
  h1 {
    margin: 0;
    font-size: 2.5em;
    color: #333;
    letter-spacing: 1px;
  }
  
  p {
    margin-top: 10px;
    font-size: 1.2em;
    color: #555;
    font-weight: 500;
  }

  #mainContainer {
    display: flex;
    flex-direction: row;
    justify-content: center; /* center horizontally */
    align-items: flex-start;
    gap: 20px;
    margin: 20px auto;
    max-width: 1200px;
  }
  
  #svgWrapper {
    display: flex;
    align-items: center;
    margin: left;
    justify-content: right;
    width: 100%;
    max-width: 500px;
    max-height: 500px;
  }
  
  #constituencyList {
    flex: 1;
    margin: right;
    justify-content: center;
    overflow-y: auto;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 10px;
    background-color: #a987b15d;
    max-width: 500px;
    max-height: 500px;
    opacity: 0.80;
  }
  
  .constituencyCard {
    margin-bottom: 12px;
    padding: 8px 12px;
    border-left: 6px solid #ccc;
    background-color: #fff;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  }
  
  svg {
    width: 100%;
    height: auto;
    display: block;

  }

  @media (max-width: 768px) {
    h1 {
      font-size: 1.6em;
    }
  
    p {
      font-size: 1em;
    }
  
    select, button {
      font-size: 14px;
      padding: 6px 12px;
    }
  }

  #majorityLine {
    position: absolute;
    height: 100%;
    width: 2px;
    background-color: black;
    left: 51.22%; /* (21 / 41) * 100 */
    top: 0;
    z-index: 10;
    margin: 0%;
  }
    
  #seatBarContainer {
    position: relative;
    max-width: 700px;
    margin: 20px auto;
    text-align: center;
  }

  #seatBar {
    position: relative;
    display: flex;
    height: 25px;
    width: 100%;
    border: 1px solid #ccc;
    border-radius: 8px;
    overflow: hidden;
    background-color: #eee;
    margin-bottom: 10px;
  }
  
  .seatSegment {
    height: 100%;
    flex-shrink: 0;
  }
  
  #pnmBar {
    background-color: #ff0700;
    margin: 0%;
    border-radius: 0% 0% 0% 0%; 
  }
  
  #uncBar {
    background-color: #FFD700;
    margin: 0%;
    border-radius: 0% 0% 0% 0%; 
  }
  
  #seatLabels span {
    font-weight: bold;
    margin: 0 8px;
  }

  #profileDataSection {
    margin: 40px auto;
    max-width: 1000px;
    background-color: #d2b8d5b4;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  }
  
  .scrollable-table {
    overflow-x: auto;
    max-height: 400px;
  }
  
  .scrollable-table table {
    width: 100%;
    border-collapse: collapse;
    background: rgb(203, 193, 220);
    border-radius: 10px;
    overflow: hidden;
  }
  
  .scrollable-table th, .scrollable-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #7f5e8e;
    text-align: left;
  }
  
  .scrollable-table th {
    background-color: #b193c4;
    font-weight: bold;
    border-radius: 0px;
  }

  .flex-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
  }

  .flex-header.space-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 1rem;
  }

  /* Optional: spacing for label + dropdown */
  .dropdown-wrapper {
    display: flex;
    align-items: center;
    gap: 1rem;
  }

  
  #chart {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    overflow-x: auto;
    background-color: #f2f0eb;
    padding: 5px;
    border-radius: 5px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
  }
  
  .chart-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 20px;
    flex-wrap: wrap;
  }
  
  #indicatorSelector {
    width: 300px;
    height: 60px;
    padding: 8px;
    border: 1px solid #bdb18e;
    border-radius: 8px;
    font-size: 14px;
  }

  @media (max-width: 768px) {
    #mainContainer {
      flex-direction: column;
      align-items: center;
      width: 90%;
    }
  
    #constituencyList {
      max-height: 300px;
      font-size: 0.85em;
      padding: 8px;
    }
  
    .constituencyCard {
      padding: 6px 10px;
      margin-bottom: 8px;
    }
  
    #seatBarContainer {
      position: relative;
      max-width: 300px;
      margin: 20px auto;
      text-align: center;
    }
  
    #profileDataSection {
      max-width: 90%;
      padding: 15px;
      font-size: 0.85em;
      margin: 20px auto;
    }
  
    .scrollable-table {
      max-height: 250px;
      overflow-y: auto;
    }
  
    .scrollable-table th,
    .scrollable-table td {
      padding: 6px 8px;
      font-size: 0.85em;
    }
  
    .dropdown-wrapper label,
    .dropdown-wrapper select {
      font-size: 0.85em;
    }
  
    #chart {
      max-width: 90%;
      padding: 10px;
      font-size: 0.85em;
      overflow-x: auto;
    }
  
    .chart-controls {
      flex-direction: column;
      gap: 0.5rem;
      font-size: 0.85em;
    }
  
    #indicatorSelector {
      width: 100%;
      font-size: 0.85em;
      height: auto;
    }

    #pageHeader{
      position: static;
    }
  
    html, body {
      width: 100%;
      height: 100%;
      overflow-x: hidden;
    }
  
    h1 {
      font-size: 1.4em;
    }
  
    h2 {
      font-size: 1.1em;
    }
  
    p, span, label, select, button, td, th {
      font-size: 0.9em;
    }

  }

  @media (max-width: 768px) and (orientation: landscape) {
    #mainContainer {
      flex-direction: row;
      align-items: flex-start;
      justify-content: center;
      gap: 1rem;
      width: 100%;
    }

    #pageHeader{
      position: static;
    }
  
    #svgWrapper,
    #constituencyList {
      max-width: 45%;
      height: auto;
    }
  
    #constituencyList {
      max-height: 80vh;
      overflow-y: auto;
    }
  }
