:root {
    --chat-bg: #FEFBFB; 
    --chat-surface: #FBF4F5; 
    --chat-border: rgba(201, 83, 106, 0.15); 
}

body {
    font-family: 'Vazirmatn', sans-serif;
    background: linear-gradient(135deg, #1A1215 0%, #3B1A22 55%, #6B2D3E 100%);
    background-attachment: fixed;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    color: #3B2630; 
    direction: rtl;
}
/********  CHATBOT SECTION  *******/
/* ─── CHATBOT SECTION ─── */
.chatbot-section {
  min-height: calc(100vh - 90px);
  background: #f9f9f9;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  border: 1px solid var(--chat-border);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 50px 24px 60px;
  border-radius: 24px;
  overflow: hidden;
  width: 55%;
}
.gl-chat-welcome {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.gl-chat-welcome.hidden { display: none; }
.gl-orb {
  width: 80px; height: 80px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #D97FA0, #C9536A 50%, #8B2A3E);
  box-shadow:
    0 20px 40px rgba(201,83,106,0.35),
    inset 0 -4px 8px rgba(0,0,0,0.2),
    inset 0 4px 8px rgba(255,255,255,0.25);
  margin-bottom: 32px;
  animation: orbFloat 3s ease-in-out infinite;
}
@keyframes orbFloat {
  0%,100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-10px) scale(1.04); }
}
.gl-welcome-title {
  font-size: 32px;
  font-weight: 900;
  color: #111;
  margin-bottom: 4px;
  line-height: 1.3;
}
.gl-welcome-title em {
  font-style: normal;
  color: #C9536A;
}
/* ─── INPUT BOX ─── */
.gl-input-box {
  width: 100%;
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 16px;
  padding: 18px 20px 14px;
  margin: 32px 0 28px;
  box-shadow: 0 2px 16px rgba(0,0,0,0.07);
  text-align: right;
}
.gl-input-field {
  width: 100%;
  border: none;
  outline: none;
  font-size: 15px;
  font-family: inherit;
  color: #111;
  background: transparent;
  min-height: 52px;
  resize: none;
  line-height: 1.6;
  direction: rtl;
}
.gl-input-field::placeholder { color: #aaa; }
.gl-input-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: left;
}
.gl-toolbar-left { display: flex; align-items: center; gap: 8px; }
.gl-toolbar-btn {
  display: flex; align-items: center; gap:6px;
  background: #f4f4f4;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 7px 14px;
  font-size: 13px;
  color: #444;
  cursor: pointer;
  font-family: inherit;
  transition: all .2s;
}
.gl-toolbar-btn:hover { background: #eee; }
.gl-toolbar-btn svg { width:15px; height:15px; opacity:.6; }
.gl-send-btn {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: #111;
  color: #fff;
  border: none;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all .2s;
  flex-shrink: 0;
}
.gl-send-btn:hover { background: #C9536A; }
.gl-send-btn:disabled { opacity: .4; cursor: not-allowed; }
.gl-send-btn svg { width:18px; height:18px; }
/* ─── SUGGESTED LABEL ─── */
.gl-suggestions-label {
  font-size: 11px;
  font-weight: 700;
  color: #999;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 14px;
  text-align: right;
  width: 100%;
}
/* ─── 4 CARDS ─── */
.gl-cards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  width: 100%;
}
.gl-card {
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 14px;
  padding: 18px 16px;
  cursor: pointer;
  text-align: right;
  transition: all .25s;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 120px;
}
.gl-card:hover {
  border-color: #C9536A;
  box-shadow: 0 4px 16px rgba(201,83,106,0.12);
  transform: translateY(-2px);
}
.gl-card-text {
  font-size: 13px;
  font-weight: 600;
  color: #222;
  line-height: 1.55;
  margin-bottom: 16px;
}
.gl-card-icon {
  align-self: flex-end;
  color: #bbb;
}
.gl-card-icon svg { width:20px; height:20px; }
/* ─── CHAT SCREEN ─── */
.gl-chat-screen {
  display: none;
  flex-direction: column;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  height: calc(100vh - 160px);
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,0.08);
}
.gl-chat-screen.active { display: flex; }

