/* style.css - COMBINED STYLES */

:root {
    --background-dark: #1a1a1d; /* Very dark gray */
    --content-bg: #2c2c31;      /* Slightly lighter dark gray for content */
    --input-bg: #3a3a40;        /* Darker gray for inputs/buttons */
    --button-bg: #404045;       /* Default button background */
    --button-active-bg: #0d6efd; /* Blue for active button (Bootstrap primary) */
    --text-light: #f8f9fa;      /* Light text (Bootstrap light) */
    --text-muted: #adb5bd;      /* Muted text (Bootstrap secondary) */
    --primary-blue: #0d6efd;    /* Primary blue */
    --danger-red: #dc3545;      /* Red for errors */
    --card-border-color: rgba(255, 255, 255, 0.1); /* Subtle border for cards */
  }
  
  body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--text-light);
    background-color: var(--background-dark); /* Fallback */
    position: relative;
    min-height: 100vh;
    overflow-x: hidden;
    padding-top: 60px; /* Add padding to prevent content from hiding under fixed nav */
  }
  
  .background-image {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('runner.png') no-repeat center center fixed;
    background-size: cover;
    z-index: -2;
  }
  
  .overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(26, 26, 29, 0.25); /* Dark semi-transparent overlay */
    z-index: -1;
  }
  
  .main-container {
    max-width: 650px; 
    margin: 0 auto;
    padding: 20px 15px; 
  }
  
  /* Header Section */
  .header-section {
    margin-bottom: 30px; 
  }
  
  .fuel-fire-text {
      font-size: 1.3rem; 
      font-weight: bold;
      letter-spacing: 1px;
      color: var(--text-muted);
      margin-bottom: 0.8rem; 
  }
  
  .main-headline {
    font-size: 2.5rem; 
    font-weight: bold;
    line-height: 1.2;
  }
  
  /* Form Section (Applied to generator and library containers) */
  .form-section {
    background-color: var(--content-bg);
    padding: 30px;
    border-radius: 15px;
  }
  
  .step {
    margin-bottom: 20px; 
  }
  
  .step-label-container {
      display: flex;
      align-items: center;
      margin-bottom: 8px; 
  }
  
  .step-number {
      background-color: var(--input-bg);
      color: var(--text-muted);
      font-size: 0.75rem; 
      font-weight: bold;
      padding: 2px 6px; 
      border-radius: 4px;
      margin-right: 8px; 
      min-width: 18px; 
      text-align: center;
  }
  
  .step-title {
      font-size: 1rem; 
      font-weight: bold;
      color: var(--text-light);
  }
  
/* Progress Bar Styles */
#progressContainer {
    margin: 1rem 0;
    padding: 15px;
    background-color: var(--input-bg);
    border-radius: 12px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

#progressContainer .text-center {
    margin-bottom: 12px;
}

/* Fix text visibility */
#progressContainer .progress-text {
    color: var(--text-light) !important; /* Force light text */
    font-size: 0.9em;
    display: block;
    animation: fadeIn 0.5s ease-in;
}

#generationProgress {
    width: 100%;
    height: 24px;
    border-radius: 12px;
    background-color: #22242a; /* Lighter dark for track */
    box-shadow: 0 1px 4px rgba(0,0,0,0.2) inset;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    overflow: hidden;
    position: relative;
}

#generationProgress::-webkit-progress-bar {
    background-color: #22242a;
    border-radius: 12px;
}

#generationProgress::-webkit-progress-value {
    background: linear-gradient(90deg, #0d6efd 0%, #0a58ca 100%);
    border-radius: 12px;
    transition: width 0.5s;
}

#generationProgress::-moz-progress-bar {
    background: linear-gradient(90deg, #0d6efd 0%, #0a58ca 100%);
    border-radius: 12px;
    transition: width 0.5s;
}

.progress-percentage {
    color: #0d6efd;
    font-weight: bold;
    font-size: 1em;
    text-align: center;
    margin-top: 4px;
    letter-spacing: 1px;
}

