/* ==========================================================================
   SkipSeek Radio -- front-end styles.
   Faithful port of the AzuraCast Player Skin, scoped to .skipseek-radio
   so it can't bleed into the surrounding WordPress theme.
   Mirrors the 10px uniform spacing rule and same Comfortaa typography.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Comfortaa:wght@500;700&display=swap');

.skipseek-radio {
    --skin-page-bg: #13151c;
    --skin-card-bg: #1c1f29;
    --skin-text: #dee2e6;

    --skin-title-font: 'Comfortaa', system-ui, sans-serif;
    --skin-title-weight: 700;
    --skin-artist-font: 'Comfortaa', system-ui, sans-serif;
    --skin-artist-weight: 700;

    --skin-button-primary-bg: #2563eb;
    --skin-button-primary-bg-hover: #1d4ed8;
    --skin-button-secondary-bg: #475569;
    --skin-button-secondary-bg-hover: #334155;
    --skin-button-text: #ffffff;

    --skin-card-max: 400px;
    --play-btn-size: clamp(48px, 18%, 80px);

    box-sizing: border-box;
    display: block;
    width: 100%;
    max-width: var(--skin-card-max);
    margin: 0 auto;
    color: var(--skin-text);
    font-family: var(--skin-title-font);
    line-height: 1;
}

.skipseek-radio *,
.skipseek-radio *::before,
.skipseek-radio *::after {
    box-sizing: inherit;
}

.skipseek-radio-layout-flat-light {
    --skin-page-bg: #ffffff;
    --skin-card-bg: #f5f6fa;
    --skin-text: #13151c;
}

/* Card wrapper -- 10px padding on all four edges to match the row gap. */
.skipseek-radio-card {
    background-color: var(--skin-card-bg);
    border-radius: 16px;
    padding: 10px;
    width: 100%;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-areas:
        "art     art     art     art"
        "station station station station"
        "title   title   title   title"
        "rot1    rot1    rot2    rot2"
        "rot3    rot4    rot5    rot6"
        "socials socials socials socials"
        "credit  credit  credit  credit";
    gap: 10px;
    align-items: center;
}

/* ------------------------------------------------------------------ Album art */

.skipseek-radio-art {
    grid-area: art;
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    margin: 0;
    background-color: #1d212c;
    background-image:
        radial-gradient(circle at 30% 30%, rgba(236, 72, 153, 0.18), transparent 60%),
        radial-gradient(circle at 70% 70%, rgba(59, 130, 246, 0.18), transparent 60%);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 8px;
    cursor: pointer;
    overflow: hidden;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

/* Play overlay -- always-visible while paused, fades when playing.
   Same simple white "play in circle" SVG used by the AzuraCast skin. */
.skipseek-radio-art::after {
    content: '';
    position: absolute;
    inset: 0;
    margin: auto;
    width: var(--play-btn-size);
    height: var(--play-btn-size);
    background-image: url("data:image/svg+xml;charset=utf-8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='white' d='M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10s10-4.48 10-10S17.52 2 12 2M9.5 16.5v-9l7 4.5z'/></svg>");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.6));
    opacity: 1;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.skipseek-radio.is-playing .skipseek-radio-art::after {
    opacity: 0;
}

/* Buffering spinner. Visible only between the user's tap and the
   moment audio actually starts playing (the `is-loading` class is
   added on 'play', removed on 'playing'). A rotating ring sits
   slightly outside the play circle so both icons read as one mark
   that gains a halo while buffering. */
.skipseek-radio-art::before {
    content: '';
    position: absolute;
    inset: 0;
    margin: auto;
    width: calc(var(--play-btn-size) + 16px);
    height: calc(var(--play-btn-size) + 16px);
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: #ffffff;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    animation: skipseek-radio-spin 0.85s linear infinite;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.5));
}
.skipseek-radio.is-loading .skipseek-radio-art::before {
    opacity: 1;
}
@keyframes skipseek-radio-spin {
    to { transform: rotate(360deg); }
}

/* Hide the legacy <button> -- the art tile is the click target. */
.skipseek-radio-play {
    display: none;
}

/* ----------------------------------------------------------- Station name row */

.skipseek-radio-station-name {
    grid-area: station;
    font-family: var(--skin-title-font);
    font-weight: 500;
    font-size: 11px;
    line-height: 1;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-align: center;
    opacity: 0.6;
    margin: 0;
    padding: 0;
    color: inherit;
}

.skipseek-radio-station-name:empty {
    display: none;
}

