/* ===== ROOT VARIABLES ===== */
:root {
  --primary: #1a3faa;
  --primary-light: #2d5be3;
  --accent: #f59e0b;
  --bg: #f0f4ff;
  --surface: #ffffff;
  --surface2: #f8faff;
  --text: #0f1b3d;
  --text-muted: #6b7280;
  --border: #e2e8f0;
  --shadow: 0 4px 24px rgba(26,63,170,0.10);
  --radius: 16px;
  --bot-bubble: #e8eeff;
  --user-bubble: #1a3faa;
  --header-height: 70px;
}

[data-theme="dark"] {
  --primary: #4a7cff;
  --primary-light: #6b94ff;
  --accent: #f59e0b;
  --bg: #0d1117;
  --surface: #161b2c;
  --surface2: #1e2436;
  --text: #e8eeff;
  --text-muted: #8892a4;
  --border: #2a3250;
  --shadow: 0 4px 24px rgba(0,0,0,0.40);
  --bot-bubble: #1e2a4a;
  --user-bubble: #2d4faa;
}

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Hind', sans-serif;
  background: var(--bg);
  color: var(--text);
  transition: background 0.3s, color 0.3s;
  overflow-x: hidden;
}

/* ===== TICKER ===== */
.ticker-wrap {
  background: var(--primary);
  color: white;
  overflow: hidden;
  white-space: nowrap;
  padding: 8px 0;
  font-size: 13px;
  font-weight: 500;
  position: relative;
  z-index: 100;
}

.ticker {
  display: inline-block;
  animation: ticker 35s linear infinite;
}

.ticker span { padding: 0 8px; }

@keyframes ticker {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ===== HEADER ===== */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  height: var(--header-height);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 99;
  transition: background 0.3s;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon { font-size: 32px; }

.logo-title {
  font-family: 'Baloo 2', cursive;
  font-size: 18px;
  font-weight: 800;
  color: var(--primary);
  display: block;
  line-height: 1.2;
}

.logo-sub {
  font-size: 11px;
  color: var(--text-muted);
  display: block;
}

nav {
  display: flex;
  gap: 4px;
}

nav a {
  color: var(--text);
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
}

nav a:hover {
  background: var(--bg);
  color: var(--primary);
}

.header-controls {
  display: flex;
  gap: 10px;
  align-items: center;
}

.lang-toggle, .theme-toggle {
  padding: 8px 14px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 20px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.2s;
  font-family: 'Hind', sans-serif;
}

.lang-toggle:hover, .theme-toggle:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--bg);
}

/* ===== HERO ===== */
.hero {
  position: relative;
  min-height: 88vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 60px 24px;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #0a1f6e 0%, #1a3faa 40%, #0e7aff 75%, #00c6ff 100%);
  z-index: 0;
}

.hero-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 70% 50%, rgba(255,200,50,0.15) 0%, transparent 60%),
              radial-gradient(ellipse at 20% 80%, rgba(100,150,255,0.2) 0%, transparent 50%);
}

.hero-shapes .shape {
  position: absolute;
  border-radius: 50%;
  opacity: 0.08;
  background: white;
  animation: float 8s ease-in-out infinite;
}

.s1 { width: 400px; height: 400px; top: -100px; right: -80px; animation-delay: 0s; }
.s2 { width: 250px; height: 250px; bottom: -60px; left: 10%; animation-delay: 2s; }
.s3 { width: 150px; height: 150px; top: 30%; left: 5%; animation-delay: 4s; }

@keyframes float {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-20px) scale(1.02); }
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 700px;
  animation: heroIn 0.8s cubic-bezier(.22,.68,0,1.2) both;
}

