/*
Theme Name: S-Cube Global Service Theme
Theme URI: https://s-cube.com.sg/
Description: A premium, highly immersive single-page WordPress theme with built-in interactive solutions grids, project showcase gallery, and an AI-powered conversational receptionist widget.
Author: S-Cube Global Services Pte. Ltd.
Author URI: https://s-cube.com.sg/
Version: 2.4.0-seo
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: s-cube-theme
*/

@font-face {
  font-family: 'Equinox';
  src: local('Equinox'), local('Equinox Regular'), local('Equinox-Regular');
  font-weight: normal;
  font-style: normal;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: #090d16;
}
::-webkit-scrollbar-thumb {
  background: #1e293b;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #D20A11;
}

/* Entrance Transitions */
.fade-in-up {
  opacity: 0;
  transform: translateY(15px);
  animation: fadeInUpAnim 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes fadeInUpAnim {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ═══════════════════════════════════════════════════════════
   AI CHATBOT STYLES
   ═══════════════════════════════════════════════════════════ */
:root {
  --chat-bg: #0B0F1A;
  --chat-surface: #111827;
  --chat-surface-2: #1A2235;
  --chat-border: rgba(255,255,255,0.08);
  --chat-text: #E2E8F0;
  --chat-text-muted: #94A3B8;
  --chat-user-bubble: #D20A11;
  --chat-bot-bubble: #1A2235;
}

#chatbot-toggle {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: #D20A11;
  border: none;
  cursor: pointer;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 30px rgba(210,10,17,0.45), 0 0 0 0 rgba(210,10,17,0.3);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  animation: toggle-breathe 3s ease-in-out infinite;
}

#chatbot-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 8px 40px rgba(210,10,17,0.6);
}

#chatbot-toggle.open {
  animation: none;
  background: #1e293b;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

@keyframes toggle-breathe {
  0%, 100% {
    box-shadow: 0 6px 30px rgba(210,10,17,0.45), 0 0 0 0 rgba(210,10,17,0.3);
  }
  50% {
    box-shadow: 0 6px 30px rgba(210,10,17,0.45), 0 0 0 12px rgba(210,10,17,0);
  }
}

#chatbot-toggle svg {
  color: white;
}

.toggle-icon-open, .toggle-icon-close {
  transition: all 0.3s ease;
  position: absolute;
}

.toggle-icon-close {
  opacity: 0;
  transform: rotate(-90deg) scale(0.5);
}

#chatbot-toggle.open .toggle-icon-open {
  opacity: 0;
  transform: rotate(90deg) scale(0.5);
}

#chatbot-toggle.open .toggle-icon-close {
  opacity: 1;
  transform: rotate(0) scale(1);
}

.chat-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 20px;
  height: 20px;
  background: #22c55e;
  border-radius: 50%;
  border: 2.5px solid white;
  animation: badge-pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes badge-pop {
  0% { transform: scale(0); }
  100% { transform: scale(1); }
}

#chatbot-window {
  position: fixed;
  bottom: 100px;
  right: 24px;
  width: 400px;
  max-width: calc(100vw - 32px);
  height: 600px;
  max-height: calc(100vh - 130px);
  background: var(--chat-bg);
  border-radius: 20px;
  border: 1px solid var(--chat-border);
  box-shadow: 0 25px 80px rgba(0,0,0,0.5);
  z-index: 9998;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.95);
  transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  font-family: 'Plus Jakarta Sans', sans-serif;
}

#chatbot-window.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.chat-header {
  background: linear-gradient(135deg, #111827 0%, #1a1030 100%);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--chat-border);
  flex-shrink: 0;
}

.chat-avatar {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: #D20A11;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Equinox', 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: 14px;
  color: white;
  flex-shrink: 0;
  position: relative;
  letter-spacing: 0.1em;
}

.chat-avatar::after {
  content: '';
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 12px;
  height: 12px;
  background: #22c55e;
  border-radius: 50%;
  border: 2px solid #111827;
}

