/* data-analysis.css */

/* Ensure images in cards cover the square area without distortion */
.ratio {
    position: relative;
    width: 100%;
    padding-bottom: 100%; /* 1:1 ratio */
    height: 0;
}
.ratio img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Optional: hover effect on cards */
.card:hover {
    transform: translateY(-5px);
    transition: transform 0.2s ease-in-out;
}

.card {
    border-radius: 14px;
}

.card-header {
    background: linear-gradient(120deg, rgba(78,121,167,0.08), rgba(118,183,178,0.08));
    border-bottom: 1px solid rgba(0,0,0,0.06);
}

.bg-light-subtle {
    background: linear-gradient(180deg, #f8fbff 0%, #f7f7fa 100%);
}

.fs-4.fw-bold {
    letter-spacing: 0.2px;
}

/* Make sure the navbar brand image doesn't distort */
.navbar-brand img {
    height: 24px;
    width: auto;
}

.category-card {
    border: 1px solid rgba(148, 163, 184, 0.22);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.category-cover {
    background:
        radial-gradient(circle at 16% 16%, rgba(148, 163, 184, 0.18) 0%, rgba(148, 163, 184, 0) 42%),
        linear-gradient(180deg, #f9fbff 0%, #f3f6fb 100%);
}

.category-cover-img {
    transition: transform 0.25s ease;
}

.category-card:hover .category-cover-img {
    transform: scale(1.015);
}

.category-card:hover {
    box-shadow: var(--card-hover, 0 22px 50px rgba(15, 23, 42, 0.14));
    border-color: rgba(59, 130, 246, 0.24);
}

.homepage-category-card .card-body {
    padding: 1.15rem;
}

.homepage-category-card .card-title {
    font-size: 1rem;
    line-height: 1.3;
}

.homepage-category-card .card-text {
    color: var(--text-soft, #475569);
}

.topic-tier-card .card-body,
.report-preview-card .card-body,
.product-card-premium .card-body {
    padding: 1.2rem;
}

.topic-tier-card h4,
.report-preview-card h5,
.product-card-premium h5 {
    line-height: 1.25;
}

.topic-tier-card .topic-copy,
.report-preview-card .report-copy,
.product-card-premium .product-copy {
    color: var(--text-soft, #475569);
    font-size: 0.93rem;
}

.report-filter-shell {
    padding: 0.85rem;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(241, 245, 249, 0.95), rgba(248, 250, 252, 0.98));
    border: 1px solid rgba(148, 163, 184, 0.18);
}

html[data-theme="dark"] .report-filter-shell {
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.88), rgba(17, 24, 39, 0.94));
    border-color: rgba(148, 163, 184, 0.18);
}

.report-catalog-grid .card {
    border-radius: 20px;
}

.topic-shell-hero {
    border-radius: 24px;
    overflow: hidden;
}

.topic-shell-section {
    border-radius: 20px;
    padding: 1.15rem;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: var(--panel-bg);
    box-shadow: var(--card-raise, 0 18px 40px rgba(15, 23, 42, 0.1));
}

.topic-shell-section + .topic-shell-section {
    margin-top: 1rem;
}

.topic-shell-lead {
    max-width: 52rem;
}

.topic-shell-note {
    padding: 0.85rem 1rem;
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(239, 246, 255, 0.88), rgba(248, 250, 252, 0.96));
    border: 1px solid rgba(148, 163, 184, 0.16);
}

.topic-cta-footer {
    border-radius: 22px;
    padding: 1.2rem;
    background: linear-gradient(135deg, rgba(30, 64, 175, 0.08), rgba(245, 158, 11, 0.08));
    border: 1px solid rgba(59, 130, 246, 0.18);
    box-shadow: var(--card-raise, 0 18px 40px rgba(15, 23, 42, 0.1));
}

.topic-cta-footer h4,
.topic-cta-footer h5 {
    margin-bottom: 0.45rem;
}

.topic-faq .accordion-item {
    border-radius: 16px !important;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.18) !important;
    box-shadow: var(--panel-shadow);
}

.topic-faq .accordion-button {
    font-weight: 600;
}

.topic-faq .accordion-button:not(.collapsed) {
    background: rgba(59, 130, 246, 0.08);
    color: var(--section-title, #0f172a);
}

html[data-theme="dark"] .topic-shell-note {
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.88), rgba(17, 24, 39, 0.94));
    border-color: rgba(148, 163, 184, 0.16);
}

html[data-theme="dark"] .topic-cta-footer {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.88), rgba(30, 41, 59, 0.94));
    border-color: rgba(96, 165, 250, 0.16);
}

