/* ChromeBoard.com — Main Stylesheet */

:root {
    --bg: #ffffff;
    --bg-alt: #f8f9fa;
    --bg-card: #ffffff;
    --text: #1a1a2e;
    --text-secondary: #555;
    --text-muted: #888;
    --border: #e0e0e0;
    --primary: #4285F4;
    --primary-hover: #3367D6;
    --accent-green: #34A853;
    --accent-yellow: #FBBC05;
    --accent-red: #EA4335;
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-hover: 0 4px 16px rgba(0,0,0,0.12);
    --radius: 12px;
    --radius-sm: 8px;
    --transition: 0.2s ease;
}

[data-theme="dark"] {
    --bg: #0f1117;
    --bg-alt: #1a1c25;
    --bg-card: #1e2029;
    --text: #e4e4e7;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;
    --border: #2e2e3a;
    --shadow: 0 2px 8px rgba(0,0,0,0.3);
    --shadow-hover: 0 4px 16px rgba(0,0,0,0.4);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, Roboto, sans-serif; background: var(--bg); color: var(--text); line-height: 1.6; }
a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-hover); }
img { max-width: 100%; height: auto; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* Header */
.site-header { background: var(--bg-card); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100; }
.header-inner { display: flex; align-items: center; gap: 24px; height: 64px; }
.logo { display: flex; align-items: center; gap: 8px; font-size: 1.25rem; color: var(--text); text-decoration: none; }
.logo-icon { font-size: 1.5rem; }
.logo-text { letter-spacing: -0.5px; }
.logo-text strong { color: var(--primary); }
.main-nav { display: flex; gap: 20px; }
.main-nav a { color: var(--text-secondary); font-size: 0.9rem; font-weight: 500; padding: 4px 0; }
.main-nav a:hover { color: var(--primary); }
.header-actions { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.header-search { display: flex; background: var(--bg-alt); border: 1px solid var(--border); border-radius: 24px; overflow: hidden; }
.header-search input { border: none; background: transparent; padding: 8px 16px; font-size: 0.9rem; color: var(--text); outline: none; width: 240px; }
.header-search button { border: none; background: transparent; padding: 8px 12px; cursor: pointer; font-size: 1rem; }
.theme-toggle { background: none; border: none; font-size: 1.2rem; cursor: pointer; padding: 4px; }
.mobile-menu-btn { display: none; background: none; border: none; font-size: 1.5rem; cursor: pointer; }
.mobile-nav { display: none; flex-direction: column; gap: 12px; padding: 16px 20px; background: var(--bg-card); border-bottom: 1px solid var(--border); }
.mobile-nav a { color: var(--text); font-weight: 500; }
.mobile-nav.active { display: flex; }
.mobile-search { display: flex; gap: 8px; }
.mobile-search input { flex: 1; padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-alt); color: var(--text); font-size: 0.9rem; }
.mobile-search button { padding: 10px 16px; border: none; background: var(--primary); color: #fff; border-radius: var(--radius-sm); cursor: pointer; font-weight: 600; }

/* Main */
.site-main { min-height: 60vh; padding: 32px 0; }

/* Hero */
.hero { text-align: center; padding: 48px 0 40px; }
.hero h1 { font-size: 2.2rem; font-weight: 800; letter-spacing: -1px; margin-bottom: 12px; }
.hero h1 .highlight { color: var(--primary); }
.hero p { font-size: 1.1rem; color: var(--text-secondary); margin-bottom: 28px; }
.hero-search { max-width: 560px; margin: 0 auto; display: flex; border: 2px solid var(--primary); border-radius: 28px; overflow: hidden; background: var(--bg-card); box-shadow: var(--shadow); }
.hero-search input { flex: 1; border: none; padding: 14px 24px; font-size: 1.05rem; background: transparent; color: var(--text); outline: none; }
.hero-search button { border: none; background: var(--primary); color: #fff; padding: 14px 28px; font-weight: 600; font-size: 1rem; cursor: pointer; transition: background var(--transition); }
.hero-search button:hover { background: var(--primary-hover); }
.hero-stats { display: flex; justify-content: center; gap: 32px; margin-top: 20px; }
.hero-stat { text-align: center; }
.hero-stat .num { font-size: 1.4rem; font-weight: 700; color: var(--primary); }
.hero-stat .label { font-size: 0.8rem; color: var(--text-muted); }

/* Section */
.section { margin-bottom: 48px; }
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.section-header h2 { font-size: 1.5rem; font-weight: 700; }
.section-header a { font-size: 0.9rem; font-weight: 500; }

/* Extension Cards Grid */
.ext-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.ext-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; transition: box-shadow var(--transition), transform var(--transition); display: flex; flex-direction: column; }
.ext-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.ext-card-top { display: flex; gap: 14px; margin-bottom: 12px; }
.ext-icon { width: 48px; height: 48px; border-radius: var(--radius-sm); object-fit: cover; background: var(--bg-alt); flex-shrink: 0; }
.ext-icon-placeholder { width: 48px; height: 48px; border-radius: var(--radius-sm); background: var(--bg-alt); display: flex; align-items: center; justify-content: center; font-size: 1.5rem; flex-shrink: 0; }
.ext-info h3 { font-size: 0.95rem; font-weight: 600; margin-bottom: 2px; line-height: 1.3; }
.ext-info h3 a { color: var(--text); }
.ext-info h3 a:hover { color: var(--primary); }
.ext-meta { display: flex; gap: 10px; align-items: center; font-size: 0.8rem; color: var(--text-muted); }
.ext-desc { font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 12px; flex: 1; line-height: 1.5; }
.ext-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { display: inline-block; padding: 3px 10px; font-size: 0.72rem; font-weight: 500; border-radius: 20px; background: var(--bg-alt); color: var(--text-secondary); border: 1px solid var(--border); }
.tag.ai { background: #4285F410; color: var(--primary); border-color: var(--primary); }

/* Stars */
.star { color: var(--accent-yellow); font-size: 0.85rem; }
.star.empty { color: var(--border); }
.star.half { background: linear-gradient(90deg, var(--accent-yellow) 50%, var(--border) 50%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }

/* Category Grid */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.cat-card { display: flex; align-items: center; gap: 12px; padding: 16px 18px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); transition: box-shadow var(--transition); }
.cat-card:hover { box-shadow: var(--shadow); color: var(--text); }
.cat-icon { font-size: 1.5rem; }
.cat-name { font-weight: 600; font-size: 0.9rem; color: var(--text); }
.cat-count { font-size: 0.75rem; color: var(--text-muted); }

/* Extension Detail Page */
.ext-detail { max-width: 900px; margin: 0 auto; }
.ext-detail-header { display: flex; gap: 24px; margin-bottom: 32px; align-items: flex-start; }
.ext-detail-icon { width: 96px; height: 96px; border-radius: var(--radius); object-fit: cover; background: var(--bg-alt); flex-shrink: 0; }
.ext-detail-info h1 { font-size: 1.8rem; font-weight: 700; margin-bottom: 4px; }
.ext-detail-info .developer { color: var(--text-secondary); font-size: 0.95rem; margin-bottom: 8px; }
.ext-detail-meta { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 16px; }
.meta-item { display: flex; align-items: center; gap: 6px; font-size: 0.9rem; color: var(--text-secondary); }
.meta-item strong { color: var(--text); }
.install-btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 28px; background: var(--primary); color: #fff; border-radius: 24px; font-weight: 600; font-size: 1rem; transition: background var(--transition); }
.install-btn:hover { background: var(--primary-hover); color: #fff; }

.ext-detail-body { margin-top: 32px; }
.ext-detail-body h2 { font-size: 1.2rem; font-weight: 600; margin-bottom: 12px; border-bottom: 1px solid var(--border); padding-bottom: 8px; }
.ext-detail-body .description { color: var(--text-secondary); line-height: 1.8; margin-bottom: 32px; white-space: pre-wrap; }

/* Screenshots */
.screenshots { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 12px; margin-bottom: 32px; }
.screenshots img { height: 200px; border-radius: var(--radius-sm); border: 1px solid var(--border); object-fit: cover; }

/* Similar Extensions */
.similar-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }

/* Search Results */
.search-header { margin-bottom: 24px; }
.search-header h1 { font-size: 1.5rem; }
.search-header .result-count { color: var(--text-muted); font-size: 0.9rem; }
.no-results { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.no-results h2 { font-size: 1.3rem; margin-bottom: 8px; color: var(--text); }

/* Pagination */
.pagination { display: flex; justify-content: center; gap: 6px; margin-top: 32px; flex-wrap: wrap; }
.pagination a, .pagination span { padding: 8px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 0.9rem; color: var(--text-secondary); }
.pagination a:hover { background: var(--bg-alt); color: var(--primary); }
.pagination .current { background: var(--primary); color: #fff; border-color: var(--primary); }

/* About */
.about-page { max-width: 700px; margin: 0 auto; }
.about-page h1 { font-size: 2rem; margin-bottom: 16px; }
.about-page p { color: var(--text-secondary); margin-bottom: 16px; line-height: 1.8; }

/* Footer */
.site-footer { background: var(--bg-alt); border-top: 1px solid var(--border); padding: 48px 0 24px; margin-top: 48px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; margin-bottom: 32px; }
.footer-col h4 { font-size: 0.95rem; font-weight: 600; margin-bottom: 12px; }
.footer-col a { display: block; color: var(--text-secondary); font-size: 0.85rem; margin-bottom: 6px; }
.footer-col a:hover { color: var(--primary); }
.footer-desc { font-size: 0.85rem; color: var(--text-muted); line-height: 1.6; }
.footer-bottom { border-top: 1px solid var(--border); padding-top: 16px; text-align: center; }
.footer-bottom p { font-size: 0.8rem; color: var(--text-muted); }
.footer-note { margin-top: 4px; font-size: 0.75rem; }

/* AI Badge */
.ai-badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; background: linear-gradient(135deg, #4285F4, #34A853); color: #fff; font-size: 0.7rem; font-weight: 600; border-radius: 10px; }

/* Responsive */
@media (max-width: 768px) {
    .main-nav { display: none; }
    .mobile-menu-btn { display: block; }
    .header-search { display: none; }
    .hero h1 { font-size: 1.6rem; }
    .hero-search { flex-direction: column; border-radius: var(--radius); }
    .hero-search input { padding: 14px 18px; }
    .hero-search button { padding: 14px; border-radius: 0; }
    .hero-stats { gap: 20px; }
    .ext-grid { grid-template-columns: 1fr; }
    .cat-grid { grid-template-columns: 1fr 1fr; }
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 24px; }
    .ext-detail-header { flex-direction: column; align-items: center; text-align: center; }
    .ext-detail-meta { justify-content: center; }
    .section-header { flex-direction: column; gap: 8px; align-items: flex-start; }
}

@media (max-width: 480px) {
    .cat-grid { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; }
    .hero-stats { flex-direction: column; gap: 8px; }
}
