/* =========================================================
   BATOUFAM - STYLE GRAND PUBLIC
   ========================================================= */

:root {
    --primary: #15231e;
    --secondary: #d3ab4f;
    --tertiary: #22302b;
    --gold-light: #ead39b;
    --white: #ffffff;
    --text: #202723;
    --muted: #75807a;
    --border: #e9ecea;
    --page-bg: #f5f7f5;

    --topbar-height: 66px;
    --bottom-nav-height: 76px;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--page-bg);
    color: var(--text);
    font-family: "Noto Sans", "Segoe UI", Arial, sans-serif;
    overflow-x: hidden;
}

/* Petit motif décoratif discret dans le fond.
   Il ne dépend d'aucune image externe. */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -2;
    opacity: .055;
    background:
        radial-gradient(circle at 15% 15%, var(--secondary) 0 2px, transparent 3px),
        radial-gradient(circle at 85% 35%, var(--primary) 0 2px, transparent 3px);
    background-size: 34px 34px, 46px 46px;
    pointer-events: none;
}

/* =========================================================
   TOPBAR
   ========================================================= */

.public-topbar {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: min(100%, 900px);
    height: var(--topbar-height);
    z-index: 1000;

    display: grid;
    grid-template-columns: 48px 1fr 48px;
    align-items: center;

    padding: 0 10px;
    background: #22302b;
    border-bottom: 1px solid rgba(21, 35, 30, .08);
    box-shadow: 0 15px 20px rgba(21, 35, 30, .07);
    backdrop-filter: blur(12px);
}

.topbar-button {
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 13px;
    background: transparent;
    color: #d3ab4f;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: .18s ease;
}

.topbar-button:hover,
.topbar-button:active {
    background: #f0f3f1;
}

.topbar-title {
    text-align: center;
    color: #d3ab4f;
    font-size: 18px;
    font-weight: 800;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* =========================================================
   MENU LATERAL
   ========================================================= */

.sidebar-overlay {
    position: fixed;
    inset: 0;
    z-index: 1100;
    background: rgba(0, 0, 0, .42);
    opacity: 0;
    visibility: hidden;
    transition: .25s ease;
}

.sidebar-overlay.open {
    opacity: 1;
    visibility: visible;
}

.public-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 1200;

    width: min(330px, 88vw);
    height: 100vh;

    display: flex;
    flex-direction: column;

    background: var(--white);
    box-shadow: -12px 0 35px rgba(0, 0, 0, .16);

    transform: translateX(105%);
    transition: transform .28s cubic-bezier(.2, .8, .2, 1);
}

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

.sidebar-head {
    min-height: 86px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 17px 16px;
    background: var(--primary);
    color: white;
}

.sidebar-logo {
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    border-radius: 15px;
    background: var(--secondary);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 25px;
}

.sidebar-app-name {
    font-size: 17px;
    font-weight: 800;
}

.sidebar-subtitle {
    margin-top: 2px;
    font-size: 11px;
    color: rgba(255,255,255,.7);
}

.sidebar-close {
    margin-left: auto;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 11px;
    background: rgba(255,255,255,.1);
    color: white;
    font-size: 17px;
}

.sidebar-body {
    flex: 1;
    overflow-y: auto;
    padding: 18px 12px;
}

.sidebar-section-title {
    padding: 12px 12px 7px;
    color: #89928d;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .12em;
}

.sidebar-item {
    min-height: 52px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 7px 11px;
    margin-bottom: 3px;
    color: #303934;
    text-decoration: none;
    border-radius: 13px;
    font-size: 14px;
    font-weight: 650;
    transition: .18s ease;
}

.sidebar-item:hover {
    background: #f2f5f3;
    color: var(--primary);
}

.sidebar-item-icon {
    width: 37px;
    height: 37px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f3f1;
    color: var(--primary);
    font-size: 18px;
}

.sidebar-footer {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px;
    border-top: 1px solid var(--border);
    color: var(--primary);
}

.sidebar-footer-icon {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5edda;
    color: #8a681f;
}

.sidebar-footer strong {
    display: block;
    font-size: 11px;
}

.sidebar-footer small {
    color: var(--muted);
    font-size: 10px;
}

/* =========================================================
   CONTENU
   ========================================================= */

.public-page {
    width: min(100%, 900px);
    min-height: 100vh;
    margin: 0 auto;
    padding:
        calc(var(--topbar-height) + 12px)
        14px
        calc(var(--bottom-nav-height) + 24px);
}

