/* === IndiePicks — Main Stylesheet === */

:root {
  --bg: #fafafa;
  --surface: #ffffff;
  --border: #e5e5e5;
  --text: #1a1a1a;
  --text-secondary: #666666;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --success: #16a34a;
  --warning: #f59e0b;
  --radius: 12px;
  --radius-sm: 8px;
  --max-width: 1200px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* === Reading Progress Bar === */
#progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: var(--accent);
  z-index: 1000;
  width: 0;
}

/* === Top Bar === */
.top-bar {
  background: var(--text);
  color: #fff;
  text-align: center;
  padding: 6px 16px;
  font-size: 0.8rem;
  letter-spacing: 0.3px;
}

/* === Header === */
.main-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  height: 60px;
  gap: 24px;
}
.logo {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}
.logo:hover { text-decoration: none; }

/* Main Nav */
.main-nav {
  display: flex;
  gap: 4px;
  flex: 1;
}
.main-nav a {
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.15s;
}
.main-nav a:hover,
.main-nav a.active {
  background: #f3f4f6;
  color: var(--text);
  text-decoration: none;
}

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.search-box {
  display: flex;
  align-items: center;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  gap: 6px;
}
.search-box input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 0.85rem;
  width: 160px;
  color: var(--text);
}
.search-box input::placeholder { color: #999; }
.search-box button {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 0.9rem;
}
.btn-submit {
  display: inline-block;
  padding: 7px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  background: var(--accent);
  color: #fff;
  transition: background 0.15s;
}
.btn-submit:hover {
  background: var(--accent-hover);
  text-decoration: none;
}

/* === Hero === */
.hero {
  max-width: var(--max-width);
  margin: 48px auto 24px;
  padding: 0 20px;
  text-align: center;
}
.hero h1 {
  font-size: 2.2rem;
  font-weight: 800;
  margin-bottom: 12px;
  color: var(--text);
}
.hero-subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 680px;
  margin: 0 auto;
}

/* === Section === */
.section {
  max-width: var(--max-width);
  margin: 0 auto 48px;
  padding: 0 20px;
}
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}
.section-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
}

/* Sub Tabs */
.sub-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.sub-tabs a {
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 0.8rem;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  transition: all 0.15s;
}
.sub-tabs a:hover,
.sub-tabs a.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  text-decoration: none;
}
.sub-tabs a.see-all {
  background: transparent;
  border: none;
  color: var(--accent);
  font-weight: 600;
}
.sub-tabs a.see-all:hover {
  background: transparent;
  color: var(--accent-hover);
  text-decoration: underline;
}

/* === Tools Grid === */
.tools-grid {
  display: grid;
  gap: 20px;
}
.tools-grid.cols-4 {
  grid-template-columns: repeat(4, 1fr);
}
.tools-grid.cols-6 {
  grid-template-columns: repeat(6, 1fr);
}

/* === Tool Card === */
.tool-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all 0.15s;
  position: relative;
}
.tool-card:hover {
  box-shadow: var(--shadow-md);
  border-color: #d1d5db;
}

/* Thumbnail */
.tool-card .thumb {
  display: block;
  position: relative;
  width: 100%;
  height: 140px;
  overflow: hidden;
  background: #f3f4f6;
}
.tool-card .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Badges */
.badge {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  z-index: 2;
}
.badge-free { background: #dcfce7; color: #166534; }
.badge-freemium { background: #dbeafe; color: #1e40af; }
.badge-premium { background: #fef3c7; color: #92400e; }
.badge-new {
  background: var(--accent);
  color: #fff;
  top: auto;
  bottom: 8px;
  left: auto;
  right: 8px;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.6rem;
}

/* Info area */
.tool-card .info {
  padding: 14px 16px;
}
.cat-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 4px;
}
.tool-card .info h4 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 4px;
}
.tool-card .info h4 a {
  color: var(--text);
}
.tool-card .info h4 a:hover {
  color: var(--accent);
  text-decoration: none;
}
.tool-card .desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.rating {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--warning);
}

/* === Footer === */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 48px 20px 0;
  margin-top: auto;
}
.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 32px;
}
.footer-brand p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 12px;
  max-width: 340px;
  line-height: 1.7;
}
.footer-logo {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
}
.footer-logo:hover { text-decoration: none; }
.footer-col h4 {
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 14px;
  color: var(--text);
}
.footer-col ul {
  list-style: none;
}
.footer-col ul li {
  margin-bottom: 8px;
}
.footer-col ul li a {
  font-size: 0.85rem;
  color: var(--text-secondary);
}
.footer-col ul li a:hover {
  color: var(--accent);
  text-decoration: none;
}
.footer-bottom {
  border-top: 1px solid var(--border);
  padding: 16px 0;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-secondary);
  max-width: var(--max-width);
  margin: 0 auto;
}

/* === Breadcrumb === */
.breadcrumb {
  max-width: var(--max-width);
  margin: 20px auto 0;
  padding: 0 20px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}
.breadcrumb a { color: var(--text-secondary); }
.breadcrumb a:hover { color: var(--accent); text-decoration: none; }
.breadcrumb span { color: var(--text); }

