/*
Color Palette:
  Primary: #F5557F
  Secondary: #907E88
  BG: #1F161D
  DarkBG: #140B12
  Disabled: #2B2229
  Black: #000000
  White: #FFFFFF
*/

:root {
    --primary: #F5557F;
    --secondary: #907E88;
    --bg: #140B12;      /* Main page BG => #140B12 */
    --footerBG: #1F161D;/* Footer => #1F161D */
    --disabled: #2B2229;
    --black: #000000;
    --white: #FFFFFF;
    --transition-duration: 0.3s;
  }
  
  * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
  }
  
  /* BODY => #140B12 */
  body {
    background-color: var(--bg);
    color: var(--white);
    font-family: 'Bricolage Grotesque', sans-serif;
    font-weight: 200; /* thin */
    min-height: 100vh;
  }
  
  /* PAGE CONTAINER => holds main content + footer */
  .page-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
  }
  
  /* MAIN CONTENT => set max 420 + padding 16 => ensure left edge matches player */
  .main-content {
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    padding: 0 16px;
    flex: 1; /* push footer down if needed */
  }
  
  /* HEADER => left aligned with same 16px offset as player card */
  .header {
    margin-top: 24px;
    margin-bottom: 24px;
  }
  .header-logo {
    width: 48px;
    height: auto;
    margin-bottom: 10px;
  }
  .header-title {
    font-weight: 200;
    font-size: 1.3rem;
    text-align: left;
  }
  
  /* PLAYER SECTION => matches .main-content spacing */
  .player-section {
    width: 100%;
    margin-bottom: 100px; /* updated to 100px bottom margin */
  }
  
  /* Player card => 40px rounding for main shape */
  .player-card {
    width: 100%;
    background-color: var(--footerBG);
    border-radius: 40px;
    padding: 20px;
    margin-bottom: 24px;
  }
  
  /* cover + info */
  .player-top {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
  }
  
  /* Updated cover => 128x128 => 24px rounding */
  .cover-art {
    width: 128px;
    height: 128px;
    flex-shrink: 0;
    border-radius: 24px;
    overflow: hidden;
  }
  .cover-art img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  
  /* Episode info */
  .episode-info {
    flex: 1;
  }
  .episode-title {
    font-size: 1.1rem;
    font-weight: 200;
    margin-bottom: 6px;
    color: var(--white);
  }
  .episode-number {
    display: block;
    font-size: 0.8rem;
    font-weight: 400;
    color: var(--secondary);
    margin-bottom: 2px;
  }
  .series-name {
    display: block;
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--white);
    margin-bottom: 10px;
  }
  .author-block {
    display: flex;
    align-items: center;
    gap: 6px;
  }
  .author-block img {
    width: 24px;
    height: 24px;
    border-radius: 24px;
  }
  .author-name {
    font-size: 0.75rem;
    font-weight: 400;
  }
  
  /* Progress section */
  .progress-section {
    margin-bottom: 20px;
  }
  .progress-bar {
    width: 100%;
    height: 4px;
    border-radius: 24px;
    -webkit-appearance: none;
    background: transparent;
    margin-bottom: 6px;
  }
  .progress-bar::-webkit-slider-runnable-track {
    height: 4px;
    background: rgba(255,255,255,0.1);
    border-radius: 24px;
  }
  .progress-bar::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 10px;
    height: 10px;
    background: var(--white);
    border-radius: 50%;
    margin-top: -3px;
    cursor: pointer;
  }
  .progress-bar::-moz-range-track {
    height: 4px;
    background: rgba(255,255,255,0.1);
    border-radius: 24px;
  }
  .progress-bar::-moz-range-thumb {
    width: 10px;
    height: 10px;
    background: var(--white);
    border-radius: 50%;
    cursor: pointer;
  }
  .time-display {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    font-weight: 400;
  }
  
  /* Controls row => left(bm), center, right(share) */
  .controls-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  .center-controls {
    display: flex;
    align-items: center;
    gap: 16px;
  }
  
  /* control buttons => 40x40, 24px rounding */
  .control-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: none;
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition-duration), transform var(--transition-duration);
    cursor: pointer;
  }
  .control-btn img {
    width: 20px;
    height: 20px;
    object-fit: contain;
  }
  .control-btn:hover {
    background-color: var(--disabled);
  }
  .control-btn:active {
    transform: scale(0.92);
  }
  
  /* play/pause => default primary BG */
  .play-pause-btn {
    background-color: var(--primary);
  }
  .play-pause-btn:hover {
    background-color: #d34568;
  }
  .play-pause-btn:active {
    background-color: var(--primary);
    transform: scale(0.92);
  }
  
  /* START LISTENING => fully pill */
  .start-listening-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--white);
    color: var(--black);
    font-weight: 700;
    text-transform: uppercase;
    text-decoration: none;
    width: 100%;
    height: 80px;
    border-radius: 9999px;
    margin: 24px 0;
    padding: 0 24px;
    gap: 12px;
  }
  .start-listening-btn .apple-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
  }
  .start-listening-btn:hover {
    background-color: var(--primary);
    color: var(--white);
  }
  .start-listening-btn:active {
    background-color: var(--white);
    color: var(--black);
  }
  
  /* JOIN 10K => 24px rounding if you'd like, but user used no border radius 
     Instead, we see margin-bottom: 48px; margin-top: 48px; 
     and the image is 200px wide. 
  */
  .join-10k {
    margin-bottom: 48px;
    margin-top: 48px;
    overflow: hidden;
    display: flex;
    justify-content: center;
  }
  .join-10k-img {
    width: 200px;
    display: block;
    object-fit: cover;
  }
  
  /* APP STORE BUTTON */
  .appstore-btn img {
    width: 180px;
    display: block;
    margin: 0 auto 40px auto;
  }
  
  /* FOOTER => #1F161D */
  .footer {
    width: 100%;
    background-color: var(--footerBG);
    padding: 100px 20px 30px; /* user-chosen values */
  }
  .footer-wrapper {
    width: 100%;
    max-width: 940px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
  }
  .footer-col-left {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    height: 102px;
    justify-content: space-between;
  }
  .footer-col-left img {
    width: 36px;
    height: auto;
    /* no rounding needed if it’s just the neutral B */
  }
  .footer-col-left span {
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--secondary);
  }
  .footer-col-right {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
  }
  .footer-col-right ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  .footer-col-right ul li a {
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--secondary);
    transition: color var(--transition-duration);
  }
  .footer-col-right ul li a:hover {
    color: var(--primary);
  }
  .footer-col-right ul li a:active {
    color: var(--secondary);
  }
  
  /* POPUP => dark overlay, 24px corners for approximate squircle */
  .popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(20, 11, 18, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
  }
  .popup-content {
    background-color: var(--footerBG);
    border-radius: 24px;
    padding: 20px;
    width: 90%;
    max-width: 320px;
    text-align: center;
    position: relative;
  }
  .popup-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: transparent;
    border: none;
    color: var(--white);
    font-size: 1.5rem;
    cursor: pointer;
  }
  .popup-content h3 {
    font-weight: 200;
    margin-bottom: 10px;
  }
  .popup-content p {
    font-size: 0.85rem;
    font-weight: 400;
    margin-bottom: 20px;
  }
  .modal-btn {
    border-radius: 9999px;
    margin-top: 0;
  }
  
  /* Loading Spinner */
  .loading-spinner {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
  }
  
  .spinner {
    width: 50px;
    height: 50px;
    border: 3px solid var(--disabled);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
  }
  
  @keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
  }
  
  /* Add error state styles for the player card */
  .player-card.error {
    opacity: 0.5;
    pointer-events: none;
  }
  
  /* Add disabled state for buttons */
  .control-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
  }
  
  /* Add styling for the B Original logo */
  .b-original-logo {
    height: 40px;
    width: auto;
  }
  