/* cheka-ui.css - Shared look added to every page by includes/site_ui.php (after the page's own styles):
 *   - the CHEKAnaMEME logo
 *   - the desktop sidebar that hides to icons only (button in its header, remembered per browser)
 *   - small-screen fixes for phones down to 320px
 */

:root {
    /* Logo gradient: orange -> pink -> orange, no white, so the white "na" always stands apart
       (starts and ends on the same colour, so the shimmer loops without a jump) */
    --cheka-logo-gradient: linear-gradient(125deg, #FFB347, #FF2B85, #FFB347);
    --cheka-sidebar-w: 280px;
    --cheka-sidebar-w-collapsed: 84px;
}

html.sidebar-collapsed {
    --cheka-sidebar-w: var(--cheka-sidebar-w-collapsed);
}

/* Every page is dark: text that sets no colour of its own (e.g. the message in the "Delete Post"
   pop-up) must not fall back to Bootstrap's dark grey (#212529), which is invisible on black */
:root {
    --bs-body-color: #e6e6e6;
}

body {
    color: #e6e6e6;
}

/* ---------- Logo: CHEKAnaMEME ---------- */

/* Inside ordinary sentences the name is plain text: "na" looks like the words around it */
.brand-na {
    color: inherit;
    -webkit-text-fill-color: currentColor;
}

/* Where the name stands as the brand (logos, pink highlights, headings) "na" is white and lighter,
   so CHEKA and MEME read apart. Logos paint their text with a gradient (background-clip: text +
   transparent colour); the fill colour puts "na" on top in white. */
.navbar-brand .brand-na,
.brand-logo .brand-na,
.logo .brand-na,
.highlight .brand-na,
h1 .brand-na,
h2 .brand-na,
h3 .brand-na,
h4 .brand-na,
.page-title .brand-na,
.more-card-title .brand-na {
    font-weight: 500;
    letter-spacing: -0.5px;
    margin: 0 1px;
    color: #fff;
    -webkit-text-fill-color: #fff;
}

.navbar-brand,
.brand-logo {
    white-space: nowrap;
}

/* Every logo uses the same gradient: top bar, sidebar, login / sign up / forgot password cards, 404.
   Pages still define their own older gradient (white -> orange -> pink); this file loads after them. */
.navbar-brand,
.brand-logo,
.logo > a,
a.logo {
    background-image: var(--cheka-logo-gradient) !important;
    background-size: 200% auto;
}

@keyframes cheka-shimmer {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ---------- Sidebar header: logo + hide/show button ---------- */

.sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 0 14px 20px 24px;
    margin-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    min-height: 56px;
}

.sidebar-brand .brand-logo {
    font-weight: 800;
    font-size: 1.4rem;
    letter-spacing: -1px;
    background: var(--cheka-logo-gradient);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-decoration: none;
    animation: cheka-shimmer 4s infinite;
    overflow: hidden;
}

.sidebar-toggle {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.05);
    color: #b0b0b0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.sidebar-toggle:hover,
.sidebar-toggle:focus-visible {
    background: rgba(255, 43, 133, 0.15);
    color: #FF2B85;
    outline: none;
}

/* ---------- Desktop: sidebar width drives the content and the top bar ---------- */

@media (min-width: 900px) {
    .sidebar-nav {
        width: var(--cheka-sidebar-w) !important;
        overflow-x: hidden;
        overflow-y: auto;
        scrollbar-width: none;
        transition: width 0.25s ease;
    }

    .sidebar-nav::-webkit-scrollbar {
        display: none;
    }

    .main-content {
        margin-left: var(--cheka-sidebar-w) !important;
        transition: margin-left 0.25s ease;
    }

    .top-nav {
        left: var(--cheka-sidebar-w) !important;
        width: auto !important;
        right: 0 !important;
        transition: left 0.25s ease;
    }

    .sidebar-item span {
        white-space: nowrap;
    }

    /* The sidebar already shows the logo; the top bar shows it only while the sidebar is icons-only */
    html:not(.sidebar-collapsed) .top-nav .navbar-brand {
        visibility: hidden;
    }

    html.sidebar-collapsed .sidebar-brand {
        justify-content: center;
        padding: 0 0 20px;
    }

    html.sidebar-collapsed .sidebar-brand .brand-logo {
        display: none;
    }

    html.sidebar-collapsed .sidebar-item {
        justify-content: center;
        gap: 0;
        padding-left: 0 !important;
        padding-right: 0 !important;
        margin-left: 12px;
        margin-right: 12px;
    }

    html.sidebar-collapsed .sidebar-item span {
        display: none;
    }

    html.sidebar-collapsed .sidebar-item i {
        width: auto;
        margin: 0;
    }
}

/* ---------- Report pop-up (assets/js/cheka-ui.js: chekaReport) ---------- */

.cheka-report-modal {
    position: fixed;
    inset: 0;
    z-index: 5500;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.2s, visibility 0.2s;
}

.cheka-report-modal.active {
    visibility: visible;
    opacity: 1;
}

.cheka-report-card {
    background: linear-gradient(145deg, #1a1a1a, #0f0f0f);
    border: 1px solid rgba(255, 43, 133, 0.3);
    border-radius: 28px;
    padding: 24px;
    width: 100%;
    max-width: 420px;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    color: #e6e6e6;
}

.cheka-report-card h3 {
    color: #fff;
    font-size: 1.2rem;
    margin: 0 0 8px;
}

.cheka-report-card h3 i {
    color: #FF2B85;
}

.cheka-report-intro {
    color: #b5b5b5;
    font-size: 0.85rem;
    line-height: 1.45;
    margin: 0 0 16px;
}

.cheka-report-reasons {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
}

.cheka-report-reasons label {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.05);
    cursor: pointer;
    font-size: 0.9rem;
}

.cheka-report-reasons label:has(input:checked) {
    background: rgba(255, 43, 133, 0.15);
    outline: 1px solid rgba(255, 43, 133, 0.5);
}

.cheka-report-reasons input {
    accent-color: #FF2B85;
    width: 18px;
    height: 18px;
}

.cheka-report-card textarea {
    width: 100%;
    min-height: 70px;
    resize: vertical;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    color: #fff;
    padding: 10px 14px;
    font: inherit;
    font-size: 0.85rem;
    margin-bottom: 16px;
}

.cheka-report-card textarea::placeholder {
    color: #8a8a8a;
}

.cheka-report-actions {
    display: flex;
    gap: 12px;
}

.cheka-report-actions button {
    flex: 1;
    padding: 12px;
    border-radius: 40px;
    font-weight: 600;
    border: none;
    cursor: pointer;
}

.cheka-report-cancel {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.cheka-report-send {
    background: linear-gradient(135deg, #FF2B85, #FFB347);
    color: #fff;
}

.cheka-report-send:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* A flag on each comment (index.php) */
.comment-report {
    background: none;
    border: none;
    color: #8a8a8a;
    font-size: 0.75rem;
    padding: 2px 0;
    margin-top: 4px;
    cursor: pointer;
}

.comment-report:hover {
    color: #FF2B85;
}

/* Messages always show above pop-ups (e.g. an error while posting from the meme preview) */
#demoToast {
    z-index: 6000 !important;
}

/* The hide/show button only exists for the desktop sidebar */
@media (max-width: 899px) {
    .sidebar-toggle {
        display: none;
    }
}

/* ---------- Small screens ---------- */

@media (max-width: 899px) {
    body {
        overflow-x: hidden;
    }

    .top-nav {
        padding-left: 16px;
        padding-right: 16px;
    }
}

@media (max-width: 420px) {
    .top-nav .navbar-brand {
        font-size: 1.45rem;
        letter-spacing: -1px;
    }

    .top-nav .nav-icon-btn {
        width: 38px;
        height: 38px;
        font-size: 1.15rem;
    }

    /* Login, sign up and forgot password cards */
    .logo > a {
        font-size: 1.8rem;
        letter-spacing: -1px;
    }

    /* Pop-ups never wider than the screen */
    .profile-card,
    .create-menu-card,
    .auth-card,
    .share-card {
        max-width: calc(100vw - 32px);
    }

    .profile-card,
    .auth-card {
        padding: 28px 20px;
        border-radius: 32px;
    }

    .bottom-tab {
        padding-left: 4px;
        padding-right: 4px;
    }

    .tab-item {
        padding: 4px 6px;
    }
}

@media (max-width: 340px) {
    .top-nav .navbar-brand {
        font-size: 1.2rem;
    }

    .logo > a {
        font-size: 1.5rem;
    }
}

/* "Report post" in the share sheets */
.share-option .bi-flag {
    color: #ff6b6b;
}

/* Staff: the Admin shield in the top bar, on phones only (large screens have it in the sidebar) */
.staff-nav-btn {
    text-decoration: none;
}

@media (min-width: 900px) {
    .staff-nav-btn {
        display: none !important;
    }
}

a.sidebar-item {
    text-decoration: none;
}

/* ---------- The ⋯ menu of a post (assets/js/cheka-ui.js: chekaPostMenu) ---------- */

.cheka-post-menu {
    align-items: flex-end;
}

@media (min-width: 600px) {
    .cheka-post-menu {
        align-items: center;
    }
}

.cheka-post-menu-card {
    max-width: 360px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cheka-post-menu-card button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.cheka-post-menu-card button:hover {
    background: rgba(255, 255, 255, 0.1);
}

.cheka-post-menu-card button.danger {
    color: #ff6b6b;
}

.cheka-post-menu-card button.cancel {
    background: none;
    color: #b5b5b5;
}

/* The ⋯ button in the corner of a post card (Discover, profiles) */
.post-card {
    position: relative;
}

.post-more-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 6;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.25); /* still visible on an all-black video */
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(6px);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    cursor: pointer;
}

.post-more-btn:hover {
    background: rgba(255, 43, 133, 0.8);
}

/* ---------- Confirm / message pop-ups (assets/js/cheka-ui.js: chekaConfirm, chekaAlert) ---------- */

.cheka-dialog {
    z-index: 5800;
}

.cheka-dialog-card {
    max-width: 380px;
    text-align: center;
}

.cheka-dialog-icon {
    width: 56px;
    height: 56px;
    margin: 4px auto 14px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    color: #FF2B85;
    background: rgba(255, 43, 133, 0.12);
}

.cheka-dialog-card.danger .cheka-dialog-icon {
    color: #ff6b6b;
    background: rgba(255, 68, 68, 0.12);
}

.cheka-dialog-title {
    color: #fff;
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 0 8px;
}

.cheka-dialog-message {
    color: #b5b5b5;
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 0 0 22px;
    word-break: break-word;
    user-select: text;
}

.cheka-dialog-card.danger .cheka-report-send {
    background: linear-gradient(135deg, #e0344f, #ff6b6b);
}

/* Which button Enter presses: a soft ring instead of the browser's hard white one */
.cheka-report-actions button:focus {
    outline: none;
}

.cheka-report-actions button:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.45);
    outline-offset: 2px;
}

/* ---------- Rows of chips that slide sideways (slideRow in assets/js/cheka-ui.js) ---------- */

.activity-tabs,
.category-tabs,
[data-slide-row] {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    -webkit-user-select: none;
    user-select: none;
    cursor: grab;
}

.activity-tabs::-webkit-scrollbar,
.category-tabs::-webkit-scrollbar,
[data-slide-row]::-webkit-scrollbar {
    display: none;
}

.activity-tab,
.category-tab {
    flex-shrink: 0;
    white-space: nowrap;
}

.activity-tabs.dragging,
.category-tabs.dragging,
.admin-menu.dragging {
    cursor: grabbing;
}

/* More chips to the right: the last one fades out */
.scroll-more {
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 48px), transparent);
    mask-image: linear-gradient(to right, #000 calc(100% - 48px), transparent);
}

@media (max-width: 420px) {
    .activity-tab {
        padding: 8px 18px !important;
    }
}

/* "Share image / video" first in the share sheets: the framed file itself */
.share-option-file {
    background: linear-gradient(95deg, rgba(255, 43, 133, 0.18), rgba(255, 179, 71, 0.08)) !important;
}

.share-option .bi-image {
    color: #FFB347;
}
