:root{
  --bg:#111111; --panel:#1a1a1a; --panel2:#222; --accent:#3ba7ff; --txt:#e5e7eb; --muted:#a3a3a3; --electric:#5cfaff;
}
*{box-sizing:border-box}
html, body { height:100% }
body{
  margin:0; background: var(--bg); color: var(--txt);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, 'Noto Kufi Arabic', Tahoma, Arial, sans-serif;
  overflow:hidden;
}

/* WebGL & FX */
#webgl,#fx{ position:fixed; inset:0; width:100vw; height:100vh; display:block; outline:0 }
#webgl{ background:transparent; z-index:0; -webkit-tap-highlight-color:transparent; touch-action:none }
#fx{ pointer-events:none; z-index:2 }

/* Top bar */
.top-bar{
  position: fixed; top:0; inset-inline:0;
  height: 64px; background: rgba(26,26,26,.9); backdrop-filter: blur(6px);
  display:flex; align-items:center; justify-content:space-between;
  gap: 10px; padding: 8px 12px; z-index: 3; border-bottom:1px solid #2a2a2a;
}
.dropdown{ position: relative }
.btn{
  background: #2a2a2a; border:1px solid #3a3a3a; color:var(--txt);
  padding:12px 24px; border-radius:12px; cursor:pointer; font-weight:700; font-size:16px;
  min-width: 180px; white-space: nowrap; text-align: center;
}
.btn:hover{ background:#323232; border-color:#4a4a4a }
.btn.accent{ background: var(--accent); border-color: transparent; color:#02121f }
.btn.accent:hover{ filter:brightness(1.05) }

/* Dropdown menu */
.dropdown-menu{
  position:absolute; top:56px; inset-inline-end:0;
  background:#1f1f1f; border:1px solid #2b2b2b; border-radius:12px; padding:8px;
  display:none; flex-direction:column; gap:6px; min-width:200px; z-index:4;
  box-shadow: 0 10px 30px rgba(0,0,0,.35);
}
.dropdown.show .dropdown-menu{ display:flex }
.dropdown-menu .btn{ width:100%; text-align:center; padding:10px 12px; font-size:15px }

/* Brand chip */
.brand-chip{
  position: relative; display:inline-flex; align-items:center; justify-content:center;
  padding:8px 16px; border-radius:12px; overflow:hidden; isolation:isolate; color:#fff;
  font-weight:900; letter-spacing:1px; min-width:140px; text-align:center;
  background: linear-gradient(90deg, #37b5ff, #934cff, #ff4fb3, #37b5ff);
  background-size:300% 100%; animation: chipGradient 6s linear infinite;
  box-shadow: 0 0 18px rgba(147,76,255,.25);
}
.brand-chip span{ position:relative; z-index:1; filter: drop-shadow(0 1px 1px rgba(0,0,0,.35)); }
.brand-chip canvas{ position:absolute; inset:0; width:100%; height:100%; z-index:0; pointer-events:none; mix-blend-mode: screen; }
@keyframes chipGradient{ 0%{ background-position:0 0 } 50%{ background-position:100% 0 } 100%{ background-position:0 0 } }

/* Chat box */
.chatgpt-box{
  position: fixed; inset-inline:0; bottom: 64px;
  margin-inline:auto; width:min(92vw, 700px); min-height: 120px;
  background: rgba(26,26,26,.28);
  border:1px solid rgba(255,255,255,.12); border-radius:14px;
  backdrop-filter: blur(10px) saturate(120%); -webkit-backdrop-filter: blur(10px) saturate(120%);
  z-index:2; padding:12px 14px; overflow:auto;
  box-shadow: 0 10px 30px rgba(0,0,0,.25), inset 0 0 20px rgba(255,255,255,.05);
}
.chatgpt-title{ font-weight:800; color:var(--accent); margin-bottom:6px }
.chatgpt-hint{ color:#c3c9d1; font-size:13px }

/* About button */
.about-btn{ position: fixed; bottom:14px; inset-inline-end:14px; z-index:2 }

/* Modal */
.modal{ position: fixed; inset:0; display:none; align-items:center; justify-content:center; z-index:5; background: rgba(0,0,0,.6) }
.modal.show{ display:flex }
.modal-card{
  background:#1f1f1f; border:1px solid #2b2b2b; border-radius:14px; padding:18px 20px; width:min(90vw, 360px);
  text-align:center; max-height:90vh;
}
.modal-card .title{ font-weight:800; margin:0 0 6px }
.modal-card .muted{ color:var(--muted); font-size:14px }
.modal-card .actions{ margin-top:12px }

/* Chat modal entrance animation (unified, no duplicates) */
#chatModal { align-items: flex-start; justify-content: center; padding-top: 40px; }
.modal-card.chat-window {
  transform: translateY(100px) scale(0.9);
  opacity: 0;
  transition: transform 1.5s ease, opacity 1.5s ease;
}
.modal.show .modal-card.chat-window { transform:none; opacity:1 }

/* Talk button (center bottom) */
#talkBtn{ position:fixed; bottom:140px; left:50%; transform:translateX(-50%); z-index:3 }

/* Responsive tweaks for chat */
#chatModal .chat-area{display:flex;flex-direction:column;min-height:420px}
#chatModal #chatRoot{height:100%}
#chatModal #messages{border-radius:clamp(8px,1.5vw,12px);padding:clamp(6px,1.2vw,12px)}
#chatModal #heading{font-size:clamp(14px,2.8vw,18px)}
#chatModal #selectorRow select{font-size:clamp(12px,2.6vw,14px);padding:clamp(6px,1.2vw,10px) clamp(10px,2vw,14px);min-width:unset}
#chatModal #composer input{font-size:clamp(12px,2.8vw,14px);padding:clamp(8px,1.8vw,12px) clamp(10px,2vw,14px)}
#chatModal #composer button{font-size:clamp(12px,2.8vw,14px);min-width:clamp(64px,14vw,92px);padding:0 clamp(12px,3vw,16px)}
#chatModal #composer{gap:clamp(6px,1.6vw,10px)}

@media (max-width: 420px){
  #chatModal .modal-card{padding:12px}
  #chatModal #selectorRow{justify-content:stretch}
  #chatModal #selectorRow select{width:100%}
  #chatModal .chat-area{min-height:72vh}
}
@media (min-width: 421px) and (max-width: 768px){
  #chatModal .chat-area{min-height:60vh}
}
@media (min-width: 769px){
  #chatModal .chat-area{min-height:420px}
}
/* ========================================= */
/*  مؤشر الكتابة الجديد - النقاط المتحركة     */
/* ========================================= */

.typing-dots {
    direction: ltr;
    text-align: left;
    padding: 5px;
    font-size: 16px;
    color: #999;
    display: flex;
    gap: 4px;
    letter-spacing: 2px;
}

.typing-dots .dot {
    opacity: 0.3;
    animation: bounce 1s infinite ease-in-out;
    font-weight: bold;
}

.typing-dots .dot1 { animation-delay: 0s; }
.typing-dots .dot2 { animation-delay: 0.2s; }
.typing-dots .dot3 { animation-delay: 0.4s; }

@keyframes bounce {
    0%   { opacity: 0.3; transform: translateY(0); }
    40%  { opacity: 1;   transform: translateY(-4px); }
    80%  { opacity: 0.3; transform: translateY(0); }
    100% { opacity: 0.3; }
}
/* =============================== */
/*      تنسيق فقرة الأكواد        */
/* =============================== */
.code-block {
    position: relative;
    background: #1a1a1a;
    border: 1px solid #333;
    padding: 10px 12px;
    border-radius: 8px;
    margin: 8px 0;
}

.code-block pre {
    margin: 0;
    overflow-x: auto;
}

.code-block code {
    font-family: "Courier New", monospace;
    font-size: 13px;
    color: #e4e4e4;
    white-space: pre;
}

.copy-btn {
    position: absolute;
    top: 6px;
    left: 6px;
    padding: 2px 8px;
    font-size: 12px;
    border: none;
    border-radius: 4px;
    background: #2563eb;
    color: white;
    cursor: pointer;
}

.copy-btn:hover {
    background: #1d4ed8;
}

.chat-link {
    color: #4fa3ff;
    text-decoration: underline;
    word-break: break-all;
}


/* Contact button – نفس تصميم About ولكن فوقه قليلاً */
.contact-btn{
  position: fixed;
  bottom:14px;
  inset-inline-start:14px;
  z-index:2;
}


/* توحيد وتصغير حجم جميع الأزرار */
.btn{
  padding: 8px 16px !important;
  font-size: 14px !important;
  border-radius: 8px !important;
}


/* تخصيص الحجم والعرض فقط لزر About و تواصل معنا */
.about-btn,
.contact-btn{
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: auto !important;
  min-width: unset !important;
  padding: 6px 12px !important;
  font-size: 13px !important;
  white-space: nowrap !important;
}
#talkBtn{
  padding: 24px 30px;     /* زيادة الارتفاع والعرض */
  font-size: 25px;       /* تكبير الخط */
  border-radius: 22px;
  min-width: 200px;
  text-align: center;

  /* ✅ وميض ثابت وناعم */
  box-shadow: 0 0 18px rgba(59,167,255,0.65);
}