*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --bg-color: #ffffff;
  --text-color: #202124;
  --search-bg: #ffffff;
  --border-color: #dfe1e5;
  --footer-bg: #f5f6f7;
  --footer-text: #555555;
  --footer-border: #d3d3d3;
  --list-border: #f1f3f4;
  --hover-bg: #f1f3f4;
  --active-bg: #e8eaed;
  --icon-color: #5f6368;
  --search-box-border: #000000; 
  --logo-border: #000000;
  --icon-hover-bg: #f1f3f4;
}

[data-theme="dark"] {
  --bg-color: #202124;
  --text-color: #e8eaed;
  --search-bg: #303134;
  --border-color: #5f6368;
  --footer-bg: #171717;
  --footer-text: #9aa0a6;
  --footer-border: #3c4043;
  --list-border: #3c4043;
  --hover-bg: #3c4043;
  --active-bg: #4a4d51;
  --icon-color: #9aa0a6;
  --search-box-border: #ffffff; 
  --logo-border: #ffffff;
  --icon-hover-bg: #2d2d2d;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: var(--bg-color);
  color: var(--text-color);
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
}

button, input {
  font: inherit;
  -webkit-tap-highlight-color: transparent;
}

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.main {
  flex: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 12px 20px;
}

.logo {
  margin: 0 0 20px;
  font-size: 28px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -1px;
  text-align: center;
}

.search-box {
  position: relative;
  width: 100%;
  max-width: 680px;
  min-height: 52px;
  display: flex;
  align-items: center;
  padding: 4px 10px;
  background: var(--search-bg);
  border: 2px solid var(--search-box-border); 
  border-radius: 32px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.logo-btn {
  width: 36px;
  height: 36px;
  border: 2px solid var(--logo-border);
  border-radius: 50%;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 2px;
  overflow: hidden;
  flex-shrink: 0;
  transition: all 0.3s ease;
}

.logo-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.logo-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 0 10px var(--logo-border);
}

.search-box input {
  flex: 1;
  min-width: 0;
  height: 44px;
  padding: 0 6px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text-color);
  font-size: 15px;
  text-overflow: ellipsis;
}

.icon-btn {
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 50%;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  color: var(--icon-color);
  outline: none;
  flex-shrink: 0;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.icon-btn svg {
  width: 20px;
  height: 20px;
  fill: var(--icon-color);
}

.icon-btn:hover, .icon-btn:active {
  background-color: var(--icon-hover-bg);
  transform: scale(1.08);
}

.right-icons {
  display: flex;
  align-items: center;
  gap: 4px;
}

.trending-section {
  width: 100%;
  max-width: 680px;
  margin-top: 25px;
}

.trending-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  padding: 0 4px;
}

.trending-header h2 {
  font-size: 18px;
  font-weight: 400;
  margin: 0;
  color: var(--text-color);
}

.menu-container {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  right: 0;
  top: 45px;
  background: var(--search-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  list-style: none;
  padding: 6px 0;
  width: 140px;
  z-index: 100;
  display: flex;
  flex-direction: column;
}

.menu-item {
  width: 100%;
  padding: 12px 16px;
  text-align: left;
  background: transparent;
  border: none;
  color: var(--text-color);
  font-size: 14px;
  cursor: pointer;
}

.menu-item:hover, .menu-item:active {
  background-color: var(--hover-bg);
}

.trending-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

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

.trending-item {
  display: flex;
  align-items: center;
  padding: 14px 8px;
  border-bottom: 1px solid var(--list-border);
  cursor: pointer;
  opacity: 0;
  animation: fadeInUp 0.4s ease forwards;
}

.trending-item:nth-child(1) { animation-delay: 0.05s; }
.trending-item:nth-child(2) { animation-delay: 0.1s; }
.trending-item:nth-child(3) { animation-delay: 0.15s; }
.trending-item:nth-child(4) { animation-delay: 0.2s; }
.trending-item:nth-child(5) { animation-delay: 0.25s; }
.trending-item:nth-child(n+6) { animation-delay: 0.3s; }

.trending-item:hover, .trending-item:active {
  background-color: var(--hover-bg);
}

.trending-icon {
  margin-right: 16px;
  display: flex;
  align-items: center;
  color: var(--icon-color);
  flex-shrink: 0;
}

.trending-text {
  font-size: 16px;
  color: var(--text-color);
  line-height: 1.4;
}

.footer {
  width: 100%;
  background: var(--footer-bg);
  color: var(--footer-text);
}

.footer-country {
  padding: 14px 20px;
  border-bottom: 1px solid var(--footer-border);
  font-size: 15px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
}

.footer-links a,
.theme-btn {
  color: var(--footer-text);
  text-decoration: none;
  font-size: 13px;
  background: none;
  border: none;
  padding: 8px 12px;
  border-radius: 4px;
  cursor: pointer;
}

.footer-links a:hover,
.theme-btn:hover,
.footer-links a:active,
.theme-btn:active {
  background-color: var(--hover-bg);
  color: var(--text-color);
}

.copyright {
  padding: 10px 15px 14px;
  border-top: 1px solid var(--footer-border);
  font-size: 12px;
  text-align: center;
  color: var(--footer-text);
}

@media (min-width: 768px) {
  .main {
    padding: 40px 15px 30px;
  }
  .logo {
    font-size: 34px;
    margin-bottom: 28px;
  }
  .search-box {
    min-height: 56px;
    padding: 4px 14px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  }
  .search-box input {
    font-size: 16px;
  }
  .trending-header h2 {
    font-size: 20px;
  }
  .trending-section {
    margin-top: 35px;
  }
  .footer-links {
    gap: 15px;
    padding: 16px 20px;
  }
  .footer-links a,
  .theme-btn {
    font-size: 14px;
    padding: 6px 10px;
  }
}
