/* ----------------------- CSS Variables --------------------------- */

:root {
    --primary: #00448D;
    --primary-light: #0066cc;
    --primary-lighter: #0088ff;
    --secondary: #6c757d;
    --light: #f8f9fa;
    --dark: #343a40;
    --sidebar-width: 280px;
    --sidebar-collapsed-width: 60px;
    --navbar-height: 60px;
}

/* ----------------------- Fonts --------------------------- */
/* Fonts are now self-hosted in vendor/fonts/fonts.css */

/* ----------------------- Global Styles --------------------------- */

body {
    font-family: "Noto Sans", sans-serif !important;
    font-size: 14px !important;
    background-color: #ffffff;
    overflow-x: hidden;
}

.wrapper {
    display: flex;
    min-height: 100vh;
    flex-direction: column;
}

.card {
    border-radius: 12px !important;
    border: 1px solid #e2e8f0;
    box-shadow: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    background: white;
}

.card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.card-header {
    border-radius: 0 !important;
    background: #f8fafc;
    color: #0f172a;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #e2e8f0;
}

.card-header .card-title {
    font-weight: 600;
    font-size: 0.95rem;
    margin: 0;
    color: #0f172a;
}

.card-header .card-title i {
    color: var(--primary);
}

.card-primary .card-header {
    background: #f8fafc;
}

.card-body {
    padding: 1.25rem;
}

.card-body p {
    color: #64748b;
    line-height: 1.65;
    margin-bottom: 0.875rem;
    font-size: 0.9rem;
}

.card-body p:last-child {
    margin-bottom: 0;
}

/* Card with tabs */
.card-tabs .card-header {
    padding-bottom: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.card-tabs .card-header-tabs {
    margin-bottom: 0;
    border-bottom: none;
    margin-left: auto;
}

.card-tabs .card-header-tabs .nav-link {
    color: #64748b;
    border: none;
    border-radius: 6px;
    padding: 0.5rem 0.875rem;
    margin-left: 4px;
    transition: all 0.15s ease;
    font-size: 0.8rem;
    font-weight: 500;
    background: transparent;
}

.card-tabs .card-header-tabs .nav-link:hover {
    color: #334155;
    background: rgba(0, 0, 0, 0.04);
}

.card-tabs .card-header-tabs .nav-link.active {
    color: var(--primary);
    background: white;
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* ----------------------- Navbar --------------------------- */

.main-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--navbar-height);
    z-index: 1030;
    background: white;
    border-bottom: 1px solid rgba(0, 0, 0, 0.125);
    display: flex;
    align-items: center;
    padding: 0 1rem;
}

.navbar-title {
    font-size: 18px;
    margin: 0;
    font-family: 'Bellota Text', sans-serif;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--dark);
}

/* Sidebar toggle buttons */
.sidebar-toggle {
    color: var(--primary);
    font-size: 1.2rem;
    padding: 0.5rem;
    border: none;
    background: transparent;
    transition: all 0.2s ease;
}

.sidebar-toggle:hover {
    color: var(--primary-light);
    transform: scale(1.1);
}

/* ----------------------- Sidebar --------------------------- */

.main-sidebar {
    position: fixed;
    top: var(--navbar-height);
    left: 0;
    width: var(--sidebar-width);
    height: calc(100vh - var(--navbar-height));
    z-index: 1020;
    background: linear-gradient(180deg, #ffffff 0%, #f8f9fa 100%);
    border-right: 1px solid rgba(0, 0, 0, 0.08);
    overflow-y: auto;
    overflow-x: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.03);
}

/* Custom scrollbar for sidebar */
.main-sidebar::-webkit-scrollbar {
    width: 6px;
}

.main-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.main-sidebar::-webkit-scrollbar-thumb {
    background: rgba(0, 68, 141, 0.2);
    border-radius: 3px;
}

.main-sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 68, 141, 0.4);
}

.sidebar-collapsed .main-sidebar {
    width: var(--sidebar-collapsed-width);
}

