/* Engagement features (TS-293) — modelled on the app designs, in the plugin's own palette. */

:root
{
    --podcast-bar: #00615F;
    --star-on: #FFCC00;
    --card-field: #f0f0f2;
}

/* ---------------------------------------------------------------- thumbs-up (TS-414 / 423 / 424) */

#plugin_window .tsg-vote
{
    position: absolute;
    font-family: "Material Icons";
    font-size: 26px;
    line-height: 1;
    color: #808080;
    cursor: pointer;
    user-select: none;
    transition: color 0.2s, transform 0.2s;
}

#plugin_window .tsg-vote:hover { opacity: 0.75; }
#plugin_window .tsg-vote:active { transform: scale(0.9); }

#plugin_window .tsg-vote.voted
{
    color: var(--tsgreen);
    cursor: default;
    opacity: 1;
    animation: tsgVotePop 0.35s ease-out;
}

@keyframes tsgVotePop
{
    0% { transform: scale(1); }
    50% { transform: scale(1.25); }
    100% { transform: scale(1); }
}

/* Map mini-player: the thumb sits left of play/pause and the scrub bar makes room. */
.view_container .audio .interior .tsg-vote
{
    top: 12px;
    right: 52px;
}

.view_container .audio .interior:has(.tsg-vote) .bar { width: calc(100% - 244px); }
.view_container .audio .interior:has(.tsg-vote) .timecode { right: 85px; }

/* Stop detail player. */
.view_container .audio-player .tsg-vote
{
    top: 12px;
    right: 44px;
}

.view_container .audio-player .audio-container:has(.tsg-vote) .scrubber { right: 165px; }
.view_container .audio-player .audio-container:has(.tsg-vote) .timecode { right: 74px; }

/* ---------------------------------------------------------------- podcast mode (TS-426) */

#plugin_window .tsg-podcast
{
    position: absolute;
    display: flex;
    align-items: center;
    gap: 5px;

    font-size: 11px;
    font-weight: 500;
    color: white;
    white-space: nowrap;
    cursor: pointer;
}

#plugin_window .tsg-podcast .dot
{
    width: 6px;
    height: 6px;
    border-radius: 100%;
    background: white;
    animation: tsgPodcastPulse 2.4s ease-in-out infinite;
}

@keyframes tsgPodcastPulse
{
    0%, 100% { opacity: 1; }
    50% { opacity: 0.35; }
}

.view_container .audio:has(.tsg-podcast) { background: var(--podcast-bar); transition: background 0.25s; }
.view_container .audio .interior .tsg-podcast { top: 27px; left: 8px; max-width: 131px; }
.view_container .audio .interior:has(.tsg-podcast) h2 { visibility: hidden; }
.view_container .audio .interior:has(.tsg-podcast) h1,
.view_container .audio .interior:has(.tsg-podcast) .timecode,
.view_container .audio .interior:has(.tsg-podcast) .action { color: white; }
.view_container .audio .interior:has(.tsg-podcast) .bar { background: rgba(255, 255, 255, 0.5); }
.view_container .audio .interior:has(.tsg-podcast) .bar .fill,
.view_container .audio .interior:has(.tsg-podcast) .bar .thumb { background: white; }

.view_container .audio-player:has(.tsg-podcast) { background: var(--podcast-bar); transition: background 0.25s; }
.view_container .audio-player .tsg-podcast { top: 5px; left: 12px; }
.view_container .audio-player:has(.tsg-podcast) .timecode,
.view_container .audio-player:has(.tsg-podcast) .button { color: white; }
.view_container .audio-player:has(.tsg-podcast) .scrubber .container .track { background: rgba(255, 255, 255, 0.5); }
.view_container .audio-player:has(.tsg-podcast) .scrubber .container .track-fill,
.view_container .audio-player:has(.tsg-podcast) .scrubber .container .track-thumb { background: white; }

/* ---------------------------------------------------------------- Connect banner flash (TS-420 / TS-332) */

.view_container .map .cta.tsg-flash { animation: tsgConnectFlash 1.2s ease-in-out infinite; }

@keyframes tsgConnectFlash
{
    0%, 100% { background: var(--tsteal); }
    50% { background: rgba(0, 127, 123, 0.3); }
}

/* ---------------------------------------------------------------- cards (TS-415 / TS-418 / TS-339) */

#plugin_window .modal_element:has(.tsg-card) .modal_mask { background: rgba(0, 0, 0, 0.55); }

#plugin_window .modal_element .modal_content.tsg-card
{
    width: 360px;
    max-width: calc(100% - 48px);
    max-height: calc(100% - 32px);
    overflow-y: auto;
    padding: 0;

    background: var(--llbg);
    border: none;
    border-radius: 14px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);

    color: var(--t-primary);
    text-align: left;
}