html[data-theme="dark"] .topic-faq .accordion-button:not(.collapsed) {
    background: rgba(30, 64, 175, 0.18);
    color: #eff6ff;
}

html[data-theme="dark"] .category-card {
    border-color: rgba(148, 163, 184, 0.2);
    box-shadow: 0 12px 28px rgba(2, 6, 23, 0.42);
}

html[data-theme="dark"] .category-cover {
    background:
        radial-gradient(circle at 16% 16%, rgba(100, 116, 139, 0.22) 0%, rgba(100, 116, 139, 0) 42%),
        linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
}

.page-title-row,
.group-title-row,
.status-badges-row {
    gap: 0.5rem;
}

.exploration-guide .explore-link {
    text-decoration: none;
    color: #1d4ed8;
    line-height: 1.45;
}

.exploration-guide .explore-link:hover {
    text-decoration: underline;
    color: #1e40af;
}

.tiny {
    font-size: 0.74rem;
}

html[data-theme="dark"] .exploration-guide .explore-link {
    color: #93c5fd;
}

html[data-theme="dark"] .exploration-guide .explore-link:hover {
    color: #bfdbfe;
}

@media (max-width: 767.98px) {
    .page-main {
        padding-inline: 0.95rem;
    }

    .page-main h1 {
        font-size: 1.52rem;
        line-height: 1.23;
        letter-spacing: 0.01em;
    }

    .page-main .lead {
        font-size: 1.02rem;
        margin-bottom: 1.25rem;
        color: #4b5563;
    }

    .group-section {
        padding: 18px;
        border-radius: 16px;
        margin-bottom: 24px;
        border: 1px solid rgba(15, 23, 42, 0.09);
        background: rgba(255, 255, 255, 0.94);
    }

    .group-title-row {
        margin-bottom: 0.95rem !important;
    }

    .group-title-row h3 {
        font-size: 1.1rem;
        line-height: 1.3;
    }

    .group-section .row {
        --bs-gutter-x: 1.25rem;
        --bs-gutter-y: 1.25rem;
    }

    .group-section .row > .col {
        max-width: 30rem;
        margin-inline: auto;
    }

    .group-section .card {
        border-radius: 16px;
        overflow: hidden;
        border: 1px solid rgba(148, 163, 184, 0.28);
        box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
    }

    .group-section .card:hover {
        transform: none;
    }

    .group-section .ratio,
    .category-cover {
        padding-bottom: 70%;
        background: linear-gradient(180deg, #f9fbff 0%, #f3f6fb 100%);
    }

    .group-section .ratio .card-img-top,
    .category-cover-img {
        object-fit: contain !important;
        width: auto;
        height: auto;
        max-width: 78%;
        max-height: 78%;
        inset: 0;
        margin: auto;
        padding: 0;
        transform: scale(0.92);
        transform-origin: center;
    }

    .group-section .card .card-body {
        padding: 1rem;
        background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 0.98) 100%);
    }

    .group-section .card-title {
        font-size: 1.02rem;
        line-height: 1.3;
        color: #111827;
    }

    .group-section .card-text {
        font-size: 0.92rem;
        margin-top: 0.45rem;
        color: #4b5563;
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .page-title-row,
    .group-title-row {
        flex-direction: column;
        align-items: flex-start !important;
    }

    .status-badges-row {
        justify-content: flex-start !important;
        flex-wrap: wrap;
    }

    .status-badges-row .badge {
        font-size: 0.78rem;
        white-space: normal;
    }

    .page-title-row .badge,
    .group-title-row .badge {
        border-radius: 999px;
        padding: 0.4rem 0.7rem;
    }

    #map,
    #categoryMap {
        height: 420px !important;
    }

    html[data-theme="dark"] .page-main .lead {
        color: #9ca3af;
    }

    html[data-theme="dark"] .group-section {
        border-color: rgba(148, 163, 184, 0.22);
        background: rgba(17, 24, 39, 0.84);
    }

    html[data-theme="dark"] .group-section .card {
        border-color: rgba(148, 163, 184, 0.2);
        box-shadow: 0 10px 24px rgba(2, 6, 23, 0.38);
    }

    html[data-theme="dark"] .group-section .ratio {
        background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
    }

    html[data-theme="dark"] .category-cover {
        background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
    }

    html[data-theme="dark"] .group-section .card .card-body {
        background: linear-gradient(180deg, rgba(15, 23, 42, 0.98) 0%, rgba(17, 24, 39, 0.98) 100%);
    }

    html[data-theme="dark"] .group-section .card-title {
        color: #e5e7eb;
    }

    html[data-theme="dark"] .group-section .card-text {
        color: #9ca3af;
    }
}
