/************************************
*
*       Base — Shared across all pages
*
************************************/

/* ── Theme custom properties ── */
:root,
[data-bs-theme="light"] {
    --hs-bg: #ffffff;
    --hs-bg-secondary: #f8f8f8;
    --hs-bg-tertiary: #e7e7e7;
    --hs-text: #212529;
    --hs-text-muted: #6c757d;
    --hs-heading: #505050;
    --hs-border: #dee2e6;
    --hs-card-bg: #ffffff;
    --hs-navbar-bg: #f8f9fa;
    --hs-navbar-border: #e0e0e0;
    --hs-sidebar-bg: #f8f9fa;
    --hs-sidebar-hover: #e9ecef;
    --hs-sidebar-active: #dbeafe;
    --hs-sidebar-active-text: #1d4ed8;
    --hs-sidebar-text: #374151;
    --hs-sidebar-text-muted: #6b7280;
    --hs-sidebar-section: #9ca3af;
    --hs-link: #6a6a6a;
    --hs-footer-bg: #f8f8f8;
    --hs-footer-text: #212529;
    --hs-cookie-bg: #e5e7eb;
    --hs-cookie-text: #333333;
    --hs-select-bg: #e7e7e7;
    --hs-input-bg: #ffffff;
    --hs-input-text: #555555;
    --hs-input-border: #cccccc;
    --hs-shadow: rgba(0,0,0,0.06);
    --hs-shadow-strong: rgba(0,0,0,0.15);
    --hs-filter-pill-bg: #f1f3f5;
    --hs-filter-pill-text: #495057;
    --hs-filter-pill-border: #dee2e6;
    --hs-filter-pill-hover-bg: #e2e8f0;
    --hs-stat-badge-bg: #f8f9fa;
    --hs-stat-badge-border: #dee2e6;
    --hs-toggle-btn-bg: transparent;
    --hs-toggle-btn-text: #555;
    --hs-toggle-btn-hover-bg: #e9ecef;
}

[data-bs-theme="dark"] {
    --hs-bg: #1a1d23;
    --hs-bg-secondary: #212529;
    --hs-bg-tertiary: #2c3034;
    --hs-text: #dee2e6;
    --hs-text-muted: #9ca3af;
    --hs-heading: #c9d1d9;
    --hs-border: #3a3f47;
    --hs-card-bg: #212529;
    --hs-navbar-bg: #1e2127;
    --hs-navbar-border: #2c3034;
    --hs-sidebar-bg: #1e2127;
    --hs-sidebar-hover: #2c3034;
    --hs-sidebar-active: #1e3a5f;
    --hs-sidebar-active-text: #7db8f5;
    --hs-sidebar-text: #c9d1d9;
    --hs-sidebar-text-muted: #8b949e;
    --hs-sidebar-section: #8b949e;
    --hs-link: #8b949e;
    --hs-footer-bg: #161b22;
    --hs-footer-text: #c9d1d9;
    --hs-cookie-bg: #2c3034;
    --hs-cookie-text: #c9d1d9;
    --hs-select-bg: #2c3034;
    --hs-input-bg: #2c3034;
    --hs-input-text: #c9d1d9;
    --hs-input-border: #3a3f47;
    --hs-shadow: rgba(0,0,0,0.25);
    --hs-shadow-strong: rgba(0,0,0,0.4);
    --hs-filter-pill-bg: #2c3034;
    --hs-filter-pill-text: #c9d1d9;
    --hs-filter-pill-border: #3a3f47;
    --hs-filter-pill-hover-bg: #3a3f47;
    --hs-stat-badge-bg: #2c3034;
    --hs-stat-badge-border: #3a3f47;
    --hs-toggle-btn-bg: transparent;
    --hs-toggle-btn-text: #fbbf24;
    --hs-toggle-btn-hover-bg: #2c3034;
}

/* ── Global resets ── */
body,
html {
    width: 100%;
    height: 100%;
}

body {
    background-color: var(--hs-bg);
    color: var(--hs-text);
    transition: background-color .3s ease, color .3s ease;
}

body,
h1, h2, h3, h4, h5, h6 {
    font-family: "Lato","Helvetica Neue",Helvetica,Arial,sans-serif;
    font-weight: 700;
}

