/* ================================================================== */
/*  Lusocanal Metrics — Share Page + Native Player                         */
/* ================================================================== */

:root {
    --lcm-accent: #f6cb45;
    --lcm-bg: #0f0f11;
    --lcm-surface: #1a1a1f;
    --lcm-surface-hover: #222228;
    --lcm-text: #f5f5f7;
    --lcm-text-muted: #9ca3af;
    --lcm-border: #2a2a30;
    --lcm-radius: 16px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body.lcm-share-page {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--lcm-bg);
    color: var(--lcm-text);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

.lcm-share-container {
    max-width: 580px;
    margin: 0 auto;
    padding: 32px 20px;
}

/* Header */
.lcm-share-header {
    text-align: center;
    margin-bottom: 24px;
}
.lcm-share-logo {
    max-width: 140px;
    max-height: 50px;
    margin-bottom: 8px;
}
.lcm-share-header h1 {
    font-size: 22px;
    font-weight: 600;
}

/* ================================================================== */
/*  Native Player                                                       */
/* ================================================================== */

.lcm-player {
    background: var(--lcm-surface);
    border: 1px solid var(--lcm-border);
    border-radius: var(--lcm-radius);
    padding: 24px;
    margin-bottom: 20px;
}

/* Now playing: artwork + info */
.lcm-player-now {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.lcm-player-artwork {
    position: relative;
    width: 120px;
    height: 120px;
    flex-shrink: 0;
}

.lcm-player-artwork img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
    box-shadow: 0 6px 24px rgba(0,0,0,0.4);
}

.lcm-play-btn {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.35);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s;
}
.lcm-play-btn:hover,
.lcm-player-artwork:hover .lcm-play-btn {
    opacity: 1;
}
.lcm-play-btn svg {
    width: 44px;
    height: 44px;
    color: #fff;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}

.lcm-player-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.lcm-player-title {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 4px;
}

.lcm-player-date {
    font-size: 13px;
    color: var(--lcm-text-muted);
    margin-bottom: 8px;
}

.lcm-player-desc {
    font-size: 13px;
    color: var(--lcm-text-muted);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Progress Bar */
.lcm-progress-wrap {
    margin-bottom: 16px;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
}

.lcm-progress-bar {
    position: relative;
    height: 6px;
    background: var(--lcm-border);
    border-radius: 3px;
    overflow: hidden;
}

.lcm-progress-buffered {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: rgba(255,255,255,0.1);
    width: 0;
    transition: width 0.3s;
}

.lcm-progress-filled {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: var(--lcm-accent);
    width: 0;
    border-radius: 3px;
    transition: width 0.1s linear;
}

.lcm-progress-wrap:hover .lcm-progress-bar {
    height: 8px;
}

.lcm-time {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--lcm-text-muted);
    margin-top: 6px;
    font-variant-numeric: tabular-nums;
}

/* Controls */
.lcm-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.lcm-ctrl-btn {
    background: none;
    border: none;
    color: var(--lcm-text-muted);
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    position: relative;
}
.lcm-ctrl-btn:hover {
    color: var(--lcm-text);
    background: rgba(255,255,255,0.08);
}
.lcm-ctrl-btn svg {
    width: 24px;
    height: 24px;
}

/* Main play button (larger) */
.lcm-ctrl-main {
    background: var(--lcm-accent);
    color: #1a1a1f;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    margin: 0 8px;
}
.lcm-ctrl-main:hover {
    background: var(--lcm-accent);
    color: #1a1a1f;
    filter: brightness(1.1);
    transform: scale(1.05);
}
.lcm-ctrl-main svg {
    width: 28px;
    height: 28px;
}

/* Rewind/Forward labels */
.lcm-ctrl-label {
    position: absolute;
    font-size: 9px;
    font-weight: 700;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}
.lcm-ctrl-rewind svg,
.lcm-ctrl-forward svg {
    width: 28px;
    height: 28px;
    opacity: 0.7;
}
.lcm-ctrl-rewind .lcm-ctrl-label,
.lcm-ctrl-forward .lcm-ctrl-label {
    margin-top: 1px;
}

/* ================================================================== */
/*  Playlist                                                            */
/* ================================================================== */

.lcm-playlist {
    background: var(--lcm-surface);
    border: 1px solid var(--lcm-border);
    border-radius: var(--lcm-radius);
    padding: 16px;
    margin-bottom: 20px;
    max-height: 400px;
    overflow-y: auto;
}

.lcm-playlist-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--lcm-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    padding: 0 4px;
}