/* chat topbar */
.gl-chat-topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid #f0f0f0;
  background: #fff;
  flex-shrink: 0;
}
.gl-chat-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #D97FA0, #C9536A 60%, #8B2A3E);
  flex-shrink: 0;
}
.gl-chat-topbar-title { font-size: 14px; font-weight: 800; color: #111; }
.gl-chat-topbar-sub {
  font-size: 11.5px; color: #999;
  display: flex; align-items: center; gap: 5px; margin-top: 1px;
}
.gl-online { width:7px; height:7px; border-radius:50%; background:#4ade80; flex-shrink:0; }
.gl-new-thread {
  margin-right: auto;
  display: flex; align-items: center; gap:6px;
  background: #111; color: #fff;
  border: none; border-radius: 8px; padding: 7px 14px;
  font-size: 12px; font-weight: 700; cursor: pointer;
  font-family: inherit; transition: background .2s;
}
.gl-new-thread:hover { background: #C9536A; }
.gl-new-thread svg { width:13px; height:13px; }
/* messages */
.gl-messages {
  flex: 1; overflow-y: auto; padding: 20px;
  background: var(--surface);
  display: flex; flex-direction: column; gap: 14px;
  scroll-behavior: smooth;
}
.gl-messages::-webkit-scrollbar { width: 5px; }
.gl-messages::-webkit-scrollbar-thumb { background: #e0e0e0; border-radius: 10px; }

.gl-msg { display: flex; align-items: flex-end; gap: 8px; animation: msgUp .3s ease; }
@keyframes msgUp { from{opacity:0;transform:translateY(8px)} to{opacity:1;transform:none} }
.gl-msg.user { flex-direction: row-reverse; }
.gl-msg-av {
  width:30px; height:30px; border-radius:50%; flex-shrink:0;
  display:flex; align-items:center; justify-content:center; font-size:13px;
}
.gl-msg.bot .gl-msg-av { background:#FDF0F2; border:1px solid rgba(201,83,106,.15); }
.gl-msg.user .gl-msg-av { background: linear-gradient(135deg,#C9536A,#b5455c); color:#fff; }
.gl-msg-text {
  max-width: 75%; padding: 12px 15px;
  font-size: 13.5px; line-height: 1.75; border-radius: 16px;
}
.gl-msg.bot .gl-msg-text {
  background: #fff; color: #222;
  border: 1px solid #eee;
  border-bottom-right-radius: 4px;
}
.gl-msg.user .gl-msg-text {
  background: linear-gradient(135deg,#C9536A,#b5455c);
  color: #fff; border-bottom-left-radius: 4px;
}
/* typing */
.gl-dots { display:inline-flex; gap:4px; align-items:center; padding:4px 2px; }
.gl-dots span {
  width:6px; height:6px; border-radius:50%; background:#ccc;
  animation: dotAnim 1.4s infinite ease-in-out;
}
.gl-dots span:nth-child(2){ animation-delay:.2s; }
.gl-dots span:nth-child(3){ animation-delay:.4s; }
@keyframes dotAnim{ 0%,60%,100%{transform:translateY(0)} 30%{transform:translateY(-7px)} }

/* chat input bar */
.gl-chat-inputbar {
  padding: 14px 16px;
  background: #fff;
  border-top: 1px solid #f0f0f0;
  flex-shrink: 0;
}
.gl-chat-inputbox {
  background: #f4f4f4;
  border: 1px solid #e8e8e8;
  border-radius: 12px;
  padding: 12px 16px 10px;
}
.gl-chat-textarea {
  width: 100%; border: none; outline: none; background: transparent;
  font-size: 14px; font-family: inherit; color: #111;
  resize: none; min-height: 44px; max-height: 110px;
  direction: rtl; line-height: 1.55;
}
.gl-chat-textarea::placeholder { color: #aaa; }
.gl-chat-toolbar {
  display: flex; align-items: center;
  justify-content: flex-end; margin-top: 8px;
}
.gl-chat-send {
  width: 34px; height: 34px; border-radius: 8px;
  background: #111; color: #fff; border: none;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background .2s;
}
.gl-chat-send:hover { background: #C9536A; }
.gl-chat-send:disabled { opacity: .4; cursor: not-allowed; }
.gl-chat-send svg { width:16px; height:16px; }
.gl-input-inner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.gl-ai-icon {
  color: #bbb;
  flex-shrink: 0;
  margin-top: 3px;
  transition: color .2s;
}
.gl-chat-inputbox:focus-within .gl-ai-icon {
  color: #C9536A;
}
/* ── TOP BAR ── */
.gl-topbar {
  width: 100%;
  max-width: 720px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-radius: 16px;
  margin-bottom: 32px;
}
.gl-topbar-logo {
  font-size: 15px;
  font-weight: 800;
  color: #111;
}
.gl-topbar-logo em {
  font-style: normal;
  color: #C9536A;
}
.gl-topbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
}
.gl-topbar-btn {
  width: 30px; height: 30px;
  border-radius: 10px;
  border: 1px solid var(--primary-light);
  background: #f7f7f7;
  color: #666;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all .2s;
}
.gl-topbar-btn:hover {
  background: #FDF0F2;
  border-color: var(--primary);
  color: #C9536A;
}
/********  CHATBOT SECTION  *******/
.chatbot-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 120px 20px 40px 20px;
    z-index: 2;
    margin-top: 50px;
}

.chat-wrapper {
    width: 100%;
    max-width: 850px;
    display: flex;
    flex-direction: column;
}

.chat-card {
    width: 60%;
    background: #FFFFFF;
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
    display: flex;
    flex-direction: column;
    height: 65vh;
    min-height: 480px;
    overflow: hidden;
    border: 1px solid var(--chat-border);
}

.chat-header {
    background: var(--chat-surface);
    padding: 18px 24px;
    border-bottom: 1px solid var(--chat-border);
    display: flex;
    align-items: center;
    gap: 14px;
}

.chat-bot-avatar {
    width: 45px;
    height: 45px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #FFF;
    font-size: 20px;
    box-shadow: 0 4px 12px rgba(201, 83, 106, 0.3);
}

.chat-header-info h2 {
    font-size: 16px;
    font-weight: 800;
    color: #1A1215;
}

.chat-header-info p {
    font-size: 12px;
    color: #9B7A82; 
    display: flex;
    align-items: center;
    gap: 6px;
}

.chat-header-info p::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #2dd4bf;
    border-radius: 50%;
    display: inline-block;
}

.chat-messages {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    background: var(--chat-bg);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.message {
    display: flex;
    gap: 12px;
    max-width: 75%;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.message.bot { align-self: flex-start; }
.message.user { align-self: flex-end; flex-direction: row-reverse; }

.message-text {
    padding: 14px 18px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.6;
}

.bot .message-text {
    background: var(--chat-surface);
    color: #3B2630;
    border-top-right-radius: 4px;
    border: 1px solid var(--chat-border);
}

.user .message-text {
    background: var(--primary);
    color: #FFFFFF;
    border-top-left-radius: 4px;
}

.chat-footer {
    padding: 16px 24px;
    background: #FFFFFF;
    border-top: 1px solid var(--chat-border);
}

.chat-form {
    display: flex;
    gap: 12px;
    align-items: center;
}

.chat-input-wrapper { flex: 1; }

.chat-input {
    width: 100%;
    padding: 14px 20px;
    background: var(--chat-surface);
    border: 1px solid var(--chat-border);
    border-radius: 30px;
    font-family: inherit;
    font-size: 14px;
    color: var(--dark);
    outline: none;
    transition: all 0.25s;
}

.chat-input:focus {
    border-color: var(--primary-light);
    background: #FFF;
    box-shadow: 0 0 0 3px rgba(201, 83, 106, 0.08);
}

@property --input-angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}

.gl-chat-inputbox.input-loading-active {
  border-color: transparent !important;
  background: linear-gradient(#FFFFFF, #FFFFFF) padding-box,
              conic-gradient(from var(--input-angle), 
                var(--primary), 
                var(--gold), 
                var(--primary-dark), 
                var(--gold), 
                var(--primary)) border-box !important;
  border: 2px solid transparent !important; 
  animation: spinInputBorder 1.5s linear infinite !important;
}

.gl-chat-inputbox.input-loading-active::placeholder {
  color: var(--muted) !important;
  opacity: 0.6;
}

@keyframes spinInputBorder {
  to {
    --input-angle: 360deg;
  }
}

.btn-chat-submit {
    background: var(--primary);
    color: #FFFFFF;
    border: none;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.25s;
    font-size: 18px;
    box-shadow: 0 4px 12px rgba(201, 83, 106, 0.2);
}

.btn-chat-submit:hover {
    background: #b5455c;
    transform: scale(1.05);
}

/* Typing indicator */
.typing-dots{ display:inline-flex; gap:4px; align-items:center; }
.typing-dots span{
  width:7px; height:7px; border-radius:50%; background:var(--primary-light);
  animation:typingBounce 1.4s infinite ease-in-out;
}
.typing-dots span:nth-child(2){ animation-delay:.2s; }
.typing-dots span:nth-child(3){ animation-delay:.4s; }
@keyframes typingBounce{
  0%,60%,100%{ transform:translateY(0); }
  30%{ transform:translateY(-8px); }
}

.info-note-box {
    width: 60%;
    background: rgba(201, 83, 106, 0.1);
    padding: 20px;
    border-radius: 12px;
    border-right: 4px solid var(--primary);
    margin: 25px 0 10px 0;
    align-self: center;
}

.info-note-box h4 {
    margin: 0 0 10px 0;
    font-size: 16px;
    color: var(--primary-light);
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: bold;
}

.info-note-box p {
    color: #ffffff !important;
    line-height: 1.9 !important;
    text-align: justify !important;
    font-size: 14px;
    margin: 0;
}

.info-note-box span {
    color: var(--primary-light);
    font-size: 16px;
    margin-top: 0;
    margin-bottom: 15px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 8px;
}
.trust-section {
    width: 60%;
    margin: 30px 0 15px 0;
    padding: 20px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 14px;
    border-right: 4px solid var(--primary);
    align-self: center;
}

.trust-section p {
    color: #ffffff;
    line-height: 1.9;
    font-size: 14px;
    margin: 0;
}

.trust-section a {
    color: var(--primary-light);
    font-weight: bold;
    text-decoration: none;
    transition: color 0.2s;
}

.trust-section a:hover {
    color: #FFF;
}

.related-links-section {
    width: 60%;
    margin-top: 15px;
    padding: 22px;
    background: rgba(201, 83, 106, 0.08);
    border-radius: 14px;
    border: 1px solid rgba(201, 83, 106, 0.2);
    text-align: right;
    align-self: center;
    margin-bottom: 50px;
}

.related-links-section h4 {
    color: var(--primary-light);
    font-size: 16px;
    margin-top: 0;
    margin-bottom: 15px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 8px;
}

.related-links-list {
    list-style: none;
    padding: 0;
    margin: 0;
    line-height: 2;
}

.related-links-list li {
    margin-bottom: 12px;
    color: #e5d5da;
    font-size: 14px;
}

.related-links-list li:last-child {
    margin-bottom: 0;
}

.related-links-list a {
    color: #FFF;
    font-weight: bold;
    text-decoration: none;
    border-bottom: 1px dashed rgba(255,255,255,0.3);
    transition: all 0.2s;
    margin-left: 4px;
}

.related-links-list a:hover {
    color: var(--primary-light);
    border-bottom-color: var(--primary-light);
}

@media (max-width: 768px) {
  .chatbot-container { padding-top: 100px; padding-bottom: 20px; }
  .chat-card { width: 90%; height: calc(100vh - 340px); min-height: 380px; }
  .related-links-section, .info-note-box, .trust-section{ width: 100%; }
  .chatbot-section { width: auto; padding: 65px 8px 40px; align-items: flex-start; }
  .gl-welcome-title { font-size: 22px; }
  .gl-cards-grid { grid-template-columns: 1fr 1fr; }
  .gl-chat-screen { height: calc(100vh - 130px); border-radius: 14px; }
  .gl-new-thread-text { display: none; }
  .gl-new-thread {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .gl-new-thread svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
  }
}
@media(max-width:480px){
  .gl-cards-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .gl-card { min-height: 100px; padding: 14px 12px; }
  .gl-input-box { padding: 14px 14px 10px; }
}

/* ── DARK MODE ── */

.chatbot-section[data-theme="dark"]                              { background: #121212; }
.chatbot-section[data-theme="dark"] .gl-chat-welcome            { background: #121212; }
.chatbot-section[data-theme="dark"] .gl-welcome-title           { color: #f0f0f0; }
.chatbot-section[data-theme="dark"] .gl-welcome-title em        { color: #F2A7B5; }
.chatbot-section[data-theme="dark"] .gl-suggestions-label       { color: #666; }
 
.chatbot-section[data-theme="dark"] .gl-topbar-logo             { color: #f0f0f0; }
.chatbot-section[data-theme="dark"] .gl-topbar-btn              { background: #2a2a2a; border-color: rgba(255,255,255,0.1); color: #aaa; }
.chatbot-section[data-theme="dark"] .gl-topbar-btn:hover        { background: rgba(201,83,106,0.15); color: #F2A7B5; }
 
.chatbot-section[data-theme="dark"] .gl-input-box               { background: #1e1e1e; border-color: rgba(255,255,255,0.1); box-shadow: none; }
.chatbot-section[data-theme="dark"] .gl-input-field             { color: #f0f0f0; background: transparent; }
.chatbot-section[data-theme="dark"] .gl-input-field::placeholder{ color: #555; }
.chatbot-section[data-theme="dark"] .gl-ai-icon                 { color: #555; }
.chatbot-section[data-theme="dark"] .gl-toolbar-btn             { background: #2a2a2a; border-color: rgba(255,255,255,0.1); color: #aaa; }
.chatbot-section[data-theme="dark"] .gl-send-btn                { background: #f0f0f0; color: #111; }
 
.chatbot-section[data-theme="dark"] .gl-card                    { background: #1e1e1e; border-color: rgba(255,255,255,0.08); }
.chatbot-section[data-theme="dark"] .gl-card-text               { color: #e0e0e0; }
.chatbot-section[data-theme="dark"] .gl-card-icon               { color: #555; }
.chatbot-section[data-theme="dark"] .gl-card:hover              { border-color: #C9536A; background: rgba(201,83,106,0.1); }
 
.chatbot-section[data-theme="dark"] .gl-chat-screen             { background: #1a1a1a; border-color: rgba(255,255,255,0.08); }
.chatbot-section[data-theme="dark"] .gl-chat-topbar             { background: #1e1e1e; border-color: rgba(255,255,255,0.08); }
.chatbot-section[data-theme="dark"] .gl-chat-topbar-title       { color: #f0f0f0; }
.chatbot-section[data-theme="dark"] .gl-chat-topbar-sub         { color: #666; }
.chatbot-section[data-theme="dark"] .gl-messages                { background: #121212; }
.chatbot-section[data-theme="dark"] .gl-msg.bot .gl-msg-text    { background: #1e1e1e; border-color: rgba(255,255,255,0.08); color: #e0e0e0; }
.chatbot-section[data-theme="dark"] .gl-chat-inputbar           { background: #1e1e1e; border-color: rgba(255,255,255,0.08); }
.chatbot-section[data-theme="dark"] .gl-chat-inputbox           { background: #2a2a2a !important; border-color: rgba(255,255,255,0.1) !important; }
.chatbot-section[data-theme="dark"] .gl-chat-textarea           { color: #f0f0f0; }
.chatbot-section[data-theme="dark"] .gl-chat-textarea::placeholder { color: #555; }
.chatbot-section[data-theme="dark"] .gl-chat-send               { background: #f0f0f0; color: #111; }
/* input-loading-active*/
.chatbot-section[data-theme="dark"] .gl-chat-inputbox.input-loading-active {
  background: linear-gradient(#1e1e1e, #1e1e1e) padding-box,
              conic-gradient(from var(--input-angle),
                #C9536A,
                #C8A96E,
                #b5455c,
                #C8A96E,
                #C9536A) border-box !important;
}