/* ============================================================
   Execution Mind — AI Credit Store
   Enterprise Dark Theme — Inter font, blue accent on Pay only.
   Uses global CSS variables from styles.css for dark/light mode.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

/* ── Page Shell ────────────────────────────────────────────── */
.store-page {
    min-height: 100vh;
    background: #0B0F17;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-image: none;
    padding: 0 24px 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

body.light-mode .store-page {
    background: #F1F5F9;
    background-image: none;
}

/* ── Store Header ───────────────────────────────────────────── */
.store-header {
    width: 100%;
    max-width: 1060px;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    align-items: center;
    text-align: center;
    padding: 52px 0 24px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 56px;
    gap: 16px;
}

.store-header-content {
    grid-column: 2;
    text-align: center;
}

.store-header-actions {
    grid-column: 3;
    justify-self: end;
    align-self: center;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.store-title {
    font-size: clamp(1.7rem, 3.5vw, 2.4rem);
    font-weight: 700;
    color: #E8ECF4;
    letter-spacing: -0.3px;
    line-height: 1.2;
    font-family: 'Inter', sans-serif;
}

body.light-mode .store-title {
    color: #0F172A;
}

.store-subtitle {
    font-size: 14px;
    color: #A0AABC;
    margin-top: 8px;
    font-weight: 400;
    font-family: 'Inter', sans-serif;
}

body.light-mode .store-subtitle {
    color: #64748B;
}

.store-header-actions .quota-box span,
.store-header-actions #creditsCount {
    color: rgba(241, 245, 249, 0.88);
}

body.light-mode .store-header-actions .quota-box span,
body.light-mode .store-header-actions #creditsCount {
    color: rgba(30, 41, 59, 0.82);
}

/* ── Cards Grid ─────────────────────────────────────────────── */
.store-grid {
    width: 100%;
    max-width: 1060px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
    gap: 24px;
    align-items: center;
}

/* ── Credit Card ────────────────────────────────────────────── */
.credit-card {
    position: relative;
    background: #151B27;
    border: 1px solid #252D3B;
    border-radius: 16px;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 28px 24px 24px;
    transition: border-color 0.2s ease;
    overflow: hidden;
}

.credit-card::before {
    content: none;
}

.credit-card:hover {
    transform: none;
    border-color: rgba(124, 58, 237, 0.22);
    box-shadow: none;
}

body.light-mode .credit-card {
    background: #F8F9FC;
    border-color: #E2E6EE;
}

/* ── Featured Card (Most Popular) ──────────────────────────── */
.credit-card.featured {
    border-color: rgba(124, 58, 237, 0.28);
    box-shadow: none;
    transform: none;
    z-index: 1;
}

.credit-card.featured::before {
    content: none;
}

.credit-card.featured:hover {
    transform: none;
    border-color: rgba(124, 58, 237, 0.45);
    box-shadow: none;
}

body.light-mode .credit-card.featured {
    border-color: rgba(124, 58, 237, 0.28);
    box-shadow: none;
}

/* ── Most Popular Badge ─────────────────────────────────────── */
.badge {
    position: absolute;
    top: 14px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(124, 58, 237, 0.16);
    border: 1px solid rgba(167, 139, 250, 0.48);
    color: #C4B5FD;
    box-shadow: 0 0 14px rgba(124, 58, 237, 0.16);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 3px 12px;
    border-radius: 20px;
    white-space: nowrap;
    font-family: 'Inter', sans-serif;
}

body.light-mode .badge {
    background: rgba(124, 58, 237, 0.12);
    border-color: rgba(124, 58, 237, 0.35);
    color: #7C3AED;
    box-shadow: 0 0 12px rgba(124, 58, 237, 0.12);
}

/* ── Card Top: Image + Label ────────────────────────────────── */
.card-top {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding-top: 24px;
}

.credit-card.featured .card-top {
    padding-top: 30px;
}

.card-image-wrap {
    display: flex;
    justify-content: center;
}

.card-image-wrap img {
    width: 96px;
    height: 96px;
    object-fit: contain;
    filter: none;
    transition: none;
    user-select: none;
}

.credit-card:hover .card-image-wrap img {
    filter: none;
    transform: none;
}

body.light-mode .card-image-wrap img {
    filter: none;
}

/* ── Card Divider ───────────────────────────────────────────── */
.card-divider {
    width: 100%;
    height: 0;
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    margin: 16px 0;
}

body.light-mode .card-divider {
    border-top-color: rgba(0, 0, 0, 0.06);
}

/* ── Credit Label (Package Name) ────────────────────────────── */
.credit-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: #A0AABC;
}

body.light-mode .credit-label {
    color: #64748B;
}

/* ── Pricing Row (single line) ──────────────────────────────── */
.credit-pricing-row {
    display: flex;
    align-items: baseline;
    justify-content: center;
    width: 100%;
    padding: 4px 0;
}

.credit-amount {
    font-size: 1.05rem;
    font-weight: 500;
    color: #E8ECF4;
    letter-spacing: 0;
    font-family: 'Inter', sans-serif;
}