/* === Detail Hero === */
.detail-hero {
  max-width: var(--max-width);
  margin: 40px auto;
  padding: 0 20px;
  display: flex;
  gap: 24px;
  align-items: flex-start;
}
.detail-hero .icon-wrapper {
  position: relative;
  flex-shrink: 0;
}
.detail-hero .icon-wrapper img {
  width: 80px;
  height: 80px;
  border-radius: 22px;
  object-fit: cover;
  box-shadow: var(--shadow-md);
}
.detail-hero .icon-emoji {
  width: 80px;
  height: 80px;
  border-radius: 22px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  box-shadow: var(--shadow-md);
}
.detail-hero .badge-new {
  position: absolute;
  top: -6px;
  right: -6px;
  background: var(--accent);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  text-transform: uppercase;
}
.detail-hero .hero-info h1 {
  font-size: 2rem;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.detail-hero .hero-info .desc {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
  max-width: 640px;
}
.detail-hero .hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* Pricing Badge */
.badge-pricing {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}
.badge-pricing.free { background: #dcfce7; color: #166534; }
.badge-pricing.freemium { background: #dbeafe; color: #1e40af; }
.badge-pricing.paid { background: #fef3c7; color: #92400e; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 24px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-hover); text-decoration: none; }
.btn-secondary {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: #f3f4f6; text-decoration: none; }
.btn-secondary.bookmarked {
  border-color: var(--accent);
  color: var(--accent);
}

/* === Detail Body === */
.detail-body {
  max-width: var(--max-width);
  margin: 0 auto 60px;
  padding: 0 20px;
}
.detail-body h2 {
  font-size: 1.5rem;
  margin: 40px 0 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--border);
}
.feature-grid {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}
.feature-grid li {
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 10px;
}
.feature-grid li::before {
  content: "\2713";
  color: var(--success);
  font-weight: 700;
  font-size: 1rem;
}
.detail-meta {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  margin-top: 32px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.meta-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.meta-item .label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  font-weight: 600;
}
.meta-item .value {
  font-size: 0.95rem;
  font-weight: 500;
}
.stars { color: var(--warning); }

/* === Category Page === */
.category-page {
  max-width: var(--max-width);
  margin: 0 auto 60px;
  padding: 0 20px;
}
.category-page h1 {
  font-size: 2rem;
  margin: 24px 0 8px;
}
.category-page .cat-desc {
  color: var(--text-secondary);
  margin-bottom: 24px;
  font-size: 1.05rem;
}

/* === Search Page === */
.search-page {
  max-width: var(--max-width);
  margin: 0 auto 60px;
  padding: 0 20px;
}
.search-page h1 {
  font-size: 1.5rem;
  margin: 24px 0;
  color: var(--text-secondary);
}
.search-page .no-results {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
  font-size: 1.1rem;
}

/* === Card Grid (for category/search pages) === */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}
.tool-card .card-top {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 10px;
}
.tool-card .card-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}
.tool-card .card-icon.dev { background: linear-gradient(135deg, #667eea, #764ba2); }
.tool-card .card-icon.creative { background: linear-gradient(135deg, #f093fb, #f5576c); }
.tool-card .card-icon.productivity { background: linear-gradient(135deg, #4facfe, #00f2fe); }
.tool-card .card-icon.utility { background: linear-gradient(135deg, #43e97b, #38f9d7); }
.tool-card .card-icon.security { background: linear-gradient(135deg, #fa709a, #fee140); }
.tool-card .card-name {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
}
.tool-card .card-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.tool-card .card-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}
.tool-card .card-stars { color: var(--warning); }
.tool-card .card-new {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--accent);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 8px;
  text-transform: uppercase;
}
.tool-card a { color: inherit; text-decoration: none; }

/* === Responsive === */
@media (max-width: 1024px) {
  .tools-grid.cols-6 {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (max-width: 768px) {
  .header-inner { flex-wrap: wrap; height: auto; padding: 12px 20px; gap: 12px; }
  .main-nav { order: 3; width: 100%; overflow-x: auto; }
  .search-box input { width: 120px; }
  .tools-grid.cols-4,
  .tools-grid.cols-6 {
    grid-template-columns: repeat(2, 1fr);
  }
  .footer-inner {
    grid-template-columns: 1fr 1fr;
    gap: 24px;
  }
  .detail-hero { flex-direction: column; align-items: center; text-align: center; }
  .detail-hero .hero-info h1 { justify-content: center; }
  .detail-hero .hero-actions { justify-content: center; }
  .detail-hero .hero-info .desc { max-width: 100%; }
  .card-grid { grid-template-columns: 1fr; }
  .feature-grid { grid-template-columns: 1fr; }
  .detail-meta { flex-direction: column; gap: 16px; }
}
@media (max-width: 480px) {
  .tools-grid.cols-4,
  .tools-grid.cols-6 {
    grid-template-columns: 1fr;
  }
  .footer-inner {
    grid-template-columns: 1fr;
  }
  .header-actions { flex-wrap: wrap; }
}
