:root {
  --bg-primary: #202124;
  --bg-secondary: #303134;
  --bg-search: #303134;
  --text-primary: #e8eaed;
  --text-secondary: #9aa0a6;
  --border-color: #5f6368;
  --hover-bg: #303134;
  --result-bg: #303134;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  --accent: #7174ff; /* Premium indigo accent */
  --accent-rgb: 99, 102, 241;
}

[data-theme="light"] {
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-search: #f1f5f9;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --border-color: #e2e8f0;
  --hover-bg: #f1f5f9;
  --shadow: 0 4px 20px rgba(148, 163, 184, 0.15);
  --accent: #4f46e5;
  --accent-rgb: 79, 70, 229;
}

/* Base resets */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  transition: background-color 0.3s ease, color 0.3s ease;
  min-height: 100vh;
  line-height: 1.5;
}

/* Font Assignments based on language class */
body.lang-ur {
  font-family: "Noto Nastaliq Urdu", serif;
}

body.lang-en,
body.lang-roman_urdu {
  font-family: "Outfit", "Inter", sans-serif;
}

/* RTL Specific Line Heights for Urdu */
[dir="rtl"] body {
  line-height: 2.2;
}

/* Top action navigation */
.navbar-btn {
  position: fixed;
  top: 1.25rem;
  left: 1.25rem;
  display: flex;
  gap: 0.75rem;
  z-index: 1000;
}

.theme-toggle,
.translator-toggle {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  width: 2.75rem;
  height: 2.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 1.25rem;
  color: var(--text-primary);
  box-shadow: var(--shadow);
}

.theme-toggle:hover,
.translator-toggle:hover {
  background: var(--hover-bg);
  transform: scale(1.08) translateY(-1px);
  border-color: var(--accent);
}

/* Homepage Hero Area */
.homepage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-height: 100vh;
  padding: 4rem 1.5rem 3rem 1.5rem;
  max-width: 1100px;
  margin: 0 auto;
}

.logo {
  width: 100%;
  max-width: 800px;
  margin-bottom: 2rem;
  animation: fadeIn 2.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.logo img {
  width: 100%;
  height: auto;
  display: block;
}

/* Search Box Container */
.search-container {
  width: 100%;
  max-width: 884px;
}

.search-box {
  display: flex;
  align-items: center;
  background: var(--bg-search);
  border: 1px solid var(--border-color);
  border-radius: 3rem;
  padding: 0.75rem 1.25rem;
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
  margin-bottom: 2rem;
  box-shadow: 0 1px 8px rgba(32, 33, 36, 0.35);
}

.search-box:hover,
.search-box:focus-within {
  box-shadow: 0 3px 16px rgba(32, 33, 36, 0.35);
}

.search-input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-family: inherit;
  font-size: 1.05rem;
  color: var(--text-primary);
  padding: 0.25rem 0.5rem;
}

.search-input::placeholder {
  color: var(--text-secondary);
  opacity: 0.7;
}

/* Button Group */
.button-group {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.5rem;
  width: 100%;
}

.search-btn,
.chat-btn {
  padding: 0.875rem 2rem;
  border-radius: 0.75rem;
  font-family: inherit;
  font-size: 1rem;
  line-height: 2.2 !important;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  min-width: 160px;
  border: 1px solid transparent;
  width: 35%;
}

.chat-btn {
  background: var(--accent);
  color: white;
}

.chat-btn:hover {
  background: var(--hover-bg);
  color: var(--text-primary);
  border-color: var(--accent);
  transform: translateY(-1.5px);
  box-shadow: 0 4px 12px rgba(var(--accent-rgb), 0.25);
}

.search-btn {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.search-btn:hover {
  background: #10b981; /* Premium Emerald green */
  color: white;
  border-color: #10b981;
  transform: translateY(-1.5px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

.search-btn:active,
.chat-btn:active {
  transform: translateY(0);
}

/* Static sections - Grid info layouts */
.static-sections-container {
  width: 100%;
  margin-top: 5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.info-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 1.25rem;
  padding: 2rem;
  box-shadow: var(--shadow);
  transition: transform 0.3s ease, border-color 0.3s ease;
}

.info-card:hover {
  border-color: rgba(var(--accent-rgb), 0.3);
}

.info-card h2 {
  font-size: 1.45rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  color: var(--accent);
}

.info-card p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.7;
}

#mainSearch {
  line-height: 2.2;
}

.lang-ur .info-card h2 {
  font-size: 1.65rem;
}

.lang-ur .info-card p {
  font-size: 1.05rem;
  line-height: 2.1;
}

.guide-intro {
  margin-bottom: 1.5rem;
  font-weight: 500;
}

.guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
}

.guide-item {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  padding: 1.25rem;
  border-radius: 0.75rem;
  border-left: 3px solid var(--accent);
}

[dir="rtl"] .guide-item {
  border-left: none;
  border-right: 3px solid var(--accent);
}

.guide-item h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}

.guide-item p {
  font-size: 0.875rem !important;
  line-height: 1.6 !important;
}

.lang-ur .guide-item p {
  font-size: 0.95rem !important;
  line-height: 2.0 !important;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
}

/* Language Selection Modal Screen */
.lang-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(10, 11, 15, 0.8);
  backdrop-filter: blur(8px);
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.lang-modal-content {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 1.5rem;
  padding: 2.5rem 2rem;
  max-width: 440px;
  width: 100%;
  text-align: center;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
  animation: modalZoom 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.lang-modal-content h2 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 1.75rem;
  color: var(--accent);
}

.lang-buttons-grid {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.lang-select-btn {
  padding: 0.95rem;
  font-size: 1.1rem;
  line-height: 2.2;
  font-weight: 600;
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  background: var(--bg-primary);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.3s ease;
}

.lang-select-btn:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 4px 12px rgba(var(--accent-rgb), 0.15);
  background: var(--hover-bg);
}

.lang-select-btn.font-urdu {
  font-family: "Noto Nastaliq Urdu", serif;
}
.lang-select-btn.font-roman,
.lang-select-btn.font-english {
  font-family: "Outfit", sans-serif;
}

@keyframes modalZoom {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive Overrides */
@media (max-width: 768px) {
  .homepage {
    padding: 3rem 1rem 2rem 1rem;
  }

  .logo {
    max-width: 420px;
  }

  .tagline {
    font-size: 1.1rem;
  }

  .search-controls {
    flex-direction: column;
    gap: 0.5rem;
  }

  .control-group {
    width: 100%;
  }

  .button-group {
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
  }

  .search-btn,
  .chat-btn {
    width: 100%;
    padding: 0.8rem;
  }

  .info-grid {
    grid-template-columns: 1fr;
  }

  .info-card {
    padding: 1.5rem;
  }

  .navbar-btn {
    top: 0.85rem;
    left: 0.85rem;
  }

  .theme-toggle,
  .translator-toggle {
    width: 2.35rem;
    height: 2.35rem;
    font-size: 1.05rem;
  }
}
