﻿/**
 * RistoSuite Server â€” demo virtuale (landing)
 * Stili allineati a RistoSuiteService/static/css/style.css, scoped su body.rs-server-demo
 */

body.rs-server-demo {
  margin: 0;
  min-height: 100vh;
  --rs-muted: rgba(255, 255, 255, 0.85);
  --rs-glass-border: rgba(255, 255, 255, 0.1);
  --rs-accent: linear-gradient(135deg, #6bd4ff 0%, #6b8bff 100%);
  font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: #fff;
}

body.rs-server-demo .rs-demo-bg {
  width: 100%;
  min-height: 100%;
  background: linear-gradient(-45deg, #162b53, #214077, #0f2027, #192e35);
  background-size: 300% 300%;
  animation: rsBgShift 12s ease infinite;
  overflow-y: auto;
  position: relative;
}

@keyframes rsBgShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Ambient glow */
body.rs-server-demo .rs-demo-bg::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 60% 40% at 15% 20%, rgba(107, 212, 255, 0.12), transparent 55%),
    radial-gradient(ellipse 50% 35% at 85% 75%, rgba(107, 139, 255, 0.1), transparent 50%);
  z-index: 0;
}

body.rs-server-demo .rs-demo-shell {
  position: relative;
  z-index: 1;
}

/* Navbar â€” come RistoSuiteService */
body.rs-server-demo .navbar {
  background: transparent !important;
  padding: 0.5rem 0 1rem;
}

body.rs-server-demo .navbar-brand img {
  height: 50px;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.35));
}

body.rs-server-demo .nav-link {
  color: var(--rs-muted) !important;
  font-weight: 500;
  padding: 0.5rem 0.85rem !important;
  border-radius: 10px;
  transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

body.rs-server-demo .nav-link:hover,
body.rs-server-demo .nav-link.active {
  color: #fff !important;
  background: rgba(255, 255, 255, 0.08);
}

body.rs-server-demo .nav-link.check.active {
  background: linear-gradient(135deg, rgba(107, 212, 255, 0.25), rgba(107, 139, 255, 0.2));
  box-shadow: 0 0 20px rgba(107, 212, 255, 0.15);
}

body.rs-server-demo .nav-link.nav-terminal {
  border: 1px solid rgba(107, 212, 255, 0.45);
  margin-left: 0.25rem;
}

body.rs-server-demo .nav-link.nav-terminal:hover {
  background: rgba(107, 212, 255, 0.15) !important;
  box-shadow: 0 0 16px rgba(107, 212, 255, 0.25);
}

body.rs-server-demo .dropdown-menu {
  background: rgba(20, 30, 60, 0.92) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

body.rs-server-demo .dropdown-item {
  color: rgba(255, 255, 255, 0.88) !important;
  border-radius: 8px;
  margin: 2px 6px;
  width: calc(100% - 12px);
}

body.rs-server-demo .dropdown-item:hover {
  background: rgba(255, 255, 255, 0.1) !important;
  color: #fff !important;
}

/* Dashboard â€” main.rs-dash-card (evita conflitto Bootstrap .card) */
body.rs-server-demo .wrap {
  min-height: 75vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

body.rs-server-demo .rs-dash-card {
  width: 100%;
  max-width: 980px;
  border-radius: 16px;
  padding: 36px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.06));
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  border: 1px solid var(--rs-glass-border);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 28px;
  align-items: center;
  animation: rsDashEnter 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes rsDashEnter {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

body.rs-server-demo .custom-layer {
  padding: 18px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.01));
  border: 1px solid rgba(255, 255, 255, 0.03);
  margin-bottom: 20px;
  max-width: 400px;
  text-align: left;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

body.rs-server-demo .custom-layer:hover {
  transform: scale(1.03);
  box-shadow: 0 8px 28px rgba(107, 212, 255, 0.12);
}

body.rs-server-demo .custom-layer h2 {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 15px;
  color: #fff;
}

body.rs-server-demo .custom-layer p {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.8);
  transition: opacity 0.5s ease;
  opacity: 1;
  min-height: 1.4em;
}

body.rs-server-demo #versione_container {
  margin-top: 180px;
  color: rgba(255, 255, 255, 0.55);
  font-size: 13px;
}

