/* --- FONT --- */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&family=Orbitron:wght@700&display=swap');

/* --- VARIABILI GLOBALI --- */
:root {
    --primary-blue: #0ea5e9;
    --accent-yellow: #facc15;
    --text-light: #f8fafc;
    --text-dark: #0f172a;
    --bg-dark: #0f172a;
    --bg-medium: #1e293b;
    --bg-light: #334155;
    --success: #22c55e;
    --error: #ef4444;
    --font-main: 'Roboto', sans-serif;
    --font-display: 'Orbitron', sans-serif;
    --border-radius: 16px;
    --transition: all 0.2s ease;
    --box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    --padding-base: 1rem;
}

/* --- RESET --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-main);
}

html, body {
    height: 100%;
    width: 100%;
    overflow: hidden;
    background-color: var(--bg-dark);
    color: var(--text-light);
}

button, .menu-button, .action-button, .scroll-button {
    -webkit-tap-highlight-color: transparent;
}

/* --- LAYOUT PRINCIPALE SPA --- */
#kiosk-container {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
}

#promo-area {
    flex-basis: 70%;
    background-color: #000;
    position: relative;
    overflow: hidden;
    transition: flex-basis 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

#interaction-area {
    flex-basis: 30%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: flex-basis 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    padding: var(--padding-base);
    background-color: var(--bg-dark);
}

/* Modalità Interattiva */
#kiosk-container.interaction-mode #promo-area {
    flex-basis: 30%;
}

#kiosk-container.interaction-mode #interaction-area {
    flex-basis: 70%;
}

/* --- AREA PROMO (BANNER) --- */
.banner-media,
.banner-poster {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    animation: fadeIn 1.5s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.banner-overlay {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 1.5rem 1.75rem;
    background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0.6) 65%, rgba(0,0,0,0.9) 100%);
}

.banner-title {
    font-family: var(--font-display);
    font-size: clamp(1.375rem, 3.5vw, 2.25rem);
    font-weight: 700;
    letter-spacing: 0.5px;
}

.banner-sub {
    opacity: 0.9;
    margin-top: 0.375rem;
    font-size: clamp(0.875rem, 2.2vw, 1.125rem);
}

/* --- SCHERMATA IDLE (INIZIALE) --- */
.idle-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    width: 100%;
    height: 100%;
}

.idle-card {
    background-color: #fff;
    color: var(--text-dark);
    border-radius: var(--border-radius);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    border: 3px solid transparent;
    padding: var(--padding-base);
    position: relative;
}

.idle-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--box-shadow);
}

.idle-card.yellow {
    background-color: var(--accent-yellow);
}

.idle-card .icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    line-height: 1;
}

.idle-card h3 {
    font-family: var(--font-main);
    font-weight: 700;
    font-size: clamp(1.5rem, 3vw, 2rem);
    line-height: 1.4;
}

.scanner-effect {
    position: absolute;
    inset: 10px;
    border-radius: calc(var(--border-radius) - 8px);
    overflow: hidden;
    box-shadow: 0 0 0 2px rgba(0,0,0,0.06) inset;
}

.scanner-effect::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    height: 3px;
    top: -3px;
    background: linear-gradient(90deg, transparent, rgba(0,255,120,0.9), transparent);
    filter: drop-shadow(0 0 6px rgba(0,255,120,0.75));
    animation: scanY 2.4s linear infinite;
}

@keyframes scanY {
    0% { top: -3px; }
    100% { top: calc(100% - 0px); }
}

/* --- STILI COMUNI PER LE VISTE INTERNE --- */
.view-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.5s;
    padding: var(--padding-base);
}

.view-container h2 {
    font-family: var(--font-display);
    font-size: 2.5rem;
    margin-bottom: 1rem;
    text-align: center;
}

.view-container p {
    font-size: 1.2rem;
    color: #ccc;
    margin-bottom: 2rem;
    max-width: 600px;
    text-align: center;
}

.button-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    width: 100%;
    max-width: 1200px;
}

.menu-button {
    background: linear-gradient(145deg, var(--bg-light), var(--bg-medium));
    color: var(--text-light);
    border-radius: var(--border-radius);
    padding: 1.25rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid var(--bg-light);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 120px;
}

.menu-button:hover {
    transform: translateY(-5px);
    border-color: var(--primary-blue);
    box-shadow: var(--box-shadow);
}

.menu-button .icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
}

.menu-button h3 {
    font-family: var(--font-display);
    font-size: clamp(1.1rem, 2vw, 1.4rem);
}

.back-button {
    position: absolute;
    top: 1.25rem;
    left: 1.25rem;
    background: var(--bg-light);
    color: var(--text-light);
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 10;
}

.action-button {
    background-color: var(--primary-blue);
    color: var(--text-dark);
    border: none;
    padding: 0.9375rem 1.875rem;
    font-size: 1.2rem;
    font-weight: 700;
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition);
}

.action-button:hover {
    background-color: #38bdf8;
}

