/* =========================================================
   Quando Vieni — Main Stylesheet
   ========================================================= */

/* ── Variabili ──────────────────────────────────────────── */
:root {
    --pr-red:       #c0392b;
    --pr-red-dark:  #a93226;
    --pr-red-light: #f9e0de;
    --pr-dark:      #2c3e50;
    --pr-gray:      #f8f9fa;
    --sidebar-w:    0px;       /* solo topbar, no sidebar */
    --topbar-h:     56px;
}

/* ── Base ───────────────────────────────────────────────── */
body { font-family: 'Segoe UI', system-ui, -apple-system, sans-serif; }

.text-pr   { color: var(--pr-red) !important; }
.bg-pr     { background-color: var(--pr-red) !important; }
.btn-pr    {
    background-color: var(--pr-red);
    border-color:     var(--pr-red);
    color:            #fff;
}
.btn-pr:hover, .btn-pr:focus {
    background-color: var(--pr-red-dark);
    border-color:     var(--pr-red-dark);
    color:            #fff;
}
.btn-pr:active {
    background-color: var(--pr-red-dark);
    color: #fff;
}
.border-pr { border-color: var(--pr-red) !important; }

/* ── Navbar ─────────────────────────────────────────────── */
.bg-primary-custom {
    background-color: var(--pr-red) !important;
}

/* ── Main content ───────────────────────────────────────── */
.main-content {
    min-height: calc(100vh - var(--topbar-h) - 46px);
    padding-bottom: 2rem;
}

/* ── Footer admin ───────────────────────────────────────── */
.footer-admin {
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    padding: 12px 0;
    font-size: .75rem;
}

/* ── Stat cards ─────────────────────────────────────────── */
.stat-card {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 18px 14px;
    text-align: center;
    transition: box-shadow .2s, transform .15s;
}
.stat-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,.1);
    transform: translateY(-2px);
}
.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1;
    color: var(--pr-dark);
}
.stat-label {
    font-size: .73rem;
    color: #6c757d;
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: .5px;
}

/* ── Avatar ─────────────────────────────────────────────── */
.avatar-sm {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--pr-red);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: .85rem;
    flex-shrink: 0;
}

/* ── Feature cards (landing) ────────────────────────────── */
.feature-card {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 16px;
    padding: 28px 22px;
    transition: box-shadow .25s, transform .2s;
}
.feature-card:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,.1);
    transform: translateY(-3px);
}
.feature-icon {
    width: 52px;
    height: 52px;
    background: var(--pr-red-light);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    font-size: 1.5rem;
    color: var(--pr-red);
}