body.rs-server-demo .right-panel {
  padding: 18px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

body.rs-server-demo .stat-box {
  flex: 1;
  min-width: 90px;
  padding: 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  opacity: 0;
  animation: rsStatPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

body.rs-server-demo .stat-box:nth-child(1) { animation-delay: 0.15s; }
body.rs-server-demo .stat-box:nth-child(2) { animation-delay: 0.25s; }
body.rs-server-demo .stat-box:nth-child(3) { animation-delay: 0.35s; }
body.rs-server-demo .right-panel > .stat-box:nth-of-type(2) { animation-delay: 0.45s; }

@keyframes rsStatPop {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.92);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

body.rs-server-demo .stat-box:hover {
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 10px 24px rgba(107, 212, 255, 0.2);
  border-color: rgba(107, 212, 255, 0.35);
}

body.rs-server-demo .stat-box .num {
  font-size: 22px;
  font-weight: 700;
  background: linear-gradient(135deg, #6bd4ff, #6b8bff);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

body.rs-server-demo .small {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
}

body.rs-server-demo .status-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 14px;
  animation: rsStatPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.55s forwards;
  opacity: 0;
}

body.rs-server-demo #stat-lic-is_alive {
  font-weight: 700;
  color: #5bf27e;
  animation: rsPulseGreen 2.5s ease-in-out infinite;
}

@keyframes rsPulseGreen {
  0%, 100% { text-shadow: 0 0 8px rgba(91, 242, 126, 0.4); }
  50% { text-shadow: 0 0 16px rgba(91, 242, 126, 0.75); }
}

body.rs-server-demo #demoClock {
  position: fixed;
  bottom: 20px;
  left: 20px;
  padding: 0.5rem 1rem;
  font-size: 1.2rem;
  font-weight: 500;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  z-index: 7000;
  font-variant-numeric: tabular-nums;
}

/* Viste secondarie */
body.rs-server-demo .demo-view {
  display: none;
}

body.rs-server-demo .demo-view.active {
  display: block;
  animation: rsViewIn 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

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

body.rs-server-demo .rs-page-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

body.rs-server-demo .rs-page-head h2 {
  color: #fff;
  font-size: 1.75rem;
  font-weight: 600;
  margin: 0;
}

body.rs-server-demo .btn-success {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  border: none;
  color: #fff;
  font-weight: 600;
  border-radius: 10px;
  padding: 0.5rem 1rem;
}

body.rs-server-demo .btn-primary {
  background: linear-gradient(135deg, #6bd4ff, #6b8bff);
  border: none;
  color: #041026;
  font-weight: 600;
  border-radius: 10px;
}

body.rs-server-demo .table-container {
  max-height: 600px;
  overflow-y: auto;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  width: 100%;
  border-collapse: collapse;
  color: #fff;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

body.rs-server-demo .table-container thead th {
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, 0.08);
  z-index: 5;
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  font-weight: 600;
}

body.rs-server-demo .table-container th,
body.rs-server-demo .table-container td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

body.rs-server-demo .glass-table tbody tr {
  transition: background 0.2s ease;
}

body.rs-server-demo .glass-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.08);
}

/* Tavoli â€” griglia planimetria demo */
body.rs-server-demo .rs-tavoli-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 1rem;
}

body.rs-server-demo .rs-tavolo-card {
  padding: 1.25rem;
  border-radius: 14px;
  text-align: center;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

body.rs-server-demo .rs-tavolo-card:hover {
  transform: scale(1.05);
}

body.rs-server-demo .rs-tavolo-card.occupato {
  background: linear-gradient(135deg, rgba(255, 107, 107, 0.35), rgba(220, 38, 38, 0.2));
  border-color: rgba(255, 107, 107, 0.5);
}

body.rs-server-demo .rs-tavolo-card.libero {
  background: linear-gradient(135deg, rgba(91, 242, 126, 0.25), rgba(34, 197, 94, 0.15));
  border-color: rgba(91, 242, 126, 0.45);
}

body.rs-server-demo .rs-tavolo-card .num {
  font-size: 1.75rem;
  -webkit-text-fill-color: #fff;
  background: none;
}

body.rs-server-demo .badge-stato {
  display: inline-block;
  padding: 0.35rem 0.85rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
}

body.rs-server-demo .badge-stato.prep {
  background: rgba(255, 193, 7, 0.25);
  color: #ffc107;
}

body.rs-server-demo .badge-stato.pronto {
  background: rgba(91, 242, 126, 0.25);
  color: #5bf27e;
}

body.rs-server-demo .rs-ordine-card {
  padding: 1.25rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

body.rs-server-demo .rs-ordine-card:hover {
  transform: translateX(4px);
  border-color: rgba(107, 212, 255, 0.3);
}

body.rs-server-demo .fade-in {
  animation: rsViewIn 0.6s ease both;
}

/* Wrapper scroll orizzontale per le tabelle su schermi stretti */
body.rs-server-demo .rs-table-scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 12px;
}

body.rs-server-demo .rs-table-scroll .table-container {
  min-width: 520px;
}

@media (max-width: 900px) {
  body.rs-server-demo .rs-dash-card {
    grid-template-columns: 1fr;
    padding: 24px;
  }
  body.rs-server-demo #versione_container {
    margin-top: 2rem;
  }
  body.rs-server-demo .rs-page-head h2 {
    font-size: 1.4rem;
  }
}

@media (max-width: 576px) {
  body.rs-server-demo #demo-stats-container {
    flex-direction: column !important;
  }
  body.rs-server-demo .rs-dash-card {
    padding: 18px;
  }
  body.rs-server-demo .custom-layer {
    padding: 14px;
  }
  body.rs-server-demo .navbar-brand img {
    height: 38px;
  }
  body.rs-server-demo #demoClock {
    bottom: 12px;
    left: 12px;
    font-size: 1rem;
    padding: 0.4rem 0.8rem;
  }
  body.rs-server-demo .rs-tavoli-grid {
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  }
}

body.rs-server-demo .rs-demo-content {
  padding-bottom: 100px;
}

body.rs-server-demo .text-accent {
  color: #6bd4ff;
}

body.rs-server-demo .rs-embed-close {
  display: none;
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 10010;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
}

body.rs-server-demo .rs-warning-popup {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  z-index: 10003;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

body.rs-server-demo .rs-warning-card {
  background: #fff;
  border-radius: 20px;
  max-width: 400px;
  width: 100%;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  animation: rsPopupIn 0.3s ease-out;
}

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

body.rs-server-demo .rs-warning-header {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  padding: 2rem;
  text-align: center;
  color: #fff;
}

body.rs-server-demo .rs-warning-icon { font-size: 3rem; margin-bottom: 1rem; }
body.rs-server-demo .rs-warning-header h3 { margin: 0; font-size: 1.5rem; font-weight: 700; letter-spacing: 1px; }

body.rs-server-demo .rs-warning-body {
  padding: 2rem;
  text-align: center;
  color: #555;
}

body.rs-server-demo .rs-warning-body button {
  width: 100%;
  margin-top: 0.5rem;
  padding: 1rem;
  border: none;
  border-radius: 12px;
  font-weight: 600;
  font-size: 1.1rem;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(135deg, #dc2626, #b91c1c);
}
