/* styles.css */

/* Apply a greenish color scheme to match the Ongeki image */
body {
    margin: 0;
    padding: 0;
    background-color: #292929;
    color: #ffffff;
    font-family: 'Plus Jakarta Sans', sans-serif;
  }
  
  /* Container */
  .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
  }
  
  /* Heading */
  h1 {
    text-align: center;
    color: #5be05b; /* Green heading */
    margin-bottom: 20px;
    font-size: 32px;
    letter-spacing: 1px;
  }
  
  /* Search Filters */
  .search-filters {
    display: flex;
    flex-direction: column;
    margin-bottom: 20px;
    background-color: #292929;
    padding-bottom: 15px;
    border-bottom: none;
  }
  
  /* Search container with input and button */
  .search-container {
    display: flex;
    width: 100%;
    margin-bottom: 20px;
  }
  
  #search-input {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 5px 0 0 5px;
    font-size: 16px;
    background-color: #ffffff;
    color: #666;
    height: 45px;
    box-sizing: border-box;
  }
  
  .search-button {
    background-color: #4cd94c; /* Green button */
    color: #ffffff;
    border: none;
    border-radius: 0 5px 5px 0;
    padding: 0 20px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    height: 45px;
    width: 100px;
  }
  
  .search-button:hover {
    background-color: #3bc23b; /* Darker green on hover */
  }
  
  /* Filters layout */
  .filters {
    display: flex;
    justify-content: center;
    gap: 20px;
    padding: 0 20px;
  }
  
  .filter-category,
  .filter-level {
    display: flex;
    align-items: center;
    gap: 10px;
  }
  
  label {
    font-weight: 600;
    color: #ffffff;
    font-size: 16px;
  }
  
  select {
    padding: 8px 12px;
    border-radius: 5px;
    border: none;
    background-color: #ffffff;
    min-width: 180px;
    height: 40px;
    font-size: 15px;
    appearance: menulist;
  }
  
  /* Song List */
  #song-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(450px, 1fr));
    gap: 20px;
  }
  
  /* Song Item */
  .song-item {
    display: flex;
    background-color: #383838;
    border-radius: 5px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
    transition: transform 0.2s;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    min-height: 180px;
  }
  
  .song-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(76, 217, 76, 0.2); /* Green glow on hover */
  }
  
  .song-image {
    flex: 0 0 150px;
    min-height: 180px;
  }
  
  .song-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  
  /* Song Info with improved text handling for long Japanese text */
  .song-info {
    flex: 1;
    padding: 12px;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    padding-bottom: 55px; /* Increased to prevent cutoff with level badges */
    padding-left: 12px;
  }
  
  .song-info h2 {
    margin: 0 0 5px 0;
    color: #5be05b;
    font-size: 18px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.3;
    max-height: 2.6em;
    white-space: normal;
  }
  
  .song-info p {
    margin: 2px 0;
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    max-height: 2.8em;
    line-height: 1.4;
  }
  
  .song-info p.romaji {
    font-style: italic;
    color: #cccccc;
    font-size: 12px;
    margin-bottom: 5px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
  }
  
  /* Artist container with better spacing */
  .artist-container {
    margin-bottom: 10px;
    flex-grow: 1;
    max-height: 60%; /* Limit height to ensure levels and button have space */
    overflow: hidden;
  }
  
  /* Improved level badges positioning */
  .song-levels {
    display: flex;
    flex-wrap: wrap;
    margin-top: auto;
    gap: 5px;
    position: absolute;
    bottom: 12px;
    left: 12px;
    width: calc(100% - 100px);
  }
  
  .song-levels span {
    display: inline-block;
    background-color: #4cd94c;
    color: #ffffff;
    padding: 3px 6px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: bold;
    margin-bottom: 3px; /* Add margin to prevent overlap */
  }
  
  .difficulty-indicator {
    display: none;
  }
  
  /* Request Button */
  .request-button {
    position: absolute;
    bottom: 12px;
    right: 12px;
    padding: 6px 12px;
    background-color: #4cd94c; /* Green button */
    color: #ffffff;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
  }
  
  .request-button:hover {
    background-color: #3bc23b; /* Darker green on hover */
  }
  
  /* Popup Notification - Improved for mobile visibility */
  #popup-notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #4cd94c; /* Green notification */
    color: #ffffff;
    padding: 15px;
    border-radius: 5px;
    z-index: 2000;
    box-shadow: 0 2px 10px rgba(76, 217, 76, 0.5); /* Green shadow */
    min-width: 200px;
    text-align: center;
    font-weight: 500;
  }
  
  /* Adjust popup for mobile devices */
  @media (max-width: 768px) {
    #popup-notification {
      width: 80%;
      left: 10%;
      right: 10%;
      bottom: 30px;
      font-size: 16px;
    }
  }
  
  .hidden {
    display: none;
  }
  
  /* Modal Styles */
  .modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.75);
    z-index: 1000;
  }
  
  .modal-content {
    position: relative;
    background-color: #292929;
    margin: 50px auto;
    padding: 20px;
    width: 90%;
    max-width: 600px;
    border-radius: 5px;
    color: #fff;
    overflow-y: auto;
    max-height: 80vh;
    box-shadow: 0 0 20px rgba(76, 217, 76, 0.3); /* Green shadow */
  }
  
  .modal-close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
  }
  
  .modal-close:hover {
    color: #4cd94c; /* Green hover color */
  }
  
  .modal-content pre {
    white-space: pre-wrap;
    word-wrap: break-word;
  }
  
  /* Responsive adjustments for mobile */
  @media (max-width: 768px) {
    #song-list {
      grid-template-columns: 1fr;
    }
  
    .filters {
      flex-direction: column;
      align-items: center;
    }
  
    .song-item {
      height: auto;
      flex-direction: column;
    }
  
    .song-image {
      width: 100%;
      height: 200px;
    }
  
    .song-info {
      padding-bottom: 90px; /* Increase further for mobile */
    }
  
    .song-levels {
      bottom: 50px;
      width: calc(100% - 24px);
      flex-wrap: wrap; /* Ensure wrapping of levels */
      max-height: 40px; /* Limit height to prevent overflow */
      overflow-y: auto; /* Allow scrolling if too many levels */
    }
  
    .request-button {
      width: calc(100% - 24px);
      bottom: 12px;
    }
  
    .artist-container {
      margin-bottom: 15px;
      max-height: none; /* Remove height restriction on mobile */
    }
  }
  
  /* Loading overlay styles */
  .loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(29, 29, 29, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 3000;
  }
  
  .loading-content {
    text-align: center;
    background-color: #383838;
    padding: 30px 40px;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(76, 217, 76, 0.3); /* Green shadow */
  }
  
  .loading-content p {
    margin-top: 15px;
    font-size: 18px;
    color: #ffffff;
    font-weight: 500;
  }
  
  .loading-spinner {
    width: 60px;
    height: 60px;
    margin: 0 auto;
    border-radius: 50%;
    border: 5px solid transparent;
    border-top-color: #4cd94c; /* Green spinner */
    border-bottom-color: #4cd94c; /* Green spinner */
    animation: spin 1.5s linear infinite;
  }
  
  @keyframes spin {
    0% {
      transform: rotate(0deg);
    }
    100% {
      transform: rotate(360deg);
    }
  }
  
  /* Fade out animation for the loading overlay */
  .loading-overlay.fade-out {
    opacity: 0;
    transition: opacity 0.5s ease-out;
    pointer-events: none;
  }
  