/* ---------------------------------------------------------- Title + artist */

/* Wrap title + artist in a flex column with 10px gap so the visible
   gap between them equals every other inter-row gap. */
.skipseek-radio-title-wrap {
    grid-area: title;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.skipseek-radio-title {
    font-family: var(--skin-title-font);
    font-weight: var(--skin-title-weight);
    font-size: 16px;
    line-height: 1;
    color: inherit;
    text-align: center;
    margin: 0;
    padding: 0;
}

.skipseek-radio-artist {
    font-family: var(--skin-artist-font);
    font-weight: var(--skin-artist-weight);
    font-size: 16px;
    line-height: 1;
    opacity: 0.85;
    color: inherit;
    text-align: center;
    margin: 0;
    padding: 0;
}

.skipseek-radio-artist:empty {
    display: none;
}

/* ------------------------------------------------------------------ Rotation */

.skipseek-radio-rotation {
    display: contents;
}

.skipseek-radio-rotation a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 9px 12px;
    border-radius: 6px;
    font-family: var(--skin-title-font);
    font-weight: 500;
    font-size: 14px;
    text-decoration: none;
    border: none;
    background-color: var(--skin-button-secondary-bg);
    color: var(--skin-button-text);
    transition: background-color 0.15s ease, transform 0.15s ease;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.skipseek-radio-rotation a:nth-child(1) { grid-area: rot1; background-color: var(--skin-button-primary-bg); padding: 12px 12px; font-size: 14px; }
.skipseek-radio-rotation a:nth-child(2) { grid-area: rot2; background-color: var(--skin-button-primary-bg); padding: 12px 12px; font-size: 14px; }
.skipseek-radio-rotation a:nth-child(3) { grid-area: rot3; font-size: 12px; }
.skipseek-radio-rotation a:nth-child(4) { grid-area: rot4; font-size: 12px; }
.skipseek-radio-rotation a:nth-child(5) { grid-area: rot5; font-size: 12px; }
.skipseek-radio-rotation a:nth-child(6) { grid-area: rot6; font-size: 12px; }

.skipseek-radio-rotation a:hover,
.skipseek-radio-rotation a:focus {
    transform: translateY(-1px);
    text-decoration: none;
    color: var(--skin-button-text);
}

.skipseek-radio-rotation a:nth-child(1):hover,
.skipseek-radio-rotation a:nth-child(2):hover {
    background-color: var(--skin-button-primary-bg-hover);
}

.skipseek-radio-rotation a:nth-child(n+3):hover {
    background-color: var(--skin-button-secondary-bg-hover);
}

.skipseek-radio-rotation a.is-current {
    background-color: var(--skin-button-primary-bg-hover);
}

/* --------------------------------------------------------------- Social row */

.skipseek-radio-socials {
    grid-area: socials;
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 14px;
    margin: 0;
    padding: 0;
}

.skipseek-radio-socials:empty {
    display: none;
}

.skipseek-radio-social {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--skin-text);
    opacity: 0.6;
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.skipseek-radio-social:hover,
.skipseek-radio-social:focus {
    opacity: 1;
    transform: translateY(-1px);
}

.skipseek-radio-social svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

/* --------------------------------------------------------------- Credit line */

.skipseek-radio-credit {
    grid-area: credit;
    font-family: var(--skin-title-font);
    font-weight: 500;
    font-size: 11px;
    line-height: 1;
    text-align: center;
    color: inherit;
    opacity: 0.6;
    padding: 0;
    margin: 0;
}

.skipseek-radio-credit:empty {
    display: none;
}

.skipseek-radio-credit a {
    color: inherit;
    text-decoration: none;
}

.skipseek-radio-credit a:hover {
    text-decoration: underline;
}

/* ------------------------------------------------------------------ Tablet */
@media (max-width: 720px) {
    .skipseek-radio {
        max-width: 100%;
    }
    .skipseek-radio-socials { gap: 14px; }
    .skipseek-radio-social svg { width: 28px; height: 28px; }
    .skipseek-radio-credit { font-size: 12px; }
}

/* ------------------------------------------------------------------ Phone */
@media (max-width: 480px) {
    .skipseek-radio-card {
        padding: 10px;
        --play-btn-size: clamp(48px, 16%, 80px);
    }
    .skipseek-radio-socials { gap: 12px; }
    .skipseek-radio-social svg { width: 32px; height: 32px; }
    .skipseek-radio-credit { font-size: 13px; }
    .skipseek-radio-rotation a { padding: 9px 12px; font-size: 14px; }
}