.input-field {
    background-color: var(--bg-medium);
    border: 1px solid var(--bg-light);
    color: var(--text-light);
    border-radius: 12px;
    padding: 0.9375rem;
    font-size: 1.2rem;
    width: 100%;
    max-width: 400px;
    margin-bottom: 1rem;
}

/* --- MODALI (QR, GIOCO, MESSAGGI) --- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0,0,0,0.8);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 1000;
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s;
}

.modal-content {
    background-color: var(--bg-medium);
    padding: 1.875rem;
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 700px;
    text-align: center;
    border: 1px solid var(--bg-light);
    position: relative;
}

.modal-content .close-button {
    position: absolute;
    top: 0.9375rem;
    right: 0.9375rem;
    background: var(--bg-light);
    color: var(--text-light);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
    cursor: pointer;
}

#qr-video {
    width: 100%;
    max-width: 400px;
    border: 4px solid var(--primary-blue);
    border-radius: var(--border-radius);
    margin-top: 1rem;
}

#game-iframe {
    width: 100%;
    height: 80vh;
    border: none;
    border-radius: var(--border-radius);
}

/* --- AREA DI STAMPA (NASCOSTA) --- */
#print-area {
    display: none;
}

@media print {
    body * {
        visibility: hidden;
    }
    #print-area,
    #print-area * {
        visibility: visible;
    }
    #print-area {
        position: absolute;
        left: 0;
        top: 0;
        font-family: 'Courier New', Courier, monospace;
        color: #000;
        background: #fff;
        padding: 0.9375rem;
        width: 300px; /* Larghezza tipica stampante termica 80mm */
    }
    #print-area h3 {
        font-size: 18px;
        text-align: center;
        margin: 0 0 10px;
    }
    #print-area p {
        font-size: 14px;
        margin: 5px 0;
        line-height: 1.4;
    }
    #print-area #print-qrcode {
        margin: 10px auto;
        display: block;
    }
    #print-area #print-qrcode img {
        width: 120px;
        height: 120px;
    }
}

/* --- SHOP LAYOUT --- */
.shop-container-bulletproof {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    background-color: var(--bg-dark);
}

.shop-content-wrapper {
    flex-grow: 1; /* Assicura che il contenitore occupi lo spazio rimanente */
    position: relative; /* Per posizionare i pulsanti di scroll */
}

.shop-header-area {
    flex-shrink: 0;
    padding: var(--padding-base);
    position: relative;
}

.shop-header-area h2 {
    text-align: center;
    margin-bottom: 1rem;
}

.shop-header-area .back-button {
    position: absolute;
    top: var(--padding-base);
    left: var(--padding-base);
}

.shop-content-area {
    flex-grow: 1;
    overflow-y: auto;
    padding: var(--padding-base);
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.shop-content-area::-webkit-scrollbar {
    display: none;
}

.shop-no-results {
    text-align: center;
    padding-top: 4rem;
    font-size: 1.2rem;
    color: var(--text-light);
}


/* --- CONTROLLI SHOP --- */
.shop-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: var(--padding-base);
    background-color: var(--bg-medium);
    border-radius: 12px;
}

.shop-input,
.shop-select {
    background-color: var(--bg-light);
    border: 1px solid var(--bg-light);
    color: var(--text-light);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    flex-grow: 1;
}

.shop-input::placeholder {
    color: #94a3b8;
}

.shop-button {
    background-color: var(--bg-light);
    border: 1px solid var(--bg-light);
    color: var(--text-light);
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
}

.shop-button:hover {
    background-color: #475569;
}

.shop-button.active {
    background-color: var(--accent-yellow);
    color: var(--text-dark);
    border-color: var(--accent-yellow);
    font-weight: 700;
}

/* --- GRIGLIA PRODOTTI --- */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    width: 100%;
    max-width: 1400px;
    padding-bottom: 2rem;
}

.product-card {
    background-color: var(--bg-medium);
    border-radius: var(--border-radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--bg-light);
    transition: var(--transition);
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--box-shadow);
}

.product-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background-color: var(--bg-light);
}

.product-card .product-info {
    padding: var(--padding-base);
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.product-card h3 {
    font-family: var(--font-main);
    font-weight: 700;
    font-size: 1.2rem;
    flex-grow: 1;
    margin-bottom: 0.5rem;
}

.product-card .price-container {
    text-align: right;
    margin-top: auto;
}

.product-card .price,
.product-card .sale-price {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--accent-yellow);
}

.product-card .regular-price {
    font-size: 1rem;
    color: #94a3b8;
    text-decoration: line-through;
    margin-right: 0.5rem;
}

