/* ═══════════════════════════════════════════
   Audio Knygos Player – Frontend Styles
   ═══════════════════════════════════════════ */

/* ─── CSS Variables (defaults, overridden inline by widget) ─── */
.abp-root {
    --abp-accent: #f15a24;
    --abp-toggle: #7eb24b;
    --abp-bg: #f6f3ee;
    --abp-card-bg: #ffffff;
    --abp-text: #333333;
    --abp-text-muted: #777777;
    --abp-radius: 8px;
    --abp-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    --abp-font-heading: 'Playfair Display', Georgia, serif;
    --abp-font-body: 'Open Sans', -apple-system, sans-serif;
    font-family: var(--abp-font-body);
    color: var(--abp-text);
    padding-bottom: 80px;
    /* space for mini-player */
}

/* ─── Section Title ─── */
.abp-section-title {
    font-family: var(--abp-font-heading);
    text-align: center;
    font-size: 2.4rem;
    color: #5a4a42;
    margin: 0 0 28px;
}

/* ─── Toggle ─── */
.abp-toggle-container {
    display: flex;
    justify-content: center;
    margin-bottom: 28px;
}

.abp-toggle-switch {
    background: #e8e8e8;
    border-radius: 30px;
    display: inline-flex;
    padding: 4px;
    gap: 0;
}

.abp-toggle-btn {
    background: transparent !important;
    border: none;
    padding: 10px 24px;
    font-family: var(--abp-font-body);
    font-size: 1rem;
    font-weight: 600;
    color: var(--abp-text-muted) !important;
    cursor: pointer;
    border-radius: 26px;
    transition: all 0.3s ease;
    text-decoration: none !important;
}

.abp-toggle-btn:hover,
.abp-toggle-btn:focus,
.abp-toggle-btn:active {
    color: var(--abp-toggle) !important;
}

.abp-toggle-btn.active {
    background: var(--abp-toggle) !important;
    color: #fff !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* ─── Actions Bar ─── */
.abp-actions-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.abp-filter-btn {
    background: #fff;
    border: 1px solid #ddd;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-family: var(--abp-font-body);
    font-size: 0.9rem;
    color: var(--abp-text);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: 0.2s;
}

.abp-filter-btn:hover,
.abp-filter-btn:focus,
.abp-filter-btn:active,
.abp-filter-btn:hover i,
.abp-filter-btn:focus i,
.abp-filter-btn:active i,
.abp-filter-btn:hover svg,
.abp-filter-btn:focus svg,
.abp-filter-btn:active svg {
    border-color: var(--abp-accent) !important;
    background: #fff !important;
    color: var(--abp-accent) !important;
    fill: var(--abp-accent) !important;
}

.abp-filter-btn.active,
.abp-filter-btn.active i,
.abp-filter-btn.active svg {
    border-color: var(--abp-accent) !important;
    background: var(--abp-accent) !important;
    color: #fff !important;
    fill: #fff !important;
}

/* ─── Grid ─── */
.abp-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

/* ─── Card ─── */
.abp-card {
    background: var(--abp-card-bg);
    border-radius: var(--abp-radius);
    padding: 20px;
    text-align: center;
    box-shadow: var(--abp-shadow);
    position: relative;
    cursor: pointer;
    transition: transform 0.2s;
    display: flex;
    flex-direction: column;
}

.abp-card:hover,
.abp-card:focus,
.abp-card:active {
    transform: translateY(-5px) !important;
}

.abp-card-image {
    width: 100%;
    height: 180px;
    background: #eee;
    border-radius: var(--abp-radius);
    margin-bottom: 15px;
    object-fit: cover;
}

.abp-card-title {
    font-family: var(--abp-font-heading);
    font-size: 1.1rem;
    margin: 0 0 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.abp-card-desc {
    font-size: 0.9rem;
    color: var(--abp-text-muted);
    margin-bottom: 20px;
    flex-grow: 1;
}

.abp-card-progress {
    width: 100%;
    height: 6px;
    background: #eee;
    border-radius: 3px;
    margin-bottom: 15px;
    overflow: hidden;
}

.abp-card-progress-fill {
    height: 100%;
    background: var(--abp-accent);
    width: 0%;
    transition: width 0.3s linear;
}

/* Status Badges */
.abp-badge {
    position: absolute;
    top: 30px;
    right: 30px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.abp-badge.listened {
    background: var(--abp-toggle);
}

.abp-badge.new {
    background: var(--abp-accent);
}

/* Play Button on Card */
.abp-card-play {
    background: transparent !important;
    border: 2px solid var(--abp-accent) !important;
    color: var(--abp-accent) !important;
    padding: 10px 0;
    width: 100%;
    border-radius: 20px;
    font-family: var(--abp-font-body);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.95rem;
    text-decoration: none !important;
}

.abp-card-play i {
    color: inherit !important;
}

.abp-card-play:hover,
.abp-card-play:focus,
.abp-card-play:active,
.abp-card-play:hover i,
.abp-card-play:focus i,
.abp-card-play:active i {
    background: var(--abp-accent) !important;
    color: #fff !important;
}

/* ─── Copyright Disclaimer ─── */
.abp-copyright {
    margin-top: 30px;
    padding: 16px 20px;
    background: rgba(90, 74, 66, 0.06);
    border-left: 4px solid var(--abp-accent);
    border-radius: 0 var(--abp-radius) var(--abp-radius) 0;
    font-size: 0.85rem;
    color: var(--abp-text-muted);
    display: flex;
    align-items: flex-start;
    gap: 10px;
    flex-wrap: wrap;
    line-height: 1.6;
}

.abp-copyright i {
    margin-top: 3px;
    color: var(--abp-accent);
    font-size: 1rem;
}

.abp-copyright a {
    color: var(--abp-accent);
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.abp-copyright a:hover {
    text-decoration: underline;
}

/* ═══════════════════════════════════════════
   MINI PLAYER (Sticky Bottom)
   ═══════════════════════════════════════════ */
.abp-mini-player {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: #fff;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    padding: 10px 20px;
    box-sizing: border-box;
    z-index: 9999;
    transform: translateY(100%);
    transition: transform 0.3s ease-out;
    cursor: pointer;
}

.abp-mini-player.visible {
    transform: translateY(0);
}

.abp-mp-progress-wrap {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: #eee;
}

.abp-mp-progress {
    height: 100%;
    background: var(--abp-accent);
    width: 0%;
    transition: width 0.3s linear;
}

.abp-mp-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 15px;
    overflow: hidden;
}

.abp-mp-img {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    object-fit: cover;
    background: #eee;
}

.abp-mp-text {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    white-space: nowrap;
}

.abp-mp-title {
    font-weight: 600;
    font-size: 0.95rem;
    text-overflow: ellipsis;
    overflow: hidden;
}

.abp-mp-subtitle {
    font-size: 0.8rem;
    color: var(--abp-text-muted);
}

.abp-mp-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.abp-mp-btn {
    background: none;
    border: none;
    font-size: 1.4rem;
    color: var(--abp-text);
    cursor: pointer;
    padding: 5px;
    transition: color 0.2s;
}

.abp-mp-btn i,
.abp-mp-btn svg {
    color: inherit !important;
    fill: inherit !important;
}

.abp-mp-btn:hover,
.abp-mp-btn:focus,
.abp-mp-btn:active,
.abp-mp-btn:hover i,
.abp-mp-btn:focus i,
.abp-mp-btn:active i,
.abp-mp-btn:hover svg,
.abp-mp-btn:focus svg,
.abp-mp-btn:active svg {
    color: var(--abp-accent) !important;
    fill: var(--abp-accent) !important;
    background: transparent !important;
}

.abp-mp-btn.abp-play-pause {
    font-size: 1.8rem;
    color: var(--abp-accent) !important;
}

/* ═══════════════════════════════════════════
   FULL PLAYER OVERLAY (Glassmorphism)
   ═══════════════════════════════════════════ */
.abp-full-player {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #111;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.35s ease;
    overflow: hidden;
}

.abp-full-player.visible {
    transform: translateY(0);
}

.abp-fp-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
    opacity: 0.95;
}

.abp-fp-top-gradient {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 120px;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.5) 0%, transparent 100%);
    z-index: 2;
    pointer-events: none;
}