.sidebar-collapsed .main-sidebar .nav-link p,
.sidebar-collapsed .main-sidebar .nav-header {
    opacity: 0;
    width: 0;
    overflow: hidden;
    transition: opacity 0.2s ease, width 0.2s ease;
}

.sidebar {
    padding: 0.75rem;
}

.nav-sidebar {
    flex-direction: column;
}

/* Sidebar collapse toggle button */
.sidebar-collapse-btn {
    position: fixed;
    top: calc(var(--navbar-height) + 12px);
    left: calc(var(--sidebar-width) - 14px);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: var(--primary);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    z-index: 1025;
    font-size: 0.75rem;
}

.sidebar-collapse-btn:hover {
    background: var(--primary);
    color: white;
}

.sidebar-collapse-btn i {
    transition: transform 0.3s ease;
}

.sidebar-collapsed .sidebar-collapse-btn {
    left: calc(var(--sidebar-collapsed-width) - 14px);
}

.sidebar-collapsed .sidebar-collapse-btn i {
    transform: rotate(180deg);
}

.nav-header {
    padding: 0.75rem 1rem 0.5rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #94a3b8;
    letter-spacing: 1px;
    margin-top: 0.75rem;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.nav-header:first-child {
    border-top: none;
    margin-top: 0;
}

.nav-sidebar .nav-item .nav-link {
    border-radius: 12px !important;
    margin: 4px 6px !important;
    padding: 11px 14px !important;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
    display: flex !important;
    align-items: center !important;
    color: #475569;
    font-weight: 500;
    font-size: 0.875rem;
    position: relative;
    overflow: hidden;
}

.nav-sidebar .nav-item .nav-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 0;
    background: var(--primary);
    border-radius: 0 3px 3px 0;
    transition: height 0.2s ease;
}

.nav-sidebar .nav-item .nav-link i,
.nav-sidebar .nav-item .nav-link .nav-icon {
    margin-right: 12px !important;
    width: 20px;
    text-align: center;
    color: var(--primary);
    font-size: 1rem;
    transition: all 0.2s ease;
}

.nav-sidebar .nav-item .nav-link p {
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-sidebar .nav-item .nav-link.active,
.nav-sidebar .nav-item .nav-link.active:hover {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%) !important;
    color: white !important;
    box-shadow: 0 4px 12px rgba(0, 68, 141, 0.3) !important;
    transform: translateX(2px);
}

.nav-sidebar .nav-item .nav-link.active::before {
    height: 60%;
    background: white;
}

.nav-sidebar .nav-item .nav-link.active i,
.nav-sidebar .nav-item .nav-link.active .nav-icon {
    color: white !important;
}

.nav-sidebar .nav-item .nav-link:not(.active):hover {
    background-color: rgba(0, 68, 141, 0.08) !important;
    color: var(--primary) !important;
    transform: translateX(4px);
}

.nav-sidebar .nav-item .nav-link:not(.active):hover::before {
    height: 40%;
}

/* ----------------------- Content Wrapper --------------------------- */

.content-wrapper {
    margin-left: var(--sidebar-width);
    margin-top: var(--navbar-height);
    padding: 1.5rem;
    min-height: calc(100vh - var(--navbar-height));
    background: #ffffff;
    transition: margin-left 0.3s ease;
    flex: 1;
}

.sidebar-collapsed .content-wrapper {
    margin-left: var(--sidebar-collapsed-width);
}

.content-section {
    display: none;
}

.content-section.active {
    display: block;
}

/* ----------------------- Nav Pills (Chart Tabs) --------------------------- */

.chart-tabs {
    margin-bottom: 1.25rem;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 6px;
    background: #f8fafc;
    border-radius: 12px;
    width: fit-content;
}

.chart-tabs .nav-item {
    margin: 0 !important;
}

