/**
 * GP Business Left Menu + Dashboard Layout Styles
 * Matches Gripar sidebar design
 */

/* ================================================================
   FULL-PAGE LAYOUT OVERRIDE
   Breaks out of WordPress / Blocksy theme constraints
   ================================================================ */

.site-main .ct-container-full[data-content="normal"],
.site-main .ct-container {
    max-width: 100% !important;
    width: 100% !important;
    padding: 0 !important;
    --theme-content-vertical-spacing: 0px !important;
}

.entry-content.is-layout-constrained,
.entry-content.is-layout-constrained > * {
    max-width: 100% !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

.wp-block-columns,
.wp-block-column {
    margin: 0 !important;
    padding: 0 !important;
    max-width: 100% !important;
    flex-basis: 100% !important;
}

/* ================================================================
   #gp-page — Full screen two-column layout
   ================================================================ */

#gp-page {
    width: 100vw !important;
    max-width: 100vw !important;
    margin-left: calc(50% - 50vw) !important;
    padding: 0 !important;
    display: flex !important;
    flex-wrap: nowrap !important;
    flex-direction: row !important;
    align-items: stretch !important;
    box-sizing: border-box !important;
    min-height: 100vh !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ================================================================
   LEFT SIDEBAR
   ================================================================ */

#gp-page-sidebar {
    width: 250px !important;
    min-width: 250px !important;
    max-width: 250px !important;
    flex: 0 0 250px !important;
    background-color: #1e2d3d !important;
    display: flex !important;
    flex-direction: column !important;
    position: relative !important;
    z-index: 100 !important;
}

/* Menu container fills sidebar width */
.gp-business-menu-container {
    width: 100%;
    min-width: 100%;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    max-height: 100vh;
    background: #1e2d3d;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
}

/* ================================================================
   BRAND HEADER (top of sidebar)
   ================================================================ */

.gp-left-menu-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 20px;
    background: #1e2d3d;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    text-decoration: none;
    flex-shrink: 0;
}

.gp-left-menu-brand:hover {
    background: rgba(255, 255, 255, 0.04);
    text-decoration: none;
}

.gp-left-menu-brand-icon {
    width: 38px;
    height: 38px;
    background: #6c5ce7;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 18px;
    color: #fff;
}

.gp-left-menu-brand-name {
    color: #ffffff;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.2px;
}

/* ================================================================
   LOADING / ERROR
   ================================================================ */

.gp-left-menu-loading,
.gp-left-menu-error {
    padding: 20px;
    text-align: center;
    color: rgba(255, 255, 255, 0.4);
    font-size: 13px;
}

.gp-left-menu-error { color: #ef4444; }

/* ================================================================
   MENU LIST
   ================================================================ */

.gp-left-menu-list { display: none; }

.gp-left-menu-items,
.gp-left-submenu {
    list-style: none;
    margin: 0;
    padding: 8px 0;
}

/* ================================================================
   MENU ITEMS
   ================================================================ */

.gp-left-menu-item {
    position: relative;
}

/* ================================================================
   MENU LINKS / ACTIONS / LABELS
   ================================================================ */

.gp-left-menu-link,
.gp-left-menu-action,
.gp-left-menu-label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 20px;
    color: #b0bec5;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease;
    cursor: pointer;
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    font-size: 14px;
    font-family: inherit;
    font-weight: 400;
    box-sizing: border-box;
}

/* Bullet dot prefix */
.gp-left-menu-link::before,
.gp-left-menu-action::before {
    content: '•';
    font-size: 10px;
    color: #546e7a;
    flex-shrink: 0;
    transition: color 0.15s ease;
    line-height: 1;
}

.gp-left-menu-link:hover,
.gp-left-menu-action:hover {
    background-color: rgba(255, 255, 255, 0.06);
    color: #ffffff;
    text-decoration: none;
}

.gp-left-menu-link:hover::before,
.gp-left-menu-action:hover::before {
    color: #6c5ce7;
}

/* Section labels */
.gp-left-menu-label {
    font-weight: 600;
    color: #546e7a;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 16px 20px 6px;
    cursor: default;
}

.gp-left-menu-label::before { display: none; }

.gp-left-menu-text { flex: 1; }

/* ================================================================
   DROPDOWN ARROWS
   ================================================================ */

.gp-left-menu-arrow {
    margin-left: auto;
    font-size: 11px;
    transition: transform 0.2s ease;
    color: #546e7a;
}

.gp-left-menu-open > .gp-left-menu-link .gp-left-menu-arrow,
.gp-left-menu-open > .gp-left-menu-action .gp-left-menu-arrow {
    transform: rotate(180deg);
}

/* ================================================================
   SUBMENU
   ================================================================ */

