@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;700&display=swap');

:root {
    --primary: #960034;
    --success: #00c742;
    --bg-overlay: rgba(15, 15, 15, 0.85);
    --card-bg: rgba(255, 255, 255, 0.08);
}

body {
    font-family: 'Inter', sans-serif;
    margin: 0;
    background: #000 url('/static/images/bg.jpg') center/cover no-repeat fixed;
    color: #fff;
    height: 100dvh;
    display: flex;
    justify-content: center;
    overflow: hidden;
}

/* Glassmorphism Container */
.container {
    width: 100%;
    min-height: 100dvh; /* Minimum full screen height */
    max-width: 480px;
    background: var(--bg-overlay);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    display: flex;
    flex-direction: column;
    padding: 20px;
    box-sizing: border-box;
    overflow-y: auto; /* Enable scrolling when content overflows */
}

/* Header & Scroll Area */
h2 {
    font-size: 1.4rem;
    color: var(--primary);
    margin: 10px 0 5px 0;
}

.instructions {
    font-size: 0.85rem;
    color: #aaa;
    margin-bottom: 20px;
}

/* Scrollable area for questions */
#surveyForm, #summary {
    flex: 1;
    overflow-y: auto;
    padding-right: 5px;
    display: flex;
    flex-direction: column;
    gap: 8px; /* More compact spacing */
}

/* Compact Option Cards */
label {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: var(--card-bg);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: 0.2s;
    cursor: pointer;
    user-select: none;
}

label:has(input:checked) {
    background: rgba(255, 77, 77, 0.15);
    border-color: var(--primary);
}

label input { display: none; }

.option-name {
    flex: 1;
    font-size: 0.95rem;
    font-weight: 500;
}

.option-price {
    font-size: 0.9rem;
    color: var(--success);
    font-weight: 600;
}

/* Footer Navigation (Sticky Bottom) */
.nav-buttons {
    padding-top: 20px;
    display: grid;
    grid-template-columns: 1fr 2fr; /* Larger "Next" button */
    gap: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* If it's the first page/index, just show one button */
.nav-buttons:has(button:only-child) {
    grid-template-columns: 1fr;
}

button {
    padding: 14px;
    border-radius: 12px;
    border: none;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: 0.2s;
}

button[onclick*="nextPage"], button[onclick*='/question'] {
    background: var(--primary);
    color: white;
}

button[onclick*="restart"] {
    background: rgba(255,255,255,0.1);
    color: white;
}

button:active { transform: scale(0.96); }

/* Total Display */
h3 {
    font-size: 1rem;
    margin: 15px 0;
    text-align: right;
    color: #eee;
}

/* Layout adjustment for the label content */
.option-content {
    display: flex;
    flex-direction: column; /* Stack Name and Potential */
    flex: 1;
}

.option-potential {
    font-size: 0.75rem;
    color: #777; /* Subtle grey */
    font-style: italic;
    margin-top: 2px;
}

/* Ensure the price still aligns vertically with the stacked text */
label {
    align-items: center; 
}

/* Optional: Highlight the potential when the item is checked */
label:has(input:checked) .option-potential {
    color: var(--primary);
    opacity: 0.8;
}

#totalPrice, #maxTotal {
    font-weight: bold;
    margin-right: 5px;
}

/* Combined Balance + Shop Card */

.balance-shop-card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);

    padding: 18px;
    border-radius: 16px;

    border: 1px solid rgba(255,255,255,0.1);

    margin-bottom: 25px;

    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;

    box-shadow: 0 8px 32px rgba(0,0,0,0.35);
}

/* Mobile stacking */
@media (max-width: 420px) {
    .balance-shop-card {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
}

.balance-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.balance-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #aaa;
    font-weight: 700;
}

.balance-amount {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--success);
    text-shadow: 0 0 18px rgba(0,199,66,0.2);
}

/* Shop Button */

.shop-button {
    padding: 12px 18px;
    border-radius: 12px;

    background: var(--primary);
    color: white;

    font-weight: 700;
    font-size: 0.95rem;

    cursor: pointer;
    border: none;

    box-shadow: 0 4px 14px rgba(150,0,52,0.3);
}

.shop-button:active {
    transform: scale(0.96);
}