.lcm-playlist-items {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.lcm-playlist-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: transparent;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    text-align: left;
    color: var(--lcm-text);
    transition: background 0.15s;
    width: 100%;
    font-family: inherit;
}
.lcm-playlist-item:hover {
    background: var(--lcm-surface-hover);
}
.lcm-playlist-item.lcm-playlist-active {
    background: var(--lcm-surface-hover);
    border-left: 3px solid var(--lcm-accent);
}

.lcm-pl-thumb {
    width: 44px;
    height: 44px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
}

.lcm-pl-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}
.lcm-pl-name {
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.lcm-pl-meta {
    font-size: 12px;
    color: var(--lcm-text-muted);
}

/* Equalizer animation */
.lcm-pl-playing {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 16px;
    flex-shrink: 0;
    margin-left: 8px;
}

.lcm-eq-bar {
    width: 3px;
    background: var(--lcm-accent);
    border-radius: 1px;
    height: 4px;
}
.lcm-eq-bar:nth-child(1) { height: 6px; }
.lcm-eq-bar:nth-child(2) { height: 10px; }
.lcm-eq-bar:nth-child(3) { height: 4px; }

.lcm-eq-active .lcm-eq-bar {
    animation: lcm-eq-bounce 0.6s ease-in-out infinite alternate;
}
.lcm-eq-active .lcm-eq-bar:nth-child(1) { animation-delay: 0s; }
.lcm-eq-active .lcm-eq-bar:nth-child(2) { animation-delay: 0.2s; }
.lcm-eq-active .lcm-eq-bar:nth-child(3) { animation-delay: 0.4s; }

@keyframes lcm-eq-bounce {
    0%   { height: 4px; }
    100% { height: 16px; }
}

/* Scrollbar for playlist */
.lcm-playlist::-webkit-scrollbar {
    width: 6px;
}
.lcm-playlist::-webkit-scrollbar-track {
    background: transparent;
}
.lcm-playlist::-webkit-scrollbar-thumb {
    background: var(--lcm-border);
    border-radius: 3px;
}

/* ================================================================== */
/*  App Buttons                                                         */
/* ================================================================== */

.lcm-app-buttons {
    text-align: center;
    margin-bottom: 24px;
}
.lcm-app-cta {
    font-size: 14px;
    color: var(--lcm-text-muted);
    margin-bottom: 12px;
}

.lcm-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
    border: none;
    font-family: inherit;
}
.lcm-btn-primary {
    background: var(--lcm-accent);
    color: #1a1a1f;
    width: 100%;
    margin-bottom: 10px;
}
.lcm-btn-primary:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

.lcm-store-links {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
}
.lcm-app-fallback-hint {
    display: none;
    flex-basis: 100%;
    width: 100%;
    font-size: 13px;
    color: var(--lcm-text-muted);
    margin-bottom: 4px;
}
.lcm-app-fallback.lcm-app-fallback-visible .lcm-app-fallback-hint {
    display: block;
}
.lcm-btn-store {
    background: var(--lcm-surface);
    border: 1px solid var(--lcm-border);
    color: var(--lcm-text);
    padding: 10px 16px;
    font-size: 13px;
    flex: 1;
    min-width: 140px;
}
.lcm-btn-store:hover {
    background: var(--lcm-surface-hover);
    color: #fff;
}