/* ── Theme Toggle Button ── */
#theme-toggle-btn,
#theme-toggle-btn-desktop {
    background: var(--hs-toggle-btn-bg);
    color: var(--hs-toggle-btn-text);
    border: 1px solid var(--hs-border);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .2s, color .2s, transform .2s;
    font-size: .9rem;
    padding: 0;
    margin: 0 6px;
}
#theme-toggle-btn:hover,
#theme-toggle-btn-desktop:hover {
    background: var(--hs-toggle-btn-hover-bg);
    transform: rotate(20deg);
}

/* ── Navbar logo ── */
.navbar-logo {
    width: 28px;
    height: 28px;
    object-fit: contain;
}
.navbar-brand-text {
    font-size: .95rem;
    font-weight: 700;
    white-space: nowrap;
}
/* "Around" et "the" réduits uniquement sur petits écrans (<= 480px) */
@media(max-width:480px) {
    .navbar-brand-text .brand-small {
        font-size: .72em;
        font-weight: 400;
        opacity: .85;
    }
    .navbar-brand-text { font-size: .85rem; }
    .navbar-logo { width: 22px; height: 22px; }
}

/* ── Cookie bar ── */
body.with-cookie-bar { padding-top: 35px; }
@media(max-width:767px) {
    body.with-cookie-bar { padding-top: 0; }
}
.cookie-bar {
    position: fixed;
    width: 100%;
    top: 0;
    text-align: center;
    height: 25px;
    line-height: 25px;
    background: var(--hs-cookie-bg);
    color: var(--hs-cookie-text);
}
@media(max-width:767px) {
    .cookie-bar {
        height: auto;
        line-height: normal;
        padding: 8px 12px;
        font-size: 13px;
    }
}

/* ── Navbar ── */
@media(min-width:1400px) {
    .topnav {
        width: auto;
        padding-left: 50px;
        padding-right: 50px;
    }
}
.navbar {
    background-color: var(--hs-navbar-bg) !important;
    border-bottom: 1px solid var(--hs-navbar-border);
    transition: background-color .3s ease;
}
.navbar .navbar-brand,
.navbar .nav-item.nav-link,
.navbar .nav-link {
    color: var(--hs-text) !important;
    transition: color .2s ease;
}
.navbar .nav-item.nav-link:hover,
.navbar .nav-link:hover {
    color: var(--hs-text-muted) !important;
}
.divider-vertical {
    border-left: 1px solid var(--hs-border);
    float: left;
    opacity: 0.5;
    margin: 0 15px;
}
@media(max-width:991px) {
    .divider-vertical {
        border-left: 0;
        margin: 0;
    }
}
.img-circle {
    border-radius: 50%;
    height: 40px;
    width: 40px;
}
.img-circle-xl {
    border-radius: 50%;
    height: 100px;
    width: 100px;
}
.nav-photo {
    padding: 0;
    margin-right: 10px;
    margin-left: 10px;
}
.active-nav {
    background-color: var(--hs-bg-tertiary);
}
.link-center {
    text-align: center;
}

/* ── Shared title styles ── */
.title h1 {
    text-align: center;
    padding-top: 80px;
    padding-bottom: 20px;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.6);
    font-size: 3em;
    color: var(--hs-heading);
}
.title h3 {
    text-align: center;
    padding-top: 80px;
    padding-bottom: 20px;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.6);
    font-size: 2em;
    color: var(--hs-heading);
}
@media(max-width:767px) {
    .title h1 {
        font-size: 1.8em;
        padding-top: 30px;
        padding-bottom: 10px;
    }
    .title h3 {
        font-size: 1.4em;
        padding-top: 30px;
        padding-bottom: 10px;
    }
}
.select {
    background-color: var(--hs-select-bg) !important;
}

/* ── Shared sidebar typography (used in countries + profile) ── */
.sidebar-section-title {
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--hs-sidebar-section);
}
.sidebar-field-label {
    font-size: .72rem;
    font-weight: 600;
    color: var(--hs-sidebar-text-muted);
    display: block;
    margin-bottom: 2px;
}