.nav-pills .nav-item .nav-link,
.chart-tabs .nav-link {
    border-radius: 8px !important;
    margin: 0 !important;
    padding: 10px 18px !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px;
    color: #64748b;
    background: transparent;
    font-weight: 500;
    font-size: 0.85rem;
    border: none !important;
    white-space: nowrap;
}

.nav-pills .nav-item .nav-link i,
.nav-pills .nav-item .nav-link span.material-symbols-outlined,
.chart-tabs .nav-link i,
.chart-tabs .nav-link span.material-symbols-outlined {
    margin-right: 0 !important;
    font-size: 1rem;
    opacity: 0.8;
}

.nav-pills .nav-item .nav-link.active,
.nav-pills .nav-item .nav-link.active:hover,
.chart-tabs .nav-link.active,
.chart-tabs .nav-link.active:hover {
    background: white !important;
    color: var(--primary) !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06) !important;
}

.nav-pills .nav-item .nav-link.active i,
.nav-pills .nav-item .nav-link.active span.material-symbols-outlined,
.chart-tabs .nav-link.active i,
.chart-tabs .nav-link.active span.material-symbols-outlined {
    opacity: 1;
}

.nav-pills .nav-item .nav-link:not(.active):hover,
.chart-tabs .nav-link:not(.active):hover {
    background: rgba(255, 255, 255, 0.6) !important;
    color: #334155 !important;
}

/* ----------------------- Chart Container --------------------------- */

.chart-container {
    min-height: 700px;
    background: white;
    border-radius: 15px;
    padding: 1rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

/* ----------------------- Icons --------------------------- */

.material-symbols-outlined {
    vertical-align: middle;
    line-height: 1;
    font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24;
}

/* ----------------------- Home tab: Content Container --------------------------- */

.content-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem 3rem;
}

#about_section {
    padding-top: 0;
}

/* ----------------------- Home tab: jumbotron --------------------------- */

.jumbotron-container {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 28vh;
    padding: 2.5rem 1.5rem 1.5rem;
    margin-bottom: 0;
    text-align: center;
}

.jumbotron {
    background: transparent !important;
    padding: 1.5rem;
}

.jumbotron-title {
    font-family: 'Noto Sans', system-ui, -apple-system, sans-serif;
    color: #0f172a;
    font-weight: 600 !important;
    font-size: 2.5rem !important;
    letter-spacing: -0.035em !important;
    line-height: 1.15 !important;
}

.jumbotron-title .highlight {
    background: linear-gradient(135deg, var(--primary) 0%, #3b82f6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.jumbotron-title::after {
    display: none;
}

.jumbotron-lead {
    font-size: 1rem !important;
    color: #64748b;
    margin-top: 0.75rem;
    font-weight: 400;
    max-width: 500px;
}

/* ----------------------- Home tab: buttons --------------------------- */

.button-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-top: 1.5rem;
    margin-bottom: 2.5rem;
}

.start-exploring-btn {
    background: var(--primary);
    border: none;
    color: white;
    padding: 12px 24px;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 10px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.start-exploring-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 68, 141, 0.25);
    background: var(--primary-light);
    color: white;
}

.action-btn {
    background: white;
    border: 1px solid #e2e8f0;
    color: #334155;
    padding: 12px 24px;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 10px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.action-btn:hover {
    background: #f8fafc !important;
    border-color: #cbd5e1 !important;
    color: var(--primary) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.button-text {
    margin-right: 10px;
}

.btn-icon {
    width: 18px;
    height: 18px;
    margin-left: 8px;
    transition: all 0.3s ease;
}

.data-icon {
    width: 24px;
    height: 24px;
    margin-left: 10px;
}

.start-exploring-btn:hover .bar1 { animation: barRise 0.5s ease-out 0.1s forwards; }
.start-exploring-btn:hover .bar2 { animation: barRise 0.5s ease-out 0.2s forwards; }
.start-exploring-btn:hover .bar3 { animation: barRise 0.5s ease-out 0.3s forwards; }
.start-exploring-btn:hover .bar4 { animation: barRise 0.5s ease-out 0.4s forwards; }

@keyframes barRise {
    0% { transform: scaleY(1); }
    50% { transform: scaleY(0.7); }
    100% { transform: scaleY(1); }
}

/* About card buttons */
.about-btn {
    background: white !important;
    border: 1px solid #e2e8f0 !important;
    color: #334155 !important;
    padding: 8px 16px !important;
    font-size: 0.8rem !important;
    font-weight: 500 !important;
    border-radius: 8px !important;
    transition: all 0.15s ease !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04) !important;
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
}

.about-btn:hover {
    background: #f8fafc !important;
    border-color: #cbd5e1 !important;
    color: var(--primary) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06) !important;
}

