body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0;
  background-color: #121212;
  color: #ffffff;
}

header {
  background-color: #1db954;
  padding: 1rem;
  text-align: center;
  font-size: 1.5rem;
}

main {
  max-width: 800px;
  margin: 2rem auto;
  padding: 1rem;
  background-color: #222222;
  border-radius: 10px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.section {
  margin-bottom: 2rem;
}

.section h2 {
  border-bottom: 2px solid #1db954;
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
}

.button {
  display: inline-block;
  margin: 0.5rem 0;
  padding: 0.75rem 1rem;
  background-color: #1db954;
  color: #ffffff;
  text-decoration: none;
  border-radius: 5px;
  font-weight: bold;
  text-align: center;
}

.button:hover {
  background-color: #14833b;
}

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

.list li {
  margin-bottom: 0.5rem;
}

footer {
  text-align: center;
  padding: 1rem;
  background-color: #1db954;
}

footer a {
  color: #ffffff;
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

/* Hide the native file input completely */
input[type="file"] {
  display: none; /* Completely hides the input */
}

/* Style the custom label as a button */
.custom-file-upload {
  display: inline-block;
  padding: 0.75rem 1rem;
  background-color: #1db954;
  color: white;
  border-radius: 5px;
  cursor: pointer;
  font-size: 1rem;
  text-align: center;
}

/* Add hover effect to the custom button */
.custom-file-upload:hover {
  background-color: #14833b;
}

/* Style for the selected file name display */
#file-chosen {
  margin-left: 1rem;
  color: #bbb;
  font-size: 0.9rem;
}

.tabs {
  display: block;
  margin-bottom: 1rem;
}

.tab-buttons-container {
  display: flex; /* Use flexbox to display buttons next to each other */
  justify-content: space-between; /* Ensure buttons are adjacent */
}

.tab-button {
  flex: 1;
  padding: 0.75rem;
  background-color: #1db954;
  color: #ffffff;
  border: none;
  cursor: pointer;
  text-align: center;
  font-size: 1rem;
  margin: 0; /* Remove margin between buttons */
}

.tab-button:hover {
  background-color: #14833b;
}

.tab-button.selected {
  background-color: #14833b; /* Faded color for selected tab */
}

.tab-content {
  display: none;
}

.tab-content ul {
  list-style-type: none;
  padding: 0;
}

.tab-content li {
  margin-bottom: 0.5rem;
  padding: 0.5rem;
  background-color: #333333;
  border-radius: 5px;
}

.tab-content li strong {
  color: #1db954;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1rem;
}

.data-table th, .data-table td {
  border: 1px solid #444;
  padding: 0.75rem;
  text-align: left;
}

.data-table th {
  background-color: #1db954;
  color: #ffffff;
}

.data-table tr:nth-child(even) {
  background-color: #333333;
}

.data-table tr:hover {
  background-color: #444444;
}

.data-table td {
  color: #ffffff;
}

.data-table th, .data-table td {
  text-align: left;
}

/* Style the dropdowns */
select {
  background-color: #333333;
  color: #ffffff;
  border: 1px solid #444;
  border-radius: 5px;
  padding: 0.5rem;
  font-size: 1rem;
  margin-right: 0.5rem;
}

select:focus {
  outline: none;
  border-color: #1db954;
}

/* Style for the summary section */
#summary p {
  margin: 0.5rem 0;
  font-size: 1rem;
  color: #bbb;
}

/* Style for the detailed data section */
#detailed-section div {
  margin-bottom: 1rem;
}

#detailed-section label {
  margin-right: 0.5rem;
}

@media (max-width: 600px) {
  header {
    font-size: 1.2rem;
    padding: 0.5rem;
  }

  main {
    margin: 1rem;
    padding: 0.5rem;
  }

  .section {
    margin-bottom: 1rem;
  }

  .button {
    padding: 0.5rem;
    font-size: 0.9rem;
  }

  .custom-file-upload {
    padding: 0.5rem;
    font-size: 0.9rem;
  }

  .tab-buttons-container {
    flex-direction: column;
  }

  .tab-button {
    margin-bottom: 0.5rem;
  }

  .data-table th, .data-table td {
    padding: 0.5rem;
  }

  #file-chosen {
    display: block;
    margin-top: 0.5rem;
  }
}

.modal {
  display: none; /* Hidden by default */
  position: fixed; /* Stay in place */
  z-index: 1; /* Sit on top */
  left: 0;
  top: 0;
  width: 100%; /* Full width */
  height: 100%; /* Full height */
  overflow: auto; /* Enable scroll if needed */
  background-color: rgb(0,0,0); /* Fallback color */
  background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
}

.modal-content {
  background-color: #222222;
  margin: 15% auto; /* 15% from the top and centered */
  padding: 20px;
  border: 1px solid #888;
  width: 80%; /* Could be more or less, depending on screen size */
  border-radius: 10px;
  border: 1px solid #444;
}

.close {
  color: #aaa;
  float: right;
  font-size: 28px;
  font-weight: bold;
}

.close:hover,
.close:focus {
  color: #fff;
  text-decoration: none;
  cursor: pointer;
}

.share-buttons .btn {
  display: inline-flex;
  align-items: center;
  background-color: #212529;
  border: 1px solid #1db954;
  color: #1db954;
  transition: all 0.3s ease;
}

.share-buttons .btn:hover {
  background-color: #1db954;
  color: #212529;
}

.share-buttons .btn svg {
  margin-right: 8px;
}