/* --- PULSANTI DI SCROLL --- */
.shop-scroll-buttons {
    position: absolute;
    right: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 20;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.shop-scroll-buttons .scroll-button {
    background-color: rgba(14, 165, 233, 0.8);
    color: var(--text-light);
    border: 2px solid var(--text-light);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 1.5rem;
    cursor: pointer;
    transition: var(--transition);
    backdrop-filter: blur(5px);
    box-shadow: var(--box-shadow);
}

.shop-scroll-buttons .scroll-button:hover {
    background-color: var(--primary-blue);
    transform: scale(1.1);
}

.shop-scroll-buttons .scroll-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* --- RESPONSIVITÀ --- */
@media (max-width: 768px) {
    .product-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
    .shop-scroll-buttons {
        right: 0.625rem;
        gap: 0.5rem;
    }
    .shop-scroll-buttons .scroll-button {
        width: 35px;
        height: 35px;
        font-size: 1.2rem;
    }
}

/* --- STILI PAGINAZIONE SHOP --- */
#pagination-container {
    flex-shrink: 0; /* Impedisce al contenitore di restringersi */
    padding: 1rem;
    border-top: 1px solid var(--bg-light);
}

.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
}

.pagination-controls span {
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--text-light);
}

.pagination-controls button {
    background-color: var(--primary-blue);
    color: var(--text-dark);
    border: none;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 700;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.pagination-controls button:hover:not(:disabled) {
    background-color: #38bdf8;
}

.pagination-controls button:disabled {
    background-color: var(--bg-light);
    color: #64748b;
    cursor: not-allowed;
}
/* Incolla questo alla fine del tuo file css/style.css */

/* --- STILI TABELLA TARIFFARIO --- */
.table-container {
    width: 100%;
    max-width: 800px;
    max-height: 60vh; /* Altezza massima per permettere lo scroll */
    overflow-y: auto;
    background-color: var(--bg-medium);
    border-radius: var(--border-radius);
    border: 1px solid var(--bg-light);
}

.rates-table {
    width: 100%;
    border-collapse: collapse;
    color: var(--text-light);
}

.rates-table th, .rates-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--bg-light);
}

.rates-table th {
    background-color: var(--bg-light);
    font-family: var(--font-display);
    font-size: 1.1rem;
    position: sticky; /* Intestazione fissa durante lo scroll */
    top: 0;
}

.rates-table tbody tr:last-child td {
    border-bottom: none;
}

.rates-table tbody tr:hover {
    background-color: #334155;
}

.rates-table td:last-child {
    font-weight: bold;
    color: var(--accent-yellow);
    text-align: right;
}
/* Incolla questo alla fine del tuo file css/style.css */

/* --- STILI QUIZ --- */
.quiz-container {
    width: 100%;
    max-width: 900px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.quiz-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    font-size: 1.1rem;
    font-weight: bold;
    margin-bottom: 1rem;
}

.progress-bar-container {
    width: 100%;
    height: 10px;
    background-color: var(--bg-light);
    border-radius: 5px;
    margin-bottom: 2rem;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background-color: var(--primary-blue);
    border-radius: 5px;
    transition: width 0.3s ease;
}

.quiz-question {
    font-size: clamp(1.4rem, 3vw, 2rem);
    text-align: center;
    margin-bottom: 2.5rem;
    min-height: 100px;
}

.quiz-options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    width: 100%;
}

.quiz-option {
    background-color: var(--bg-medium);
    border: 2px solid var(--bg-light);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    font-size: 1.2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.quiz-option:hover {
    border-color: var(--primary-blue);
    transform: translateY(-5px);
}

.quiz-option.correct {
    background-color: var(--success);
    border-color: var(--success);
    color: var(--text-dark);
    font-weight: bold;
}

.quiz-option.incorrect {
    background-color: var(--error);
    border-color: var(--error);
    color: var(--text-dark);
    font-weight: bold;
}

.quiz-score {
    font-family: var(--font-display);
    font-size: 4rem;
    margin: 1rem 0;
    color: var(--accent-yellow);
}

.discount-code-container {
    background-color: var(--bg-medium);
    border: 2px dashed var(--accent-yellow);
    padding: 1rem 2rem;
    border-radius: 8px;
    margin: 1rem 0;
}

#discount-code {
    font-family: 'Courier New', Courier, monospace;
    font-size: 2rem;
    font-weight: bold;
    color: var(--accent-yellow);
}
/* Incolla questo alla fine del tuo file css/style.css */

/* --- STILI GIOCO "EV RACER" --- */
.game-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    background-color: #000;
}

.game-header {
    flex-shrink: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background-color: var(--bg-medium);
}

#score-display {
    font-size: 1.2rem;
    font-weight: bold;
    font-family: var(--font-display);
}

#game-canvas {
    flex-grow: 1;
    width: 100%;
    display: block;
}

#game-over-screen {
    position: absolute;
    inset: 0;
    background-color: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(5px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: var(--text-light);
    text-align: center;
}

#game-over-screen h2 {
    font-family: var(--font-display);
    font-size: 3rem;
    color: var(--error);
}

#game-over-screen p {
    font-size: 1.5rem;
    margin: 1rem 0;
}

#restart-button {
    margin-top: 1rem;
}
