/* File: static/css/sermon_player.css */
/* Sermon player and shared sermon card styles */
/* Version: 2.0.0 */
/* Last Modified: 2026-02-17 */
/* Change: SVG controls styling, draggable progress bar, desktop responsive centering */

/* ── Sermon Cards ──────────────────────────────────────────────────── */

.sermon-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #ffffff;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 10px;
    border: 1px solid #dee2e6;
    cursor: pointer;
    transition: box-shadow 0.15s ease;
    color: inherit;
}

.sermon-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.sermon-thumb {
    width: 56px;
    height: 56px;
    background: #e8f5e9;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #1a5f3c;
}

.sermon-info {
    flex: 1;
    min-width: 0;
}

.sermon-title {
    font-size: 15px;
    font-weight: 600;
    color: #212529;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sermon-meta {
    font-size: 13px;
    color: #6c757d;
    margin-top: 3px;
}

.sermon-category-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 6px;
    margin-top: 4px;
}

.sermon-stats {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: #adb5bd;
    margin-top: 4px;
}

/* ── Loading Skeleton ──────────────────────────────────────────────── */

.sermon-skeleton {
    pointer-events: none;
}

.skeleton-shimmer {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 6px;
}

.skeleton-line {
    height: 14px;
    margin-bottom: 8px;
}

.sermon-skeleton .sermon-thumb {
    background: none;
}

.sermon-skeleton .sermon-thumb.skeleton-shimmer {
    width: 56px;
    height: 56px;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ── Empty State ───────────────────────────────────────────────────── */

.sermon-empty {
    text-align: center;
    padding: 48px 24px;
    color: #6c757d;
}

.sermon-empty svg {
    margin-bottom: 16px;
}

.sermon-empty p {
    font-size: 15px;
    margin: 0;
}

.retry-btn {
    margin-top: 16px;
    padding: 8px 24px;
    background: #1a5f3c;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.retry-btn:hover {
    background: #155a34;
}

/* ── Sermon Player ─────────────────────────────────────────────────── */

.sermon-player {
    background: #ffffff;
    border-radius: 16px;
    padding: 20px;
    border: 1px solid #dee2e6;
    margin-bottom: 20px;
}

/* Subtitle area - fixed height to prevent controls from shifting */
.sp-subtitle-area {
    height: 240px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 18px;
    line-height: 1.75;
    color: #212529;
    padding: 0 24px;
    background: #f1f3f5;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    margin-bottom: 16px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.06);
    transition: font-size 0.25s ease;
    overflow-y: auto;
}

/* Progress bar */
.sp-progress-wrap {
    width: 100%;
    height: 6px;
    background: #e9ecef;
    border-radius: 3px;
    cursor: pointer;
    margin-bottom: 8px;
    position: relative;
    transition: height 0.15s ease;
    touch-action: none;
}

.sp-progress-wrap.sp-progress-dragging {
    height: 10px;
}

.sp-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #1a5f3c, #2e7d52);
    border-radius: 3px;
    width: 0%;
    position: relative;
    transition: none;
}

.sp-progress-wrap.sp-progress-dragging .sp-progress-bar::after {
    content: '';
    position: absolute;
    right: -7px;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    background: #1a5f3c;
    border-radius: 50%;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

/* Time display */
.sp-time-row {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #6c757d;
    margin-bottom: 16px;
}

/* Controls */
.sp-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    margin-bottom: 12px;
}

.sp-control-btn {
    width: 48px;
    height: 48px;
    border: none;
    background: transparent;
    font-size: 24px;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, transform 0.1s ease;
    color: #495057;
}

.sp-control-btn svg {
    width: 22px;
    height: 22px;
}

.sp-control-btn:active {
    transform: scale(0.93);
}

.sp-control-btn:hover {
    background: #e8f5e9;
    color: #1a5f3c;
}

.sp-control-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