.abp-fp-header {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-sizing: border-box;
    z-index: 5;
}

.abp-fp-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 10px;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.abp-fp-header-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Glass content */
.abp-fp-content {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 100px 20px 40px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 5;
    color: #333;
}

.abp-fp-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.7) 40%, rgba(255, 255, 255, 0.98) 100%);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 30%);
    mask-image: linear-gradient(to bottom, transparent 0%, black 30%);
    z-index: -1;
    pointer-events: none;
}

.abp-fp-title {
    font-family: var(--abp-font-heading);
    font-size: 1.6rem;
    text-align: center;
    margin: 0 0 8px;
    color: #333;
    line-height: 1.3;
}

.abp-fp-subtitle {
    color: var(--abp-text-muted);
    font-size: 0.95rem;
    margin: 0 0 10px;
}

.abp-fp-controls-wrap {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    padding: 20px 0;
}

.abp-fp-progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
    overflow: hidden;
    cursor: pointer;
}

.abp-fp-progress {
    height: 100%;
    background: var(--abp-accent);
    width: 0%;
    transition: width 0.3s linear;
}

.abp-fp-times {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--abp-text-muted);
    font-weight: 600;
    margin-top: 4px;
}

.abp-fp-buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 40px;
    margin-top: 36px;
}

.abp-fp-btn {
    background: none;
    border: none;
    font-size: 1.8rem;
    color: var(--abp-text);
    cursor: pointer;
    padding: 5px;
    transition: color 0.2s;
}

.abp-fp-btn i,
.abp-fp-btn svg {
    color: inherit !important;
    fill: inherit !important;
}

.abp-fp-btn:hover,
.abp-fp-btn:focus,
.abp-fp-btn:active,
.abp-fp-btn:hover i,
.abp-fp-btn:focus i,
.abp-fp-btn:active i,
.abp-fp-btn:hover svg,
.abp-fp-btn:focus svg,
.abp-fp-btn:active svg {
    color: var(--abp-accent) !important;
    fill: var(--abp-accent) !important;
    background: transparent !important;
}

