﻿body.rs-interattiva-demo {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(-45deg, #162b53, #214077, #0f2027, #192e35);
  background-size: 300% 300%;
  color: #fff;
  padding: 1rem 0 2rem;
  overflow-x: hidden;
}

.demo-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    z-index: 10000;
    overflow-y: auto;
}

.demo-modal.active {
    display: block;
}

.demo-container {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 2rem;
}

.demo-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.demo-header h2 {
    margin: 0;
    font-size: 2rem;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.demo-close {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1.5rem;
}

.demo-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.demo-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.demo-tab {
    padding: 1rem 2rem;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.demo-tab:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.demo-tab.active {
    background: var(--accent-2);
    color: #041026;
    border-color: transparent;
}

.demo-content {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(12px);
    min-height: 600px;
}

.demo-panel {
    display: none;
}

.demo-panel.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* Virtual Demo Views */
.demo-view {
    display: none;
}

.demo-view.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* Table Container for Demo - Liquid Glass */
#virtualDemoModal .table-container {
    max-height: 600px;
    overflow-y: auto;
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.06));
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
}

#virtualDemoModal .table {
    width: 100%;
    border-collapse: collapse;
    color: #fff;
    background: transparent;
}

#virtualDemoModal .table thead th {
    position: sticky;
    top: 0;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(8px);
    z-index: 5;
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
}

#virtualDemoModal .table tbody tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: transparent;
}

#virtualDemoModal .table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.12);
    cursor: pointer;
    transition: background-color 0.2s ease;
}

#virtualDemoModal .table td {
    padding: 0.75rem 1rem;
    color: rgba(255, 255, 255, 0.85);
    background: transparent;
}

#virtualDemoModal .btn {
    border-radius: 10px;
    font-weight: 600;
    padding: 0.4rem 0.8rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#virtualDemoModal .btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
}

#virtualDemoModal .btn-primary {
    background: var(--accent-2);
    color: #041026;
    border: none;
}

/* Liquid Glass for Demo Views */
#virtualDemoModal .demo-view {
    background: transparent;
}

#virtualDemoModal .demo-view h2 {
    background: transparent;
    color: #fff;
}

/* Ensure table striped rows are transparent */
#virtualDemoModal .table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(255, 255, 255, 0.03) !important;
}

/* Stili demo classica — standalone demo-interattiva/ */

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes popupSlideIn {
    from { 
        opacity: 0; 
        transform: scale(0.9) translateY(20px); 
    }
    to { 
        opacity: 1; 
        transform: scale(1) translateY(0); 
    }
}

/* iOS-style button hover */
#demoWarningPopup button:hover {
    transform: scale(0.98);
    box-shadow: 0 2px 10px rgba(220, 38, 38, 0.3);
}

#demoWarningPopup button:active {
    transform: scale(0.95);
}

/* Dashboard Panel */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.dashboard-stat {
    background: rgba(255, 255, 255, 0.08);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.dashboard-stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    background: var(--accent-2);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

.dashboard-stat-label {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
}

/* Tavoli Panel */
.tavoli-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1rem;
}

.tavolo-card {
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tavolo-card:hover {
    transform: translateY(-5px);
    border-color: #6bd4ff;
    box-shadow: 0 8px 20px rgba(107, 212, 255, 0.3);
}

.tavolo-card.occupato {
    background: rgba(255, 107, 107, 0.2);
    border-color: rgba(255, 107, 107, 0.5);
}

.tavolo-card.libero {
    background: rgba(91, 242, 126, 0.2);
    border-color: rgba(91, 242, 126, 0.5);
}

.tavolo-number {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.tavolo-status {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
}

/* Ordini Panel */
.ordini-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.ordine-card {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.ordine-card:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: translateX(5px);
}

.ordine-info {
    flex: 1;
}

.ordine-tavolo {
    font-weight: 600;
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.ordine-items {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.ordine-totale {
    font-weight: 700;
    color: #6bd4ff;
    font-size: 1.3rem;
}

.ordine-status {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.ordine-status.in-preparazione {
    background: rgba(255, 193, 7, 0.3);
    color: #ffc107;
}

.ordine-status.pronto {
    background: rgba(91, 242, 126, 0.3);
    color: #5bf27e;
}

/* Inventario Panel */
.inventario-table-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 12px;
}

.inventario-table {
    width: 100%;
    min-width: 560px;
    border-collapse: collapse;
}

.inventario-table th,
.inventario-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    white-space: nowrap;
}

.inventario-table th {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-weight: 600;
    position: sticky;
    top: 0;
}

.inventario-table td {
    color: rgba(255, 255, 255, 0.85);
}

.inventario-table tbody tr {
    transition: background 0.2s ease;
}

.inventario-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.06);
}

/* Stock badges */
.stock-badge {
    display: inline-block;
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
}

.stock-badge.alto {
    background: rgba(91, 242, 126, 0.2);
    color: #5bf27e;
    border: 1px solid rgba(91, 242, 126, 0.4);
}

.stock-badge.medio {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
    border: 1px solid rgba(255, 193, 7, 0.4);
}

.stock-badge.basso {
    background: rgba(255, 107, 107, 0.2);
    color: #ff7a6b;
    border: 1px solid rgba(255, 107, 107, 0.45);
}

.btn-demo-action {
    background: var(--accent-2);
    color: #041026;
    border: none;
    border-radius: 10px;
    padding: 0.45rem 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-demo-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(107, 212, 255, 0.3);
}

/* ============================================
   RESPONSIVE — demo interattiva
   ============================================ */
@media (max-width: 768px) {
    .demo-container {
        padding: 1rem;
        margin: 1rem auto;
    }

    .demo-header {
        padding: 1rem;
        margin-bottom: 1.25rem;
    }

    .demo-header h2 {
        font-size: 1.15rem;
        gap: 0.5rem;
        min-width: 0;
        flex: 1;
    }

    .demo-header h2 img {
        height: 28px !important;
        flex-shrink: 0;
    }

    .demo-tabs {
        gap: 0.5rem;
        margin-bottom: 1.25rem;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 0.35rem;
    }

    .demo-tab {
        flex-shrink: 0;
        padding: 0.7rem 1.1rem;
        font-size: 0.9rem;
    }

    .demo-content {
        padding: 1.25rem;
        min-height: 0;
    }

    .dashboard-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .dashboard-stat {
        padding: 1rem;
    }

    .dashboard-stat-value {
        font-size: 1.8rem;
    }

    .tavoli-grid {
        grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    }

    .ordine-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
}

@media (max-width: 420px) {
    .dashboard-stats {
        grid-template-columns: 1fr;
    }

    .demo-header h2 {
        font-size: 1.1rem;
    }
}
