/* Global Gandhi Bot v7 */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,700;1,400&family=Inter:wght@300;400;500;600&display=swap');

.ggb-wrapper {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: #EAE6DE;
  background: #0D0F14;
  border: 1px solid #2E3448;
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  max-width: 880px;
  width: 100%;
  margin: 0 auto;
  position: relative;
  display: flex;
  flex-direction: column;
  height: 620px;
  overflow: hidden;
}
.ggb-wrapper * { box-sizing: border-box; margin: 0; padding: 0; }

/* HEADER */
.ggb-header {
  background: #13161E;
  border-bottom: 1px solid #2E3448;
  padding: 13px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  gap: 12px;
}
.ggb-header-left { display: flex; align-items: center; gap: 12px; }
.ggb-avatar {
  width: 40px; height: 40px; min-width: 40px;
  background: linear-gradient(135deg,#E8A020,#9A6508);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  animation: ggb-spin 14s linear infinite;
}
@keyframes ggb-spin { to { transform: rotate(360deg); } }
.ggb-bot-name { font-family:'Playfair Display',serif; font-size:16px; font-weight:700; color:#E8A020; display:block; }
.ggb-subtitle  { font-size:11px; color:#7A8099; display:block; }
.ggb-btn-clear {
  background: rgba(239,68,68,0.12);
  border: 1px solid rgba(239,68,68,0.35);
  border-radius: 8px; color: #FCA5A5;
  cursor: pointer; font-size: 12px; font-weight: 600;
  padding: 6px 14px; white-space: nowrap; transition: all .2s;
}
.ggb-btn-clear:hover { background:rgba(239,68,68,0.28); color:#fff; }

/* TABS */
.ggb-tabs {
  background: #13161E;
  border-bottom: 1px solid #2E3448;
  display: flex; flex-shrink: 0;
}
.ggb-tab {
  flex: 1; background: transparent;
  border: none; border-bottom: 3px solid transparent;
  color: #7A8099; cursor: pointer;
  font-family:'Inter',sans-serif; font-size:13px; font-weight:500;
  padding: 13px 8px; transition: all .15s;
  display: flex; align-items: center; justify-content: center; gap: 5px;
}
.ggb-tab:hover { color: #C8C0B0; background: rgba(255,255,255,0.03); }
.ggb-tab.ggb-tab-active {
  color: #FFB830 !important;
  font-weight: 600 !important;
  border-bottom: 3px solid #C8860A !important;
  background: rgba(200,134,10,0.08) !important;
}

/* PANELS */
.ggb-panel { display: none; flex: 1; flex-direction: column; overflow: hidden; min-height: 0; }
.ggb-panel.ggb-panel-active { display: flex; }

/* CHAT MESSAGES */
.ggb-messages { flex:1; overflow-y:auto; padding:18px 16px; scroll-behavior:smooth; }
.ggb-messages::-webkit-scrollbar { width:4px; }
.ggb-messages::-webkit-scrollbar-thumb { background:#2E3448; border-radius:4px; }
.ggb-welcome { text-align:center; padding:22px 18px 14px; }
.ggb-welcome-icon { font-size:36px; display:block; margin-bottom:10px; animation:ggb-float 3s ease-in-out infinite; }
@keyframes ggb-float { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-6px)} }
.ggb-welcome-text { font-family:'Playfair Display',serif; font-style:italic; font-size:16px; color:#EAE6DE; line-height:1.7; margin-bottom:5px; }
.ggb-welcome-hint { font-size:11px; color:#C8860A; letter-spacing:1.5px; text-transform:uppercase; margin-bottom:18px; }
.ggb-suggestions { display:flex; flex-wrap:wrap; gap:8px; justify-content:center; }
.ggb-suggestion {
  background:#1C2030; border:1px solid #2E3448; border-radius:20px;
  color:#EAE6DE; cursor:pointer; font-family:'Inter',sans-serif; font-size:12px; padding:6px 14px; transition:all .2s;
}
.ggb-suggestion:hover { border-color:#C8860A; color:#E8A020; background:rgba(200,134,10,0.1); }
.ggb-message { margin-top:14px; display:flex; gap:10px; animation:ggb-in .25s ease-out; }
@keyframes ggb-in { from{opacity:0;transform:translateY(8px)} to{opacity:1;transform:translateY(0)} }
.ggb-message-user { flex-direction:row-reverse; }
.ggb-msg-icon { width:28px; height:28px; min-width:28px; border-radius:50%; display:flex; align-items:center; justify-content:center; font-size:14px; margin-top:2px; }
.ggb-message-bot  .ggb-msg-icon { background:#9A6508; }
.ggb-message-user .ggb-msg-icon { background:#252A3A; border:1px solid #2E3448; }
.ggb-msg-bubble { max-width:78%; padding:11px 14px; border-radius:14px; font-size:14px; line-height:1.65; word-wrap:break-word; }
.ggb-message-bot  .ggb-msg-bubble { background:#1C2030; color:#EAE6DE; border:1px solid #2E3448; border-radius:4px 14px 14px 14px; }
.ggb-message-user .ggb-msg-bubble { background:#9A6508; color:#fff; border-radius:14px 4px 14px 14px; }
.ggb-typing { display:flex; gap:5px; align-items:center; padding:8px 2px; }
.ggb-dot { width:7px; height:7px; border-radius:50%; background:#C8860A; animation:ggb-dots .8s ease-in-out infinite; }
.ggb-dot:nth-child(2){animation-delay:.15s} .ggb-dot:nth-child(3){animation-delay:.3s}
@keyframes ggb-dots{0%,80%,100%{transform:scale(.6);opacity:.4}40%{transform:scale(1);opacity:1}}

/* INPUT */
.ggb-input-wrap { background:#13161E; border-top:1px solid #2E3448; padding:12px 14px; display:flex; gap:10px; align-items:flex-end; flex-shrink:0; }
.ggb-chat-input {
  flex:1; background:#FFFFFF !important; border:2px solid #D0D5E8 !important;
  border-radius:10px !important; color:#111827 !important;
  font-family:'Inter',sans-serif !important; font-size:14px !important; line-height:1.5 !important;
  max-height:100px !important; outline:none !important; padding:10px 14px !important; resize:none !important;
  transition:border-color .2s !important; -webkit-text-fill-color:#111827 !important;
}
.ggb-chat-input::placeholder { color:#9CA3AF !important; -webkit-text-fill-color:#9CA3AF !important; opacity:1 !important; }
.ggb-chat-input:focus { border-color:#C8860A !important; }
.ggb-send { width:40px; height:40px; min-width:40px; background:#C8860A; border:none; border-radius:10px; color:#fff; cursor:pointer; font-size:18px; display:flex; align-items:center; justify-content:center; transition:all .2s; }
.ggb-send:hover { background:#E8A020; transform:translateY(-1px); }
.ggb-send:disabled { background:#2E3448; cursor:not-allowed; transform:none; }
.ggb-chat-footer { font-size:10px; color:#7A8099; padding:0 14px 8px; flex-shrink:0; }
.ggb-chat-footer a { color:#C8860A; text-decoration:none; }

/* POSTER PANEL */
.ggb-panel-poster { overflow-y:auto; }
.ggb-poster-form { padding:16px 18px; border-bottom:1px solid #2E3448; flex-shrink:0; }
.ggb-field { margin-bottom:12px; }
.ggb-field label { display:block; font-size:11px; font-weight:600; color:#7A8099; text-transform:uppercase; letter-spacing:0.8px; margin-bottom:6px; }
.ggb-wrapper .ggb-textarea,
.ggb-wrapper .ggb-select {
  display:block; width:100%; background:#FFFFFF !important; border:2px solid #D0D5E8 !important;
  border-radius:10px !important; color:#111827 !important;
  font-family:'Inter',sans-serif !important; font-size:13px !important;
  outline:none !important; padding:10px 14px !important; transition:border-color .2s !important;
  -webkit-text-fill-color:#111827 !important;
}
.ggb-wrapper .ggb-textarea { resize:vertical !important; min-height:62px !important; line-height:1.5 !important; }
.ggb-wrapper .ggb-textarea::placeholder { color:#9CA3AF !important; -webkit-text-fill-color:#9CA3AF !important; opacity:1 !important; }
.ggb-wrapper .ggb-select { cursor:pointer !important; appearance:auto !important; height:auto !important; }
.ggb-wrapper .ggb-textarea:focus,
.ggb-wrapper .ggb-select:focus { border-color:#C8860A !important; box-shadow:0 0 0 3px rgba(200,134,10,0.12) !important; }
.ggb-grid-2 { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.ggb-grid-3 { display:grid; grid-template-columns:1fr 1fr 1fr; gap:10px; }
.ggb-btn-generate {
  display:block; width:100%; background:linear-gradient(135deg,#E8A020,#C8860A);
  border:none; border-radius:10px; color:#fff; cursor:pointer;
  font-family:'Inter',sans-serif; font-size:14px; font-weight:600;
  padding:13px 20px; margin-top:10px; transition:all .2s; letter-spacing:0.3px;
}
.ggb-btn-generate:hover { background:linear-gradient(135deg,#F0B030,#D8960A); transform:translateY(-1px); box-shadow:0 6px 20px rgba(200,134,10,0.35); }
.ggb-btn-generate:disabled { opacity:0.5; cursor:not-allowed; transform:none; box-shadow:none; }
.ggb-poster-output { flex:1; overflow-y:auto; padding:16px 18px; }
.ggb-placeholder { display:flex; flex-direction:column; align-items:center; justify-content:center; min-height:140px; gap:8px; color:#7A8099; border:2px dashed #2E3448; border-radius:12px; padding:24px; text-align:center; }
.ggb-placeholder-icon { font-size:34px; opacity:0.4; }
.ggb-placeholder p, .ggb-placeholder small { font-size:13px; color:#7A8099; }
.ggb-poster-wrap { max-width:540px; margin:0 auto; border-radius:10px; overflow:hidden; box-shadow:0 12px 40px rgba(0,0,0,0.5); }
.ggb-dl-bar { max-width:540px; margin:12px auto 0; display:flex; gap:10px; }
.ggb-btn-dl { flex:1; background:#C8860A; border:none; border-radius:8px; color:#fff; cursor:pointer; font-family:'Inter',sans-serif; font-size:13px; font-weight:600; padding:10px 16px; transition:all .2s; }
.ggb-btn-dl:hover { background:#E8A020; }
.ggb-btn-copy { background:#1C2030; border:1px solid #2E3448; border-radius:8px; color:#7A8099; cursor:pointer; font-family:'Inter',sans-serif; font-size:13px; padding:10px 14px; transition:all .2s; }
.ggb-btn-copy:hover { border-color:#C8860A; color:#C8860A; }

/* MCQ PANEL */
.ggb-panel-mcq { overflow-y:auto; display:flex; flex-direction:column; }
.ggb-mcq-top { padding:16px 18px; border-bottom:1px solid #2E3448; flex-shrink:0; }
.ggb-mcq-title { font-family:'Playfair Display',serif; font-size:18px; font-weight:700; color:#EAE6DE; margin-bottom:3px; }
.ggb-mcq-sub { font-size:12px; color:#7A8099; margin-bottom:14px; }
.ggb-mcq-out { flex:1; overflow-y:auto; padding:14px 18px; }
.ggb-mcq-out::-webkit-scrollbar { width:4px; }
.ggb-mcq-out::-webkit-scrollbar-thumb { background:#2E3448; border-radius:4px; }
.ggb-q-card { background:#13161E; border:1px solid #2E3448; border-radius:12px; margin-bottom:14px; overflow:hidden; animation:ggb-in .3s ease-out; }
.ggb-q-head { background:#1C2030; padding:12px 16px; display:flex; align-items:flex-start; gap:10px; }
.ggb-q-num { background:#C8860A; color:#fff; border-radius:50%; width:24px; height:24px; min-width:24px; display:flex; align-items:center; justify-content:center; font-size:11px; font-weight:700; flex-shrink:0; margin-top:1px; }
.ggb-q-text { font-size:14px; font-weight:500; color:#FFFFFF; line-height:1.5; }
.ggb-opts { padding:12px 16px; display:flex; flex-direction:column; gap:8px; }
.ggb-opt { display:block; width:100%; background:#1C2030; border:1.5px solid #2E3448; border-radius:8px; color:#EAE6DE; cursor:pointer; font-family:'Inter',sans-serif; font-size:13px; padding:10px 14px; text-align:left; transition:all .15s; line-height:1.4; }
.ggb-opt:hover:not(.ggb-disabled) { border-color:#C8860A; background:rgba(200,134,10,0.1); color:#fff; }
.ggb-opt.ggb-correct { background:rgba(34,197,94,0.15) !important; border-color:#22C55E !important; color:#86EFAC !important; }
.ggb-opt.ggb-wrong   { background:rgba(239,68,68,0.15)  !important; border-color:#EF4444  !important; color:#FCA5A5  !important; }
.ggb-opt.ggb-disabled { cursor:not-allowed !important; }
.ggb-exp { background:rgba(200,134,10,0.06); border-top:1px solid #2E3448; font-size:12px; color:#C8C0B0; padding:10px 16px; line-height:1.6; }
.ggb-exp strong { color:#C8860A; }
.ggb-score { background:linear-gradient(135deg,#13161E,#1C2030); border:1px solid #C8860A; border-radius:12px; margin-top:10px; padding:20px; text-align:center; }
.ggb-score-num { font-family:'Playfair Display',serif; font-size:36px; color:#C8860A; font-weight:700; }
.ggb-score-lbl { font-size:13px; color:#7A8099; margin-top:4px; }
.ggb-score-q { font-style:italic; font-size:12px; color:#EAE6DE; margin-top:10px; opacity:0.8; }

/* LOADING OVERLAY */
.ggb-overlay { position:absolute; inset:0; z-index:200; background:rgba(13,15,20,0.92); display:none; flex-direction:column; align-items:center; justify-content:center; gap:14px; backdrop-filter:blur(4px); }
.ggb-spin { font-size:42px; animation:ggb-spin 1.2s linear infinite; }
.ggb-overlay p { color:#7A8099; font-size:13px; }

/* FLOATING */
.ggb-float-btn { position:fixed; bottom:24px; right:24px; z-index:9999; background:linear-gradient(135deg,#E8A020,#9A6508); border-radius:50%; width:58px; height:58px; display:flex; align-items:center; justify-content:center; font-size:28px; cursor:pointer; box-shadow:0 6px 24px rgba(200,134,10,0.45); animation:ggb-float 3s ease-in-out infinite; }

@media (max-width:640px) {
  .ggb-wrapper { border-radius:0; height:92vh; }
  .ggb-grid-3 { grid-template-columns:1fr; }
  .ggb-grid-2 { grid-template-columns:1fr; }
}

.ggb-overlay.ggb-active { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:14px; backdrop-filter:blur(4px); }
