/* Basalt App Extensions & Seamless Vietnamese + Admin/CTV Compatibility */
:root {
    --bs-body-font-family: "Schibsted Grotesk", "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* Smooth page wrapper mapping for legacy admin/ctv views */
.page-body,
.pc-container {
    width: 100%;
    padding: 0;
}
.pc-content {
    width: 100%;
}
.page-title {
    margin-bottom: 1.25rem;
}
.page-title h3,
.page-title h4 {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0;
}

/* Basalt-consistent card & table refinements */
.basalt-stage .card {
    border-radius: var(--basalt-radius-lg, 14px);
    border: 1px solid var(--basalt-edge, var(--bs-border-color));
    background: var(--basalt-plane, var(--bs-body-bg));
    box-shadow: var(--basalt-shadow-xs, 0 1px 2px rgba(0, 0, 0, .03));
    margin-bottom: 1.25rem;
}
.basalt-stage .card-header {
    background: transparent;
    border-bottom: 1px solid var(--basalt-edge, var(--bs-border-color));
    padding: 1rem 1.25rem;
}
.basalt-stage .card-header h4,
.basalt-stage .card-header h5 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0;
}
.basalt-stage .card-body {
    padding: 1.25rem;
}

/* Legacy badge & avatar compatibility */
.badge-light-primary, .bg-light-primary { background: var(--bs-primary-bg-subtle) !important; color: var(--bs-primary-text-emphasis) !important; }
.badge-light-success, .bg-light-success { background: var(--bs-success-bg-subtle) !important; color: var(--bs-success-text-emphasis) !important; }
.badge-light-warning, .bg-light-warning { background: var(--bs-warning-bg-subtle) !important; color: var(--bs-warning-text-emphasis) !important; }
.badge-light-danger,  .bg-light-danger  { background: var(--bs-danger-bg-subtle) !important;  color: var(--bs-danger-text-emphasis) !important; }
.badge-light-info,    .bg-light-info    { background: var(--bs-info-bg-subtle) !important;    color: var(--bs-info-text-emphasis) !important; }
.badge-light-secondary, .bg-light-secondary { background: var(--bs-secondary-bg-subtle) !important; color: var(--bs-secondary-text-emphasis) !important; }
.badge-success { background: var(--bs-success); color: #fff; }
.badge-danger  { background: var(--bs-danger);  color: #fff; }
.badge-warning { background: var(--bs-warning); color: #111; }
.badge-info    { background: var(--bs-info);    color: #fff; }
.badge-primary { background: var(--bs-primary); color: #fff; }
.badge-black   { background: var(--bs-dark);    color: #fff; }
.txt-primary, .font-primary { color: var(--bs-primary) !important; }
.txt-success, .font-success { color: var(--bs-success) !important; }
.txt-danger,  .font-danger  { color: var(--bs-danger) !important; }
.f-light { color: var(--bs-secondary-color); }

.avtar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
}
.avtar-s { width: 34px; height: 34px; }
.avtar-l { width: 48px; height: 48px; font-size: 1.25rem; }
.avtar-xl { width: 64px; height: 64px; font-size: 1.75rem; }
.wid-45 { width: 45px; height: 45px; object-fit: cover; }
.wid-80 { width: 80px; height: 80px; object-fit: cover; }

/* Template catalog cards (Basalt storefront style) */
.tpl-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.tpl-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--basalt-shadow-md, 0 10px 28px rgba(15, 23, 42, .08));
    border-color: var(--bs-primary);
}
.tpl-thumb {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: var(--bs-tertiary-bg);
}
.tpl-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .35s ease;
}
.tpl-card:hover .tpl-thumb img {
    transform: scale(1.04);
}
.tpl-ribbon {
    position: absolute;
    top: .75rem;
    right: .75rem;
    z-index: 2;
}
.tpl-price {
    font-family: "Chivo Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--bs-primary);
}
.tpl-price del {
    font-size: .8rem;
    color: var(--bs-secondary-color);
    font-weight: 400;
    margin-left: .35rem;
}

/* Landing page hero & section styling aligned to Basalt Dusk palette */
.basalt-landing-nav {
    position: sticky;
    top: 0;
    z-index: 1030;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    background: color-mix(in srgb, var(--basalt-plane, var(--bs-body-bg)) 86%, transparent);
    border-bottom: 1px solid var(--basalt-edge, var(--bs-border-color));
}
.basalt-landing-hero {
    position: relative;
    padding: 4.5rem 0 3.5rem;
    overflow: hidden;
    background:
        radial-gradient(60% 60% at 15% 0%, color-mix(in srgb, var(--bs-primary) 16%, transparent) 0%, transparent 70%),
        radial-gradient(50% 50% at 85% 15%, color-mix(in srgb, var(--basalt-series-2, #ec4899) 12%, transparent) 0%, transparent 70%);
}
.basalt-hero-title {
    font-size: clamp(2rem, 4.2vw, 3.25rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.12;
}
.basalt-mono {
    font-family: "Chivo Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* AI Chat bubble polish */
.ai-chat-stream {
    height: 380px;
    overflow-y: auto;
    padding: 1rem;
    background: var(--bs-tertiary-bg);
}
.ai-bubble {
    max-width: 85%;
    padding: .65rem .9rem;
    border-radius: 12px;
    font-size: .92rem;
    line-height: 1.45;
    word-break: break-word;
}
.ai-bubble-bot {
    background: var(--basalt-plane, var(--bs-body-bg));
    border: 1px solid var(--basalt-edge, var(--bs-border-color));
}
.ai-bubble-user {
    background: var(--bs-primary);
    color: #fff;
}

/* DataTables & Dark Mode polish */
[data-bs-theme="dark"] .dataTables_wrapper .dataTables_length,
[data-bs-theme="dark"] .dataTables_wrapper .dataTables_filter,
[data-bs-theme="dark"] .dataTables_wrapper .dataTables_info,
[data-bs-theme="dark"] .dataTables_wrapper .dataTables_paginate {
    color: var(--bs-body-color);
}
[data-bs-theme="dark"] .swal2-popup {
    background: var(--basalt-plane, #14102a) !important;
    color: var(--bs-body-color) !important;
}

/* Code blocks in API docs */
.api-endpoint-pill {
    font-family: "Chivo Mono", ui-monospace, monospace;
    font-size: .875rem;
    padding: .25rem .6rem;
    border-radius: 6px;
    background: var(--bs-primary-bg-subtle);
    color: var(--bs-primary-text-emphasis);
}
.response-area {
    max-height: 360px;
    overflow-y: auto;
    background: #14102a;
    color: #e2e8f0;
    border-radius: 10px;
    padding: .85rem 1rem;
    display: none;
    margin-top: 1rem;
}
.response-area pre { margin: 0; background: transparent; }
.response-area code { white-space: pre-wrap; word-break: break-word; }

/* Prose readability for blog & legal pages */
.basalt-prose {
    font-size: 1rem;
    line-height: 1.75;
    color: var(--bs-body-color);
}
.basalt-prose img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    margin: 1rem 0;
}
.basalt-prose h2, .basalt-prose h3 {
    margin-top: 1.75rem;
    margin-bottom: .75rem;
    font-weight: 700;
}
