/* ===== Base Layout ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
  }
  
  body {
    font-family: "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
    background-color: #000;
    color: #fff;
    min-height: 100vh;
    padding: 10px;
    margin: 0;
    display: flex;
    flex-direction: column;
  }
  
  .container {
    max-width: 100%;
    width: 100%;
    margin: 0 auto;
    padding: 0 10px;
    flex: 1;
    display: flex;
    flex-direction: column;
  }
  
  /* ===== Header Section ===== */
  .header-section {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 15px;
    padding: 10px 0;
    flex-shrink: 0;
  }

  .controls-group {
    display: flex;
    align-items: center;
    gap: 15px;
  }

  .title-section {
    text-align: center;
  }

  .title {
    font-size: 28px;
    font-weight: 600;
    letter-spacing: -0.5px;
    margin-bottom: 5px;
    color: #e50914;
    line-height: 1.3;
  }

  .subtitle {
    font-size: 16px;
    font-weight: 400;
    color: #aaa;
    margin: 0;
  }

  .reset-btn {
    background-color: transparent;
    border-color: #e50914;
    color: #e50914;
    font-weight: 500;
    transition: all 0.2s ease;
  }

  .reset-btn:hover {
    background-color: #e50914;
    border-color: #e50914;
    color: #fff;
  }

  .reset-btn span {
    font-size: 16px;
  }
  
   /* ===== Dropdown ===== */
  .dropdown {
    position: relative;
    margin-right: 30px;
  }
   
   .dropdown .btn {
     background-color: #303030;
     border-color: #444;
     color: #fff;
     font-weight: 500;
     width: 180px; 
     text-align: left;
     position: relative;
     display: flex;
     justify-content: space-between;
     align-items: center;
     padding: 6px 10px;
     font-size: 13px;
   }
   
   .dropdown .btn:hover {
     background-color: #444;
     border-color: #e50914;
     color: #fff;
   }

   .dropdown .btn:focus,
   .dropdown .btn:active,
   .dropdown .btn.show {
     background-color: #444;
     border-color: #e50914;
     color: #fff;
     box-shadow: 0 0 0 0.2rem rgba(229, 9, 20, 0.25);
   }
   
   .dropdown-arrow {
     font-size: 12px;
     color: #aaa;
     transition: transform 0.3s ease;
     flex-shrink: 0;
     margin-left: 8px;
   }
   
   .dropdown .btn[aria-expanded="true"] .dropdown-arrow {
     transform: rotate(180deg);
   }
  
   .dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #303030;
    border: 1px solid #444;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    max-height: 700px;
    overflow-y: auto;
    padding: 15px;
    width: 200px;
    z-index: 1050;
  }
  
  
  .dropdown-item {
    padding: 3px 6px;
    font-size: 12px;
  }

  .dropdown-item:hover {
    background-color: #444;
    color: #fff;
  }


  /* Checkbox Styling */
  .form-check-input:checked {
    background-color: #e50914;
    border-color: #e50914;
  }
  
  .form-check-input:focus {
    border-color: #e50914;
    box-shadow: 0 0 0 0.2rem rgba(229, 9, 20, 0.25);
  }
  
  .form-check-label {
    color: #fff;
    font-size: 12px;
    cursor: pointer;
    transition: color 0.2s ease;
    padding-left: 3px;
  }

  .genre-count-badge {
    color: #888;
    font-size: 12px;
    font-weight: 400;
  }

  .form-check:hover .form-check-label {
    color: #e50914;
  }

  .form-check:hover .genre-count-badge {
    color: #aaa;
  }

  .form-check {
    padding: 1px 3px;
  }

  .form-check:hover .form-check-input:not(:checked) {
    border-color: #e50914;
  }

  /* ===== Instructions ===== */
  .instructions {
    background-color: #1a1a1a;
    border-left: 3px solid #e50914;
    padding: 12px 20px;
    margin-bottom: 10px;
    border-radius: 4px;
  }

  .instructions p {
    margin: 0;
    font-size: 14px;
    color: #ccc;
  }

  .instructions strong {
    color: #fff;
  }

  /* ===== Statistics Panel ===== */
  .stats-panel {
    display: flex;
    justify-content: center;
    gap: 5px;
    background-color: #1a1a1a;
    padding: 5px 5px;
    margin-bottom: 5px;
    border-radius: 4px;
    flex-wrap: wrap;
  }

  .stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .stat-label {
    font-size: 13px;
    color: #888;
    font-weight: 500;
  }

  .stat-value {
    font-size: 15px;
    color: #e50914;
    font-weight: 600;
  }

  /* ===== Featured Movies ===== */
  .featured-movies {
    background-color: #1a1a1a;
    border-radius: 8px;
    padding: 20px;
    margin-top: 15px;
  }

  .featured-title {
    font-size: 16px;
    font-weight: 600;
    color: #e50914;
    margin: 0 0 15px 0;
    text-align: center;
  }

  .featured-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
  }

  .featured-card {
    background-color: #111;
    border: 1px solid #333;
    border-radius: 6px;
    padding: 15px;
    text-align: center;
    transition: all 0.3s ease;
  }

  .featured-card:hover {
    border-color: #e50914;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(229, 9, 20, 0.2);
  }

  .featured-icon {
    font-size: 32px;
    margin-bottom: 8px;
  }

  .featured-label {
    font-size: 12px;
    color: #888;
    font-weight: 500;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }

  .featured-sublabel {
    font-size: 10px;
    color: #666;
    font-weight: 400;
    margin-bottom: 8px;
    font-style: italic;
  }

  .featured-movie-title {
    font-size: 14px;
    color: #fff;
    font-weight: 600;
    margin-bottom: 5px;
    min-height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .featured-value {
    font-size: 13px;
    color: #e50914;
    font-weight: 500;
  }

  /* ===== Loading Indicator ===== */
  .loading-indicator {
    background-color: #111;
    border-radius: 8px;
    padding: 60px 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
  }

  .loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #333;
    border-top-color: #e50914;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
  }

  @keyframes spin {
    to {
      transform: rotate(360deg);
    }
  }

  .loading-indicator p {
    color: #aaa;
    font-size: 16px;
    font-weight: 500;
    margin: 0;
  }

  /* ===== Visualization Section ===== */
  .visualization-section {
    background-color: #111;
    border-radius: 8px;
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
  }
  
  .slider-section {
    margin-bottom: 5px;
    padding: 5px;
    height: 170px;
    background-color: #1a1a1a;
    border-radius: 8px;
    overflow-x: visible;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }

  #slider-chart {
    width: 100%;
    max-width: 100%;
    height: 160px;
    background-color: transparent;
    display: block;
  }

  .main-chart-section {
    overflow-x: visible;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
  }

  #main-chart {
    width: 100%;
    height: 100%;
    min-height: 400px;
    background-color: transparent;
    display: block;
    flex: 1;
  }
  
  /* SVG Styles */
  svg {
    background-color: transparent;
  }

  .axis {
    color: #ffffff;
  }

  .axis text {
    fill: #cccccc;
    font-size: 12px;
    font-weight: 500;
  }

  .axis line,
  .axis path {
    stroke: #444444;
  }

  .axis .domain {
    stroke: #444444;
  }

  .legend text {
    fill: #cccccc;
    font-size: 12px;
    font-weight: 500;
  }

  /* Netflix Red Elements */
  .netflix-red {
    fill: #e50914;
    stroke: #e50914;
  }

  .netflix-red-light {
    fill: #ff6b6b;
  }

  .netflix-red-dark {
    fill: #b8070f;
  }

  /* Brush/Slider Styles */
  .brush .selection {
    fill: #e50914;
    fill-opacity: 0.3;
    stroke: #e50914;
    stroke-width: 2px;
  }

  .brush .handle {
    fill: #e50914;
    stroke: #ffffff;
    stroke-width: 2px;
  }

  .brush .handle:hover {
    fill: #ff6b6b;
  }

  /* Data Points */
  .dot {
    /* fill color is now controlled by JavaScript */
    /* fill: #e50914; */
    stroke: #ffffff;
    stroke-width: 1px;
    opacity: 0.8;
  }

  .dot:hover {
    /* fill: #ff6b6b; */
    stroke: #e50914;
    stroke-width: 2px;
    opacity: 1;
  }

  /* Trend Line */
  .trend-line {
    fill: none;
    stroke: #e50914;
    stroke-width: 3px;
    opacity: 0.9;
  }

  /* ===== Annotations ===== */
  .annotation-group {
    pointer-events: none;
  }

  .annotation-label {
    font-family: "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
  }

  .annotation-line {
    pointer-events: none;
  }

  /* ===== Tooltip ===== */
  .tooltip {
    position: fixed;
    background-color: #303030;
    color: #fff;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid #444;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 1000;
    max-width: 400px;
  }
  
  .tooltip.visible {
    opacity: 1;
  }
  
  .tooltip-content {
    display: flex;
    gap: 12px;
    align-items: flex-start;
  }
  
  .movie-info {
    flex: 1;
    min-width: 200px;
  }
  
  .movie-poster {
    flex-shrink: 0;
  }
  
  .poster-image {
    width: 80px;
    height: 120px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #444;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  }
  
  .poster-image:hover {
    transform: scale(1.05);
    transition: transform 0.2s ease;
  }

  /* ===== Footer / Data Source ===== */
  .data-source {
    text-align: center;
    padding: 20px 10px;
    margin-top: 20px;
    border-top: 1px solid #333;
    font-size: 12px;
    color: #888;
  }

  .data-source p {
    margin: 5px 0;
  }

  .inspiration-text {
    font-style: italic;
    color: #777;
  }

  .data-source a {
    color: #e50914;
    text-decoration: none;
    transition: color 0.2s ease;
  }

  .data-source a:hover {
    color: #ff6b6b;
    text-decoration: underline;
  }
  /* ===== Responsive ===== */
  @media (max-width: 1200px) {
    .container {
      padding: 5px;
    }

    .header-section {
      flex-direction: column;
      align-items: flex-start;
      gap: 5px;
    }

    .title {
      font-size: 24px;
    }

    .dropdown .btn {
      width: 160px;
    }
  }

  @media (max-width: 768px) {
    body {
      padding: 5px;
    }

    .container {
      padding: 5px;
    }

    .header-section {
      flex-direction: column;
      align-items: flex-start;
      gap: 10px;
      margin-bottom: 5px;
    }

    .title {
      font-size: 20px;
    }

    .dropdown .btn {
      width: 180px;
    }

    .featured-grid {
      grid-template-columns: 1fr;
      gap: 10px;
    }

    .visualization-section {
      padding: 10px;
    }

    .slider-section {
      height: 140px;
    }

    #slider-chart {
      height: 130px;
    }

    #main-chart {
      min-height: 300px;
    }
  }

  @media (max-width: 480px) {
    .title {
      font-size: 18px;
    }

    .dropdown .btn {
      width: 120px;
    }

    .slider-section {
      height: 120px;
    }

    #slider-chart {
      height: 110px;
    }

    #main-chart {
      min-height: 250px;
    }
  }