/* ==========================================================================
   CUSTOM AUDIO PLAYER MAIN CONTAINER (COMPACT & RESPONSIVE)
   ========================================================================== */
.custom-audio-player {
     max-width: 450px;
     margin: 15px auto;
     background: #f3f0f9;
     padding: 14px 20px;
     border-radius: 16px;
     box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
     display: flex;
     flex-direction: column;
     align-items: center;
     gap: 12px;
     font-family: inherit;
     border: 1px solid #e2e8f0;
}

/* ==========================================================================
   TRACK TITLE & SUBTITLE DISPLAY
   ========================================================================== */
.track-info {
     text-align: center;
     width: 100%;
     margin-bottom: 0px;
}

.track-title {
     font-size: 18px;
     font-weight: 700;
     color: #222277;
     margin: 0;
     line-height: 1.4;
}

.track-subtitle {
     font-size: 13px;
     color: #64748b;
     margin-top: 4px;
     font-weight: 500;
}

/* ==========================================================================
   CORE CONTROL INTERFACE & BUTTONS
   ========================================================================== */
.player-controls {
     display: flex;
     align-items: center;
     justify-content: center;
     gap: 24px;
}

.control-btn {
     background: none;
     border: none;
     cursor: pointer;
     display: flex;
     align-items: center;
     justify-content: center;
     padding: 8px;
     border-radius: 10%;
     transition: background-color 0.2s ease, transform 0.1s ease, color 0.2s ease, box-shadow 0.2s ease;
     color: #222277;
}

.control-btn:hover {
     background-color: #f0f0fa;
     color: #111144;
}

.control-btn:active {
     transform: scale(0.95);
}

.control-btn.play-pause-btn {
     border-radius: 8px;
     padding: 6px 12px;
     border: 2px solid #222277;
     background-color: #222277;
     color: #ffffff;
     min-width: 95px;
     box-shadow: 0 2px 4px rgba(34, 34, 119, 0.12);
}

.control-btn.play-pause-btn:hover {
     background-color: rgb(241, 188, 13);
     color: #222277;
     box-shadow: 0 3px 6px rgba(34, 34, 119, 0.2);
}

/* Ensure the SVG icon scales uniformly inside the updated button structure */
.control-btn svg {
     width: 24px;
     height: 24px;
     fill: currentColor;
}

.control-btn.play-pause-btn svg {
     width: 24px;
     height: 24px;
}

/* HIGH-VISIBILITY CURVED RECTANGLE BUTTONS */
.control-btn.rect-btn {
     border-radius: 20px;
     padding: 6px 12px;
     font-size: 12px;
     font-weight: 700;
     border: 1px solid #222277;
     background-color: #f0f0fa;
     color: #222277;
     min-width: 52px;
     display: inline-flex;
     align-items: center;
     justify-content: center;
     box-shadow: 0 2px 4px rgba(34, 34, 119, 0.12);
}

.control-btn.rect-btn:hover {
     background-color: rgb(241, 188, 13);
     color: #ffffff;
     box-shadow: 0 3px 6px rgba(34, 34, 119, 0.2);
}

/* Toggle Rule Logic for Play/Pause Icons */
.play-pause-btn .pause-icon {
     display: none;
}

.custom-audio-player.playing .play-icon {
     display: none;
}

.custom-audio-player.playing .pause-icon {
     display: block;
}

/* ==========================================================================
   PROGRESS BAR TIMELINE SCRUBBER
   ========================================================================== */
.timeline-container {
     width: 100%;
     display: flex;
     align-items: center;
     gap: 12px;
}

.time-stamp {
     font-size: 13px;
     color: #64748b;
     font-weight: 500;
     min-width: 40px;
}

.time-stamp.current {
     text-align: right;
}

/* ==========================================================================
   UTILITY FOOTER SECTION (VOLUME & DOWNLOADS)
   ========================================================================== */
.player-footer {
     width: 100%;
     display: flex;
     justify-content: space-between;
     align-items: center;
     border-top: 1px solid #e2e8f0;
     padding-top: 10px;
     /* Reduced top padding */
}

.volume-container {
     display: flex;
     align-items: center;
     gap: 8px;
}

/* Custom Seeker Input Ranger Track Styling */
.slider-bar {
     -webkit-appearance: none;
     appearance: none;
     height: 6px;
     border-radius: 3px;
     background: #e2e8f0;
     outline: none;
     cursor: pointer;
}

.seeker-bar {
     flex: 1;
}

.volume-bar {
     width: 80px;
}

/* Slider Handle Pin Controls */
.slider-bar::-webkit-slider-thumb {
     -webkit-appearance: none;
     appearance: none;
     width: 14px;
     height: 14px;
     border-radius: 50%;
     background: #222277;
     cursor: pointer;
     transition: transform 0.1s ease;
}

.slider-bar::-moz-range-thumb {
     width: 14px;
     height: 14px;
     border: none;
     border-radius: 50%;
     background: #222277;
     cursor: pointer;
     transition: transform 0.1s ease;
}

.slider-bar::-webkit-slider-thumb:hover {
     transform: scale(1.2);
}

.slider-bar::-moz-range-thumb:hover {
     transform: scale(1.2);
}

/* Dynamic Volume Text Symbol States */
.volume-btn .vol-mute,
.volume-btn .vol-low,
.volume-btn .vol-high {
     display: none;
}

.custom-audio-player.v-muted .volume-btn .vol-mute {
     display: inline-block;
}