.gp-left-submenu {
    display: none;
    background-color: rgba(0, 0, 0, 0.15);
    padding: 4px 0;
    overflow: hidden;
    animation: gpMenuSlideDown 0.2s ease-out;
}

.gp-left-menu-open > .gp-left-submenu { display: block; }

.gp-left-submenu .gp-left-menu-link,
.gp-left-submenu .gp-left-menu-action,
.gp-left-submenu .gp-left-menu-label {
    padding: 9px 20px 9px 44px;
    font-size: 13px;
    color: #90a4ae;
}

.gp-left-submenu .gp-left-menu-link::before,
.gp-left-submenu .gp-left-menu-action::before { font-size: 8px; }

.gp-left-submenu .gp-left-menu-link:hover,
.gp-left-submenu .gp-left-menu-action:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: #ffffff;
}

/* 3rd level */
.gp-left-submenu .gp-left-submenu .gp-left-menu-link,
.gp-left-submenu .gp-left-submenu .gp-left-menu-action {
    padding-left: 60px;
}

/* ================================================================
   ACTIVE STATE
   ================================================================ */

.gp-left-menu-item.gp-left-menu-active > .gp-left-menu-link,
.gp-left-menu-item.gp-left-menu-active > .gp-left-menu-action {
    color: #ffffff !important;
    font-weight: 500;
    background-color: rgba(108, 92, 231, 0.2);
}

.gp-left-menu-item.gp-left-menu-active > .gp-left-menu-link::before,
.gp-left-menu-item.gp-left-menu-active > .gp-left-menu-action::before {
    color: #6c5ce7 !important;
}

/* ================================================================
   RIGHT PANEL
   ================================================================ */

#gp-page-right {
    width: calc(100% - 250px) !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    background: #f0f4f8;
}

/* ================================================================
   TOP HEADER BAR
   ================================================================ */

#gp-page-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    background: #ffffff !important;
    padding: 14px 28px !important;
    border-bottom: 1px solid #e2e8f0 !important;
    width: 100% !important;
    box-sizing: border-box !important;
    flex-shrink: 0 !important;
}

.gp-header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.gp-header-left h1 {
    margin: 0 !important;
    padding: 0 !important;
    font-size: 22px !important;
    font-weight: 700 !important;
    color: #1a202c !important;
    line-height: 1 !important;
    letter-spacing: -0.3px !important;
}

.gp-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

#gp-header-email {
    font-size: 14px;
    color: #64748b;
}

.gp-header-role-badge {
    display: inline-flex;
    align-items: center;
    background: #6c5ce7;
    color: #ffffff;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 20px;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    white-space: nowrap;
}

/* Mobile sidebar toggle — hidden on desktop */
.gp-mobile-toggle,
.gp-sidebar-close-btn {
    display: none !important;
}

/* ================================================================
   LOGOUT BUTTON
   ================================================================ */

#gp-logout-btn {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    background: #ef4444 !important;
    color: #ffffff !important;
    border: none !important;
    padding: 8px 18px !important;
    border-radius: 6px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    transition: background 0.15s ease !important;
    font-family: inherit !important;
    text-decoration: none !important;
}

#gp-logout-btn:hover { background: #dc2626 !important; }

/* ================================================================
   MAIN CONTENT AREA
   ================================================================ */

#gp-page-main {
    flex: 1;
    padding: 32px 28px;
    box-sizing: border-box;
}

/* ================================================================
   DASHBOARD CONTENT COMPONENTS
   ================================================================ */

#gp-dashboard-loading {
    padding: 60px 20px;
    text-align: center;
    color: #94a3b8;
    font-size: 15px;
}

.gp-section-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 20px 24px;
    margin-bottom: 24px;
}

.gp-section-card-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 600;
    color: #1a202c;
    padding-bottom: 14px;
    border-bottom: 1px solid #f1f5f9;
    margin-bottom: 18px;
}

.gp-section-card-title i { color: #6c5ce7; }

.gp-welcome-text {
    color: #64748b;
    font-size: 14px;
    margin: 0 0 20px;
}

/* Quick tiles grid */
.gp-tiles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}

.gp-tile {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 18px 20px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.gp-tile:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    border-color: #6c5ce7;
    text-decoration: none;
    color: inherit;
}

