/* ============================================================
   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: var(--bg-body);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-image:
        radial-gradient(ellipse 65% 40% at 50% 0%, rgba(30, 20, 80, 0.08) 0%, transparent 70%);
    padding: 0 24px 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

body.light-mode .store-page {
    background-image: none;
}

/* ── Store Header ───────────────────────────────────────────── */
.store-header {
    width: 100%;
    max-width: 1060px;
    display: grid;
    grid-template-columns: 1fr auto 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: var(--text-main);
    letter-spacing: -0.3px;
    line-height: 1.2;
    font-family: 'Inter', sans-serif;
}

.store-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 8px;
    font-weight: 400;
    font-family: 'Inter', sans-serif;
}

/* ── 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: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 28px 24px 24px;
    transition: var(--transition-smooth);
    overflow: hidden;
}

.credit-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 16px;
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.015) 0%, transparent 50%);
    pointer-events: none;
}

.credit-card:hover {
    transform: translateY(-4px);
    border-color: rgba(79, 70, 229, 0.2);
    box-shadow:
        0 12px 36px rgba(0, 0, 0, 0.3),
        0 2px 8px rgba(0, 0, 0, 0.2);
}

/* ── Featured Card (Most Popular) ──────────────────────────── */
.credit-card.featured {
    border-color: rgba(79, 70, 229, 0.28);
    box-shadow:
        0 8px 30px rgba(0, 0, 0, 0.25),
        0 2px 8px rgba(0, 0, 0, 0.2);
    transform: scale(1.04);
    z-index: 1;
}

.credit-card.featured::before {
    background: linear-gradient(160deg, rgba(79, 70, 229, 0.04) 0%, transparent 50%);
}

.credit-card.featured:hover {
    transform: scale(1.04) translateY(-4px);
    border-color: rgba(79, 70, 229, 0.4);
    box-shadow:
        0 16px 44px rgba(0, 0, 0, 0.35),
        0 4px 12px rgba(0, 0, 0, 0.25);
}

body.light-mode .credit-card.featured {
    box-shadow:
        0 4px 20px rgba(0, 0, 0, 0.08),
        0 1px 4px rgba(0, 0, 0, 0.05);
}

/* ── Most Popular Badge ─────────────────────────────────────── */
.badge {
    position: absolute;
    top: 14px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(79, 70, 229, 0.15);
    border: 1px solid rgba(79, 70, 229, 0.3);
    color: rgba(139, 132, 255, 0.9);
    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(79, 70, 229, 0.08);
    color: var(--primary);
}

/* ── 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: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.45));
    transition: var(--transition-smooth);
    user-select: none;
}

.credit-card:hover .card-image-wrap img {
    filter: drop-shadow(0 4px 14px rgba(79, 70, 229, 0.2));
    transform: scale(1.04);
}

body.light-mode .card-image-wrap img {
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.15));
}

/* ── 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: var(--text-muted);
}

/* ── 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: var(--text-main);
    letter-spacing: 0;
    font-family: 'Inter', sans-serif;
}

.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: var(--text-main);
    letter-spacing: 0;
    font-family: 'Inter', sans-serif;
}

/* ── Description ────────────────────────────────────────────── */
.credit-desc {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.6;
    text-align: center;
    width: 100%;
    font-weight: 400;
    font-family: 'Inter', sans-serif;
}

/* ── Card Footer / Pay Button ───────────────────────────────── */
.card-footer {
    width: 100%;
    margin-top: 20px;
}

.pay-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: var(--primary);
    border: 1.5px solid rgba(79, 70, 229, 0.4);
    border-radius: 10px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.3px;
    cursor: pointer;
    transition: var(--transition-fast);
    box-shadow: none;
    font-family: 'Inter', sans-serif;
}

.pay-btn:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 18px rgba(79, 70, 229, 0.3);
}

.pay-btn:active {
    transform: translateY(1px);
    box-shadow: 0 1px 6px rgba(79, 70, 229, 0.2);
}

/* ── 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: var(--text-muted);
    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 {
        transform: scale(1.0);
    }

    .credit-card.featured:hover {
        transform: translateY(-4px);
    }
}

@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%;
    }
}