.tsg-card .tsg-card-header
{
    padding: 14px 16px;
    background: var(--tsgreen);
    color: rgba(255, 255, 255, 0.95);
    font-size: 15px;
    font-weight: 500;
    text-align: center;
}

.tsg-card .tsg-card-header.small
{
    padding: 12px 16px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.9);
}

.tsg-card .tsg-card-steps { animation: tsgFadeIn 0.25s ease-in-out; }

@keyframes tsgFadeIn
{
    from { opacity: 0; }
    to { opacity: 1; }
}

.tsg-card .tsg-card-body
{
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 20px 20px 4px;
}

.tsg-card .tsg-card-body.center { align-items: center; text-align: center; }
.tsg-card .tsg-card-body + .tsg-card-footer { padding-top: 14px; }
#tsg_exit_confirm .tsg-card-body { padding-bottom: 20px; }

.tsg-card .tsg-card-footer
{
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 14px 20px 14px;
}

.tsg-card p { margin: 0; }
.tsg-card .center { text-align: center; }
.tsg-card .tsg-lead { font-size: 16px; line-height: 1.4; text-align: center; }
.tsg-card .tsg-secondary { font-size: 14px; line-height: 1.4; color: var(--t-medium); text-align: center; }
.tsg-card .tsg-error { font-size: 12px; color: var(--dangmain); }

.tsg-card .tsg-fineprint
{
    font-size: 12px;
    color: var(--t-medium);
    text-align: center;
}

.tsg-card .tsg-fineprint a { color: var(--tsgreen); }

.tsg-card .tsg-divider
{
    margin: 18px 0 0;
    border: none;
    border-top: 1px solid var(--border);
}

.tsg-card .tsg-label
{
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 14px;
    color: var(--t-medium);
}

.tsg-card .tsg-input
{
    box-sizing: border-box;
    width: 100%;
    padding: 10px;

    border: 1px solid transparent;
    border-radius: 6px;
    background: var(--card-field);

    font-family: inherit;
    font-size: 15px;
    color: var(--t-primary);
    outline: none;
}

.tsg-card .tsg-input:focus { border-color: var(--tsgreen50); }
.tsg-card textarea.tsg-input { height: 72px; resize: none; }

.tsg-card .tsg-stars { display: flex; gap: 10px; justify-content: center; }

.tsg-card .tsg-stars a
{
    font-family: "Material Icons";
    font-size: 32px;
    line-height: 1;
    color: #8e8e93;
    cursor: pointer;
    user-select: none;
    transition: color 0.2s, transform 0.2s;
}

.tsg-card .tsg-stars a.on { color: var(--star-on); }
.tsg-card .tsg-stars a:active { transform: scale(0.9); }

.tsg-card .tsg-progress { display: flex; flex-direction: column; gap: 6px; }

.tsg-card .tsg-progress .track
{
    height: 8px;
    border-radius: 4px;
    background: var(--card-field);
    overflow: hidden;
}

.tsg-card .tsg-progress .fill
{
    height: 100%;
    border-radius: 4px;
    background: var(--tsgreen);
}

.tsg-card .tsg-progress .labels
{
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--t-medium);
}

.tsg-card .tsg-button
{
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    min-height: 44px;

    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    user-select: none;
}

.tsg-card .tsg-button.primary { background: var(--tsgreen); color: white; }
.tsg-card .tsg-button.primary:hover { background: #007535; }
.tsg-card .tsg-button.primary.tall { min-height: 52px; font-size: 17px; }
.tsg-card .tsg-button.primary small { font-size: 12px; font-weight: 400; color: rgba(255, 255, 255, 0.85); }
.tsg-card .tsg-button.outline { border: 1.5px solid var(--tsgreen); color: var(--tsgreen); }
.tsg-card .tsg-button.outline:hover { background: var(--tsgreen10); }
.tsg-card .tsg-button.text { min-height: 36px; font-size: 15px; font-weight: 400; color: var(--t-medium); }
.tsg-card .tsg-button.text:hover { color: var(--t-primary); }
.tsg-card .tsg-button:active { opacity: 0.75; }
.tsg-card .tsg-button.disabled { opacity: 0.5; cursor: default; pointer-events: none; }

/* ---------------------------------------------------------------- audio scrubbing */
/* The whole bar seeks on tap or drag; an invisible band around the thin track makes it easy to hit. */

.view_container .audio .interior .bar,
.view_container .audio-player .scrubber
{
    cursor: pointer;
    touch-action: none;
}

.view_container .audio .interior .bar::before,
.view_container .audio-player .scrubber::before
{
    content: "";
    position: absolute;
    top: -14px;
    bottom: -14px;
    left: -8px;
    right: -8px;
}

/* Map player: a smaller grabber centred on the track, clear of the thumbs-up and the time below it. */
.view_container .audio .interior .bar .thumb
{
    top: -4.5px;
    width: 14px;
    height: 14px;
}

.view_container .audio .interior .timecode { top: 36px; }
