/* ===== Theme Variables ===== */
:root {
  --bg-primary: #ffffff;
  --bg-secondary: #f8f9fa;
  --bg-hover: #f1f3f4;
  --text-primary: #202124;
  --text-secondary: #5f6368;
  --text-muted: #9aa0a6;
  --border-color: #dfe1e5;
  --border-hover: #c0c0c0;
  --accent: #00BFA5;
  --accent-hover: #009688;
  --link-color: #1a0dab;
  --link-visited: #681da8;
  --url-color: #188038;
  --shadow-search: 0 1px 6px rgba(32, 33, 36, 0.12);
  --shadow-search-hover: 0 2px 8px rgba(32, 33, 36, 0.2);
  --footer-bg: #f2f2f2;
  --footer-border: #e4e4e4;
  --btn-bg: #f8f9fa;
  --btn-border: #f8f9fa;
  --btn-text: #3c4043;
  --btn-hover-bg: #e8e8e8;
  --theme-toggle-bg: transparent;
  --theme-toggle-hover: #f1f3f4;
  color-scheme: light;
}

[data-theme="dark"] {
  --bg-primary: #202124;
  --bg-secondary: #171717;
  --bg-hover: #303134;
  --text-primary: #e8eaed;
  --text-secondary: #bdc1c6;
  --text-muted: #9aa0a6;
  --border-color: #5f6368;
  --border-hover: #8ab4f8;
  --accent: #00BFA5;
  --accent-hover: #26D9B8;
  --link-color: #8ab4f8;
  --link-visited: #c58af9;
  --url-color: #69d298;
  --shadow-search: 0 1px 6px rgba(0, 0, 0, 0.3);
  --shadow-search-hover: 0 2px 8px rgba(0, 0, 0, 0.5);
  --footer-bg: #171717;
  --footer-border: #303134;
  --btn-bg: #303134;
  --btn-border: #303134;
  --btn-text: #e8eaed;
  --btn-hover-bg: #3c4043;
  --theme-toggle-bg: transparent;
  --theme-toggle-hover: #303134;
  color-scheme: dark;
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color 0.2s ease, color 0.2s ease;
}

a {
  color: var(--link-color);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

a:visited {
  color: var(--link-visited);
}

/* ===== Navbar ===== */
.navbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 12px 24px;
  gap: 16px;
}

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: var(--theme-toggle-bg);
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.2s;
}

.theme-toggle:hover {
  background: var(--theme-toggle-hover);
}

.theme-toggle svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* ===== Main Content (Landing) ===== */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 24px;
  margin-top: -80px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 36px;
}

.logo-icon {
  width: 56px;
  height: 56px;
}

.logo-text {
  font-size: 2.75rem;
  font-weight: 600;
  letter-spacing: -0.5px;
  color: var(--text-primary);
}

.logo-text span {
  color: var(--accent);
}

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

.search-box {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 12px 18px;
  border: 1px solid var(--border-color);
  border-radius: 24px;
  background: var(--bg-primary);
  box-shadow: var(--shadow-search);
  transition: box-shadow 0.2s, border-color 0.2s;
}

.search-box:hover,
.search-box:focus-within {
  box-shadow: var(--shadow-search-hover);
  border-color: transparent;
}

.search-icon {
  width: 20px;
  height: 20px;
  color: var(--text-muted);
  flex-shrink: 0;
  margin-right: 12px;
}

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

.search-input::placeholder {
  color: var(--text-muted);
}

/* ===== Buttons ===== */
.search-buttons {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 24px;
}

.btn {
  padding: 10px 20px;
  border: 1px solid var(--btn-border);
  border-radius: 4px;
  background: var(--btn-bg);
  color: var(--btn-text);
  font-size: 0.875rem;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.btn:hover {
  background: var(--btn-hover-bg);
  border-color: var(--btn-hover-bg);
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.08);
}

/* ===== Footer ===== */
.footer {
  background: var(--footer-bg);
  border-top: 1px solid var(--footer-border);
  padding: 16px 24px;
  text-align: center;
  transition: background-color 0.2s;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.footer-links a:visited {
  color: var(--text-secondary);
}

.footer-links a:hover {
  text-decoration: underline;
}

/* ===== Responsive ===== */
@media (max-width: 600px) {
  .main {
    margin-top: -40px;
  }

  .logo-text {
    font-size: 2rem;
  }

  .logo-icon {
    width: 40px;
    height: 40px;
  }

  .search-buttons {
    flex-direction: column;
    align-items: center;
  }

  .btn {
    width: 100%;
    max-width: 200px;
  }
}
