:root {
  --bg-color: #ffffff;
  --text-color: #1a1a1a;
  --border-color: #e0e0e0;
  --hover-bg: #f5f5f5;
  --new-highlight: #e3f2fd;
  --font-size-sm: 0.75rem;
  --font-size-md: 0.875rem;
}

[data-theme="dark"] {
  --bg-color: #1a1a1a;
  --text-color: #ffffff;
  --border-color: #333333;
  --hover-bg: #2d2d2d;
  --new-highlight: #2d3748;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-color);
  color: var(--text-color);
  transition: background 0.3s, color 0.3s;
}

.main-header {
  background: var(--bg-color);
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1.5rem;
  gap: 0.8rem;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: #2196f3;
  flex-shrink: 0;
}

.search-container {
  flex-grow: 1;
  max-width: 500px;
  position: relative;
  padding: 0px 10px 0px 0px;
  margin: 0px 10px 0px 0px;
}

#search-input {
  width: 100%;
  padding: 0.5rem 0rem 0.5rem 1.1rem;
  border: 1px solid var(--border-color);
  border-radius: 24px;
  background: var(--bg-color);
  color: var(--text-color);
  font-size: 0.95rem;
  transition: all 0.3s;
  line-height: 1.5;
}

#search-input:focus {
  outline: none;
  border-color: #2196f3;
  box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.15);
}

.clear-btn {
  position: absolute;
  right: 2px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #666;
  cursor: pointer;
  font-size: 1.8rem;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s;
  opacity: 0.7;
}

.clear-btn:hover {
  opacity: 1;
  color: #ff4444;
  background: rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .clear-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #ff6666;
}

.theme-btn {
  background: none;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 0.68rem 1rem;
  cursor: pointer;
  flex-shrink: 0;
  transition: opacity 0.3s;
}

.theme-btn:hover {
  opacity: 0.8;
}

.container {
  display: flex;
  gap: 1.5rem;
  padding: 1.5rem;
  max-width: 1400px;
  margin: 0 auto;
}

.column {
  flex: 1;
  min-width: 0;
  width: 50%;
}

h2 {
  margin: 0 0 1rem 0;
  font-size: 1.1rem;
  font-weight: 600;
}

.feed-container {
  border: 1px solid var(--border-color);
  border-radius: 6px;
  overflow: hidden;
}

.feed-item {
  padding: 0.35rem 0.7rem;
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.feed-item:hover {
  background: var(--hover-bg);
}

.feed-item.new {
  border-left: 2px solid #2196f3;
  background-color: var(--new-highlight);
}

.feed-item.new:hover {
  border-left-width: 3px;
  background-color: color-mix(in srgb, var(--new-highlight) 90%, transparent);
}

.time {
  font-size: var(--font-size-sm);
  color: #666;
  margin-right: 0.2rem;
  flex-shrink: 0;
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
  width: 45px;
}

.title {
  font-size: var(--font-size-md);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-grow: 1;
}

.category-tag {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  margin-right: 0.3rem;
}

[data-category="business"] { background: #e8f5e9; color: #2e7d32; }
[data-category="sports"] { background: #fff3e0; color: #ef6c00; }
[data-category="tech"] { background: #e3f2fd; color: #1565c0; }
[data-category="science"] { background: #f3e5f5; color: #6a1b9a; }
[data-category="health"] { background: #f315f5; color: #7a1b9a; }
[data-category="economy"] { background: #f3e555; color: #6a7b9a; }
[data-category="cricket"] { background: #13e5f5; color: #6a1bfa; }
[data-category="lifestyle"] { background: #f315f5; color: #8a1b9a; }

.main-footer {
  border-top: 1px solid var(--border-color);
  margin-top: 2rem;
  padding: 2rem 0;
}

.footer-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1.5rem;
  text-align: center;
}

.footer-nav {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.footer-nav a {
  color: var(--text-color);
  text-decoration: none;
  font-size: 0.9rem;
  white-space: nowrap;
}

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

.copyright {
  color: #666;
  font-size: 0.8rem;
  margin: 0;
}

@media (max-width: 768px) {
  .container {
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
  }

  .column {
    width: 100%;
  }

  .header-content {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
}

#loading-spinner {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.5rem;
  color: #333;
}