/* ============================================================
   ZTX Global Styles — Production Enterprise Site
   ============================================================ */

/* --- Material Symbols --- */
.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

/* --- Glass effects --- */
.glass-panel {
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

/* --- Gradient helpers --- */
.technical-gradient {
  background: linear-gradient(135deg, #001e40 0%, #003366 50%, #00658d 100%);
}
.hero-gradient-overlay {
  background: linear-gradient(to top, #001e40 0%, rgba(0,30,64,0.3) 40%, transparent 100%);
}

/* --- Smooth scroll --- */
html { scroll-behavior: smooth; }

/* Tab panels fade transition */
[data-tab-panel] {
  transition: opacity 0.3s ease-in-out;
}

/* --- Custom scrollbar --- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #f1f4f7; }
::-webkit-scrollbar-thumb { background: #003366; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #001e40; }

/* --- Scroll-triggered animations --- */
.scroll-reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.scroll-reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}
.scroll-reveal.delay-1 { transition-delay: 0.15s; }
.scroll-reveal.delay-2 { transition-delay: 0.3s; }
.scroll-reveal.delay-3 { transition-delay: 0.45s; }
.scroll-reveal.delay-4 { transition-delay: 0.6s; }

/* --- Swiper custom pagination --- */
.swiper-pagination-bullet {
  width: 32px !important;
  height: 4px !important;
  border-radius: 2px !important;
  background: rgba(255,255,255,0.4) !important;
  opacity: 1 !important;
  transition: all 0.3s ease !important;
}
.swiper-pagination-bullet-active {
  background: #2dbcfe !important;
  width: 48px !important;
}

/* --- Language dropdown --- */
.lang-dropdown {
  position: relative;
  z-index: 100;
}
.lang-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: #fff;
  border: 1px solid #e0e3e6;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,30,64,0.12);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all 0.2s ease;
  overflow: hidden;
}
.lang-dropdown-menu.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.lang-dropdown-menu button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 500;
  color: #43474f;
  background: none;
  border: none;
  cursor: pointer;
  transition: background 0.15s;
  text-align: left;
  white-space: nowrap;
}
.lang-dropdown-menu button:hover {
  background: #f1f4f7;
  color: #001e40;
}
.lang-dropdown-menu button.active {
  color: #00658d;
  font-weight: 700;
  background: #f1f4f7;
}

/* --- Chat Widget --- */
.chat-fab {
  position: fixed;
  bottom: 32px;
  right: 32px;
  z-index: 9999;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #003366, #00658d);
  color: #fff;
  border: none;
  cursor: pointer;
  box-shadow: 0 6px 24px rgba(0,30,64,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}
.chat-fab:hover {
  transform: scale(1.08);
  box-shadow: 0 8px 32px rgba(0,30,64,0.45);
}
.chat-fab .material-symbols-outlined { font-size: 28px; }
.chat-fab .chat-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ba1a1a;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: none;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
}

.chat-panel {
  position: fixed;
  bottom: 104px;
  right: 32px;
  z-index: 9998;
  width: 380px;
  max-height: 560px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 12px 48px rgba(0,30,64,0.2);
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px) scale(0.96);
  transition: all 0.3s ease;
  overflow: hidden;
}
.chat-panel.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.chat-header {
  background: linear-gradient(135deg, #001e40, #003366);
  color: #fff;
  padding: 18px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}
.chat-header h3 { font-family: 'Manrope', sans-serif; font-weight: 700; font-size: 15px; }
.chat-header .chat-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  opacity: 0.8;
}
.chat-header .chat-status::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4caf50;
}
.chat-close {
  background: rgba(255,255,255,0.1);
  border: none;
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.chat-close:hover { background: rgba(255,255,255,0.2); }

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 300px;
  background: #f7fafd;
}
.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-thumb { background: #c3c6d1; border-radius: 2px; }

.chat-bubble {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.5;
  word-wrap: break-word;
}
.chat-bubble.agent {
  align-self: flex-start;
  background: #fff;
  color: #181c1e;
  border: 1px solid #e0e3e6;
  border-bottom-left-radius: 4px;
}
.chat-bubble.user {
  align-self: flex-end;
  background: linear-gradient(135deg, #003366, #00658d);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.chat-bubble .time {
  display: block;
  font-size: 10px;
  opacity: 0.6;
  margin-top: 4px;
}

.chat-typing {
  display: none;
  align-self: flex-start;
  padding: 10px 16px;
  background: #fff;
  border: 1px solid #e0e3e6;
  border-radius: 14px;
  border-bottom-left-radius: 4px;
}
.chat-typing.show { display: flex; gap: 4px; }
.chat-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #737780;
  animation: typing-dot 1.4s infinite ease-in-out;
}
.chat-typing span:nth-child(2) { animation-delay: 0.2s; }
.chat-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing-dot {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

.chat-input-area {
  display: flex;
  gap: 8px;
  padding: 14px 16px;
  border-top: 1px solid #e0e3e6;
  background: #fff;
  flex-shrink: 0;
}
.chat-input-area input {
  flex: 1;
  border: 1px solid #e0e3e6;
  border-radius: 24px;
  padding: 10px 16px;
  font-size: 14px;
  outline: none;
  background: #f7fafd;
  color: #181c1e;
  transition: border-color 0.2s;
}
.chat-input-area input:focus { border-color: #2dbcfe; }
.chat-input-area button {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #003366;
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  flex-shrink: 0;
}
.chat-input-area button:hover { background: #00658d; }
.chat-input-area button:disabled { background: #c3c6d1; cursor: not-allowed; }

/* --- Toast notifications --- */
.toast {
  position: fixed;
  top: 100px;
  right: 32px;
  z-index: 10000;
  background: #fff;
  border-radius: 12px;
  padding: 16px 24px;
  box-shadow: 0 8px 32px rgba(0,30,64,0.15);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  font-weight: 500;
  opacity: 0;
  transform: translateX(100%);
  transition: all 0.4s ease;
}
.toast.show { opacity: 1; transform: translateX(0); }
.toast.success { border-left: 4px solid #4caf50; }
.toast.error { border-left: 4px solid #ba1a1a; }

/* --- Mobile responsive overrides --- */
@media (max-width: 768px) {
  .chat-panel {
    right: 0;
    bottom: 0;
    width: 100%;
    max-height: 100vh;
    border-radius: 0;
  }
  .chat-fab {
    bottom: 20px;
    right: 20px;
    width: 52px;
    height: 52px;
  }
}

/* --- Print --- */
@media print {
  .chat-fab, .chat-panel, header, footer { display: none !important; }
  body { font-size: 12pt; }
}