/* =========================================================
   RECHERCHE
   ========================================================= */

.search-card {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 58px;
    padding: 7px 9px 7px 15px;
    margin-bottom: 10px;

    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 18px rgba(21, 35, 30, .08);
}

.search-icon {
    color: #197d88;
    font-size: 25px;
}

.search-card input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text);
    font-size: 18px;
}

.search-card input::placeholder {
    color: #898f8c;
}

.search-clear {
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 11px;
    background: #f1f4f2;
    color: #727c77;
    display: none;
    align-items: center;
    justify-content: center;
}

.search-clear.show {
    display: flex;
}

/* =========================================================
   CATEGORIES
   ========================================================= */

.category-scroll {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 1px 1px 9px;
    margin-bottom: 3px;
    scrollbar-width: none;
}

.category-scroll::-webkit-scrollbar {
    display: none;
}

.category-chip {
    flex: 0 0 auto;
    border: 1px solid #e1e6e3;
    border-radius: 999px;
    background: white;
    color: #52605a;
    padding: 8px 13px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
    transition: .17s ease;
}

.category-chip.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.category-chip:hover {
    border-color: var(--secondary);
}

/* =========================================================
   LISTE ACCORDÉON
   ========================================================= */

.words-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.word-item {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 3px 13px rgba(21, 35, 30, .055);
}

.word-header {
    min-height: 54px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 9px;
    cursor: pointer;
}

.word-title {
    flex: 1;
    min-width: 0;
    color: #2c312f;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.25;
}

.word-chevron {
    width: 30px;
    height: 30px;
    border: 0;
    background: transparent;
    color: #111;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform .2s ease;
}

.word-item.open .word-chevron {
    transform: rotate(180deg);
}

.word-details {
    display: none;
    padding: 2px 18px 17px;
    border-top: 1px solid #f0f1f0;
}

.word-item.open .word-details {
    display: block;
}

.translation-row {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    padding: 10px 0 3px;
}

.translation-text {
    flex: 1;
    min-width: 0;
    color: #147b83;
    font-size: 18px;
    font-weight: 800;
    line-height: 1.3;
}

.audio-button {
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    margin-top: -2px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--secondary);
    font-size: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.audio-button:hover {
    background: #fbf5e6;
}

.example-label {
    margin-top: 7px;
    color: #e1a400;
    font-size: 16px;
    font-weight: 500;
}

.example-audio-row {
    display: flex;
    align-items: flex-start;
    gap: 9px;
}

.example-audio-row .example-fr {
    flex: 1;
    min-width: 0;
}

.example-audio-button {
    flex: 0 0 34px;
    margin-top: 0;
}

.example-fr {
    margin-top: 2px;
    color: #555b58;
    font-size: 15px;
    font-style: italic;
    line-height: 1.45;
}

.example-ba {
    margin-top: 10px;
    color: #21845a;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.4;
}

.no-translation {
    color: #9ba39e;
    font-size: 13px;
    font-style: italic;
    padding-top: 10px;
}

.no-results {
    padding: 42px 20px;
    text-align: center;
    color: #7b8580;
}

.no-results i {
    font-size: 35px;
    color: #b7bfbb;
}

.no-results p {
    margin: 9px 0 0;
    font-size: 13px;
}

/* =========================================================
   BOTTOM NAVBAR
   ========================================================= */

.public-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: min(100%, 900px);
    height: var(--bottom-nav-height);
    z-index: 1000;

    display: grid;
    grid-template-columns: repeat(4, 1fr);

    background: #22302b;
    border-top: 1px solid rgba(21,35,30,.08);
    box-shadow: 0 -5px 15px #d3ab4f;
    backdrop-filter: blur(12px);
}

.bottom-nav-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: #fff;
    text-decoration: none;
    font-size: 11px;
    font-weight: 700;
}

.bottom-nav-item i {
    font-size: 25px;
    line-height: 1;
}

.bottom-nav-item.active {
    color: #d3ab4f;
}

.bottom-nav-item.active i {
    font-size: 27px;
}

@media (max-width: 420px) {
    .public-page {
        padding-left: 10px;
        padding-right: 10px;
    }

    .topbar-title {
        font-size: 16px;
    }

    .word-title {
        font-size: 15px;
    }

    .translation-text {
        font-size: 17px;
    }

    .example-fr {
        font-size: 14px;
    }

    .bottom-nav-item {
        font-size: 10px;
    }
}