/* Remove shimmer animation - it can cause performance issues */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

  .custom-input, .form-select.custom-input { /* Added .form-select.custom-input */
    background-color: var(--input-bg);
    border: 1px solid var(--input-bg);
    color: var(--text-light);
    border-radius: 8px;
    padding: 10px 12px; 
    font-size: 0.95rem; 
  }
  
  .custom-input::placeholder {
    color: var(--text-muted);
  }
  
  .custom-input:focus, .form-select.custom-input:focus { /* Added .form-select.custom-input:focus */
    background-color: var(--input-bg);
    color: var(--text-light);
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
  }
  
  .custom-input.is-invalid {
      border-color: var(--danger-red);
  }
  .custom-input.is-invalid:focus {
      box-shadow: 0 0 0 0.25rem rgba(220, 53, 69, 0.25);
  }
  .invalid-feedback {
      color: var(--danger-red);
      font-size: 0.8em; 
      margin-top: .25rem;
      display: none;
  }
  .is-invalid ~ .invalid-feedback, 
  .button-group.is-invalid + .invalid-feedback
   {
      display: block;
  }
  
  .button-group {
    display: flex;
    gap: 8px; 
    flex-wrap: wrap;
  }
  .button-group.is-invalid .option-button {
      /* border: 1px solid var(--danger-red); */
  }
  
  .option-button {
    background-color: var(--button-bg);
    border: none;
    color: var(--text-light);
    padding: 8px 12px; 
    border-radius: 8px;
    font-size: 0.85rem; 
    transition: background-color 0.2s ease-in-out;
    flex-grow: 1;
    text-align: center;
    cursor: pointer;
  }
  
  .option-button:hover {
    background-color: #5a5a61;
     color: var(--text-light);
  }
  
  .option-button.active {
    background-color: var(--button-active-bg);
    color: white;
    font-weight: bold;
  }
  
  .audio-container {
      background-color: var(--input-bg);
      padding: 15px; 
      border-radius: 8px;
      margin-top: 20px; 
  }
  .result-heading {
      font-size: 1.1rem; 
      margin-bottom: 10px; 
      color: var(--text-light);
  }
  .custom-audio-player { /* Used for the main generator player */
      filter: invert(1) sepia(0.05) saturate(0.5) hue-rotate(180deg) brightness(1.1) contrast(0.9);
      height: 45px; 
      max-width: 100%;
  }
  
  .lyrics-details summary {
      cursor: pointer;
      color: var(--text-muted);
      font-size: 0.85rem; 
      margin-bottom: 5px;
  }
  .lyrics-details summary:hover {
      color: var(--text-light);
  }
  .lyrics-details pre {
      background-color: var(--background-dark);
      border: 1px solid var(--button-bg);
      color: var(--text-muted);
      font-size: 0.8rem; 
      max-height: 180px; 
      overflow-y: auto;
      white-space: pre-wrap;
      word-wrap: break-word;
      padding: 10px; 
      border-radius: 5px; 
  }
  
  #loadingIndicator p {
      color: var(--text-muted);
      font-size: 0.9em;
  }
  #loadingIndicator .spinner-border {
      color: var(--primary-blue) !important;
      width: 2rem; 
      height: 2rem; 
  }
  
  .motivate-button, #surpriseMeButton { /* Grouped for consistent sizing if desired */
    padding: 10px 15px;
    font-size: 1rem;
    border-radius: 8px;
    font-weight: bold;
    letter-spacing: 0.5px;
    transition: background-color 0.2s ease-in-out, opacity 0.2s ease-in-out, color 0.2s ease-in-out, border-color 0.2s ease-in-out;
    cursor: pointer;
  }
  
  .motivate-button {
    background-color: var(--primary-blue);
    border: 1px solid var(--primary-blue);
    color: white;
    text-transform: uppercase;
  }
  .motivate-button:hover:not(:disabled) {
    background-color: #0b5ed7;
    border-color: #0a58ca;
    color: white;
  }
  .motivate-button:disabled {
      opacity: 0.65;
      cursor: not-allowed;
  }
  
  #surpriseMeButton {
    background-color: transparent;
    border: 1px solid var(--primary-blue); /* Use primary blue for outline */
    color: var(--primary-blue);
  }
  #surpriseMeButton:hover {
    background-color: var(--primary-blue);
    color: white;
  }
  
  
  input[type="hidden"] {
      display: none;
  }
  
  #generalError.alert { 
      background-color: rgba(220, 53, 69, 0.15); 
      border: 1px solid var(--danger-red);
      color: var(--danger-red);
      padding: 10px 15px; 
      font-size: 0.9em;
  }
  
  .user-nav {
      position: fixed; 
      top: 0;
      left: 0; 
      width: 100%; 
      z-index: 1030; 
      color: var(--text-light);
      font-size: 0.9em;
      background-color: rgba(26, 26, 29, 0.9); 
      padding: 8px 20px; 
      display: flex; 
      justify-content: flex-end; 
      align-items: center; 
      border-bottom: 1px solid var(--button-bg); 
  }
  .user-nav button {
      font-size: 0.85em;
  }
  #userInfo span {
      font-weight: bold;
  }
  #authButtons {
      margin-left: auto; 
  }
  
  .modal-content.bg-dark {
      background-color: var(--content-bg) !important;
      border: 1px solid var(--button-bg);
  }
  .modal-header.border-secondary {
      border-bottom: 1px solid var(--button-bg) !important;
  }
  .modal-body .form-control {
       background-color: var(--input-bg);
       border: 1px solid var(--input-bg);
       color: var(--text-light);
  }
  .modal-body .form-control:focus {
       background-color: var(--input-bg);
       color: var(--text-light);
       border-color: var(--primary-blue);
       box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
  }
  .modal-body .alert { 
       padding: 8px 12px;
       font-size: 0.85em;
  }
  .modal-lg .modal-body {
      padding: 2rem; 
  }
  .modal-lg .modal-body .form-label {
      font-size: 0.95rem; 
  }
  .modal-lg .modal-body .btn {
      padding: 10px 15px; 
      font-size: 1rem; 
  }
  /* Style for the "Forgot Password?" link in the login modal */
  #loginModal .modal-body #loginForm .text-end a.small {
    color: var(--text-light) !important; 
    text-decoration: none; 
  }
  #loginModal .modal-body #loginForm .text-end a.small:hover {
    color: var(--primary-blue) !important; 
    text-decoration: underline; 
  }
  
  .nav-pills .nav-link {
      color: var(--text-muted);
      background-color: var(--button-bg);
      margin: 0 5px;
      border: none;
      padding: 8px 15px; 
      font-size: 0.9rem; 
      border-radius: 8px; 
  }
  .nav-pills .nav-link.active {
      color: white;
      background-color: var(--primary-blue);
      font-weight: bold;
  }
  .nav-pills .nav-link:hover:not(.active) {
      background-color: #5a5a61;
  }
  .tab-content {
      margin-top: 25px;
  }
  
  .library-section h2 {
      color: var(--text-light);
  }
  
  .library-list .list-group-item {
      background-color: var(--input-bg);
      border: 1px solid var(--button-bg);
      margin-bottom: 10px;
      border-radius: 8px;
      color: var(--text-light);
      padding: 15px;
      display: flex;
      justify-content: space-between;
      align-items: center;
      flex-wrap: wrap;
  }
  .library-item-info {
      flex-grow: 1;
      margin-right: 15px;
  }
  .library-item-info h5 {
      margin-bottom: 5px;
      font-size: 1.05rem; 
      color: var(--text-light);
  }
  .library-item-info p {
      font-size: 0.8em; 
      color: var(--text-muted);
      margin-bottom: 3px;
      line-height: 1.3;
  }
  .library-item-controls {
      display: flex; 
      align-items: center;
  }
  .library-item-controls .library-audio-player { 
       max-width: 250px;
       height: 40px;
       filter: invert(1) sepia(0.05) saturate(0.5) hue-rotate(180deg) brightness(1.1) contrast(0.9); /* Same as custom-audio-player */
       margin-right: 10px; 
  }
  .library-item-controls .badge { 
      margin-right: 10px;
      padding: 5px 8px;
      font-size: 0.75rem;
  }
  .library-item-controls .btn-delete-song {
      font-size: 0.8rem;
      padding: 5px 8px;
  }
  
  #libraryLoading, #libraryEmpty {
      margin-top: 20px;
      color: var(--text-muted);
  }
  
  /* === Example Songs Section Styling === */
  #exampleSongsSection {
      background-color: transparent; /* Make section background transparent to see main page bg */
      border-top: 1px solid var(--card-border-color); 
      border-bottom: 1px solid var(--card-border-color); 
      padding-top: 40px;
      padding-bottom: 40px;
  }
  
  #exampleSongsSection h2 {
      font-weight: 300; 
      letter-spacing: 1px;
      margin-bottom: 2rem; /* More space below heading */
  }
  
  .example-song-card {
      background-color: rgba(44, 44, 49, 0.85); /* var(--content-bg) with some transparency */
      border: 1px solid var(--card-border-color); 
      box-shadow: 0 6px 12px rgba(0,0,0,0.25); /* Softer, more spread shadow */
      transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
      border-radius: 12px; /* Slightly more rounded corners */
      padding: 20px; /* More padding inside card */
  }
  
  .example-song-card:hover {
      transform: translateY(-8px); 
      box-shadow: 0 10px 20px rgba(0,0,0,0.35); 
  }
  
  .example-song-card h5 {
      color: var(--text-light); 
      font-weight: 500;
      margin-bottom: 0.5rem;
      font-size: 1.1rem;
  }
  
  .example-song-card p.small {
      font-size: 0.9em;
      color: var(--text-muted); 
      line-height: 1.4;
      margin-bottom: 1rem; /* Space before audio player */
  }
  
  /* Styling for the default audio player in example cards */
  .example-song-card audio {
      width: 100%;
      height: 40px; /* Consistent height */
      border-radius: 6px; /* Match card's roundness a bit */
      /* Attempt to style default player controls for dark theme (WebKit) */
      filter: invert(1) sepia(0.05) saturate(0.5) hue-rotate(180deg) brightness(1.1) contrast(0.9);
  }
  
  /* More specific WebKit styling for audio controls (experimental) */
  .example-song-card audio::-webkit-media-controls-panel {
    background-color: rgba(30, 30, 33, 0.8); /* Darker, slightly transparent panel */
    border-radius: 6px;
    color: var(--text-light);
  }
  
  .example-song-card audio::-webkit-media-controls-play-button,
  .example-song-card audio::-webkit-media-controls-mute-button,
  .example-song-card audio::-webkit-media-controls-volume-slider-container, /* Target container for better effect */
  .example-song-card audio::-webkit-media-controls-timeline-container { /* Target container */
    /* The filter on the main audio element often handles this, but you can try specific icon colors if needed */
    /* For example, if icons were SVGs, you could target fill. Here, it's more about the overall inversion. */
  }
  
  .example-song-card audio::-webkit-media-controls-current-time-display,
  .example-song-card audio::-webkit-media-controls-time-remaining-display {
    color: var(--text-muted); /* Try to make time text more muted */
    font-size: 0.9em;
    text-shadow: none; /* Remove any default browser shadow */
  }
  
  .example-song-card audio::-webkit-media-controls-timeline {
    background-color: rgba(80, 80, 80, 0.5); /* Darker track for timeline */
    border-radius: 3px;
    height: 6px; /* Slimmer timeline */
    margin: 0 5px;
  }
  
  .example-song-card audio::-webkit-media-slider-thumb { /* For volume/progress thumb */
    background-color: var(--primary-blue);
    border-radius: 50%;
    width: 12px;
    height: 12px;
  }
  /* END Example Songs Section Styling === */
  
  
  @media (max-width: 768px) {
      .main-container {
           max-width: 95%;
           padding: 15px;
      }
       .main-headline {
          font-size: 2rem; 
      }
      .form-section {
          padding: 20px; 
      }
       .user-nav {
           padding: 8px 10px;
           font-size: 0.8em;
      }
  }
  
  @media (max-width: 576px) {
       body {
           padding-top: 50px; 
       }
       .main-headline {
          font-size: 1.8rem;
      }
       .nav-pills .nav-link {
           font-size: 0.8rem;
           padding: 6px 10px;
       }
       .motivate-button, #surpriseMeButton { /* Ensure surprise button is also responsive */
           font-size: 1rem;
       }
  
      .library-item-info {
          margin-right: 0;
          margin-bottom: 10px;
          width: 100%;
      }
      .library-item-controls {
          width: 100%;
          justify-content: space-between;
      }
       .library-item-controls .library-audio-player {
          max-width: calc(100% - 60px); 
      }
  }
  
  /* Payment Form Styles - Unchanged */
  #payment-form { /* ... */ }
  #payment-element { /* ... */ }
  #submit { /* ... */ }
  #submit:hover { /* ... */ }
  #submit:disabled { /* ... */ }
  #error-message { /* ... */ }
  
  /* Payment Complete Page Styles - Unchanged */
  .payment-complete-container { /* ... */ }
  .success-message { /* ... */ }
  .error-message { /* ... */ }
  .button { /* ... */ }
  .button:hover { /* ... */ }
  
  /* Ensure the styles for the payment form and completion page are still here if they were previously */
  /* For brevity, I'm omitting the full payment styles if they were extensive and unchanged. */
  /* If they were part of the original style.css, they should remain. */
  
  input.is-valid, select.is-valid, textarea.is-valid {
    border-color: #28a745 !important;
    box-shadow: 0 0 0 0.15rem rgba(40,167,69,.15);
    background-image: url('data:image/svg+xml;utf8,<svg fill="%2328a745" height="20" viewBox="0 0 20 20" width="20" xmlns="http://www.w3.org/2000/svg"><path d="M7.629 15.29a1 1 0 0 1-1.415 0l-4.243-4.242a1 1 0 1 1 1.415-1.415l3.536 3.535 7.778-7.778a1 1 0 1 1 1.415 1.415l-8.486 8.485z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1.2em 1.2em;
    padding-right: 2.5em;
  }
  
/* Smooth Animations */
.fade-in {
    animation: fadeIn 0.6s ease-out;
}

.slide-up {
    animation: slideUp 0.5s ease-out;
}

.slide-in-right {
    animation: slideInRight 0.5s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Button hover animations */
.btn, .option-button {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.btn::before, .option-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before, .option-button:hover::before {
    width: 300px;
    height: 300px;
}

/* Input focus animations */
.custom-input {
    transition: all 0.3s ease;
}

.custom-input:focus {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.3);
}

/* Card hover animations */
.library-list-item {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.library-list-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    border-color: var(--primary-blue);
}

/* Loading spinner animation */
.spinner-border {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
  
  