/* === Base Search Styles ===
   Used by both index.html and public.html
   =============================== */

/* --- Base --- */
body {
    background-color: #f0f2f5;
}

/* --- Brand lockup --- */
.brand-header-center {
    text-align: center;
    padding: 0 20px;
}

.brand-header-wrapper {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    margin: 60px auto 32px;
}

.main-brand-logo {
    width: 300px;
    flex-shrink: 0;
}

.brand-text-block {
    border-left: 3px solid #dee2e6;
    padding-left: 1.5rem;
    margin-left: 1.5rem;
}

.brand-main-title {
    color: #140197;
    font-size: 3rem;
    font-weight: 800;
    line-height: 0.85;
    margin: 0;
    display: block;
}

.brand-sub-title {
    color: #4285f4;
    font-size: 1.4rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: 0;
    display: block;
}

/* --- Search container --- */
.search-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px 60px;
}

/* public.html uses fluid layout inside an iframe */
.search-container--fluid {
    max-width: 100%;
    padding: 0 20px 40px;
    margin: 0;
}

/* --- Primary button accent --- */
.btn-primary {
    background-color: #140197;
    border-color: #140197;
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: #0f0179;
    border-color: #0f0179;
}

/* --- Filters card --- */
.filters-card {
    background-color: #ffffff;
    border: none;
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

/* --- Result cards --- */
.result-card {
    background-color: #ffffff;
    border: none;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04), 0 6px 20px rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.result-card .card-body {
    padding: 20px 24px;
}

.result-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.07), 0 12px 32px rgba(0, 0, 0, 0.09);
    transform: translateY(-2px);
}

/* --- Media Object layout --- */
.result-media {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 16px;
    align-items: start;
}

.yt-compact {
    width: 220px;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
}

.result-info {
    min-width: 0;
}

.result-title {
    color: #140197;
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.35;
    margin-bottom: 6px;
    text-transform: uppercase;
}

.result-meta {
    font-size: 0.83rem;
    color: #6c757d;
    margin-bottom: 8px;
    letter-spacing: 0.01em;
}

/* --- Type badges --- */
.badge {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 20px;
    letter-spacing: 0.02em;
}

.badge-servicio-dominical {
    background-color: #dbeafe;
    color: #1d4ed8;
}

.badge-estudio-biblico {
    background-color: #ffedd5;
    color: #c2410c;
}

.badge-remanente {
    background-color: #dcfce7;
    color: #15803d;
}

.badge-seminario {
    background-color: #fef9c3;
    color: #a16207;
}

.badge-preguntas {
    background-color: #f3e8ff;
    color: #7e22ce;
}

.badge-otro {
    background-color: #f1f5f9;
    color: #475569;
}

/* --- Timestamp pill buttons --- */
.ts-link {
    display: inline-flex;
    align-items: center;
    background-color: #eef2ff;
    color: #3730a3;
    font-weight: 600;
    font-size: 0.72rem;
    font-variant-numeric: tabular-nums;
    padding: 2px 8px;
    border-radius: 6px;
    border: 1px solid #c7d2fe;
    text-decoration: none;
    line-height: 1.5;
    letter-spacing: 0.02em;
    transition: background-color 0.15s ease, border-color 0.15s ease;
    cursor: pointer;
    white-space: nowrap;
}

.ts-link:hover {
    background-color: #e0e7ff;
    border-color: #a5b4fc;
    color: #312e81;
}

/* --- Skeleton loading --- */
@keyframes shine {
    0% {
        background-position: -400px 0;
    }

    100% {
        background-position: 400px 0;
    }
}

.skeleton {
    background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
    background-size: 800px 100%;
    animation: shine 1.4s infinite linear;
    border-radius: 6px;
}

.skeleton-video {
    width: 220px;
    aspect-ratio: 16 / 9;
    border-radius: 10px;
}

.skeleton-line {
    height: 14px;
    border-radius: 4px;
    margin-bottom: 8px;
}

/* --- Search clear button --- */
.search-clear-btn {
    background-color: #ffffff;
    border-color: #ced4da;
    color: #9ca3af;
    font-size: 1.25rem;
    line-height: 1;
}

.search-clear-btn:hover,
.search-clear-btn:focus {
    background-color: #f8f9fa;
    border-color: #adb5bd;
    color: #6c757d;
}

/* --- Platform links on result cards --- */
.platform-links {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
    align-items: center;
}

/* Thin vertical rule between media group and document group */
.platform-links-separator {
    display: inline-block;
    width: 1px;
    height: 18px;
    background: #d1d5db;
    margin: 0 2px;
    flex-shrink: 0;
    align-self: center;
}

.platform-link-btn {
    display: inline-flex;
    align-items: center;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
    border: 1.5px solid currentColor;
    text-decoration: none;
    line-height: 1.4;
    transition: opacity 0.15s ease;
    white-space: nowrap;
}

.platform-link-btn:hover {
    opacity: 0.7;
    text-decoration: none;
}