.lcm-app-buttons-desktop {
    padding: 20px;
    background: var(--lcm-surface);
    border: 1px solid var(--lcm-border);
    border-radius: var(--lcm-radius);
}

/* Footer */
.lcm-share-footer {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid var(--lcm-border);
}
.lcm-share-footer p {
    font-size: 12px;
    color: var(--lcm-text-muted);
}

/* ================================================================== */
/*  Index Page: Header Toggle + Shared                                  */
/* ================================================================== */

.lcm-index-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.lcm-index-header-row h1 {
    margin: 0;
}
.lcm-view-toggle {
    font-size: 13px;
    font-weight: 600;
    color: var(--lcm-accent);
    text-decoration: none;
    padding: 6px 14px;
    border: 1px solid var(--lcm-accent);
    border-radius: 20px;
    white-space: nowrap;
    transition: all 0.15s;
}
.lcm-view-toggle:hover {
    background: var(--lcm-accent);
    color: #1a1a1f;
}

/* ================================================================== */
/*  Episode List (Index Page)                                           */
/* ================================================================== */

.lcm-episodes-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 24px;
}
.lcm-episode-item {
    display: flex;
    gap: 14px;
    padding: 14px;
    background: var(--lcm-surface);
    border: 1px solid var(--lcm-border);
    border-radius: 12px;
    text-decoration: none;
    color: var(--lcm-text);
    transition: all 0.2s;
}
.lcm-episode-item:hover {
    border-color: var(--lcm-accent);
    transform: translateY(-1px);
}
.lcm-episode-thumb {
    width: 64px;
    height: 64px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}
.lcm-episode-info {
    flex: 1;
    min-width: 0;
}
.lcm-episode-info h2 {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 2px;
}
.lcm-episode-meta {
    font-size: 12px;
    color: var(--lcm-text-muted);
}
.lcm-episode-info p {
    font-size: 13px;
    color: var(--lcm-text-muted);
    line-height: 1.4;
    margin-top: 4px;
}

/* ================================================================== */
/*  Programs Grid (Index Page)                                          */
/* ================================================================== */

.lcm-shows-container {
    max-width: 720px;
}

.lcm-shows-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.lcm-show-card {
    display: flex;
    flex-direction: column;
    background: var(--lcm-surface);
    border: 1px solid var(--lcm-border);
    border-radius: 14px;
    overflow: hidden;
    text-decoration: none;
    color: var(--lcm-text);
    transition: all 0.2s;
}
.lcm-show-card:hover {
    border-color: var(--lcm-accent);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

.lcm-show-artwork {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
}
.lcm-show-artwork-placeholder {
    background: var(--lcm-surface-hover);
}

.lcm-show-info {
    padding: 12px;
}
.lcm-show-name {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    margin: 0 0 4px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.lcm-show-meta {
    font-size: 12px;
    color: var(--lcm-text-muted);
}

/* ================================================================== */
/*  Responsive                                                          */
/* ================================================================== */

@media (max-width: 480px) {
    .lcm-share-container { padding: 20px 16px; }

    .lcm-shows-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 12px;
    }

    .lcm-player-now {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .lcm-player-artwork {
        width: 160px;
        height: 160px;
    }

    .lcm-player-title { font-size: 17px; }

    .lcm-controls { gap: 4px; }
    .lcm-ctrl-main { width: 48px; height: 48px; }

    .lcm-store-links { flex-direction: column; }
    .lcm-btn-store { min-width: unset; }
}

/* Light mode */
@media (prefers-color-scheme: light) {
    body.lcm-share-page {
        --lcm-bg: #f5f5f7;
        --lcm-surface: #ffffff;
        --lcm-surface-hover: #f0f0f2;
        --lcm-text: #1d1d1f;
        --lcm-text-muted: #6b7280;
        --lcm-border: #e5e7eb;
    }
    .lcm-player-artwork img { box-shadow: 0 6px 24px rgba(0,0,0,0.12); }
    .lcm-play-btn { background: rgba(0,0,0,0.2); }
}
