/* =============================================
   GK Learn Study — Header & Footer & Theme CSS
   ============================================= */

/* ── Variables ── */
:root {
  --primary: #0066cc;
  --primary-dark: #0052a3;
  --secondary: #00a86b;
  --accent: #ff6b35;
  --bg: #ffffff;
  --bg-alt: #f8f9fb;
  --card-bg: #ffffff;
  --text: #1a1a1a;
  --text-muted: #666666;
  --border: #e0e4e8;
  --header-bg: #ffffff;
  --header-shadow: 0 2px 8px rgba(0,0,0,0.06);
  --footer-bg: #1a1a2e;
  --footer-text: #b0b8c8;
  --radius: 8px;
  --transition: 0.25s ease;
}

/* ── Dark Theme ── */
[data-theme="dark"] {
  --bg: #12121f;
  --bg-alt: #1a1a2e;
  --card-bg: #1e1e35;
  --text: #f0f2ff;
  --text-muted: #8892a4;
  --border: #2a2a45;
  --header-bg: #1a1a2e;
  --header-shadow: 0 2px 12px rgba(0,0,0,0.4);
  --footer-bg: #0d0d1a;
  --primary: #4d9fff;
}

/* ── Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  transition: background var(--transition), color var(--transition);
}

/* ── Language Classes ── */
.lang-hi { display: none !important; }
.lang-en { display: block; }
body.hi-active .lang-hi { display: block !important; }
body.hi-active .lang-en { display: none !important; }
span.lang-hi { display: none !important; }
body.hi-active span.lang-hi { display: inline !important; }
body.hi-active span.lang-en { display: none !important; }

/* =================== HEADER =================== */
.header {
  background: var(--header-bg) !important;
  border-bottom: 1px solid var(--border) !important;
  position: fixed !important;
  left: 0 !important;
  top: 0 !important;
  width: 100% !important;
  margin: 0 !important;
  z-index: 2147483647 !important; /* Max z-index */
  box-shadow: var(--header-shadow);
  transition: background var(--transition), box-shadow var(--transition);
}
.header-container {
  max-width: 1572px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Logo */
.header-left { flex-shrink: 0; }
.logo-link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.logo-name {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}

/* Desktop Nav */
.header-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  justify-content: center;
}
.header-nav a {
  text-decoration: none;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.92rem;
  padding: 6px 14px;
  border-radius: 6px;
  transition: color var(--transition), background var(--transition);
  white-space: nowrap;
}
.header-nav a:hover,
.header-nav a.active {
  color: var(--primary);
  background: rgba(0,102,204,0.08);
}

/* Right Actions */
.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Icon Buttons */
.icon-btn {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px;
  cursor: pointer;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), border-color var(--transition);
}
.icon-btn:hover { background: var(--border); }

/* Theme Icons */
.icon-sun { display: none; }
.icon-moon { display: block; }
[data-theme="dark"] .icon-sun { display: block; }
[data-theme="dark"] .icon-moon { display: none; }

/* Language Toggle */
.lang-toggle {
  display: flex;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 3px;
  gap: 2px;
}
.lang-btn {
  border: none;
  background: transparent;
  padding: 4px 10px;
  border-radius: 15px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.lang-btn.active {
  background: var(--primary);
  color: #fff;
}

/* Search Wrapper */
.search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}
.search-input-wrap {
  position: absolute;
  right: 44px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  overflow: hidden;
  transition: width 0.3s ease;
}
.search-wrapper.open .search-input-wrap { 
  width: 220px; 
  overflow: visible;
}
.search-input-wrap input {
  width: 100%;
  padding: 8px 14px;
  border: 1.5px solid var(--primary);
  border-radius: 8px;
  background: var(--card-bg);
  color: var(--text);
  font-size: 0.9rem;
  outline: none;
}
.search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  max-height: 300px;
  overflow-y: auto;
  z-index: 500;
  display: none;
}
.search-results.show { display: block; }
.search-result-item {
  display: block;
  padding: 10px 14px;
  text-decoration: none;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
  transition: background var(--transition);
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: var(--bg-alt); }
.search-result-item strong { display: block; font-size: 0.88rem; }
.search-result-item small { color: var(--text-muted); font-size: 0.78rem; }