.about-btn i {
    color: var(--primary);
    font-size: 0.85rem;
}

/* ----------------------- Home tab: user cards --------------------------- */

.widget-user {
    border-radius: 12px !important;
    border: 1px solid #e2e8f0 !important;
    overflow: hidden;
    transition: all 0.2s ease;
    box-shadow: none !important;
}

.widget-user:hover {
    border-color: #cbd5e1;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05) !important;
}

.widget-user-header {
    border-radius: 0 !important;
    background: #f8fafc !important;
    padding: 1.5rem 1rem 2rem;
    text-align: center;
    border-bottom: 1px solid #e2e8f0;
}

.widget-user-username {
    font-size: 0.95rem !important;
    font-weight: 600 !important;
    color: #0f172a !important;
    margin-bottom: 0.25rem;
}

.widget-user-desc {
    font-size: 0.75rem !important;
    color: #64748b !important;
    font-weight: 500;
}

.widget-user-image {
    position: relative;
    margin-top: -40px;
    text-align: center;
}

.widget-user-image img {
    width: 80px;
    height: 80px;
    border-radius: 50% !important;
    object-fit: cover;
    border: 3px solid white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.widget-user .card-footer {
    background: white;
    border-top: none;
    padding: 1rem;
    text-align: center;
}

.widget-user .card-footer p {
    font-size: 0.8rem;
    line-height: 1.5;
    color: #64748b;
}

.widget-user .card-footer a {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
}

.widget-user .card-footer a:hover {
    text-decoration: underline;
}

.team-bio-hidden {
    display: none;
}

/* Meet the team section header */
#meet_team_section h3 {
    color: var(--primary);
    font-weight: 700;
}

.img-circle {
    border-radius: 50% !important;
}

/* ----------------------- Info button inline --------------------------- */

.info-icon-inline {
    background-color: #e0e7ff;
    color: var(--primary);
    padding: 3px 6px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
}

.info-btn {
    border-radius: 8px !important;
    width: 34px;
    height: 34px;
    min-width: 34px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f1f5f9 !important;
    border: 1px solid #e2e8f0 !important;
    color: #64748b !important;
    box-shadow: none;
    transition: all 0.15s ease;
}

.info-btn:hover {
    background-color: #e2e8f0 !important;
    border-color: #cbd5e1 !important;
    color: var(--primary) !important;
    transform: none;
}

.info-btn i {
    font-size: 0.875rem;
}

/* ----------------------- Form Controls --------------------------- */

.question-picker-group {
    margin-bottom: 1.25rem;
}

.question-picker-group label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #1e293b;
    font-size: 0.85rem;
    letter-spacing: 0.01em;
}

/* Tom Select Styling - Modern flat design */

/* Hide raw select elements before Tom Select initializes them */
select.form-control:not(.tomselected),
select[multiple]:not(.tomselected) {
    opacity: 0;
    height: 44px;
}

/* Show once Tom Select has processed the element */
select.tomselected {
    display: none;
}

.ts-wrapper {
    width: 100%;
}

.ts-wrapper .ts-control {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 10px 14px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: none;
    min-height: 44px;
    background: #f8fafc;
}

.ts-wrapper .ts-control:hover {
    border-color: #cbd5e1;
    background: #ffffff;
}