.abp-fp-btn.abp-fp-play-pause {
    font-size: 4.5rem;
    color: var(--abp-accent) !important;
}

/* Copyright inside full player */
.abp-fp-copyright {
    margin-top: 30px;
    font-size: 0.75rem;
    color: var(--abp-text-muted);
    text-align: center;
    line-height: 1.4;
}

.abp-fp-copyright i {
    margin-right: 4px;
    color: var(--abp-accent);
}

/* ═══════════════════════════════════════════
   TAB TOGGLE SECTIONS
   ═══════════════════════════════════════════ */
.abp-tab-content {
    animation: abpFadeIn 0.3s ease;
}

@keyframes abpFadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ═══════════════════════════════════════════
   TEXT STORIES (Tekstinės Istorijos)
   ═══════════════════════════════════════════ */

/* ═══════════════════════════════════════════
   TEXT STORIES (matching existing StraipsniaiCarousel)
   ═══════════════════════════════════════════ */

/* ── Special intro/outro cards ── */
.abp-ts-special {
    display: flex;
    align-items: stretch;
    border-radius: 10px;
    padding: 24px 30px;
    margin-bottom: 24px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    gap: 30px;
}

.abp-ts-outro {
    margin-top: 24px;
    margin-bottom: 0;
}

.abp-ts-special-label {
    font-family: var(--abp-font-heading);
    font-size: 1.8rem;
    color: var(--abp-accent, #f56342);
    font-style: italic;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 160px;
    flex-shrink: 0;
}

.abp-ts-special-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.abp-ts-special-excerpt {
    font-size: 0.95rem;
    color: #666;
    line-height: 1.6;
    margin: 0 0 16px;
}

.abp-ts-special-btn {
    display: inline-block;
    background: transparent !important;
    border: 2px solid var(--abp-accent, #f56342) !important;
    color: var(--abp-accent, #f56342) !important;
    padding: 8px 24px;
    border-radius: 5px;
    font-family: var(--abp-font-body);
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none !important;
    transition: all 0.3s;
    text-align: center;
}

.abp-ts-special-btn:hover,
.abp-ts-special-btn:focus,
.abp-ts-special-btn:active {
    background: var(--abp-accent, #f56342) !important;
    color: #fff !important;
}

/* ── Grid of remaining text stories ── */
.abp-text-grid-wrap {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.abp-ts-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background-color: #f9f9f9;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 20px;
    text-align: center;
    height: 100%;
}

.abp-ts-title {
    font-family: var(--abp-font-heading);
    font-size: 1.05rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #333;
    margin: 0 0 10px;
}

.abp-ts-excerpt {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 20px;
    flex-grow: 1;
    line-height: 1.5;
}

.abp-ts-btn {
    display: block;
    background: transparent !important;
    border: 2px solid var(--abp-accent, #f56342) !important;
    color: var(--abp-accent, #f56342) !important;
    padding: 8px 24px;
    border-radius: 5px;
    font-family: var(--abp-font-body);
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none !important;
    transition: all 0.3s;
    margin-top: auto;
    height: 40px;
    line-height: 22px;
    text-align: center;
}

.abp-ts-btn:hover,
.abp-ts-btn:focus,
.abp-ts-btn:active {
    background: var(--abp-accent, #f56342) !important;
    color: #fff !important;
}

/* ═══════════════════════════════════════════
   PAGINATION
   ═══════════════════════════════════════════ */
.abp-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-top: 24px;
    padding: 10px 0;
}

.abp-page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    border: 1px solid #ddd !important;
    border-radius: 4px;
    background: #fff !important;
    color: #333 !important;
    font-family: var(--abp-font-body);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none !important;
}

.abp-page-btn:hover,
.abp-page-btn:focus,
.abp-page-btn:active {
    border-color: var(--abp-accent, #f56342) !important;
    color: var(--abp-accent, #f56342) !important;
}

.abp-page-btn.active {
    background: var(--abp-accent, #f56342) !important;
    border-color: var(--abp-accent, #f56342) !important;
    color: #fff !important;
}

.abp-page-btn.dots {
    border: none;
    background: none;
    cursor: default;
    color: #999;
}

/* ═══════════════════════════════════════════
   RESPONSIVE (Mobile-First)
   ═══════════════════════════════════════════ */
@media (max-width: 600px) {
    .abp-section-title {
        font-size: 1.8rem;
    }

    .abp-toggle-btn {
        padding: 8px 16px;
        font-size: 0.9rem;
    }

    .abp-grid {
        grid-template-columns: 1fr;
    }

    .abp-mp-text {
        max-width: 150px;
    }

    .abp-fp-title {
        font-size: 1.35rem;
    }

    .abp-actions-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .abp-filter-btn {
        justify-content: center;
    }

    .abp-text-grid-wrap {
        grid-template-columns: 1fr;
    }

    .abp-ts-special {
        flex-direction: column;
        text-align: center;
        padding: 20px;
        gap: 16px;
    }

    .abp-ts-special-label {
        min-width: auto;
        font-size: 1.4rem;
    }
}