/* Hamburger (hidden on desktop) */
.hamburger-btn { display: none; }
.icon-ham { display: block; }
.icon-close { display: none; }
.hamburger-btn.open .icon-ham { display: none; }
.hamburger-btn.open .icon-close { display: block; }

/* Mobile Nav */
.mobile-nav {
  display: none;
  flex-direction: column;
  background: var(--header-bg);
  border-top: 1px solid var(--border);
}
.mobile-nav.show { display: flex; }
.mobile-nav a {
  display: block;
  padding: 14px 24px;
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition), color var(--transition);
}
.mobile-nav a:hover { color: var(--primary); background: var(--bg-alt); }
.mobile-nav a:last-child { border-bottom: none; }

/* Mobile Search Bar */
.mobile-search-bar {
  display: none;
  padding: 10px 16px;
  background: var(--header-bg);
  border-top: 1px solid var(--border);
  position: relative;
}
.mobile-search-bar.show { display: block; }
.mobile-search-bar input {
  width: 100%;
  padding: 9px 14px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: var(--bg-alt);
  color: var(--text);
  font-size: 0.9rem;
  outline: none;
}
.mobile-search-bar input:focus { border-color: var(--primary); }
.mobile-search-bar .search-results {
  position: absolute;
  top: 100%;
  left: 16px;
  right: 16px;
  z-index: 500;
}

/* =================== FOOTER =================== */
.footer {
  background: var(--footer-bg);
  color: var(--footer-text);
  margin-top: 60px;
}
.footer-inner {
  display: grid;
  grid-template-columns: 1.5fr repeat(3, 1fr);
  gap: 48px;
  padding: 52px 1.5rem 40px;
}
.footer-logo {
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 12px;
}
.brand-col p {
  font-size: 0.9rem;
  line-height: 1.7;
  margin-bottom: 20px;
}
.telegram-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #0088cc;
  color: #fff;
  padding: 9px 18px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.88rem;
  transition: opacity var(--transition);
}
.telegram-btn:hover { opacity: 0.85; }
.footer-col h4 {
  color: #fff;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  margin-bottom: 16px;
}
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 10px; }
.footer-col ul a {
  color: var(--footer-text);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color var(--transition);
}
.footer-col ul a:hover { color: #fff; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.08);
  text-align: center;
  padding: 18px 1.5rem;
  font-size: 0.85rem;
  color: var(--footer-text);
}

/* =================== RESPONSIVE =================== */
@media (max-width: 900px) {
  .header-nav { display: none; }
  .hamburger-btn { display: flex; }
  .search-wrapper.open .search-input-wrap { 
    width: 180px; 
    overflow: visible;
  }
  .footer-inner { grid-template-columns: 1fr 1fr; gap: 32px; }
}

@media (max-width: 600px) {
  .header-container { padding: 0 14px; height: 62px; gap: 8px; }
  .logo-name { font-size: 1rem; }
    .lang-toggle { 
    display: flex; 
    position: fixed; 
    bottom: 20px; 
    right: 20px; 
    z-index: 9999; 
    background: var(--card-bg); 
    box-shadow: 0 4px 15px rgba(0,0,0,0.3); 
    border: 2px solid var(--primary);
    transform: scale(1.1);
  }
  .footer-inner { grid-template-columns: 1fr; gap: 24px; padding: 32px 1.5rem 24px; }
  .search-wrapper { display: none; }
}



/* Prevent Google Auto Ads from showing inside or under the footer */
.footer .google-auto-placed,
footer .google-auto-placed,
footer + .google-auto-placed,
.footer + .google-auto-placed,
.footer-bottom .google-auto-placed {
    display: none !important;
    height: 0 !important;
    opacity: 0 !important;
    visibility: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
}


body {
  padding-top: 60px;
}
@media (max-width: 600px) {
  body {
    padding-top: 62px;
  }
}