/* ── Landing page ───────────────────────────────────────── */
.landing-page {
    overflow-x: hidden;
}
.landing-hero {
    position: relative;
    background: linear-gradient(135deg, var(--pr-red) 0%, #8e1a11 100%);
    min-height: 380px;
    display: flex;
    align-items: center;
}
.hero-overlay {
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.py-6 { padding-top: 5rem; padding-bottom: 5rem; }
.stat-counter { padding: 20px 10px; }

/* ── Auth pages ─────────────────────────────────────────── */
.auth-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #2c3e50 0%, var(--pr-red) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.auth-container {
    width: 100%;
    max-width: 420px;
}
.auth-card {
    border-radius: 16px;
    overflow: hidden;
    background: #fff;
    border: none;
}
.auth-header {
    background: var(--pr-red);
    padding: 32px 28px 24px;
    color: #fff;
}
.auth-logo { font-size: 2.5rem; }
.auth-body { padding: 24px 28px; }

/* ── Table cards (admin/tables) ─────────────────────────── */
.table-card {
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 12px 10px;
    background: #fff;
    transition: border-color .2s;
}
.table-card:hover { border-color: var(--pr-red); }
.table-shape {
    width: 60px;
    height: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0 auto 4px;
    background: var(--pr-red-light);
    border: 2px solid var(--pr-red);
    color: var(--pr-red);
    font-size: .82rem;
}
.table-shape-round     { border-radius: 50%; }
.table-shape-square    { border-radius: 6px; }
.table-shape-rectangle { border-radius: 6px; width: 76px; height: 50px; }

/* ── Opacity utilities ──────────────────────────────────── */
.opacity-60  { opacity: .6; }
.opacity-80  { opacity: .8; }
.opacity-90  { opacity: .9; }

/* ──────────────────────────────────────────────────────────
   BOOKING WIDGET (area utente - stile Restoo)
   ────────────────────────────────────────────────────────── */
.booking-page {
    background: #f5f0ed;
    min-height: 100vh;
}

.booking-hero {
    background: linear-gradient(160deg, var(--pr-red) 0%, #7b1e1e 100%);
    position: relative;
    min-height: 140px;
    display: flex;
    align-items: center;
}

/* Widget contenitore */
.booking-widget {
    max-width: 700px;
    margin: -40px auto 0;
    position: relative;
    z-index: 10;
    border-radius: 20px !important;
    overflow: hidden;
}

/* Step */
.booking-step { display: none; }
.booking-step.active { display: block; }

.booking-widget-header {
    border-bottom: 1px solid #f0f0f0;
}

/* ── Pax selectors ──────────────────────────────────────── */
.pax-selector {
    display: flex;
    align-items: center;
    gap: 0;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    width: 120px;
}
.pax-btn {
    background: #f8f8f8;
    border: none;
    width: 36px;
    height: 36px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background .15s;
    flex-shrink: 0;
    color: var(--pr-red);
}
.pax-btn:hover { background: var(--pr-red-light); }
.pax-value {
    flex: 1;
    text-align: center;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--pr-dark);
    min-width: 32px;
}
.pax-total-badge {
    background: var(--pr-red-light);
    color: var(--pr-red);
    border-radius: 8px;
    padding: 6px 14px;
    font-weight: 600;
    font-size: .9rem;
    white-space: nowrap;
}

/* ── Date strip ─────────────────────────────────────────── */
.date-strip-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.date-strip-wrapper::-webkit-scrollbar { display: none; }
.date-strip {
    display: flex;
    gap: 8px;
    padding-bottom: 8px;
    min-width: max-content;
}
.date-pill {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 68px;
    padding: 8px 6px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
    transition: all .2s;
    color: var(--pr-dark);
    line-height: 1.2;
}
.date-pill:hover:not(.disabled) {
    border-color: var(--pr-red);
    background: var(--pr-red-light);
    color: var(--pr-red);
}
.date-pill.active {
    border-color: var(--pr-red);
    background: var(--pr-red);
    color: #fff !important;
}
.date-pill.disabled {
    opacity: .4;
    cursor: not-allowed;
}
.date-pill-day   { font-size: .65rem; text-transform: uppercase; letter-spacing: .5px; font-weight: 600; }
.date-pill-num   { font-size: 1.3rem; font-weight: 700; line-height: 1; }
.date-pill-month { font-size: .65rem; text-transform: uppercase; }

/* ── Shift cards (pranzo / cena) ────────────────────────── */
.shift-cards {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.shift-card {
    border: 2px solid #e0e0e0;
    border-radius: 14px;
    padding: 12px 20px;
    background: #fff;
    cursor: pointer;
    transition: all .2s;
    text-align: left;
    min-width: 160px;
}
.shift-card:hover {
    border-color: var(--pr-red);
    background: var(--pr-red-light);
}
.shift-card.active {
    border-color: var(--pr-red);
    background: var(--pr-red);
    color: #fff;
}
.shift-label { font-weight: 700; font-size: 1rem; }
.shift-time  { font-size: .82rem; opacity: .75; }

/* ── Slot grid ──────────────────────────────────────────── */
.slot-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.time-slot {
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 8px 16px;
    background: #fff;
    cursor: pointer;
    font-weight: 600;
    font-size: .9rem;
    color: var(--pr-dark);
    transition: all .15s;
    min-width: 72px;
    text-align: center;
}
.time-slot:hover {
    border-color: var(--pr-red);
    background: var(--pr-red-light);
    color: var(--pr-red);
}
.time-slot.active {
    border-color: var(--pr-red);
    background: var(--pr-red);
    color: #fff;
}
.no-slots-msg {
    padding: 12px 0;
    color: #6c757d;
    font-size: .9rem;
}

/* ── Booking summary ────────────────────────────────────── */
.booking-summary {
    background: #fff8f7;
    border: 1px solid var(--pr-red-light);
}

/* ── Detail grid (reservation_detail) ──────────────────── */
.detail-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}
.detail-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}
.detail-icon {
    width: 36px;
    height: 36px;
    background: var(--pr-red-light);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--pr-red);
    font-size: 1rem;
    flex-shrink: 0;
}
.detail-label { font-size: .75rem; color: #6c757d; }
.detail-value { font-weight: 600; color: var(--pr-dark); }

/* ── Booking code display ───────────────────────────────── */
.booking-code-display {
    display: inline-block;
    background: var(--pr-red-light);
    color: var(--pr-red);
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: .3em;
    padding: 12px 28px;
    border-radius: 12px;
    border: 2px dashed var(--pr-red);
    font-family: 'Courier New', monospace;
}

/* ── Confirm animation ──────────────────────────────────── */
@keyframes popIn {
    0%   { transform: scale(0); opacity: 0; }
    70%  { transform: scale(1.15); }
    100% { transform: scale(1); opacity: 1; }
}
.confirm-animation { animation: popIn .5s ease forwards; }

/* ── Responsive tweaks ──────────────────────────────────── */
@media (max-width: 576px) {
    .booking-widget { border-radius: 16px !important; margin-top: -24px; }
    .stat-value     { font-size: 1.4rem; }
    .shift-card     { min-width: 130px; }
    .time-slot      { min-width: 60px; padding: 7px 10px; }
    .booking-code-display { font-size: 1.4rem; letter-spacing: .2em; padding: 8px 16px; }
}

/* ── Print ──────────────────────────────────────────────── */
@media print {
    .navbar, .btn, footer { display: none !important; }
    .booking-widget { box-shadow: none !important; }
}
