/* SmartFlow Tower 3D CSS Stylesheet */

/* Seamless page entrance curtain fade */
#room-fade {
  position: fixed;
  inset: 0;
  z-index: 99990;
  background: #000;
  opacity: 1;
  pointer-events: none;
  transition: opacity 0.65s cubic-bezier(0.2, 0, 0.2, 1);
}

#room-fade.loaded {
  opacity: 0;
}

#room-fade.exiting {
  opacity: 1;
  pointer-events: auto;
  transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.tower-body {
  margin: 0;
  padding: 0;
  background-color: #030712;
  color: #f3f4f6;
  font-family: 'Heebo', system-ui, -apple-system, sans-serif;
  overflow: hidden;
  width: 100vw;
  height: 100vh;
}

/* Mobile gate overlay */
.mobile-gate-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(3, 7, 18, 0.96);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.mobile-gate-card {
  background: #0f172a;
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 16px;
  padding: 32px 24px;
  max-width: 420px;
  text-align: center;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.8);
}

.mobile-gate-card .gate-icon {
  font-size: 3rem;
  margin-bottom: 16px;
}

.mobile-gate-card h3 {
  font-size: 1.3rem;
  color: #38bdf8;
  margin-bottom: 12px;
}

.mobile-gate-card p {
  font-size: 0.95rem;
  color: #94a3b8;
  line-height: 1.6;
  margin-bottom: 24px;
}

/* Elevator HUD */
.tower-elevator-hud {
  position: fixed;
  right: 28px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 50;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 16px;
  padding: 16px 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

[dir="rtl"] .tower-elevator-hud {
  right: auto;
  left: 28px;
}

.elevator-header {
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  color: #64748b;
  text-align: center;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.elevator-floors {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.floor-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: #94a3b8;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  width: 100%;
  text-align: right;
}

[dir="ltr"] .floor-btn {
  text-align: left;
}

.floor-btn:hover {
  background: rgba(56, 189, 248, 0.1);
  border-color: rgba(56, 189, 248, 0.4);
  color: #f8fafc;
  transform: translateX(-4px);
}

[dir="rtl"] .floor-btn:hover {
  transform: translateX(4px);
}

.floor-btn.active {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.2) 0%, rgba(14, 165, 233, 0.3) 100%);
  border-color: #38bdf8;
  color: #38bdf8;
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.25);
}

.floor-num {
  font-size: 0.8rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.06);
  padding: 3px 6px;
  border-radius: 4px;
}

/* Server Racks Navigation Sub-Dock (Floor 1 Interior) */
.tower-server-hud {
  position: fixed;
  right: calc(28px + 230px + 12px);
  top: 50%;
  transform: translateY(-50%);
  z-index: 50;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 16px;
  padding: 16px 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), inset 0 0 16px rgba(56, 189, 248, 0.08);
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: serverHudPop 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
}

[dir="rtl"] .tower-server-hud {
  right: auto;
  left: calc(28px + 230px + 12px);
}

@keyframes serverHudPop {
  from {
    opacity: 0;
    transform: translateY(-50%) translateX(16px);
  }
  to {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
  }
}

[dir="rtl"] @keyframes serverHudPop {
  from {
    opacity: 0;
    transform: translateY(-50%) translateX(-16px);
  }
  to {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
  }
}

.server-header {
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  color: #38bdf8;
  font-weight: 700;
  text-align: center;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(56, 189, 248, 0.2);
}

.server-racks {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.server-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: #94a3b8;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  width: 100%;
  text-align: right;
  white-space: nowrap;
}

[dir="ltr"] .server-btn {
  text-align: left;
}

.server-btn:hover {
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.45);
  color: #f8fafc;
  transform: translateX(-3px);
}

[dir="rtl"] .server-btn:hover {
  transform: translateX(3px);
}

.server-btn.active {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.25) 0%, rgba(14, 165, 233, 0.38) 100%);
  border-color: #38bdf8;
  color: #38bdf8;
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.3);
  font-weight: 600;
}

.server-num {
  font-size: 0.8rem;
  font-weight: 700;
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  padding: 3px 6px;
  border-radius: 4px;
}

@media (max-width: 860px) {
  .tower-server-hud {
    display: none !important;
  }
}

.floor-btn.active .floor-num {
  background: #38bdf8;
  color: #030712;
}

.floor-name {
  font-size: 0.85rem;
  font-weight: 500;
  white-space: nowrap;
}

/* Floor Action HUD Pill (Floating Enter/Inspect button) */
.tower-action-pill {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 50;
  animation: pulsePill 2.5s infinite ease-in-out;
}

@keyframes pulsePill {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50% { transform: translate(-50%, -50%) scale(1.05); }
}

.btn-floor-action {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  border: 1px solid #38bdf8;
  border-radius: 30px;
  color: #ffffff;
  padding: 14px 28px;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  cursor: pointer;
  box-shadow: 0 10px 25px rgba(2, 132, 199, 0.4);
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.2s ease;
}