@keyframes heroIn {
  from { opacity: 0; transform: translateY(40px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero-badge {
  display: inline-block;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.3);
  color: white;
  padding: 6px 18px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 20px;
  backdrop-filter: blur(8px);
}

.hero h1 {
  font-family: 'Baloo 2', cursive;
  font-size: clamp(32px, 5vw, 58px);
  font-weight: 800;
  color: white;
  line-height: 1.15;
  margin-bottom: 20px;
  text-shadow: 0 2px 20px rgba(0,0,0,0.2);
}

.hero p {
  font-size: 18px;
  color: rgba(255,255,255,0.88);
  line-height: 1.7;
  margin-bottom: 36px;
}

.hero-btns {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-primary {
  background: var(--accent);
  color: #1a1a1a;
  border: none;
  padding: 14px 30px;
  border-radius: 50px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s;
  box-shadow: 0 4px 20px rgba(245,158,11,0.4);
  font-family: 'Baloo 2', cursive;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(245,158,11,0.5);
}

.btn-secondary {
  background: rgba(255,255,255,0.15);
  color: white;
  border: 2px solid rgba(255,255,255,0.4);
  padding: 14px 30px;
  border-radius: 50px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s;
  backdrop-filter: blur(8px);
  font-family: 'Baloo 2', cursive;
}

.btn-secondary:hover {
  background: rgba(255,255,255,0.25);
  transform: translateY(-2px);
}

/* ===== STATS ===== */
.stats {
  display: flex;
  justify-content: center;
  gap: 0;
  background: var(--primary);
  flex-wrap: wrap;
}

.stat-card {
  padding: 28px 40px;
  text-align: center;
  border-right: 1px solid rgba(255,255,255,0.15);
  flex: 1;
  min-width: 140px;
}

.stat-card:last-child { border-right: none; }

.stat-num {
  font-family: 'Baloo 2', cursive;
  font-size: 38px;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 6px;
}

.stat-label {
  font-size: 13px;
  color: rgba(255,255,255,0.8);
  font-weight: 500;
}

/* ===== INFO SECTION ===== */
.info {
  padding: 80px 32px;
  background: var(--surface2);
}

.section-header {
  text-align: center;
  margin-bottom: 50px;
}

.section-header h2 {
  font-family: 'Baloo 2', cursive;
  font-size: 38px;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 10px;
}

.section-header p {
  font-size: 16px;
  color: var(--text-muted);
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  max-width: 1100px;
  margin: 0 auto;
}

.card {
  background: var(--surface);
  padding: 32px 28px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  transition: all 0.3s;
  opacity: 0;
  transform: translateY(30px);
}

.card.visible {
  opacity: 1;
  transform: translateY(0);
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 40px rgba(26,63,170,0.15);
  border-color: var(--primary-light);
}

.card-icon {
  font-size: 36px;
  margin-bottom: 16px;
  display: block;
}

.card h3 {
  font-family: 'Baloo 2', cursive;
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 10px;
}

.card p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.7;
}

/* ===== CHATBOT ===== */
.chatbot {
  position: fixed;
  bottom: 100px;
  right: 24px;
  width: 380px;
  height: 520px;
  background: var(--surface);
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  display: none;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border);
  animation: chatSlideIn 0.3s cubic-bezier(.22,.68,0,1.2);
  z-index: 1000;
}

@keyframes chatSlideIn {
  from { opacity: 0; transform: translateY(20px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.chat-header {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: white;
  padding: 16px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chat-header-left { display: flex; align-items: center; gap: 12px; }

.bot-avatar-sm {
  width: 40px; height: 40px;
  background: rgba(255,255,255,0.2);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
}

.chat-title {
  font-family: 'Baloo 2', cursive;
  font-weight: 700;
  font-size: 15px;
}

.chat-status {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  opacity: 0.85;
}

.status-dot {
  width: 8px; height: 8px;
  background: #4ade80;
  border-radius: 50%;
  display: inline-block;
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

.chat-header-right { display: flex; gap: 8px; align-items: center; }

.icon-btn {
  background: rgba(255,255,255,0.15);
  border: none;
  color: white;
  width: 30px; height: 30px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 13px;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
}

.icon-btn:hover { background: rgba(255,255,255,0.3); }

.chat-box {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  background: var(--bg);
  scroll-behavior: smooth;
}

.chat-box::-webkit-scrollbar { width: 4px; }
.chat-box::-webkit-scrollbar-track { background: transparent; }
.chat-box::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.message {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
  animation: msgIn 0.3s ease both;
}

@keyframes msgIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.message.user { flex-direction: row-reverse; }

.avatar {
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--primary);
  font-size: 16px;
  flex-shrink: 0;
}

.message.user .avatar { background: var(--accent); }

.msg-content { max-width: 75%; }

.text {
  padding: 12px 16px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.6;
  background: var(--bot-bubble);
  color: var(--text);
  border-bottom-left-radius: 4px;
}

.message.user .text {
  background: var(--user-bubble);
  color: white;
  border-bottom-left-radius: 14px;
  border-bottom-right-radius: 4px;
}

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

.message.user .msg-time { text-align: right; }

/* Typing animation */
.typing-dot {
  display: inline-block;
  width: 8px; height: 8px;
  background: var(--primary);
  border-radius: 50%;
  margin: 0 2px;
  animation: typing 1.2s ease-in-out infinite;
}

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

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

/* Suggestions */
.suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 4px 0 10px;
  margin-left: 44px;
}

.suggestion-btn {
  background: var(--surface);
  border: 1.5px solid var(--primary);
  color: var(--primary);
  padding: 6px 14px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  transition: all 0.2s;
  font-family: 'Hind', sans-serif;
}

.suggestion-btn:hover {
  background: var(--primary);
  color: white;
}

/* Chat Input */
.chat-input-area {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.voice-btn {
  background: var(--bg);
  border: 1.5px solid var(--border);
  color: var(--text);
  width: 38px; height: 38px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.voice-btn:hover { border-color: var(--primary); }
.voice-btn.recording { background: #fee2e2; border-color: #ef4444; animation: pulse-red 0.8s ease infinite; }

@keyframes pulse-red {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0.4); }
  50% { box-shadow: 0 0 0 8px rgba(239,68,68,0); }
}

#userInput {
  flex: 1;
  padding: 10px 14px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 24px;
  font-size: 14px;
  color: var(--text);
  outline: none;
  transition: border 0.2s;
  font-family: 'Hind', sans-serif;
}

#userInput:focus { border-color: var(--primary); }

.send-btn {
  background: var(--primary);
  border: none;
  color: white;
  width: 40px; height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.send-btn:hover {
  background: var(--primary-light);
  transform: scale(1.05);
}

/* ===== FLOAT BUTTON ===== */
.chat-float {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 62px; height: 62px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: white;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px;
  cursor: pointer;
  z-index: 999;
  box-shadow: 0 6px 24px rgba(26,63,170,0.4);
  transition: transform 0.2s;
}

.chat-float:hover { transform: scale(1.1); }

.float-pulse {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid var(--primary);
  opacity: 0;
  animation: float-ring 2.5s ease-out infinite;
}

@keyframes float-ring {
  0% { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(1.5); opacity: 0; }
}

/* ===== TOOLS HUB ===== */
.tools-hub {
  padding: 80px 32px;
  background: var(--bg);
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  max-width: 1100px;
  margin: 0 auto;
}

.tool-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 28px 24px;
  border: 1.5px solid var(--border);
  text-decoration: none;
  display: block;
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
}

.tool-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  transform: scaleX(0);
  transition: transform 0.3s;
  transform-origin: left;
}

.tool-card:hover::before { transform: scaleX(1); }

.tool-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 40px rgba(26,63,170,0.15);
  border-color: var(--primary);
}

.tool-icon {
  font-size: 38px;
  margin-bottom: 14px;
  display: block;
}

.tool-name {
  font-family: 'Baloo 2', cursive;
  font-size: 18px;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 8px;
}

.tool-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 14px;
}

.tool-tag {
  display: inline-block;
  background: var(--bg);
  color: var(--text-muted);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid var(--border);
}

.tool-tag.ai-tool {
  background: linear-gradient(90deg, #6366f1, #8b5cf6);
  color: white;
  border: none;
}

.api-key-widget{
  position: fixed;
  bottom: 24px;
  left: 24px;
  background: var(--surface);
  padding: 10px;
  border-radius: 12px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  z-index: 999;
}

.api-key-widget input{
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  outline: none;
  font-size: 12px;
}

.api-key-widget button{
  margin-left: 6px;
  padding: 8px 12px;
  border-radius: 8px;
  border: none;
  background: var(--primary);
  color: white;
  cursor: pointer;
}

/* ===== FOOTER ===== */
.footer {
  background: var(--primary);
  color: rgba(255,255,255,0.75);
  text-align: center;
  padding: 20px;
  font-size: 13px;
}

/* ===== AI THINKING BADGE ===== */
.ai-badge {
  font-size: 10px;
  background: linear-gradient(90deg, #6366f1, #8b5cf6);
  color: white;
  padding: 2px 8px;
  border-radius: 10px;
  display: inline-block;
  margin-bottom: 6px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .header { padding: 0 16px; }
  nav { display: none; }
  .stats { gap: 0; }
  .stat-card { min-width: 50%; padding: 20px 16px; border-right: none; border-bottom: 1px solid rgba(255,255,255,0.1); }
  .chatbot { width: calc(100vw - 32px); right: 16px; }
  .info { padding: 50px 16px; }
  .logo-title { font-size: 14px; }
}