.share-buttons h4 {
  color: #1db954;
}

/* Mobile Improvements */
@media (max-width: 768px) {
  /* Main container adjustments */
  .container {
    padding: 10px;
  }

  /* Summary section */
  #summary p {
    font-size: 14px;
    line-height: 1.4;
    margin: 8px 0;
    word-break: break-word;
  }

  /* Tab buttons */
  .btn-group {
    flex-direction: column;
    width: 100%;
  }

  .btn-group .btn {
    width: 100%;
    margin-bottom: 5px;
    border-radius: 4px !important;
    font-size: 14px;
    padding: 8px;
  }

  /* Tables */
  .table {
    font-size: 14px;
  }

  .table td, .table th {
    padding: 8px 4px;
    min-width: 60px;
  }

  /* Long text handling */
  .table td {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* Visualizations section */
  #visualization-section .row {
    margin: 0;
  }

  #visualization-section .col-md-6,
  #visualization-section .col-md-12 {
    padding: 10px 0;
  }

  canvas {
    height: 300px !important;
  }

  /* Share buttons */
  .share-buttons .btn {
    width: 100%;
    margin-bottom: 10px;
    font-size: 14px;
  }

  .share-buttons .d-flex {
    flex-direction: column;
  }

  /* Form controls */
  .form-group {
    margin-bottom: 10px;
  }

  select.form-control {
    font-size: 14px;
    height: 38px;
  }

  /* Filter section */
  #detailed-section .form-row {
    margin: 0;
  }

  #detailed-section .form-group {
    padding: 0;
  }

  /* Modal adjustments */
  .modal-content {
    width: 95%;
    margin: 5% auto;
    padding: 15px;
  }

  /* Loading indicator */
  #loading-indicator {
    font-size: 14px;
    padding: 10px;
  }

  /* Stats image */
  #stats-image {
    width: 100%;
    height: auto;
  }
}

/* Touch-specific improvements */
@media (hover: none) {
  .btn:hover {
    opacity: 1;
  }

  .table tr:hover {
    background-color: inherit;
  }

  /* Increase touch targets */
  .btn, 
  select,
  .table td,
  .table th {
    min-height: 44px;
  }
}

/* Landscape orientation */
@media (max-width: 768px) and (orientation: landscape) {
  .modal-content {
    margin: 2% auto;
    max-height: 90vh;
    overflow-y: auto;
  }

  canvas {
    height: 200px !important;
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.chart-container {
  position: relative;
  height: 400px;  /* Fixed height for charts */
  margin-bottom: 2rem;
}

.chart-container {
    position: relative;
    height: 400px !important; /* Force fixed height */
    width: 100%;
    margin-bottom: 2rem;
}

#trackLineChart {
    max-height: 400px !important; /* Prevent excessive growth */
}

.col-md-12 {
    height: auto !important; /* Reset any inherited height */
}

#trackLineChart {
  height: 100% !important;
  width: 100% !important;
}

.loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(33, 37, 41, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.loading-overlay div {
  color: #1db954;
  font-size: 14px;
  font-weight: bold;
  padding: 10px 20px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.7);
}

.toast {
  background-color: #212529;
  max-width: 350px;
  margin: 15px;
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

#get-ai-comment {
  transition: all 0.3s ease;
}

#get-ai-comment:hover {
  transform: scale(1.05);
  box-shadow: 0 0 15px rgba(29, 185, 84, 0.3);
}

#ai-comment-content {
  min-height: 100px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  font-size: 1.1em;
  line-height: 1.5;
}

.spinner-border {
  width: 2rem;
  height: 2rem;
}

.search-container {
    margin-bottom: 20px;
}

.search-input {
    background-color: #333333;
    color: #ffffff;
    border: 1px solid #444;
    border-radius: 5px;
    padding: 8px 12px;
    width: 100%;
    margin-bottom: 10px;
}

.search-input:focus {
    outline: none;
    border-color: #1db954;
}

.search-results {
    max-height: 300px;
    overflow-y: auto;
    background-color: #333333;
    border-radius: 5px;
    padding: 10px;
}

.search-result-item {
    padding: 10px;
    border-bottom: 1px solid #444;
    cursor: pointer;
    transition: background-color 0.2s;
}

.search-result-item:hover {
    background-color: #444444;
}

.search-result-item:last-child {
    border-bottom: none;
}

.result-details {
    background-color: #333333;
    padding: 15px;
    border-radius: 5px;
    margin-top: 15px;
}

.result-details h4 {
    color: #1db954;
    margin-bottom: 10px;
}

.result-details p {
    margin: 5px 0;
    color: #ffffff;
}

.search-wrapper {
    max-width: 500px;
    margin-left: 1rem;
    display: none; /* Hide by default */
}

.search-button {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    padding: 0 10px;
    background-color: #1db954;
    border: none;
    color: white;
    border-top-right-radius: 4px;
    border-bottom-right-radius: 4px;
}

.search-button:hover {
    background-color: #179443;
}

.search-wrapper .form-control {
    background-color: #333333;
    color: #ffffff;
    border: 1px solid #444;
}

.search-wrapper .form-control:focus {
    background-color: #444444;
    color: #ffffff;
    border-color: #1db954;
    box-shadow: 0 0 0 0.2rem rgba(29, 185, 84, 0.25);
}

.search-results-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: #333333;
    border: 1px solid #444;
    border-radius: 4px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    margin-top: 2px;
}

.search-result-item {
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid #444;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background-color: #444444;
}
