/* ============================
   SmartHotel.pt Demo — Base Layout
   Matches main landing page branding
   ============================ */

:root {
  --bg:          #0a0a0f;
  --bg-subtle:   #111118;
  --bg-card:     #14141c;
  --bg-card-hover: #1a1a24;
  --surface:     #1c1c28;
  --border:      rgba(201, 169, 110, 0.12);
  --border-hover: rgba(201, 169, 110, 0.25);

  --text:        #f0ebe3;
  --text-muted:  #9a958d;
  --text-dim:    #6b6762;

  --accent:      #c9a96e;
  --accent-soft: rgba(201, 169, 110, 0.08);
  --accent-glow: rgba(201, 169, 110, 0.15);

  --ok:          #36c78a;
  --warn:        #f0b43a;
  --bad:         #de5a5a;

  --font-display: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --font-body:    'Libre Franklin', 'Helvetica Neue', Helvetica, sans-serif;

  --header-h: 56px;
  --form-h:   64px;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
}

::selection {
  background: var(--accent);
  color: var(--bg);
}

/* Grain overlay — matches landing page */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px;
}

/* ============================
   Shell Layout
   ============================ */
.demo-shell {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Subtle radial glow at top — matches hero */
.demo-shell::before {
  content: '';
  position: fixed;
  top: -200px;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(ellipse, rgba(201, 169, 110, 0.04) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* ============================
   Header
   ============================ */
.demo-header {
  height: var(--header-h);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: rgba(10, 10, 15, 0.85);
  position: sticky;
  top: 0;
  z-index: 20;
}

.back-link {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.8125rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  transition: color 0.3s var(--ease-out);
}

.back-link:hover {
  color: var(--accent);
}

.hotel-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.05rem, 2.5vw, 1.35rem);
  text-align: center;
  letter-spacing: -0.01em;
}

.header-tools {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 12px;
}

.reset-btn {
  width: 32px;
  height: 32px;
  border-radius: 2px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-dim);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s var(--ease-out);
}

.reset-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.status-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
  transition: background 0.3s;
}

.status-connected {
  background: var(--ok);
  box-shadow: 0 0 6px rgba(54, 199, 138, 0.4);
}

.status-connecting {
  background: var(--warn);
  animation: pulse 1.5s ease-in-out infinite;
}

.status-offline {
  background: var(--bad);
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.status-label {
  color: var(--text-dim);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ============================
   Chat Form (bottom input bar)
   ============================ */
.chat-form {
  height: var(--form-h);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: rgba(10, 10, 15, 0.9);
  position: sticky;
  bottom: 0;
  z-index: 20;
}

#chat-input {
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  border-radius: 2px;
  padding: 0 16px;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 300;
  outline: none;
  transition: border-color 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out);
}

#chat-input::placeholder {
  color: var(--text-dim);
}

#chat-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

#btn-send {
  border: none;
  border-radius: 2px;
  background: var(--accent);
  color: var(--bg);
  padding: 0 20px;
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.35s var(--ease-out);
}

#btn-send:hover {
  background: #d4b87a;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(201, 169, 110, 0.2);
}

#btn-send:active {
  transform: translateY(0);
}

#btn-send:disabled,
#chat-input:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

#btn-send:disabled:hover {
  transform: none;
  box-shadow: none;
  background: var(--accent);
}

/* ============================
   Footer
   ============================ */
.demo-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  color: var(--text-dim);
  font-size: 0.75rem;
  letter-spacing: 0.02em;
  border-top: 1px solid var(--border);
}

/* ============================
   Accessibility
   ============================ */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ============================
   Mobile
   ============================ */
@media (max-width: 640px) {
  .demo-header {
    padding: 0 12px;
    gap: 8px;
  }

  .hotel-title {
    font-size: 1rem;
  }

  .chat-form {
    padding: 10px 12px;
  }

  .demo-footer {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 4px;
    padding: 8px 12px;
  }
}