.btn-floor-action:hover {
  background: #0ea5e9;
  box-shadow: 0 12px 30px rgba(56, 189, 248, 0.6);
  transform: translateY(-2px);
}

.hud-tower-badge {
  font-size: 0.75rem;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 4px 10px;
  border-radius: 20px;
  letter-spacing: 0.1em;
}

/* Street Level Footer Bar Styles */
.hud-bottom-street {
  width: 100%;
  max-width: 1100px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: 11px;
  color: var(--muted);
}

.street-footer-copy {
  display: flex;
  align-items: center;
  gap: 8px;
}

.street-footer-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.street-footer-links a {
  color: var(--text);
  text-decoration: none;
  transition: color 0.2s ease;
}

.street-footer-links a:hover {
  color: var(--accent);
}

@media (max-width: 768px) {
  .hud-bottom-street {
    flex-direction: column;
    gap: 6px;
    text-align: center;
  }
}

/* Floating Glass CTA Card (matches landing hero style on right side) */
.tower-cta-card {
  position: fixed;
  right: 32px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 45;
  width: min(440px, calc(100vw - 64px));
  background: rgba(4, 9, 20, 0.82);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(102, 204, 240, 0.35);
  border-radius: 18px;
  padding: 30px 32px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.75), inset 0 0 24px rgba(102, 204, 240, 0.1);
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: floatCardIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
  pointer-events: auto;
}

[dir="rtl"] .tower-cta-card {
  right: 32px;
  left: auto;
  text-align: right;
}

[dir="ltr"] .tower-cta-card {
  right: auto;
  left: 32px;
  text-align: left;
}

@keyframes floatCardIn {
  from {
    opacity: 0;
    transform: translateY(-50%) translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
  }
}

.tower-cta-card .kicker {
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  color: #38bdf8;
  font-weight: 600;
}

.tower-cta-title {
  font-size: clamp(1.45rem, 2.3vw, 1.85rem);
  font-weight: 800;
  line-height: 1.25;
  margin: 0;
  color: #f8fafc;
}

.tower-cta-desc {
  font-size: 1.02rem;
  color: #cbd5e1;
  line-height: 1.6;
  margin: 0;
}

.tower-cta-highlights {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 4px 0;
  padding: 14px 0;
  border-top: 1px solid rgba(102, 204, 240, 0.15);
  border-bottom: 1px solid rgba(102, 204, 240, 0.15);
}

.tower-cta-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.tower-cta-icon {
  font-size: 1.15rem;
  line-height: 1.3;
  flex-shrink: 0;
}

.tower-cta-item strong {
  display: block;
  font-size: 0.95rem;
  color: #e2e8f0;
  font-weight: 600;
  margin-bottom: 2px;
}

.tower-cta-item p {
  font-size: 0.86rem;
  color: #94a3b8;
  line-height: 1.45;
  margin: 0;
}

.tower-cta-actions {
  display: flex;
  margin-top: 2px;
}

.tower-cta-card .btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #ffffff;
  border: 1px solid #38bdf8;
  padding: 14px 26px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 1.05rem;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 4px 20px rgba(2, 132, 199, 0.45);
  width: 100%;
}

