/**
 * File: demo/portal/assets/css/portal.css
 * Purpose: Self-contained customer-portal DEMO shell + demo-only additions.
 * Reuses copied app style.css + style_plus.css; no global app CSS is touched.
 * No external CDNs; local Outfit font.
 */

/* ---------- Local Outfit font (was an external Google Fonts @import) ---------- */
@font-face {
    font-family: 'Outfit';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('../fonts/outfit-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: 'Outfit';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('../fonts/outfit-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- Application shell (copied semantics from app/template/layout.php) ---------- */
:root { --header-h: 64px; }

.page-wrapper { position: relative; min-height: 100vh; }

/* Sidebar */
.sidebar::-webkit-scrollbar { width: 0; height: 0; }
.sidebar { scrollbar-width: none; -ms-overflow-style: none; }

@media (min-width: 1024px) {
    .sidebar {
        position: fixed !important;
        top: var(--header-h) !important;
        bottom: 0 !important;
        left: 0 !important;
        width: 90px !important;
        min-width: 90px !important;
        max-width: 90px !important;
        height: auto !important;
        z-index: 50;
        padding-top: 1.25rem;
        box-sizing: border-box;
        transition: none !important;
    }
    .sidebar:hover { width: 90px !important; min-width: 90px !important; max-width: 90px !important; }
    .sidebar * { transition: none !important; }
    .sidebar nav h3 { margin-top: 0.5rem; }
    .menu-item-text {
        display: block !important;
        font-size: 0.65rem !important;
        line-height: 1 !important;
        text-align: center;
        margin-top: 0.25rem;
        padding: 0 2px;
        word-break: break-word;
        overflow-wrap: break-word;
    }
}

@media (max-width: 1023px) {
    .sidebar {
        top: var(--header-h) !important;
        height: calc(100vh - var(--header-h)) !important;
        width: 130px !important;
        min-width: 130px !important;
        max-width: 130px !important;
        z-index: 50;
    }
    .menu-item-text { font-size: 0.875rem !important; white-space: nowrap; }
}

/* style_plus.css sidebar overrides (kept, scoped to this demo) */
.sidebar { scrollbar-width: none; -ms-overflow-style: none; }
@media (min-width: 1024px) {
    .sidebar { width: 110px; min-width: 110px; flex-basis: 110px; }
}
/* The layout inline rule forces 90px on desktop; mirror app precedence. */
@media (min-width: 1024px) { .sidebar { width: 90px !important; min-width: 90px !important; max-width: 90px !important; } }
.menu-item-text { white-space: nowrap; }

/* Header */
.header { position: fixed; top: 0; left: 0; right: 0; height: var(--header-h); z-index: 60; }
.header-logo { height: 32px; width: 32px; }

/* Main content */
.content-area {
    position: fixed;
    top: var(--header-h);
    right: 0;
    bottom: 0;
    left: 0;
    overflow-y: auto;
    overflow-x: hidden;
}
@media (min-width: 1024px) {
    .content-area { left: 90px; }
    .content-area > main > div { padding-left: 1rem; padding-right: 1.5rem; }
}

/* Mobile dropdown */
.mobile-dropdown { position: absolute; top: 100%; left: 0; right: 0; z-index: 70; background-color: rgb(255 255 255); }
.dark .mobile-dropdown { background-color: rgb(17 24 39); }

svg.dark\:hidden { color: #374151; }

/* Sidebar overlay */
.sidebar-overlay { position: fixed; width: 100%; height: 100vh; z-index: 45; background-color: rgb(17 24 39 / 0.5); }

/* SweetAlert compact sizing (from app style_plus.css) */
html body .swal2-container .swal2-popup { font-size: 0.85rem !important; padding: 1.1rem 1.3rem !important; width: 26rem !important; max-width: calc(100vw - 2rem) !important; }
html body .swal2-container .swal2-title { font-size: 1.1rem !important; margin: 0 0 0.5rem 0 !important; }
html body .swal2-container .swal2-html-container { font-size: 0.85rem !important; margin: 0.5rem 0 0 0 !important; }
html body .swal2-container .swal2-actions { margin-top: 1rem !important; }
html body .swal2-container .swal2-confirm,
html body .swal2-container .swal2-cancel { font-size: 0.8rem !important; padding: 0.45rem 0.9rem !important; }

/* ---------- DEMO-ONLY additions ---------- */
/* Permanent Demo Mode indicator */
.demo-mode-pill {
    display: inline-flex; align-items: center; gap: 0.35rem;
    border-radius: 9999px; padding: 0.15rem 0.6rem;
    font-size: 11px; font-weight: 700; letter-spacing: 0.04em; line-height: 1;
    text-transform: uppercase; white-space: nowrap;
    background: #FEF3C7; color: #92400E; border: 1px solid #FDE68A;
}
.dark .demo-mode-pill { background: rgba(146, 64, 14, 0.35); color: #FCD34D; border-color: rgba(146, 64, 14, 0.5); }
.demo-mode-pill__dot { width: 7px; height: 7px; border-radius: 9999px; background: #F59E0B; }

/* Guided tour mount point and target hooks (tour visuals live in demo-tour.css) */
#demo-tour-root { position: relative; z-index: 200; }
[data-tour] { /* target hooks only; no styling */ }

/* "Coming soon" placeholder */
.demo-placeholder {
    display: flex; min-height: 60vh; flex-direction: column; align-items: center; justify-content: center;
    text-align: center; padding: 2rem;
}

/* x-cloak replacement safety */
[x-cloak] { display: none !important; }

/* --- shared modal conventions (app style, page-scoped) --- */
.modal { position: fixed; inset: 0; background-color: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center; z-index: 9999; visibility: hidden; opacity: 0; transition: visibility .15s, opacity .15s; }
.modal.show { visibility: visible; opacity: 1; }
.modal.hidden { visibility: hidden; opacity: 0; }
.modal-content { background: white; border-radius: 1rem; max-width: 900px; width: 92%; max-height: 90vh; overflow-y: auto; padding: 1.5rem; box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1); }
.dark .modal-content { background: rgb(17,24,39); color: white; }

/*
 * DataTables dark theme: the copied datatables.css darkens the search input
 * background (`:root.dark`), but the demo content canvas stays light, so the
 * input's inherited text colour would be black-on-dark. Keep it readable.
 */
.dark .dt-container .dt-search input {
    color: #E4E7EC;
}
.dark .dt-container .dt-search input::placeholder {
    color: #98A2B3;
}
/* --- shared workflow-step button conventions (fixes label overflow; app `.workflow-step-btn`) --- */
.workflow-step-btn {
    display: inline-flex;
    align-items: center;           /* vertical centre */
    justify-content: center;       /* horizontal centre */
    text-align: center;
    width: 100%;                   /* full width on mobile */
    min-height: 38px;              /* consistent height */
    padding-left: 1rem;            /* sufficient horizontal padding */
    padding-right: 1rem;
    line-height: 1.15;
    white-space: normal;           /* do NOT clip longer labels */
    overflow-wrap: break-word;
    word-break: normal;
    box-sizing: border-box;
}
.workflow-step-btn:disabled { cursor: not-allowed; }
@media (min-width: 640px) {
    /* desktop: auto width, retain min width, stay right-aligned */
    .workflow-step-btn { width: auto; min-width: 10.625rem; }  /* 170px min, grows for longer labels */
}
/* container right-alignment on desktop */
.workflow-step-actions { margin-top: 0.75rem; }
@media (min-width: 640px) { .workflow-step-actions { margin-top: 0; text-align: right; } }

/* --- other buttons: avoid label overflow, keep padding, no fixed clipping --- */
.demo-btn { overflow-wrap: break-word; word-break: normal; line-height: 1.15; min-height: 38px; box-sizing: border-box; }
/* ---------- Cosmetics product table sizing (mirrors app/products_cosmetics.php) ---------- */
#cosmeticsProductsTable td.cosmetics-family-cell {
    white-space: normal !important;
    min-width: 8rem;
    max-width: 28rem;
    vertical-align: top;
}
#cosmeticsProductsTable td.cosmetics-title-cell {
    white-space: normal !important;
    min-width: 9rem;
    max-width: 26rem;
    vertical-align: top;
}

/* ---------- Cosmetics document library: keep the document name readable on mobile ---------- */
#cosmeticsDocumentsTable td:first-child {
    white-space: normal !important;
}
@media (max-width: 640px) {
    #cosmeticsDocumentsTable th:first-child,
    #cosmeticsDocumentsTable td:first-child {
        max-width: 11rem;
    }
}

/* ---------- Header Actions dropdown (mirrors app/template/partials/header.php) ---------- */
.demo-header-actions-menu {
    position: absolute;
    top: 100%;
    right: 0;
    z-index: 80;
    display: flex;
    flex-direction: column;
    width: 350px;
    max-width: calc(100vw - 1rem);
    height: 340px;
    margin-top: 17px;
    padding: 0.75rem;
    border: 1px solid #E5E7EB;
    border-radius: 1rem;
    background: #FFFFFF;
    box-shadow: 0 12px 16px -4px rgba(16, 24, 40, 0.08), 0 4px 6px -2px rgba(16, 24, 40, 0.03);
}
.demo-header-actions-menu.hidden { display: none; }
.demo-header-actions-menu--mobile {
    position: fixed;
    top: 64px;
    left: 1rem;
    right: 1rem;
    width: auto;
    max-width: 420px;
    margin: 0 auto;
}
@media (min-width: 640px) {
    .demo-header-actions-menu { width: 361px; }
}

/* ---------- Guides two-column layout (mirrors app/guides.php) ---------- */
.guides-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}
@media (min-width: 1024px) {
    .guides-layout {
        grid-template-columns: 280px minmax(0, 1fr);
        align-items: start;
    }
}