.ts-wrapper.focus .ts-control {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 68, 141, 0.1);
    background: #ffffff;
}

/* Question picker dropdown - larger for better browsing */
.question-picker-group .ts-wrapper .ts-dropdown {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
    padding: 6px;
    margin-top: 4px;
    max-height: 400px;
    min-width: 100%;
}

/* On desktop, make question dropdown wider */
@media (min-width: 992px) {
    .question-picker-group .ts-wrapper .ts-dropdown {
        min-width: 550px;
        max-width: 700px;
    }
}

.question-picker-group .ts-wrapper .ts-dropdown-content {
    max-height: 360px;
    overflow-y: auto;
}

.ts-wrapper .ts-dropdown {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
    padding: 6px;
    margin-top: 4px;
}

.ts-wrapper .ts-dropdown .option {
    border-radius: 8px;
    padding: 10px 14px;
    transition: all 0.2s;
    line-height: 1.4;
}

.ts-wrapper .ts-dropdown .option:hover,
.ts-wrapper .ts-dropdown .option.active {
    background-color: rgba(0, 68, 141, 0.1);
    color: var(--primary);
}

.ts-wrapper .ts-dropdown .option.selected {
    background-color: var(--primary);
    color: white;
}

/* Optgroup headers in dropdown */
.ts-wrapper .ts-dropdown .optgroup-header {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
    padding: 12px 14px 6px;
    margin-top: 4px;
    border-top: 1px solid #f1f5f9;
}