.tower-cta-card .btn-primary:hover {
  background: linear-gradient(135deg, #0369a1 0%, #0284c7 100%);
  box-shadow: 0 0 24px rgba(56, 189, 248, 0.7);
  transform: translateY(-2px);
}

/* Dedicated AI Chat styling on Tower 3D */

/* When on normal exterior or other floors, chat widget and WhatsApp button stay in standard bottom position */
body.tower-body .chat-widget {
  bottom: 24px;
  z-index: 100;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

[dir="rtl"] body.tower-body .chat-widget {
  inset-inline-start: 1.75rem;
  inset-inline-end: auto;
  left: 1.75rem;
  right: auto;
}

[dir="ltr"] body.tower-body .chat-widget {
  inset-inline-start: 1.75rem;
  inset-inline-end: auto;
  left: 1.75rem;
  right: auto;
}

body.tower-body .chat-panel {
  width: min(400px, calc(100vw - 3rem));
  height: min(540px, calc(100vh - 7rem));
  background: rgba(15, 23, 42, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(56, 189, 248, 0.4);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 30px rgba(56, 189, 248, 0.15);
  border-radius: 18px;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==========================================================================
   INSIDE PENTHOUSE (PH)
   - Chat panel is ALWAYS open docked next to the 3D Avatar (center-right).
   - No open/close toggle buttons needed; WhatsApp button stays down at the bottom.
   - Close button is hidden inside PH (it stays open permanently while in PH).
   ========================================================================== */
body.tower-body.inside-penthouse .chat-widget {
  position: static;
}

/* In Penthouse: Hide the toggle bubble button since the panel is permanently open */
body.tower-body.inside-penthouse .chat-bubble {
  display: none !important;
}

/* In Penthouse: Keep WhatsApp button fixed at the bottom left */
body.tower-body.inside-penthouse .chat-wa {
  position: fixed;
  bottom: 24px;
  inset-inline-start: 1.75rem;
  left: 1.75rem;
  z-index: 1200;
}

/* In Penthouse: Dock the open chat panel in the middle-right area next to the 3D Avatar */
body.tower-body.inside-penthouse .chat-panel {
  display: flex !important;
  position: fixed;
  bottom: auto;
  top: 50%;
  transform: translateY(-50%);
  right: max(3vw, calc(50% - 560px));
  left: auto;
  width: min(440px, 42vw);
  height: min(560px, 72vh);
  border: 1.5px solid #38bdf8;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.9), 0 0 35px rgba(56, 189, 248, 0.25);
  animation: avatarChatPop 0.45s cubic-bezier(0.16, 1, 0.3, 1) both;
  z-index: 1200;
}

[dir="rtl"] body.tower-body.inside-penthouse .chat-panel {
  right: max(3vw, calc(50% - 560px));
  left: auto;
}

[dir="ltr"] body.tower-body.inside-penthouse .chat-panel {
  right: max(3vw, calc(50% - 560px));
  left: auto;
}

/* Hide close button while in Penthouse — chat is permanent inside PH */
body.tower-body.inside-penthouse .chat-close {
  display: none !important;
}

@keyframes avatarChatPop {
  0% {
    opacity: 0;
    transform: translateY(-50%) scale(0.9) translateX(20px);
  }
  100% {
    opacity: 1;
    transform: translateY(-50%) scale(1) translateX(0);
  }
}

body.tower-body .chat-header {
  background: rgba(3, 7, 18, 0.85);
  border-bottom: 1px solid rgba(56, 189, 248, 0.25);
  padding: 0.85rem 1rem;
}

body.tower-body .chat-title {
  color: #38bdf8;
  font-weight: 700;
  font-size: 0.9rem;
}

body.tower-body .chat-input-row {
  background: rgba(3, 7, 18, 0.85);
  border-top: 1px solid rgba(56, 189, 248, 0.25);
}

@media (max-width: 860px) {
  .tower-cta-card {
    display: none !important;
  }
}

/* Tower view enhancements to keep 3D scene prominent and accessible */
body.tower-body .panel-inner {
  width: min(440px, 34vw);
  padding: 76px 28px 64px;
}

body.tower-body .callout {
  max-width: min(420px, 33vw);
  max-height: min(78vh, 680px);
  padding: 24px 24px 28px;
  background: rgba(10, 18, 32, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(56, 189, 248, 0.28);
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.65), inset 0 0 1px 1px rgba(255, 255, 255, 0.05);
  box-sizing: border-box;
}

body.tower-body .callout-pop-a {
  inset-inline-start: calc(min(440px, 34vw) + 18px);
  inset-inline-end: auto;
  inset-block-start: 6%;
}

body.tower-body .callout-pop-b {
  inset-inline-start: calc(min(440px, 34vw) + 18px);
  inset-inline-end: auto;
  inset-block-start: 6%;
  inset-block-end: auto;
}

body.tower-body .callout-wide {
  max-width: min(480px, 38vw);
  max-height: min(84vh, 740px);
}

body.tower-body .tech-block {
  padding-bottom: 12px;
}

/* --- City / Tower Dialog Modals --- */
.city-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 24px;
  box-sizing: border-box;
}

.city-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

.city-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 16, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.city-modal-dialog {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 840px;
  max-height: 88vh;
  background: linear-gradient(180deg, rgba(9, 20, 36, 0.96) 0%, rgba(4, 9, 20, 0.98) 100%);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 16px;
  padding: 28px 32px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.85), 0 0 35px rgba(56, 189, 248, 0.18);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  transform: scale(0.96) translateY(10px);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  color: #f8fafc;
}

.city-modal.is-open .city-modal-dialog {
  transform: scale(1) translateY(0);
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 14px;
  margin-bottom: 18px;
}

.modal-title {
  font-size: 1.5rem;
  font-weight: 800;
  margin: 4px 0 0 0;
  color: #f8fafc;
}

.modal-close-btn {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #94a3b8;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s ease;
}

.modal-close-btn:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: #ef4444;
  color: #fff;
}

.modal-body {
  overflow-y: auto;
  line-height: 1.6;
}

.btn-ghost-cyan {
  display: inline-block;
  padding: 0.5rem 1rem;
  border: 1px solid rgba(56, 189, 248, 0.4);
  background: rgba(56, 189, 248, 0.08);
  color: var(--cyan, #38bdf8);
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.2s ease;
}

.btn-ghost-cyan:hover {
  background: rgba(56, 189, 248, 0.2);
  border-color: var(--cyan, #38bdf8);
  color: #fff;
}