.platform-link-youtube     { color: #CC0000; }
.platform-link-spotify     { color: #1DB954; }
.platform-link-apple       { color: #872EC4; }
.platform-link-amazon      { color: #00A8E1; }
.platform-link-soundcloud  { color: #FF5500; }
.platform-link-pdf-view    { color: #374151; }
.platform-link-pdf-download{ color: #0F766E; }
.platform-link-read-inline { color: #140197; }

/* --- Pagination --- */
.search-pagination {
    margin: 20px 0 8px;
}

.search-pagination .pagination {
    gap: 2px;
}

.search-pagination .page-link {
    border-radius: 8px !important;
    font-size: 0.82rem;
    font-weight: 500;
    color: #374151;
    border-color: #e5e7eb;
    padding: 5px 10px;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
    white-space: nowrap;
}

.search-pagination .page-item.active .page-link {
    background-color: #140197;
    border-color: #140197;
    color: #ffffff;
    font-weight: 700;
}

.search-pagination .page-item.disabled .page-link {
    color: #adb5bd;
    border-color: #e5e7eb;
    background: transparent;
}

.search-pagination .page-link:hover:not(:disabled) {
    background-color: #eef2ff;
    border-color: #c7d2fe;
    color: #140197;
}

.pagination-mobile-label {
    font-size: 0.82rem;
    font-weight: 500;
    color: #6c757d;
    border-color: transparent !important;
    background: transparent !important;
    pointer-events: none;
}

/* --- Responsive --- */
@media (max-width: 576px) {
    .brand-header-wrapper {
        margin: 36px auto 24px;
    }

    .main-brand-logo {
        /*height: 65px;*/
    }

    .brand-text-block {
        padding-left: 1rem;
        margin-left: 1rem;
    }

    .brand-main-title {
        font-size: 2.2rem;
    }

    .brand-sub-title {
        font-size: 1rem;
    }

    .form-control-lg,
    .btn-lg {
        font-size: 1rem;
    }

    /* Hide separator when platform links wrap on small screens */
    .platform-links-separator {
        display: none;
    }
}

@media (max-width: 768px) {
    .result-media {
        grid-template-columns: 1fr;
    }

    .skeleton-video,
    .yt-compact {
        width: 100%;
        /*max-width: 260px;*/
    }

    .result-card .card-body {
        padding: 16px 18px;
    }
}


/**
 * Lectura Inline
 */
/* color defined with the other platform link colors above */

/* --- Modal header --- */
.inline-reader-header {
    background: #fafbff;
    border-bottom: 1px solid #e8eaf0;
    padding: 12px 20px;
}

.inline-reader-logo {
    height: 32px;
    width: auto;
    flex-shrink: 0;
    object-fit: contain;
}

/* --- Toolbar (search bar + nav buttons) --- */
.inline-reader-toolbar {
    padding: 0 0 12px;
    border-bottom: 1px solid #f0f2f5;
    margin-bottom: 16px;
    flex-shrink: 0;
}

.inline-reader-search .form-control {
    border-radius: 8px 0 0 8px;
    background-color: #f8f9fc;
}

.inline-reader-search .btn {
    border-radius: 0 8px 8px 0;
}

/* --- Transcript content area --- */
.inline-reader-content {
    max-height: 65vh;
    overflow-y: auto;
    white-space: normal;
    line-height: 1.85;
    font-size: 1.06rem;
    color: #1f2937;
    padding: 28px 36px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #fdfcfb;
    /* Centered reading column on desktop */
    max-width: 85ch;
    margin: 0 auto;
}

/* Modal title line-clamp */
#inlineReaderModalLabel {
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    white-space: normal;
    word-break: break-word;
}

/* --- Mobile fullscreen reader --- */
@media (max-width: 576px) {
    #inlineReaderModal .modal-dialog {
        width: 100vw !important;
        max-width: 100vw !important;
        height: 100dvh !important;
        margin: 0 !important;
    }

    #inlineReaderModal .modal-content {
        height: 100dvh !important;
        max-height: none !important;
        border-radius: 0 !important;
        display: flex;
        flex-direction: column;
    }

    #inlineReaderModal .modal-body {
        flex: 1;
        min-height: 0;
        overflow: hidden !important;
        display: flex;
        flex-direction: column;
        padding: 12px 14px;
    }

    .inline-reader-content {
        flex: 1;
        max-height: none !important;
        overflow-y: auto;
        padding: 14px 16px;
        font-size: 0.97rem;
        max-width: 100%;
        border-radius: 8px;
    }

    .inline-reader-logo {
        display: none;
    }

    #inlineReaderModalLabel {
        -webkit-line-clamp: 2;
        font-size: 0.95rem;
    }

    .inline-reader-header {
        padding: 10px 16px;
        flex-shrink: 0;
    }

    .inline-reader-toolbar {
        padding-bottom: 8px;
        margin-bottom: 10px;
    }

    .inline-reader-toolbar .input-group-sm .form-control,
    .inline-reader-toolbar .input-group-sm .btn {
        font-size: 0.85rem;
    }
}

/* --- Highlight marks --- */
.inline-reader-match {
    background: #fef3c7;
    color: #111827;
    padding: 1px 2px;
    border-radius: 3px;
    border-bottom: 2px solid #fcd34d;
    text-decoration: none;
}

.inline-reader-match-active {
    background: #fde68a;
    color: #111827;
    border-bottom: 2px solid #d97706;
    outline: 2px solid #d97706;
    outline-offset: 1px;
    border-radius: 3px;
}