/* Country select dropdown - taller for better browsing */
.question-picker-group:has(#dwelling-country) .ts-wrapper .ts-dropdown-content,
.question-picker-group:has(#attitudes-country) .ts-wrapper .ts-dropdown-content,
.question-picker-group:has(#work-country) .ts-wrapper .ts-dropdown-content,
.question-picker-group:has(#migration-country) .ts-wrapper .ts-dropdown-content,
.question-picker-group:has(#digitalization-country) .ts-wrapper .ts-dropdown-content,
.question-picker-group:has(#impact-country) .ts-wrapper .ts-dropdown-content,
.question-picker-group:has(#misc-country) .ts-wrapper .ts-dropdown-content,
[id*="-country"] + .ts-wrapper .ts-dropdown-content,
.ts-wrapper:has(+ [id*="-country"]) .ts-dropdown-content {
    max-height: 450px;
}

/* More general approach - country selects have multiple items */
.ts-wrapper.multi .ts-dropdown-content {
    max-height: 450px;
    overflow-y: auto;
}

/* Country select action buttons (Select all / Clear all) */
.country-select-actions {
    display: flex;
    gap: 8px;
    padding: 8px 10px;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}

.btn-select-action {
    flex: 1;
    padding: 6px 12px;
    font-size: 0.75rem;
    font-weight: 500;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: white;
    color: #64748b;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-select-action:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(0, 68, 141, 0.05);
}

.btn-select-action i {
    font-size: 0.7rem;
}

/* Question picker option styling - code inline with label */
.ts-wrapper .ts-dropdown .option .option-code {
    display: inline-block;
    font-size: 0.7rem;
    color: #94a3b8;
    font-family: 'SF Mono', 'Fira Code', monospace;
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
    margin-right: 8px;
    vertical-align: middle;
}

.ts-wrapper .ts-dropdown .option .option-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #1e293b;
    line-height: 1.4;
    vertical-align: middle;
}

.ts-wrapper .ts-dropdown .option:hover .option-label,
.ts-wrapper .ts-dropdown .option.active .option-label {
    color: var(--primary);
}

.ts-wrapper .ts-dropdown .option:hover .option-code,
.ts-wrapper .ts-dropdown .option.active .option-code {
    background: rgba(0, 68, 141, 0.1);
    color: var(--primary);
}

.ts-wrapper .ts-dropdown .option.selected .option-label,
.ts-wrapper .ts-dropdown .option.selected .option-code {
    color: white;
}

.ts-wrapper .ts-dropdown .option.selected .option-code {
    background: rgba(255, 255, 255, 0.2);
}

/* Category Select Buttons (Survey Response Options) */
.category-select-container {
    margin-bottom: 1.5rem;
}

/* Category select wrapper - segmented control style matching chart tabs */
.category-select-wrapper {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.category-select-header {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    margin-bottom: 4px;
}

.category-select-container > label {
    font-weight: 600;
    margin-bottom: 0.75rem;
    display: block;
    color: #1e293b;
    font-size: 0.85rem;
    letter-spacing: 0.01em;
}

/* Category button group - wrap buttons naturally */
.category-btn-group,
.category-select-container .btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    background: transparent;
    padding: 0;
}

/* Individual category buttons - match app rounded style */
.category-select-container .btn-check + .btn,
.category-btn {
    border-radius: 10px !important;
    border: 1px solid #e2e8f0 !important;
    background-color: #f8fafc !important;
    color: #64748b !important;
    transition: all 0.2s ease !important;
    font-weight: 500 !important;
    padding: 8px 14px !important;
    font-size: 0.8rem !important;
    box-shadow: none !important;
    margin: 0 !important;
    white-space: normal;
    text-align: center;
    line-height: 1.3;
    max-width: 200px;
    width: auto !important;
    flex: none !important;
}

.category-select-container .btn-check + .btn:hover,
.category-btn:hover {
    border-color: #cbd5e1 !important;
    background-color: #f1f5f9 !important;
    color: #475569 !important;
}

/* Checked/active state - subtle highlight with checkmark */
.category-select-container .btn-check:checked + .btn,
.category-btn.active {
    background: rgba(0, 68, 141, 0.08) !important;
    border-color: var(--primary) !important;
    color: var(--primary) !important;
    font-weight: 600 !important;
}

.category-select-container .btn-check:checked + .btn::before,
.category-btn.active::before {
    content: '✓ ';
    font-weight: 700;
}

/* Focus state */
.category-select-container .btn-check:focus + .btn {
    box-shadow: 0 0 0 2px rgba(0, 68, 141, 0.1) !important;
}

/* Remove Bootstrap default focus ring */
.category-select-container .btn-check + .btn:focus {
    outline: none !important;
}

/* Wave select buttons (Compare waves section) */
.wave-select-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.wave-select-group .btn-check + .btn {
    border-radius: 10px !important;
    border: 1px solid #e2e8f0 !important;
    background-color: #f8fafc !important;
    color: #64748b !important;
    transition: all 0.2s ease !important;
    font-weight: 500 !important;
    padding: 8px 14px !important;
    font-size: 0.8rem !important;
    box-shadow: none !important;
    width: auto !important;
    flex: none !important;
}

.wave-select-group .btn-check + .btn:hover {
    border-color: #cbd5e1 !important;
    background-color: #f1f5f9 !important;
    color: #475569 !important;
}

.wave-select-group .btn-check:checked + .btn {
    background: rgba(0, 68, 141, 0.08) !important;
    border-color: var(--primary) !important;
    color: var(--primary) !important;
    font-weight: 600 !important;
}

.wave-select-group .btn-check:checked + .btn::before {
    content: '✓ ';
    font-weight: 700;
}

/* ----------------------- Footer --------------------------- */

.main-footer {
    background: white;
    border-top: 1px solid rgba(0, 0, 0, 0.125);
    padding: 1rem;
    margin-left: var(--sidebar-width);
    transition: margin-left 0.3s ease;
}

.sidebar-collapsed .main-footer {
    margin-left: var(--sidebar-collapsed-width);
}

.footer-text {
    font-size: 10px !important;
    color: #666;
    text-align: center;
}

/* ----------------------- Loading Overlay --------------------------- */

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* Override Bootstrap spinner color to match app signature blue */
.spinner-border.text-primary,
.spinner-border {
    color: var(--primary) !important;
}

/* ----------------------- Highcharts --------------------------- */

.highcharts-legend-item {
    font-weight: bold !important;
    font-family: "Noto Sans", sans-serif;
}

text.highcharts-title {
    font-weight: bold !important;
    font-family: "Noto Sans", sans-serif;
}

/* Chart caption (notes) spacing */
.highcharts-caption {
    margin-top: 15px;
}

@media (max-width: 768px) {
    .highcharts-caption {
        margin-top: 30px;
        font-size: 8px !important;
    }

    .highcharts-caption text {
        font-size: 8px !important;
    }
}

/* ----------------------- Survey Minigame --------------------------- */

.survey-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
}

.question-text {
    font-size: 1.2em;
    color: var(--primary);
    margin-bottom: 20px;
    text-align: center;
}

.survey-progress {
    width: 100%;
    height: 4px;
    background: #e2e8f0;
    border-radius: 2px;
    margin: 20px 0;
    overflow: hidden;
}

.survey-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    border-radius: 2px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.survey-option-btn {
    width: 100%;
    margin-bottom: 10px;
    padding: 12px 20px;
    border-radius: 15px;
    border: 1.5px solid #e2e8f0;
    background: #f8f9fa;
    color: #333;
    text-align: left;
    transition: all 0.3s ease;
    cursor: pointer;
}

.survey-option-btn:hover {
    background: rgba(0, 68, 141, 0.1);
    border-color: var(--primary);
    transform: translateX(4px);
}

.survey-option-btn.selected {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.fade-transition {
    animation: fadeIn 0.4s ease-out forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Minigame question transitions */
.minigame-question {
    animation: slideIn 0.35s ease-out forwards;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

#minigame-question-container {
    transition: opacity 0.2s ease-out, transform 0.2s ease-out;
}

.results-container {
    margin-top: 30px;
    text-align: center;
}

.country-result {
    margin-top: 20px;
}

.country-name {
    font-size: 2.5em;
    color: var(--primary);
    font-weight: 700;
}

/* Slider styling for minigame */
.slider-container {
    margin: 20px 0;
    padding: 0;
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    gap: 30px;
    margin-bottom: 1rem;
}

.slider-label-left,
.slider-label-right {
    font-size: 0.85rem;
    color: #64748b;
    font-weight: 500;
    line-height: 1.5;
    width: 45%;
    flex-shrink: 0;
}

.slider-label-left {
    text-align: left;
}

.slider-label-right {
    text-align: right;
    margin-left: auto;
}

/* Range input styling */
input[type="range"] {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #e2e8f0;
    outline: none;
    -webkit-appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    background: white;
    border: 3px solid var(--primary);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 68, 141, 0.3);
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

/* ----------------------- Minigame Card Styles --------------------------- */

.minigame-card {
    max-width: 700px;
    margin: 0 auto;
}


.minigame-card .card-body {
    padding: 2rem;
}

.minigame-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, rgba(0, 68, 141, 0.1) 0%, rgba(0, 102, 204, 0.1) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

.minigame-icon i {
    font-size: 2.5rem;
    color: var(--primary);
}

.minigame-intro-text {
    color: #64748b;
    font-size: 1rem;
    line-height: 1.6;
    max-width: 450px;
    margin-left: auto;
    margin-right: auto;
}

.minigame-progress-bar {
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
}

.minigame-progress-bar .progress-bar {
    background: linear-gradient(90deg, var(--primary) 0%, #0066cc 100%);
    transition: width 0.4s ease;
}

/* Question styling */
.minigame-question h5 {
    color: #0f172a;
    font-weight: 600;
    font-size: 1.1rem;
    line-height: 1.5;
}

.minigame-question .btn-group-vertical {
    gap: 0.5rem;
}

.minigame-question .btn-outline-primary {
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    color: #334155;
    font-weight: 500;
    font-size: 0.875rem;
    padding: 0.625rem 1rem;
    transition: all 0.2s ease;
}

.minigame-question .btn-outline-primary:hover {
    background: rgba(0, 68, 141, 0.08);
    border-color: var(--primary);
    color: var(--primary);
    transform: translateX(4px);
}

.minigame-question .btn-check:checked + .btn-outline-primary {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(0, 68, 141, 0.3);
}

/* Results styling */
.top-match-flag {
    margin-bottom: 1rem;
}

.flag-large {
    width: 120px;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

#minigame-results-container h2 {
    color: var(--primary);
}

#minigame-results-container .list-group-item {
    border-radius: 10px;
    margin-bottom: 0.5rem;
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
}

#minigame-results-container .list-group-item:hover {
    background: #f8fafc;
}

#minigame-results-container .list-group-item-primary {
    background: rgba(0, 68, 141, 0.08);
    border-color: var(--primary);
}

/* ----------------------- Responsive Design --------------------------- */

@media (max-width: 992px) {
    .main-sidebar {
        transform: translateX(-100%);
    }

    .sidebar-open .main-sidebar {
        transform: translateX(0);
    }

    .content-wrapper,
    .main-footer {
        margin-left: 0;
    }

    .main-header {
        padding-left: 1rem;
    }
}

@media (max-width: 768px) {
    .jumbotron-container {
        min-height: 30vh;
        padding: 1rem 0.5rem;
    }

    .jumbotron-title {
        font-size: 1.8rem !important;
    }

    .jumbotron-title::after {
        animation: none;
    }

    .jumbotron-lead {
        font-size: 0.9rem !important;
    }

    .button-container {
        flex-direction: column;
        align-items: center;
    }

    .action-btn,
    .start-exploring-btn {
        width: 80%;
    }

    .chart-container {
        min-height: 550px;
    }

    .nav-pills {
        flex-wrap: wrap;
    }

    .nav-pills .nav-item .nav-link {
        padding: 6px 12px !important;
        font-size: 0.85rem;
    }

    .footer-text {
        font-size: 8px !important;
    }

    body {
        font-size: 14px !important;
    }

    /* Add gap between subsample picker and chart tabs on mobile */
    .question-picker-group {
        margin-bottom: 1.5rem;
    }

    .chart-tabs {
        margin-top: 0.75rem;
    }
}

/* ----------------------- Dropdown Menus --------------------------- */

.dropdown-menu {
    border: none;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    padding: 8px;
    z-index: 1000 !important;
}

.dropdown-item {
    border-radius: 8px;
    transition: all 0.2s;
    padding: 8px 12px;
}

.dropdown-item:hover,
.dropdown-item.active {
    background-color: rgba(0, 68, 141, 0.1);
    color: var(--primary);
}

.dropdown-item.active,
.dropdown-item:active {
    background-color: var(--primary) !important;
    color: white !important;
}

/* ----------------------- Popover --------------------------- */

.popover {
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    border: none;
}

.popover-header {
    background: var(--primary);
    color: white;
    border-radius: 10px 10px 0 0;
    font-weight: 600;
}

.popover-body {
    padding: 1rem;
}

/* ----------------------- Animations --------------------------- */

.animate-in {
    animation: fadeInUp 1s ease forwards;
    opacity: 0;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ----------------------- Responsive Layout for Survey Sections --------------------------- */

/* On large screens, give controls column more width for better dropdown browsing */
@media (min-width: 1200px) {
    .section-content .row > .col-md-4 {
        flex: 0 0 35%;
        max-width: 35%;
    }

    .section-content .row > .col-md-8 {
        flex: 0 0 65%;
        max-width: 65%;
    }
}

/* On extra large screens, even more space for controls */
@media (min-width: 1400px) {
    .section-content .row > .col-md-4 {
        flex: 0 0 30%;
        max-width: 30%;
    }

    .section-content .row > .col-md-8 {
        flex: 0 0 70%;
        max-width: 70%;
    }
}
