/* ==========================================================================
   KIDDIE BLOCKS PH - PREMIUM UI/UX DESIGN SYSTEM & OVERLAYS
   Strictly adheres to PREMIUM_UI_UX.md and BRAND_GUIDELINES.md.
   Brand Colors:
     - Dusty Sky: #9DB6DA
     - Prussian Blue: #091951
     - Cherry Red: #F12020
     - Sunny Yellow: #FFD700
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. GLOBAL MODAL BACKDROP & BASE CONTAINER
   -------------------------------------------------------------------------- */
.kb-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(9, 25, 81, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(10px, 3vw, 20px);
    box-sizing: border-box;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s ease;
    overflow-y: auto;
}

.kb-modal-backdrop.active {
    opacity: 1;
    visibility: visible;
}

.kb-modal-content {
    background: #FFFFFF;
    width: 100%;
    max-width: 540px;
    max-height: min(90vh, 740px);
    display: flex;
    flex-direction: column;
    border-radius: clamp(16px, 3vw, 24px);
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(9, 25, 81, 0.35);
    position: relative;
    transform: scale(0.94) translateY(16px);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    border: 2.5px solid var(--prussian-blue, #091951);
    box-sizing: border-box;
}

.kb-modal-backdrop.active .kb-modal-content {
    transform: scale(1) translateY(0);
}

.kb-modal-close-btn {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(9, 25, 81, 0.1);
    border: none;
    color: #091951;
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10;
}

.kb-modal-close-btn:hover {
    background: #F12020;
    color: #FFFFFF;
    transform: rotate(90deg);
}

/* --------------------------------------------------------------------------
   2. PAYWALL UPGRADE MODAL (Soft Dusty Sky #9DB6DA Background)
   -------------------------------------------------------------------------- */
.kb-paywall-hero {
    background: linear-gradient(145deg, #9DB6DA 0%, #B8CCE6 100%);
    padding: clamp(16px, 4vw, 28px) clamp(16px, 4vw, 26px) clamp(14px, 3vw, 20px) clamp(16px, 4vw, 26px);
    text-align: center;
    position: relative;
    border-bottom: 2px solid rgba(9, 25, 81, 0.12);
    flex-shrink: 0;
}

.kb-paywall-badge {
    display: inline-block;
    background: #091951;
    color: #FFFFFF;
    font-family: 'Montserrat', sans-serif;
    font-size: clamp(7pt, 1.8vw, 8pt);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 5px 14px;
    border-radius: 30px;
    margin-bottom: 10px;
    box-shadow: 0 4px 10px rgba(9, 25, 81, 0.15);
}

.kb-paywall-title {
    font-family: 'ABeeZee', sans-serif;
    color: #091951;
    font-size: clamp(15pt, 3.8vw, 20pt);
    font-weight: 800;
    line-height: 1.22;
    margin: 0 0 8px 0;
}

.kb-paywall-subtitle {
    font-family: 'Montserrat', sans-serif;
    color: #091951;
    font-size: clamp(8.5pt, 2vw, 10pt);
    line-height: 1.45;
    margin: 0 auto;
    max-width: 440px;
    opacity: 0.95;
    font-weight: 500;
}

.kb-paywall-body {
    padding: clamp(16px, 3.5vw, 24px);
    background: #FFFFFF;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(9, 25, 81, 0.2) transparent;
}

.kb-paywall-body::-webkit-scrollbar {
    width: 6px;
}

.kb-paywall-body::-webkit-scrollbar-thumb {
    background-color: rgba(9, 25, 81, 0.2);
    border-radius: 4px;
}

/* Price callout */
.kb-price-card {
    background: #EEF4FC;
    border: 2px dashed #9DB6DA;
    border-radius: 14px;
    padding: clamp(12px, 2.5vw, 16px) clamp(14px, 3vw, 20px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: clamp(14px, 2.5vw, 18px);
}

.kb-price-text {
    text-align: left;
}

.kb-price-label {
    font-size: 8.5pt;
    text-transform: uppercase;
    font-weight: 700;
    color: #64748B;
    letter-spacing: 0.5px;
}

.kb-price-amount {
    font-family: 'ABeeZee', sans-serif;
    font-size: clamp(20pt, 5vw, 26pt);
    font-weight: 800;
    color: #091951;
    line-height: 1.1;
}

.kb-price-cycle {
    font-size: 9pt;
    color: #64748B;
    font-weight: 600;
}

.kb-benefits-list {
    list-style: none;
    padding: 0;
    margin: 0 0 clamp(14px, 2.5vw, 20px) 0;
    text-align: left;
}

.kb-benefits-list li {
    font-family: 'Montserrat', sans-serif;
    font-size: clamp(8.5pt, 2vw, 9.5pt);
    color: #091951;
    margin-bottom: 8px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    line-height: 1.4;
}

.kb-benefit-icon {
    color: #22C55E;
    font-size: 12pt;
    line-height: 1;
    flex-shrink: 0;
    margin-top: 1px;
}

/* Big Cherry Red CTA Button (Min 48px Touch Target) */
.kb-btn-upgrade-cta {
    background: #F12020;
    color: #FFFFFF;
    border: none;
    width: 100%;
    min-height: 48px;
    padding: 12px clamp(16px, 3vw, 24px);
    border-radius: 12px;
    font-family: 'Montserrat', sans-serif;
    font-size: clamp(9.5pt, 2.5vw, 11pt);
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 6px 18px rgba(241, 32, 32, 0.35);
    transition: all 0.25s ease;
    line-height: 1.2;
}

.kb-btn-upgrade-cta:hover {
    background: #D01414;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(241, 32, 32, 0.5);
}

.kb-btn-upgrade-cta:active {
    transform: translateY(0);
}

/* Local Center Cross-Promotion Box */
.kb-local-funnel-box {
    margin-top: clamp(14px, 2.5vw, 18px);
    background: #F8FAFC;
    border: 1.5px solid #E2E8F0;
    border-radius: 12px;
    padding: 12px 14px;
    text-align: center;
}

.kb-local-box-title {
    font-family: 'ABeeZee', sans-serif;
    font-size: 9pt;
    font-weight: 700;
    color: #091951;
    margin-bottom: 4px;
}

.kb-local-box-desc {
    font-size: 8pt;
    color: #475569;
    margin-bottom: 8px;
    line-height: 1.35;
}

.kb-local-packages-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    justify-content: center;
    margin-bottom: 8px;
}

.kb-pill {
    background: #EEF4FC;
    color: #091951;
    font-size: 7.5pt;
    font-weight: 700;
    padding: 2.5px 8px;
    border-radius: 6px;
    border: 1px solid #9DB6DA;
}

.kb-btn-messenger-alt {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #091951;
    color: #FFFFFF;
    text-decoration: none;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 8pt;
    padding: 7px 14px;
    border-radius: 20px;
    transition: all 0.2s;
}

.kb-btn-messenger-alt:hover {
    background: #1A2F75;
    transform: translateY(-1px);
}

/* --------------------------------------------------------------------------
   3. "REQUEST A WORKSHEET" DASHBOARD MODAL
   -------------------------------------------------------------------------- */
.kb-req-header {
    background: linear-gradient(135deg, #091951 0%, #1A2F75 100%);
    color: #FFFFFF;
    padding: clamp(14px, 2.5vw, 20px) clamp(16px, 3.5vw, 26px);
    flex-shrink: 0;
    position: relative;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.kb-req-title {
    font-family: 'ABeeZee', sans-serif;
    font-size: clamp(13pt, 2.8vw, 15pt);
    color: #FFFFFF;
    margin: 0 0 4px 0;
    font-weight: 800;
}

.kb-req-desc {
    font-size: 8.5pt;
    color: #9DB6DA;
    line-height: 1.4;
    margin: 0;
}

/* Enhanced contrast for close button on dark header */
#kbReqCloseBtn,
.kb-req-close-btn {
    color: #FFFFFF;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.35);
}

#kbReqCloseBtn:hover,
.kb-req-close-btn:hover {
    background: #F12020;
    color: #FFFFFF;
    border-color: #F12020;
    transform: rotate(90deg);
}

.kb-req-form-body {
    padding: clamp(16px, 3vw, 22px) clamp(16px, 3.5vw, 26px);
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box;
    scrollbar-width: thin;
    scrollbar-color: rgba(9, 25, 81, 0.2) transparent;
}

.kb-req-form-body::-webkit-scrollbar {
    width: 6px;
}

.kb-req-form-body::-webkit-scrollbar-thumb {
    background-color: rgba(9, 25, 81, 0.2);
    border-radius: 4px;
}

.kb-form-group {
    margin-bottom: clamp(10px, 1.8vw, 14px);
    text-align: left;
}

.kb-form-label {
    display: block;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 8.5pt;
    color: #091951;
    margin-bottom: 5px;
}

.kb-form-select,
.kb-form-input,
.kb-form-textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1.5px solid #CBD5E1;
    border-radius: 9px;
    font-family: 'Montserrat', sans-serif;
    font-size: 9pt;
    color: #091951;
    background: #F8FAFC;
    transition: all 0.2s;
    box-sizing: border-box;
}

.kb-form-textarea {
    resize: vertical;
    min-height: 60px;
}

.kb-form-select:focus,
.kb-form-input:focus,
.kb-form-textarea:focus {
    outline: none;
    border-color: #091951;
    background: #FFFFFF;
    box-shadow: 0 0 0 3px rgba(157, 182, 218, 0.35);
}

.kb-btn-submit-req {
    background: linear-gradient(135deg, #091951 0%, #1A2F75 100%);
    color: #FFFFFF;
    border: none;
    min-height: 46px;
    width: 100%;
    border-radius: 10px;
    font-family: 'Montserrat', sans-serif;
    font-size: 10pt;
    font-weight: 800;
    letter-spacing: 0.3px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 6px;
    margin-bottom: 2px;
    box-shadow: 0 4px 14px rgba(9, 25, 81, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.kb-btn-submit-req:hover {
    background: linear-gradient(135deg, #1A2F75 0%, #2A4395 100%);
    box-shadow: 0 6px 18px rgba(9, 25, 81, 0.35);
    transform: translateY(-1px);
}

.kb-btn-submit-req:active {
    transform: translateY(1px);
}

/* Status Tracker Pills */
.kb-status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 7.5pt;
    font-weight: 800;
    text-transform: uppercase;
}

.kb-status-badge.pending {
    background: #FEF3C7;
    color: #92400E;
}

.kb-status-badge.in-development {
    background: #DBEAFE;
    color: #1E40AF;
}

.kb-status-badge.published {
    background: #DCFCE7;
    color: #166534;
}

/* --------------------------------------------------------------------------
   4. CHANNEL B: TUTORIAL INQUIRY FORM & SUCCESS TOAST
   -------------------------------------------------------------------------- */
.kb-inquiry-card {
    background: #FFFFFF;
    border: 2px solid var(--dusty-sky, #9DB6DA);
    border-radius: 18px;
    padding: clamp(20px, 4vw, 32px);
    box-shadow: 0 8px 25px rgba(9, 25, 81, 0.07);
    margin-top: 30px;
    position: relative;
}

.kb-inquiry-card.sidebar-mode {
    border-radius: 14px;
    padding: 16px;
    margin-top: 20px;
    background: #F8FAFC;
}

.kb-inquiry-header {
    text-align: center;
    margin-bottom: 22px;
}

.kb-inquiry-badge {
    display: inline-block;
    background: #FFF0F0;
    color: #F12020;
    border: 1px solid #FED7D7;
    font-size: 8pt;
    font-weight: 800;
    text-transform: uppercase;
    padding: 3px 10px;
    border-radius: 20px;
    margin-bottom: 8px;
}

.kb-inquiry-title {
    font-family: 'ABeeZee', sans-serif;
    color: #091951;
    font-size: clamp(14pt, 3vw, 18pt);
    font-weight: 800;
    margin-bottom: 6px;
}

.kb-inquiry-subtitle {
    font-size: 9pt;
    color: #64748B;
    line-height: 1.45;
}

.kb-inquiry-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

@media (max-width: 600px) {
    .kb-inquiry-grid-2 {
        grid-template-columns: 1fr;
        gap: 10px;
    }
}

.kb-inquiry-btn-submit {
    background: #F12020;
    color: #FFFFFF;
    border: none;
    min-height: 50px;
    width: 100%;
    border-radius: 12px;
    font-family: 'Montserrat', sans-serif;
    font-size: 10.5pt;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(241, 32, 32, 0.35);
    transition: all 0.2s ease;
    margin-top: 8px;
}

.kb-inquiry-btn-submit:hover {
    background: #D01414;
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(241, 32, 32, 0.45);
}

/* Floating Success Toast */
.kb-inquiry-toast {
    position: fixed;
    bottom: 24px;
    left: 24px;
    max-width: 440px;
    background: #FFFFFF;
    border: 2px solid #10B981;
    border-radius: 16px;
    padding: 16px 18px;
    box-shadow: 0 15px 35px rgba(9, 25, 81, 0.2);
    z-index: 999999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.kb-inquiry-toast.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

@media (max-width: 600px) {
    .kb-inquiry-toast {
        left: 16px;
        right: 16px;
        bottom: 85px; /* Above the FAB on small mobile */
        max-width: none;
    }
}

/* Navbar 30-Day Member Status Chip */
.kb-navbar-member-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #FEF9C3;
    color: #854D0E;
    border: 1.5px solid #FACC15;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 8pt;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(133, 77, 14, 0.1);
    transition: all 0.2s ease;
    white-space: nowrap;
}

.kb-navbar-member-chip:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(133, 77, 14, 0.2);
}

.kb-navbar-member-chip.warning {
    background: #FEE2E2;
    color: #991B1B;
    border-color: #F87171;
    animation: pulseSlow 2s infinite;
}

.kb-navbar-member-chip.expired {
    background: #F3F4F6;
    color: #4B5563;
    border-color: #D1D5DB;
}

@keyframes pulseSlow {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.85; }
}

/* --------------------------------------------------------------------------
   5. LANDSCAPE ORIENTATION MODAL OPTIMIZATION
   -------------------------------------------------------------------------- */
@media screen and (max-height: 520px) and (orientation: landscape) {
    .kb-modal-backdrop {
        padding: 6px;
    }
    .kb-modal-content {
        max-height: 96vh;
        max-width: 580px;
        border-radius: 14px;
    }
    .kb-paywall-hero {
        padding: 10px 16px 8px 16px;
    }
    .kb-paywall-badge {
        margin-bottom: 4px;
        padding: 3px 10px;
        font-size: 7pt;
    }
    .kb-paywall-title {
        font-size: 13pt;
        margin-bottom: 2px;
    }
    .kb-paywall-subtitle {
        display: none;
    }
    .kb-paywall-body {
        padding: 10px 16px;
    }
    .kb-price-card {
        padding: 8px 14px;
        margin-bottom: 10px;
    }
    .kb-benefits-list {
        margin-bottom: 10px;
    }
    .kb-benefits-list li {
        margin-bottom: 4px;
        font-size: 8pt;
    }
    .kb-btn-upgrade-cta {
        min-height: 42px;
        padding: 8px 16px;
        font-size: 9.5pt;
    }
    .kb-local-funnel-box {
        margin-top: 8px;
        padding: 8px 10px;
    }
    .kb-req-header {
        padding: 8px 14px;
    }
    .kb-req-desc {
        display: none;
    }
    .kb-req-title {
        font-size: 12pt;
        margin-bottom: 2px;
    }
    .kb-req-form-body {
        padding: 10px 14px;
    }
    .kb-form-group {
        margin-bottom: 8px;
    }
}

/* --------------------------------------------------------------------------
   5. STRICT PRINT ENGINE PRESERVATION
   -------------------------------------------------------------------------- */
@media print {
    .kb-modal-backdrop,
    .kb-modal-content,
    .kb-paywall-hero,
    .kb-btn-upgrade-cta,
    .kb-local-funnel-box,
    .kb-inquiry-card,
    .kb-inquiry-toast,
    .kb-navbar-member-chip,
    form[data-inquiry-form],
    .section-inquiry,
    .fab-messenger,
    .fab-pulse,
    #kbAdminPortal,
    .admin-wrapper {
        display: none !important;
        visibility: hidden !important;
        height: 0 !important;
        width: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
    }
}