#sp-play-btn {
    width: 64px;
    height: 64px;
    background: #1a5f3c;
    color: #ffffff;
    font-size: 24px;
    box-shadow: 0 4px 16px rgba(26,95,60,0.35);
    transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}

#sp-play-btn:hover {
    background: #155a34;
    box-shadow: 0 6px 20px rgba(26,95,60,0.4);
}

#sp-play-btn:active {
    transform: scale(0.95);
}

#sp-play-btn:disabled {
    background: #adb5bd;
}

/* ── Player Settings (speed, font size) ────────────────────────────── */

.sp-settings-card {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 14px 16px;
    margin-top: 16px;
}

.sp-settings-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.sp-setting-group {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.sp-setting-label {
    font-size: 12px;
    color: #6c757d;
    margin-right: 4px;
    font-weight: 500;
}

.sp-setting-btn {
    padding: 5px 10px;
    border-radius: 14px;
    font-size: 12px;
    border: 1px solid #dee2e6;
    background: #ffffff;
    color: #495057;
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1.4;
    text-align: center;
}

.sp-setting-btn:hover {
    border-color: #1a5f3c;
    color: #1a5f3c;
    background: #f0faf4;
}

.sp-setting-btn.active {
    background: #1a5f3c;
    color: #ffffff;
    border-color: #1a5f3c;
    box-shadow: 0 2px 6px rgba(26,95,60,0.3);
    transform: scale(1.05);
}

/* ── Language Selector (used on detail page) ───────────────────────── */

.language-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 8px;
    margin-bottom: 20px;
}

.language-btn {
    padding: 10px 16px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    color: #212529;
    cursor: pointer;
    text-align: center;
    transition: all 0.15s ease;
}

.language-btn:hover {
    border-color: #1a5f3c;
    color: #1a5f3c;
}

.language-btn.active {
    background: #1a5f3c;
    border-color: #1a5f3c;
    color: #ffffff;
}

/* ── Filter Tabs ───────────────────────────────────────────────────── */

.sermon-filter-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.sermon-filter-tab {
    padding: 8px 16px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    color: #6c757d;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s ease;
}

.sermon-filter-tab:hover {
    border-color: #1a5f3c;
    color: #1a5f3c;
}

.sermon-filter-tab.active {
    background: #1a5f3c;
    border-color: #1a5f3c;
    color: #ffffff;
}

/* ── Scroll Sentinel (infinite scroll) ─────────────────────────────── */

.scroll-sentinel {
    height: 1px;
    visibility: hidden;
}

/* ── Mosque Info Row (sermon detail page) ─────────────────────────── */

.mosque-info-row {
    padding: 10px 20px;
    background: #f8faf8;
    border-bottom: 1px solid #e9ecef;
}

.mosque-link {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: inherit;
    transition: opacity 0.15s ease;
}

.mosque-link:hover {
    opacity: 0.8;
}

.mosque-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.mosque-name-en {
    font-weight: 600;
    font-size: 14px;
    color: #1a5f3c;
}

.mosque-name-ar {
    font-size: 13px;
    color: #666;
}

.mosque-arrow {
    color: #999;
    margin-left: auto;
    transition: transform 0.15s ease;
}

.mosque-link:hover .mosque-arrow {
    transform: translateX(2px);
}

/* ── Responsive ────────────────────────────────────────────────────── */

@media (max-width: 480px) {
    .sermon-player {
        padding: 16px;
        border-radius: 12px;
    }

    .sp-subtitle-area {
        font-size: 16px;
        height: 210px;
        padding: 0 16px;
    }

    .sp-controls {
        gap: 16px;
    }

    .language-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .sp-settings-card {
        padding: 12px;
    }

    .sp-settings-row {
        flex-direction: column;
        gap: 8px;
    }

    .mosque-info-row {
        padding: 8px 16px;
    }

    .mosque-name-en {
        font-size: 13px;
    }

    .mosque-name-ar {
        font-size: 12px;
    }
}