body.light-mode .credit-amount {
    color: #0F172A;
}

.pricing-sep {
    padding: 0 12px;
    color: rgba(255, 255, 255, 0.15);
    font-weight: 300;
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
}

body.light-mode .pricing-sep {
    color: rgba(0, 0, 0, 0.15);
}

.credit-price {
    font-size: 1.05rem;
    font-weight: 600;
    color: #E8ECF4;
    letter-spacing: 0;
    font-family: 'Inter', sans-serif;
}

body.light-mode .credit-price {
    color: #0F172A;
}

/* ── Description ────────────────────────────────────────────── */
.credit-desc {
    font-size: 13px;
    color: #A0AABC;
    line-height: 1.6;
    text-align: center;
    width: 100%;
    font-weight: 400;
    font-family: 'Inter', sans-serif;
}

body.light-mode .credit-desc {
    color: #64748B;
}

/* ── Card Footer / Pay Button ───────────────────────────────── */
.card-footer {
    width: 100%;
    margin-top: 20px;
}

.store-page .pay-btn,
.store-page .btn-pay {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    background: rgba(109, 40, 217, 0.16);
    color: #E8ECF4;
    border: 1px solid rgba(139, 92, 246, 0.38);
    border-radius: 12px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.3px;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 0 12px rgba(124, 58, 237, 0.12);
    font-family: 'Inter', sans-serif;
}

.store-page .pay-btn:hover,
.store-page .btn-pay:hover {
    background: rgba(124, 58, 237, 0.25);
    color: #E8ECF4;
    border-color: rgba(167, 139, 250, 0.7);
    transform: none;
    filter: none;
    box-shadow: 0 4px 14px rgba(124, 58, 237, 0.22);
}

.store-page .pay-btn:active,
.store-page .btn-pay:active {
    transform: none;
    box-shadow: none;
}

body.light-mode .store-page .pay-btn,
body.light-mode .store-page .btn-pay {
    background: rgba(124, 58, 237, 0.08);
    color: #1E293B;
    border-color: rgba(124, 58, 237, 0.28);
}

/* ── Inline alerts (match subscription page) ───────────────── */
.inline-alert {
    padding: 14px 18px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    display: none;
}

.inline-alert.success {
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #22c55e;
}

.inline-alert.error {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

.inline-alert.info {
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: var(--primary);
}

/* ── Store Footer ───────────────────────────────────────────── */
.store-footer {
    width: 100%;
    max-width: 1060px;
    margin-top: 48px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-family: 'Inter', sans-serif;
}

.store-footer p {
    font-size: 13px;
    color: #A0AABC;
    line-height: 1.6;
}

.store-footer-note {
    font-size: 11px !important;
    opacity: 0.5;
    font-style: italic;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 960px) {
    .credit-card.featured,
    .credit-card.featured:hover {
        transform: none;
    }
}

@media (max-width: 680px) {
    .store-page {
        padding: 0 16px 48px;
    }

    .store-header {
        align-items: center;
        margin-bottom: 36px;
        padding: 36px 0 16px;
    }

    .store-header-content {
        text-align: center;
    }

    .store-header-actions .quota-box {
        font-size: 12px;
        padding: 5px 10px;
    }

    .store-header-actions .quota-box span {
        font-size: 13px;
    }

    .store-grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .credit-card {
        padding: 24px 20px 20px;
    }

    .card-top {
        padding-top: 20px;
    }

    .credit-card.featured .card-top {
        padding-top: 26px;
    }
}

@media (max-width: 400px) {
    .store-title {
        font-size: 1.55rem;
    }

    .card-image-wrap img {
        width: 80px;
        height: 80px;
    }

    .credit-pricing-row {
        flex-direction: column;
        align-items: center;
        gap: 2px;
    }

    .pricing-sep {
        display: none;
    }
}

/* ── Menu Toggle Button (opens sidebar) ─────────────────────── */
.menu-toggle-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-main);
    font-size: 20px;
    padding: 6px 13px;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition-fast);
    flex-shrink: 0;
    font-family: 'Inter', sans-serif;
    line-height: 1;
}

.menu-toggle-btn:hover {
    background: rgba(79, 70, 229, 0.08);
    border-color: var(--primary);
    color: var(--primary);
}

@media (max-width: 768px) {
    .store-header {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        border-bottom: none;
        margin-bottom: 0;
        padding-bottom: 0;
    }

    .store-header-actions {
        order: 1;
        position: static;
        grid-column: unset;
        align-self: flex-end;
        display: flex;
        align-items: center;
        justify-content: flex-end;
        gap: 12px;
        width: 100%;
        margin-bottom: 4px;
    }

    .store-header-content {
        order: 2;
        grid-column: unset;
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 100%;
    }

    .store-title {
        width: 100%;
        text-align: center;
        margin-top: 12px;
        padding-bottom: 16px;
        border-bottom: 1px solid var(--border-color);
    }

    .store-subtitle {
        text-align: center;
        margin: 20px 0 28px;
        width: 100%;
    }
}
