﻿/* Design 6b/6c: header (G6), mobile drawer (G7), footer (G8), icons (G10), shared page pieces.
   Uses the tokens from lafeef-theme.css. Loaded after it in every layout. */

.lf-i { fill: currentColor; flex: none; vertical-align: middle; }

/* ---------- Header ---------- */
.lf-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: #fff;
    border-bottom: 1px solid var(--lf-border);
}

.lf-header-inner {
    max-width: 1328px;
    height: 88px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.lf-header-start { display: flex; align-items: center; gap: 20px; height: 100%; }
.lf-header-end { display: flex; align-items: center; gap: 12px; }

.lf-logo { display: inline-flex; flex: none; }
.lf-logo img { display: block; width: 98px; height: 32px; }

.lf-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    background: var(--lf-border);
}

.lf-avatar-menu { position: relative; }
.lf-avatar-btn { display: block; padding: 0; border: 0; background: none; cursor: pointer; border-radius: 50%; list-style: none; }
.lf-avatar-btn::-webkit-details-marker { display: none; }
.lf-avatar-menu[open] > .lf-menu { display: block; }
.lf-avatar-btn:focus-visible { outline: 2px solid var(--lf-deep-red); outline-offset: 2px; }

.lf-menu {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    inset-inline-start: 0;
    min-width: 230px;
    padding: 8px;
    background: #fff;
    border: 1px solid var(--lf-border);
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(46, 6, 17, 0.08);
    z-index: 1100;
}
.lf-menu-name { padding: 8px 12px 10px; font-weight: 700; color: var(--lf-deep-red); }
.lf-menu a, .lf-menu button {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    border: 0;
    border-radius: 10px;
    background: none;
    color: var(--lf-text);
    font: inherit;
    font-size: 16px;
    text-align: start;
    text-decoration: none;
    cursor: pointer;
}
.lf-menu a:hover, .lf-menu button:hover { background: var(--lf-border); color: var(--lf-deep-red); }
.lf-menu hr { border: 0; border-top: 1px solid var(--lf-border); margin: 6px 0; }
.lf-menu form { margin: 0; }

.lf-nav { display: flex; align-items: stretch; gap: 28px; height: 100%; }
.lf-nav-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--lf-text-2);
    font-size: 18px;
    text-decoration: none;
    white-space: nowrap;
}
.lf-nav-link:hover { color: var(--lf-text); }
.lf-nav-link.is-active { color: var(--lf-text); font-weight: 700; }
.lf-nav-link.is-active::after {
    content: "";
    position: absolute;
    inset-inline: 0;
    bottom: 0;
    height: 4px;
    border-radius: 4px 4px 0 0;
    background: var(--lf-text);
}
.lf-nav-link .notification-badge {
    position: absolute;
    top: 24px;
    inset-inline-start: 12px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: var(--lf-pomegranate);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
}