.custom-audio-player.v-low .volume-btn .vol-low {
     display: inline-block;
}

.custom-audio-player.v-high .volume-btn .vol-high {
     display: inline-block;
}

/* ==========================================================================
   PLAYLIST PANEL LIST STYLING (SCALED UP TEXT)
   ========================================================================== */
.playlist-container {
     max-width: 450px;
     margin: 20px auto;
     background: #ffffff;
     border-radius: 12px;
     border: 1px solid #e2e8f0;
     box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
     overflow: hidden;
}

.playlist-item {
     display: flex;
     align-items: center;
     justify-content: space-between;
     padding: 14px 20px;
     cursor: pointer;
     border-bottom: 1px solid #f1f5f9;
     transition: background-color 0.2s ease;
     font-size: 16.5px;
     /* Increased by 10% for improved readability */
     color: #334155;
     font-weight: 500;
}

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

.playlist-item:hover {
     background-color: #f8fafc;
     color: #222277;
}

.playlist-item.active-track {
     background-color: #f0f0fa;
     color: #222277;
     font-weight: 700;
     border-left: 4px solid #222277;
}

.playlist-play-icon {
     font-size: 25px;
     color: #222277;
     opacity: 0.9;
}

.playlist-item.active-track .playlist-play-icon {
     opacity: 1;
}

/* ==========================================================================
   PLAYLIST CONTROLS & PAGINATION
   ========================================================================== */
.playlist-controls-wrapper {
     max-width: 450px;
     margin: 25px auto 10px auto;
     width: 100%;
     display: flex;
     gap: 12px;
     align-items: center;
}

.search-box-flex {
     flex: 1;
}

#playlistSearchInput {
     width: 100%;
     padding: 12px 16px;
     border-radius: 8px;
     border: 1px solid #e2e8f0;
     font-size: 15px;
     font-family: inherit;
     box-sizing: border-box;
     outline: none;
     box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
     transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#playlistSearchInput:focus,
#itemsPerPageSelect:focus {
     border-color: #222277;
     box-shadow: 0 0 0 3px rgba(34, 34, 119, 0.15);
}

.dropdown-box-flex {
     display: flex;
     align-items: center;
     gap: 6px;
     font-size: 14px;
     color: #64748b;
     font-weight: 600;
}

#itemsPerPageSelect {
     padding: 11px 12px;
     border-radius: 8px;
     border: 1px solid #e2e8f0;
     background-color: #ffffff;
     font-family: inherit;
     font-size: 14px;
     outline: none;
     cursor: pointer;
     box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.pagination-nav-container {
     max-width: 450px;
     margin: 15px auto;
     display: flex;
     justify-content: center;
     align-items: center;
     gap: 6px;
     flex-wrap: wrap;
}

.page-nav-btn {
     border: 1px solid #e2e8f0;
     background: #ffffff;
     padding: 6px 14px;
     font-size: 16px;
     font-weight: 700;
     border-radius: 6px;
     cursor: pointer;
     color: #64748b;
     transition: all 0.2s ease;
     line-height: 1;
}

.page-nav-btn:hover {
     border-color: #222277;
     color: #222277;
     background-color: #f0f0fa;
}

.page-nav-btn.active-page {
     background-color: #222277;
     color: #ffffff;
     border-color: #222277;
     font-size: 14px;
}

.page-nav-btn:disabled {
     opacity: 0.4;
     cursor: not-allowed;
     border-color: #e2e8f0;
     background: #f8fafc;
     color: #94a3b8;
}

/* Playlist Row Download Button Accents */
.playlist-row-download {
     color: #64748b;
     transition: color 0.2s ease, transform 0.1s ease;
     display: flex;
     align-items: center;
     justify-content: center;
     padding: 4px;
}

.playlist-row-download svg {
     width: 18px;
     height: 18px;
}

.playlist-row-download:hover {
     color: #222277;
     transform: scale(1.1);
}

.playlist-item.active-track .playlist-row-download {
     color: #222277;
}


/* ==========================================================================
   RESPONSIVE DESIGN & SCREEN BREAKPOINTS
   ========================================================================== */

/* 1. Base Mobile Devices (Under 480px) */
@media (max-width: 480px) {

     .custom-audio-player,
     .playlist-container,
     .playlist-controls-wrapper,
     .pagination-nav-container {
          max-width: 100% !important;
          /* Forces components fluid on tiny screens */
          margin-left: 15px !important;
          margin-right: 15px !important;
          padding: 14px !important;
     }

     .player-controls {
          gap: 16px !important;
          /* Prevents buttons from clipping margins */
     }

     .playlist-controls-wrapper {
          flex-direction: column;
          /* Stack layout fields vertically */
          align-items: stretch !important;
     }

     .dropdown-box-flex {
          justify-content: space-between;
     }
}

/* 2. iPad / Tablet Screens (768px to 1023px)  */
@media (min-width: 768px) {

     .custom-audio-player,
     .playlist-container,
     .playlist-controls-wrapper,
     .pagination-nav-container {
          max-width: 600px !important;
     }

     .track-title {
          font-size: 20px !important;
     }

     .volume-bar {
          width: 110px !important;
          /* Easier touch adjustment slider control */
     }
}

/* 3. Desktop Monitors (1024px and up) */
@media (min-width: 1024px) {

     .custom-audio-player,
     .playlist-container,
     .playlist-controls-wrapper,
     .pagination-nav-container {
          max-width: 700px !important;
     }

     .playlist-item {
          padding: 16px 24px !important;
     }
}