/* =========================================================
   Frontbook — app.css
   Bootstrap 5 base, customised with CSS variables so light
   and dark mode flow from a single source of truth.
   ========================================================= */

:root {
    --fb-blue: #1877f2;
    --fb-blue-dark: #0d5fce;
    --fb-radius: 14px;
    --fb-shadow: 0 1px 2px rgba(0, 0, 0, .08), 0 2px 8px rgba(0, 0, 0, .04);
}

/* ---- Theme surfaces ---- */
[data-bs-theme="light"] {
    --fb-bg: #f0f2f5;
    --fb-card: #ffffff;
    --fb-text: #1c1e21;
    --fb-muted: #65676b;
    --fb-border: #e4e6eb;
    --fb-hover: #f2f3f5;
}
[data-bs-theme="dark"] {
    --fb-bg: #18191a;
    --fb-card: #242526;
    --fb-text: #e4e6eb;
    --fb-muted: #b0b3b8;
    --fb-border: #3a3b3c;
    --fb-hover: #3a3b3c;
}

body {
    background: var(--fb-bg);
    color: var(--fb-text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    padding-top: 64px;
    padding-bottom: env(safe-area-inset-bottom);
}

.app-shell { max-width: 1280px; margin: 0 auto; }

/* ---- Top navbar ---- */
.fb-navbar {
    position: fixed; top: 0; left: 0; right: 0; height: 56px; z-index: 1030;
    background: var(--fb-card); border-bottom: 1px solid var(--fb-border);
    display: flex; align-items: center; gap: .75rem; padding: 0 1rem;
    box-shadow: var(--fb-shadow);
}
.fb-brand {
    font-weight: 800; font-size: 1.5rem; color: var(--fb-blue);
    text-decoration: none; letter-spacing: -.5px;
}
.fb-search {
    background: var(--fb-bg); border: none; border-radius: 999px;
    padding: .5rem 1rem; color: var(--fb-text); max-width: 260px;
}
.fb-search:focus { outline: 2px solid var(--fb-blue); background: var(--fb-card); }
.fb-nav-btn {
    width: 40px; height: 40px; border-radius: 50%; border: none;
    background: var(--fb-bg); color: var(--fb-text); font-size: 1.15rem;
    display: inline-flex; align-items: center; justify-content: center;
    position: relative; cursor: pointer; transition: background .15s;
}
.fb-nav-btn:hover { background: var(--fb-hover); }
.fb-badge {
    position: absolute; top: -2px; right: -2px; background: #fa3e3e; color: #fff;
    font-size: .65rem; min-width: 18px; height: 18px; border-radius: 999px;
    display: flex; align-items: center; justify-content: center; padding: 0 4px;
}

/* ---- Cards ---- */
.card-fb {
    background: var(--fb-card); border: 1px solid var(--fb-border);
    border-radius: var(--fb-radius); box-shadow: var(--fb-shadow);
    margin-bottom: 1rem;
}
.card-fb-body { padding: 1rem 1.1rem; }

/* ---- Post ---- */
.post-author { display: flex; align-items: center; gap: .65rem; }
.avatar { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; background: var(--fb-hover); }
.avatar-sm { width: 32px; height: 32px; }
.avatar-lg { width: 96px; height: 96px; border: 4px solid var(--fb-card); }
.post-name { font-weight: 600; color: var(--fb-text); text-decoration: none; }
.post-name:hover { text-decoration: underline; }
.post-meta { color: var(--fb-muted); font-size: .8rem; }
.post-body { margin: .75rem 0; white-space: pre-wrap; word-break: break-word; line-height: 1.5; }
.post-media { width: 100%; border-radius: 10px; margin-top: .5rem; max-height: 560px; object-fit: cover; }
.post-stats { color: var(--fb-muted); font-size: .85rem; padding: .5rem 0; border-bottom: 1px solid var(--fb-border); }
.post-actions { display: flex; padding-top: .35rem; }
.action-btn {
    flex: 1; border: none; background: none; color: var(--fb-muted); font-weight: 600;
    padding: .5rem; border-radius: 8px; cursor: pointer; transition: background .15s;
    display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
}
.action-btn:hover { background: var(--fb-hover); }
.action-btn.liked { color: var(--fb-blue); }
.action-btn.liked i::before { font-weight: bold; }

/* ---- Composer ---- */
.composer-trigger {
    width: 100%; text-align: left; background: var(--fb-bg); border: none;
    border-radius: 999px; padding: .65rem 1rem; color: var(--fb-muted); cursor: pointer;
}
.composer-trigger:hover { background: var(--fb-hover); }

/* ---- Sidebar ---- */
.side-link {
    display: flex; align-items: center; gap: .85rem; padding: .65rem .75rem;
    border-radius: 10px; color: var(--fb-text); text-decoration: none; font-weight: 500;
}
.side-link:hover { background: var(--fb-hover); }
.side-link i { font-size: 1.35rem; color: var(--fb-blue); width: 28px; text-align: center; }
.side-section-title { color: var(--fb-muted); font-weight: 600; font-size: .8rem; margin: 1rem .75rem .25rem; }

/* ---- Comments ---- */
.comment { display: flex; gap: .5rem; margin-top: .6rem; }
.comment-bubble { background: var(--fb-bg); border-radius: 16px; padding: .5rem .75rem; }
.comment-name { font-weight: 600; font-size: .85rem; }
.comment-body { font-size: .9rem; }

/* ---- Profile header ---- */
.profile-cover {
    height: 240px; border-radius: 0 0 var(--fb-radius) var(--fb-radius);
    background: linear-gradient(135deg, #4267b2, #1877f2); background-size: cover; background-position: center;
}
.profile-head { background: var(--fb-card); border-radius: 0 0 var(--fb-radius) var(--fb-radius); padding: 0 1.25rem 1rem; }

/* ---- Buttons ---- */
.btn-fb { background: var(--fb-blue); color: #fff; font-weight: 600; border: none; }
.btn-fb:hover { background: var(--fb-blue-dark); color: #fff; }

/* ---- Mobile bottom nav ---- */
.mobile-nav {
    position: fixed; bottom: 0; left: 0; right: 0; height: 56px; z-index: 1030;
    background: var(--fb-card); border-top: 1px solid var(--fb-border);
    display: flex; align-items: center; justify-content: space-around;
    padding-bottom: env(safe-area-inset-bottom);
}
.mn-item {
    color: var(--fb-muted); font-size: 1.4rem; background: none; border: none;
    position: relative; text-decoration: none;
}
.mn-create { background: var(--fb-blue); color: #fff; width: 44px; height: 44px; border-radius: 50%; }
.mn-avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.mn-badge { position: absolute; top: -4px; right: -8px; background: #fa3e3e; color: #fff; font-size: .6rem; border-radius: 999px; padding: 1px 5px; }

/* ---- Auth pages ---- */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; background: var(--fb-bg); padding: 1rem; }
.auth-card { background: var(--fb-card); border-radius: var(--fb-radius); box-shadow: 0 4px 24px rgba(0,0,0,.12); padding: 2rem; max-width: 420px; width: 100%; margin: auto; }
.auth-brand { font-size: 2.5rem; font-weight: 800; color: var(--fb-blue); text-align: center; }

@media (max-width: 991px) { body { padding-bottom: 64px; } }