/* ── Shared forms ── */
#contact_form { padding-top: 50px; }
#photo_form   { padding-top: 20px; }
#success_message { display: none; }
img.captcha {
    float: right;
    height: 34px;
    width: 60px;
}
#recaptcha { height: 100%; width: 100%; }
#recaptcha-captcha { margin: 0 auto; display: table; }
#id_captcha_1 {
    width: calc(100% - 60px);
    height: 34px;
    padding: 6px 12px;
    font-size: 14px;
    line-height: 1.4;
    color: var(--hs-input-text);
    background-color: var(--hs-input-bg);
    background-image: none;
    border: 1px solid var(--hs-input-border);
    border-radius: 0px 4px 4px 0px;
}

/* ── Footer ── */
.footer {
    width: 100%;
    height: 80px;
    position: fixed;
    bottom: 0;
    background-color: var(--hs-footer-bg);
    color: var(--hs-footer-text);
    vertical-align: center;
}
.footer-text { color: var(--hs-footer-text); }
footer {
    padding: 50px 0;
    background-color: var(--hs-footer-bg);
    color: var(--hs-footer-text);
    transition: background-color .3s ease;
}
p.copyright { margin: 15px 0 0; }

/************************************
*
*   Dark Mode — Global Overrides
*
************************************/

[data-bs-theme="dark"] .card,
[data-bs-theme="dark"] .list-group-item {
    background-color: var(--hs-card-bg);
    border-color: var(--hs-border);
    color: var(--hs-text);
}
[data-bs-theme="dark"] .bg-light {
    background-color: var(--hs-bg-secondary) !important;
}
[data-bs-theme="dark"] .border-end {
    border-color: var(--hs-border) !important;
}
[data-bs-theme="dark"] .text-dark {
    color: var(--hs-text) !important;
}
[data-bs-theme="dark"] .text-muted {
    color: var(--hs-text-muted) !important;
}
[data-bs-theme="dark"] .table {
    color: var(--hs-text);
    border-color: var(--hs-border);
}
[data-bs-theme="dark"] .table th {
    color: var(--hs-text);
}
[data-bs-theme="dark"] .dropdown-menu {
    background-color: var(--hs-card-bg);
    border-color: var(--hs-border);
}
[data-bs-theme="dark"] .dropdown-item {
    color: var(--hs-text);
}
[data-bs-theme="dark"] .dropdown-item:hover,
[data-bs-theme="dark"] .dropdown-item:focus {
    background-color: var(--hs-bg-tertiary);
    color: var(--hs-text);
}
[data-bs-theme="dark"] .dropdown-divider {
    border-color: var(--hs-border);
}
[data-bs-theme="dark"] .cookie-bar {
    background: var(--hs-cookie-bg) !important;
    color: var(--hs-cookie-text);
    box-shadow: 0 2px 10px var(--hs-shadow) !important;
}
[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select {
    background-color: var(--hs-input-bg);
    color: var(--hs-input-text);
    border-color: var(--hs-input-border);
}
[data-bs-theme="dark"] .form-control:focus,
[data-bs-theme="dark"] .form-select:focus {
    background-color: var(--hs-input-bg);
    color: var(--hs-input-text);
    border-color: #4a8fe7;
    box-shadow: 0 0 0 .2rem rgba(74,143,231,.25);
}
[data-bs-theme="dark"] .alert-secondary {
    background-color: var(--hs-bg-tertiary);
    color: var(--hs-text);
    border-color: var(--hs-border);
}
[data-bs-theme="dark"] .accordion-button {
    background-color: var(--hs-bg-secondary);
    color: var(--hs-text);
}
[data-bs-theme="dark"] .accordion-button.collapsed {
    background-color: transparent;
}
[data-bs-theme="dark"] .btn-logout {
    color: var(--hs-text);
}
[data-bs-theme="dark"] .breadcrumb {
    background-color: var(--hs-bg-secondary);
}
[data-bs-theme="dark"] a:not(.btn):not(.nav-link):not(.dropdown-item):not(.list-group-item):not(.page-link):not(.navbar-brand):not(.filter-pill):not(.countries-link) {
    color: #7db8f5;
}

/* ── Smooth transitions ── */
.navbar, .card, .list-group-item, .dropdown-menu,
.form-control, .form-select, footer, .cookie-bar,
.sidebar-col, .stat-badge, .filter-pill,
.contact-type-card, .btn {
    transition: background-color .3s ease, color .3s ease, border-color .3s ease;
}