.gp-tile-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.gp-tile-icon.purple { background: #f0ecff; color: #6c5ce7; }
.gp-tile-icon.blue   { background: #e3f2fd; color: #3b82f6; }
.gp-tile-icon.green  { background: #e8f5e9; color: #22c55e; }
.gp-tile-icon.yellow { background: #fff8e1; color: #f59e0b; }
.gp-tile-icon.red    { background: #fef2f2; color: #ef4444; }

.gp-tile-body h4 {
    margin: 0 0 4px;
    font-size: 15px;
    font-weight: 600;
    color: #1a202c;
}

.gp-tile-body p {
    margin: 0;
    font-size: 13px;
    color: #94a3b8;
}

/* ================================================================
   ACCOUNT / MFA SECTION
   ================================================================ */

.gp-account-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.gp-account-info strong { font-size: 14px; color: #374151; }
.gp-account-info span   { font-size: 14px; color: #64748b; margin-left: 6px; }

#gp-setup-mfa-btn {
    background: #6c5ce7;
    color: #fff;
    border: none;
    padding: 9px 18px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s ease;
    font-family: inherit;
    display: none;
}

#gp-setup-mfa-btn:hover { background: #5b4bd5; }

.gp-mfa-active-badge {
    display: none;
    align-items: center;
    gap: 6px;
    background: #e8f5e9;
    color: #16a34a;
    font-size: 13px;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 20px;
}

/* ================================================================
   MFA MODAL
   ================================================================ */

#gp-mfa-modal {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.45);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

#gp-mfa-modal.active { display: flex; }

.gp-modal-box {
    background: #fff;
    width: 90%;
    max-width: 380px;
    padding: 32px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.gp-modal-box h3 {
    margin: 0 0 8px;
    font-size: 18px;
    font-weight: 700;
    color: #1a202c;
}

.gp-modal-subtitle {
    font-size: 13px;
    color: #64748b;
    margin: 0 0 20px;
}

#gp-mfa-qr-img {
    border: 1px solid #e2e8f0;
    padding: 8px;
    border-radius: 8px;
    margin-bottom: 16px;
    width: 160px;
    height: 160px;
}

#gp-mfa-verify-code {
    padding: 10px 14px;
    font-size: 20px;
    text-align: center;
    width: 140px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    letter-spacing: 4px;
    font-family: monospace;
    outline: none;
    transition: border-color 0.15s;
    box-sizing: border-box;
}

#gp-mfa-verify-code:focus {
    border-color: #6c5ce7;
    box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.12);
}

#gp-mfa-confirm-btn {
    background: #22c55e;
    color: #fff;
    border: none;
    padding: 10px 24px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    margin-top: 14px;
    font-family: inherit;
    transition: background 0.15s;
}

#gp-mfa-confirm-btn:hover { background: #16a34a; }

#gp-mfa-cancel-btn {
    background: none;
    border: none;
    margin-top: 10px;
    cursor: pointer;
    font-size: 13px;
    color: #94a3b8;
    text-decoration: underline;
    font-family: inherit;
    display: block;
    width: 100%;
}

#gp-mfa-msg {
    margin-top: 12px;
    font-size: 13px;
    font-weight: 500;
    min-height: 18px;
}

#gp-dashboard-error {
    color: #ef4444;
    margin-top: 12px;
    font-size: 14px;
    text-align: center;
}

/* ================================================================
   ANIMATIONS
   ================================================================ */

@keyframes gpMenuSlideDown {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.fa-spinner { animation: gpSpin 1s linear infinite; }

@keyframes gpSpin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* ================================================================
   SCROLLBAR
   ================================================================ */

.gp-business-menu-container::-webkit-scrollbar { width: 4px; }
.gp-business-menu-container::-webkit-scrollbar-track { background: transparent; }
.gp-business-menu-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}
.gp-business-menu-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* ================================================================
   MOBILE
   ================================================================ */

@media (max-width: 768px) {
    #gp-page {
        flex-direction: column !important;
        min-height: 100vh !important;
    }

    #gp-page-sidebar {
        display: none !important;
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        flex: none !important;
        position: relative !important;
        order: 1 !important;
    }

    #gp-page-sidebar.active {
        display: block !important;
    }

    .gp-business-menu-container {
        max-height: none !important;
        overflow: visible !important;
    }

    #gp-page-right {
        width: 100% !important;
        order: 2 !important;
    }

    #gp-page-header {
        padding: 12px 16px !important;
        min-height: 58px !important;
    }

    #gp-header-email {
        display: none !important;
    }

    .gp-header-role-badge {
        display: none !important;
    }

    #gp-page-main {
        padding: 20px 16px !important;
    }

    .gp-mobile-toggle {
        display: inline-flex !important;
        background: transparent !important;
        color: #334155 !important;
        border: none !important;
        font-size: 22px !important;
        cursor: pointer !important;
        padding: 4px !important;
        align-items: center !important;
    }

    .gp-sidebar-close-btn {
        display: flex !important;
        align-items: center !important;
        gap: 10px !important;
        width: 100% !important;
        padding: 15px 20px !important;
        background: #16212e !important;
        color: #ef4444 !important;
        border: none !important;
        font-size: 16px !important;
        font-weight: 600 !important;
        cursor: pointer !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
        font-family: inherit !important;
    }

    .gp-tiles-grid {
        grid-template-columns: 1fr !important;
    }
}