.chat-header-info h4 {
  color: white;
  font-family: 'Equinox', 'Orbitron', sans-serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.chat-header-info p {
  color: #22c55e;
  font-size: 11px;
  font-weight: 500;
  margin-top: 1px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.chat-header-actions {
  margin-left: auto;
  display: flex;
  gap: 6px;
}

.chat-header-actions button {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  background: rgba(255,255,255,0.05);
  color: #94a3b8;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.chat-header-actions button:hover {
  background: rgba(255,255,255,0.1);
  color: white;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  scroll-behavior: smooth;
}

.chat-messages::-webkit-scrollbar {
  width: 4px;
}

.chat-messages::-webkit-scrollbar-track {
  background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.1);
  border-radius: 4px;
}

.msg-wrapper {
  display: flex;
  flex-direction: column;
  max-width: 88%;
  animation: msg-in 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.msg-wrapper.bot {
  align-self: flex-start;
}

.msg-wrapper.user {
  align-self: flex-end;
  align-items: flex-end;
}

@keyframes msg-in {
  0% { opacity: 0; transform: translateY(10px); }
  100% { opacity: 1; transform: translateY(0); }
}

.msg-bubble {
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 13.5px;
  line-height: 1.65;
  word-wrap: break-word;
}

.msg-wrapper.bot .msg-bubble {
  background: var(--chat-bot-bubble);
  color: var(--chat-text);
  border-bottom-left-radius: 4px;
  border: 1px solid var(--chat-border);
}

.msg-wrapper.user .msg-bubble {
  background: var(--chat-user-bubble);
  color: white;
  border-bottom-right-radius: 4px;
}

.msg-time {
  font-size: 10px;
  color: var(--chat-text-muted);
  margin-top: 4px;
  padding: 0 4px;
  opacity: 0.6;
}

.msg-bubble strong {
  color: white;
  font-weight: 600;
}

.msg-bubble a {
  color: #f87171;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.msg-bubble a:hover {
  color: #fca5a5;
}

.msg-bubble ul {
  margin: 8px 0;
  padding-left: 16px;
}

.msg-bubble li {
  margin-bottom: 4px;
  color: #cbd5e1;
}

.msg-bubble li::marker {
  color: #D20A11;
}

.msg-bubble .highlight-box {
  background: rgba(210,10,17,0.08);
  border: 1px solid rgba(210,10,17,0.2);
  border-radius: 10px;
  padding: 10px 14px;
  margin-top: 8px;
  font-size: 12.5px;
}

.typing-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 14px 18px;
  background: var(--chat-bot-bubble);
  border-radius: 16px;
  border-bottom-left-radius: 4px;
  border: 1px solid var(--chat-border);
  width: fit-content;
  animation: msg-in 0.25s ease;
}

.typing-dot {
  width: 7px;
  height: 7px;
  background: #64748b;
  border-radius: 50%;
  animation: typing-bounce 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(2) {
  animation-delay: 0.15s;
}

.typing-dot:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes typing-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-6px); opacity: 1; }
}

.quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 16px 4px;
  animation: msg-in 0.35s ease;
}

.quick-reply-btn {
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid rgba(210,10,17,0.3);
  background: rgba(210,10,17,0.06);
  color: #f87171;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

.quick-reply-btn:hover {
  background: rgba(210,10,17,0.15);
  border-color: rgba(210,10,17,0.5);
  transform: translateY(-1px);
}

.chat-input-area {
  padding: 12px 16px 16px;
  border-top: 1px solid var(--chat-border);
  background: var(--chat-surface);
  flex-shrink: 0;
}

.chat-input-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  background: var(--chat-surface-2);
  border: 1px solid var(--chat-border);
  border-radius: 14px;
  padding: 4px 4px 4px 14px;
  transition: border-color 0.2s;
}

.chat-input-row:focus-within {
  border-color: rgba(210,10,17,0.4);
}

#chat-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: white;
  font-size: 13.5px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  padding: 8px 0;
  max-height: 100px;
  resize: none;
  line-height: 1.5;
}

#chat-input::placeholder {
  color: #4b5563;
}

#chat-send {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: none;
  background: #D20A11;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

#chat-send:hover {
  background: #B3080E;
  transform: scale(1.05);
}

#chat-send:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.chat-input-hint {
  font-size: 10px;
  color: #374151;
  text-align: center;
  margin-top: 8px;
}

.welcome-card {
  background: linear-gradient(135deg, rgba(210,10,17,0.1) 0%, rgba(99,102,241,0.05) 100%);
  border: 1px solid rgba(210,10,17,0.15);
  border-radius: 14px;
  padding: 16px;
  margin-top: 6px;
}

.welcome-card h5 {
  color: white;
  font-family: 'Equinox', 'Orbitron', sans-serif;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: 0.05em;
}

.welcome-card p {
  font-size: 12.5px;
  color: #94a3b8;
  line-height: 1.6;
}

@media (max-width: 480px) {
  #chatbot-window {
    bottom: 0;
    right: 0;
    width: 100vw;
    max-width: 100vw;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
  }
  #chatbot-toggle {
    bottom: 16px;
    right: 16px;
    width: 56px;
    height: 56px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* Mobile landscape support: target mobile screens in landscape orientation */
@media (orientation: landscape) and (max-height: 550px) {
  .hero-section-landscape {
    min-height: 100vh !important;
    min-height: 100dvh !important;
    height: auto !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-end !important;
    padding-top: 36px !important;
    padding-bottom: 0px !important;
  }
  
  .hero-video-wrapper-landscape {
    position: absolute !important;
    top: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 0 !important;
  }

  .hero-video-landscape {
    object-fit: cover !important;
    width: 100% !important;
    height: 100% !important;
  }

  .hero-content-landscape {
    margin-top: auto !important;
    transform: translateY(0) !important;
    padding-bottom: 8px !important;
    z-index: 20 !important;
  }

  .hero-content-landscape p {
    font-size: 0.8rem !important;
    line-height: 1.35 !important;
    margin-bottom: 4px !important;
  }

  .hero-content-landscape div {
    margin-top: 10px !important;
    display: flex !important;
    justify-content: center !important;
  }

  .hero-content-landscape button {
    padding-top: 8px !important;
    padding-bottom: 8px !important;
    padding-left: 24px !important;
    padding-right: 24px !important;
    font-size: 0.75rem !important;
    font-weight: 700 !important;
    white-space: nowrap !important;
    border-radius: 9999px !important;
  }
}

/* Mobile portrait layout: keep existing centered layout below 40vh video */
@media (max-width: 767px) and (orientation: portrait) {
  .hero-content-landscape {
    justify-content: center !important;
    padding-top: 1.5rem !important;
    padding-bottom: 2rem !important;
    transform: translateY(0) !important;
  }
  .hero-text-block {
    transform: none !important;
  }
}