.lf-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 40px;
    padding: 0 20px;
    border: 0;
    border-radius: 40px;
    background: var(--lf-deep-red);
    color: #fff;
    font: inherit;
    font-size: 16px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
}
.lf-btn:hover, .lf-btn:focus-visible { background: var(--lf-deep-red-hover); color: #fff; }
.lf-btn:disabled { opacity: 0.6; cursor: default; }
.lf-btn-secondary { background: var(--lf-border); color: var(--lf-deep-red); border-radius: 20px; }
.lf-btn-secondary:hover { background: #E5E3D0; color: var(--lf-deep-red); }
.lf-btn-outline { background: transparent; color: var(--lf-deep-red); border: 1px solid var(--lf-border-2); }
.lf-btn-outline:hover { background: var(--lf-border); color: var(--lf-deep-red); }
.lf-btn-danger-outline { background: transparent; color: var(--lf-pomegranate); border: 1px solid var(--lf-pomegranate); }
.lf-btn-danger-outline:hover { background: var(--lf-pomegranate); color: #fff; }
.lf-btn-block { width: 100%; height: 48px; }
/* Google sign-in button: Google's own look (white outline, 40px, 4px corners, logo on the left), not the brand pill */
.lf-gbtn { position: relative; display: flex; align-items: center; justify-content: center; width: 100%; height: 40px; padding: 0 44px; border: 1px solid #747775; border-radius: 4px; background: #fff; color: #1f1f1f; font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; }
.lf-gbtn:hover { background: #f8faff; border-color: #747775; }
.lf-gbtn:focus-visible { outline: 2px solid #0b57d0; outline-offset: 2px; }
.lf-gbtn-logo { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); }
/* «أو» line between the Google button and the email form */
.lf-or { display: flex; align-items: center; gap: 12px; margin: 16px 0; color: var(--lf-text-2); font-size: 14px; }
.lf-or::before, .lf-or::after { content: ""; flex: 1; border-top: 1px solid var(--lf-border-2); }
.lf-auth .lf-or { margin: 0; }

.lf-icon-btn {
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: none;
    color: var(--lf-text);
    cursor: pointer;
}
.lf-icon-btn:hover { background: var(--lf-border); }

.lf-menu-btn { display: none; padding: 4px; border: 0; background: none; color: var(--lf-text); cursor: pointer; }

@media (max-width: 1023px) {
    .lf-header-inner { height: 64px; padding: 0 16px; }
    .lf-nav, .lf-avatar-menu, .lf-add-btn { display: none !important; }
    .lf-menu-btn { display: inline-flex; }
}

/* ---------- Drawer (one full-screen menu on mobile, G7) ---------- */
.lf-drawer-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1200;
    background: rgba(17, 17, 17, 0.4);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}
.lf-drawer-backdrop.active { opacity: 1; pointer-events: auto; }

.lf-drawer {
    position: fixed;
    inset-block: 0;
    inset-inline-start: 0;
    z-index: 1201;
    width: 100%;
    max-width: 440px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 16px 16px 24px;
    background: #fff;
    overflow-y: auto;
    transform: translateX(100%);
    visibility: hidden;
    transition: transform 0.25s ease, visibility 0.25s;
}
.lf-drawer.active { transform: none; visibility: visible; }
@media (prefers-reduced-motion: reduce) { .lf-drawer, .lf-drawer-backdrop { transition: none; } }

.lf-drawer-head { display: flex; align-items: center; justify-content: space-between; }

.lf-drawer-user {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
    border: 1px solid var(--lf-border);
    border-radius: 40px;
}
.lf-drawer-user-link { display: flex; align-items: center; gap: 8px; color: var(--lf-text); font-weight: 700; text-decoration: none; }
.lf-drawer-user .lf-avatar { width: 28px; height: 28px; }
.lf-drawer-user form { margin: 0; }
.lf-drawer-logout { border: 0; background: none; color: var(--lf-pomegranate); font: inherit; cursor: pointer; }

.lf-drawer-nav { display: flex; flex-direction: column; gap: 4px; }
.lf-drawer-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 10px;
    border-radius: 12px;
    color: var(--lf-text);
    font-size: 18px;
    font-weight: 700;
    text-decoration: none;
}
.lf-drawer-nav a:hover, .lf-drawer-nav a.is-active { background: var(--lf-border); }
.lf-drawer-foot { margin-top: auto; }

/* ---------- Footer (G8) ---------- */
.lf-footer { margin-top: 64px; background: var(--lf-deep-red); color: #FFFEF7; }
.lf-footer-inner { max-width: 1104px; margin: 0 auto; padding: 48px 16px 24px; }
.lf-footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 32px; }
.lf-footer h3 { margin: 0 0 16px; color: #FFFEF7; font-size: 16px; font-weight: 700; }
.lf-footer ul { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; font-size: 14px; color: rgba(255, 254, 247, 0.8); }
.lf-footer a { color: rgba(255, 254, 247, 0.8); text-decoration: none; }
.lf-footer a:hover { color: var(--lf-sun); }
.lf-footer-brand img { display: block; }
.lf-footer-desc { max-width: 340px; margin: 16px 0 24px; color: rgba(255, 254, 247, 0.8); font-size: 14px; line-height: 1.7; }
.lf-social { display: flex; gap: 12px; }
.lf-social a { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: #fff; color: var(--lf-deep-red); }
.lf-social a:hover { background: var(--lf-sun); color: var(--lf-deep-red); }
.lf-footer-bottom {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 254, 247, 0.15);
    color: rgba(255, 254, 247, 0.7);
    font-size: 13px;
}
@media (max-width: 767px) {
    .lf-footer-grid { grid-template-columns: 1fr 1fr; }
    .lf-footer-brand { grid-column: 1 / -1; }
}

/* ---------- Login modal (AU8) ---------- */
.lf-auth-backdrop { flex-direction: column; gap: 12px; padding: 16px; background: rgba(17, 17, 17, 0.5); backdrop-filter: none; z-index: 1500; }
.lf-auth-close { display: inline-flex; align-items: center; gap: 6px; align-self: center; width: min(1024px, 100%); justify-content: flex-start; border: 0; background: none; color: #fff; font: inherit; font-size: 18px; font-weight: 700; cursor: pointer; }
.lf-auth { display: grid; grid-template-columns: 1.5fr 1fr; width: min(1024px, 100%); max-height: calc(100vh - 80px); overflow: auto; border-radius: 20px; background: #fff; }
.lf-auth-form { display: flex; flex-direction: column; gap: 16px; padding: 48px clamp(20px, 6vw, 84px); }
.lf-auth-title { margin: 0; color: var(--lf-deep-red); font-size: 36px; font-weight: 700; text-align: center; }
.lf-auth-sub { margin: -8px 0 8px; color: var(--lf-text); text-align: center; }
.lf-field { display: flex; flex-direction: column; gap: 6px; }
.lf-field label { color: var(--lf-deep-red); font-size: 15px; font-weight: 700; }
.lf-auth-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; }
.lf-check { display: inline-flex; align-items: center; gap: 8px; color: var(--lf-text); font-size: 15px; cursor: pointer; }
.lf-check input { width: 18px; height: 18px; accent-color: var(--lf-deep-red); }
.lf-auth .lf-btn-block { height: 56px; font-size: 18px; }
.lf-auth-link { align-self: center; color: var(--lf-pomegranate); font-size: 15px; }
.lf-auth-switch { margin: 0; color: var(--lf-text); text-align: center; }
.lf-auth-switch a { color: var(--lf-pomegranate); font-weight: 700; }
.lf-auth-legal { margin: 0; color: var(--lf-text-2); font-size: 13px; text-align: center; }
.lf-auth-legal a { color: var(--lf-pomegranate); }
.lf-auth-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 40px 32px;
    background-color: #FFF8D6;
    background-image: url("/assets/favicon.svg");
    background-size: 44px;
    background-repeat: space;
    background-blend-mode: soft-light;
    text-align: center;
}
.lf-auth-brand h3 { margin: 0; color: var(--lf-deep-red); font-size: 28px; font-weight: 700; }
.lf-auth-brand p { max-width: 300px; margin: 0; color: var(--lf-text); }
.lf-auth-count { display: flex; flex-direction: column; gap: 2px; width: min(310px, 100%); padding: 16px; border: 1px solid #CCC28D; border-radius: 16px; background: #FFFDEF; color: var(--lf-text); }
.lf-auth-count strong { color: var(--lf-deep-red); font-size: 26px; }
@media (max-width: 767px) {
    .lf-auth-backdrop { padding: 0; justify-content: flex-start; }
    .lf-auth-close { padding: 12px 16px 0; color: var(--lf-deep-red); background: #fff; width: 100%; }
    .lf-auth { grid-template-columns: 1fr; width: 100%; max-height: none; height: 100%; border-radius: 0; }
    .lf-auth-brand { display: none; }
    .lf-auth-form { padding: 24px 16px 40px; }
    .lf-auth-backdrop.active { background: #fff; }
}

/* ---------- Unread notifications on phones: bell in the header + count in the drawer ---------- */
.notification-badge[hidden] { display: none !important; }
.lf-bell-btn { display: none; position: relative; padding: 6px; color: var(--lf-text); border-radius: 50%; }
.lf-bell-btn:hover { background: var(--lf-border); color: var(--lf-text); }
.lf-bell-btn .notification-badge, .lf-drawer-nav a .notification-badge {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px;
    background: var(--lf-pomegranate); color: #fff; font-size: 12px; font-weight: 700; line-height: 1;
}
.lf-bell-btn .notification-badge { position: absolute; top: -4px; left: 58%; right: auto; min-width: 18px; height: 18px; padding: 0 4px; font-size: 11px; border: 2px solid #fff; box-sizing: content-box; }
.lf-drawer-nav a .notification-badge { position: static; margin-inline-start: auto; }
@media (max-width: 1023px) { .lf-bell-btn { display: inline-flex; } }
