/* ============================================
   BOYGLE.COM — COMPLETE DESIGN SYSTEM
   ============================================ */

/* ---------- Theme Variables (Default: Soft Light) ---------- */
:root {
    --bg-body: #f8f6f3;
    --bg-card: #fdfcfa;
    --bg-header: #fdfcfa;
    --bg-footer: #1a1a2e;
    --bg-hero: #f0ece6;
    --text-primary: #1a1a2e;
    --text-secondary: #3d3d4a;
    --text-muted: #5a5a6a;
    --text-light: #d0d0d8;
    --border-color: #e8e6e1;
    --color-primary: #4a6fa5;
    --color-primary-hover: #3a5f95;
    --color-success: #5a8a6a;
    --color-warning: #c4875a;
    --color-danger: #a55a5a;
    --shadow-card: 0 2px 10px rgba(0,0,0,0.05);
    --shadow-hover: 0 4px 20px rgba(0,0,0,0.08);
    --radius: 12px;
    --radius-sm: 8px;
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ---------- Reset & Base ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--font-family);
    background: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.7;
    transition: background 0.3s, color 0.3s;
}
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
a { color: var(--color-primary); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--color-primary-hover); }
img { max-width: 100%; height: auto; }

/* ---------- Typography ---------- */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-primary);
}
h1 { font-size: 40px; }
h2 { font-size: 30px; }
h3 { font-size: 22px; }
h4 { font-size: 18px; }
p { color: var(--text-secondary); }

/* ---------- Buttons ---------- */
.btn {
    display: inline-block;
    padding: 12px 28px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s, transform 0.2s, box-shadow 0.3s;
    text-align: center;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
    background: var(--color-primary);
    color: #fff;
}
.btn-primary:hover {
    background: var(--color-primary-hover);
    box-shadow: 0 4px 15px rgba(74, 111, 165, 0.3);
}

.btn-success {
    background: var(--color-success);
    color: #fff;
}
.btn-success:hover { box-shadow: 0 4px 15px rgba(90, 138, 106, 0.3); }

.btn-danger {
    background: var(--color-danger);
    color: #fff;
}
.btn-danger:hover { box-shadow: 0 4px 15px rgba(165, 90, 90, 0.3); }

.btn-outline {
    background: transparent;
    border: 2px solid var(--border-color);
    color: var(--text-primary);
}
.btn-outline:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

/* ---------- Cards ---------- */
.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    padding: 24px;
    transition: all 0.3s;
    box-shadow: var(--shadow-card);
}
.card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}
.card-header { margin-bottom: 16px; }
.card-title { font-size: 20px; font-weight: 600; }
.card-body { color: var(--text-secondary); }
.card-footer { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border-color); }

/* ---------- Forms ---------- */
.form-group { margin-bottom: 20px; }
.form-label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-primary);
}
.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-family: var(--font-family);
    background: var(--bg-body);
    color: var(--text-primary);
    transition: border-color 0.3s, box-shadow 0.3s;
}
.form-control:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(74, 111, 165, 0.15);
}
textarea.form-control { resize: vertical; min-height: 120px; }
select.form-control { appearance: none; }

/* ---------- Header ---------- */
.site-header {
    background: var(--bg-header);
    border-bottom: 1px solid var(--border-color);
    padding: 16px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: background 0.3s;
}
.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}
.logo a {
    font-size: 26px;
    font-weight: 700;
    color: var(--text-primary);
}
.logo a:hover { color: var(--color-primary); }
.main-nav ul {
    display: flex;
    list-style: none;
    gap: 24px;
    flex-wrap: wrap;
}
.main-nav a {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 15px;
}
.main-nav a:hover { color: var(--color-primary); }
.theme-toggle {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    transition: background 0.3s;
}
.theme-toggle:hover { background: var(--border-color); }

/* ---------- Hero ---------- */
.hero {
    background: var(--bg-hero);
    padding: 60px 0 50px;
    text-align: center;
    transition: background 0.3s;
}
.hero h1 { margin-bottom: 8px; }
.hero-subtitle {
    font-size: 18px;
    color: var(--text-muted);
    margin-bottom: 28px;
}
.hero-search { max-width: 560px; margin: 0 auto; }
.hero-search form { display: flex; gap: 12px; }
.search-input { flex: 1; }
.search-button { padding: 14px 32px; }

/* ---------- Sections ---------- */
section { padding: 50px 0; }
section h2 { text-align: center; margin-bottom: 30px; }

/* ---------- Tools Grid ---------- */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}
.tool-card {
    text-align: center;
    padding: 24px 16px;
}
.tool-card .icon { font-size: 36px; margin-bottom: 10px; }
.tool-card .name { font-weight: 600; font-size: 16px; }

/* ---------- Categories Grid ---------- */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
}
.category-card {
    text-align: center;
    padding: 20px;
}
.category-card .icon { font-size: 28px; margin-bottom: 8px; }
.category-card .name { font-weight: 500; }

/* ---------- Features ---------- */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
}
.feature {
    background: var(--bg-card);
    padding: 28px 20px;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    text-align: center;
    transition: all 0.3s;
}
.feature:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-3px);
}
.feature h3 { font-size: 18px; margin-bottom: 6px; }
.feature p { font-size: 15px; color: var(--text-muted); }

/* ---------- FAQ ---------- */
.faq-list { max-width: 760px; margin: 0 auto; }
.faq-item {
    background: var(--bg-card);
    padding: 18px 24px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    margin-bottom: 12px;
}
.faq-item h3 { font-size: 17px; margin-bottom: 4px; }
.faq-item p { font-size: 15px; color: var(--text-muted); }

/* ---------- Footer ---------- */
.site-footer {
    background: var(--bg-footer);
    color: var(--text-light);
    padding: 40px 0 20px;
    margin-top: 40px;
    transition: background 0.3s;
}
.footer-inner {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 30px;
    margin-bottom: 24px;
}
.footer-col h4 { color: #fff; margin-bottom: 12px; font-size: 16px; }
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 6px; }
.footer-col ul li a { color: var(--text-light); font-size: 14px; }
.footer-col ul li a:hover { color: #fff; }
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.08);
    padding-top: 18px;
    text-align: center;
    font-size: 14px;
    color: var(--text-muted);
}

/* ---------- 404 Page ---------- */
.error-404 { text-align: center; padding: 60px 20px; }
.error-404 h1 { font-size: 80px; color: var(--color-primary); }
.error-404 h2 { font-size: 28px; margin-bottom: 8px; }
.error-404 p { font-size: 18px; color: var(--text-muted); margin-bottom: 28px; }
.error-404 .btn-group { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ---------- Flash Messages ---------- */
.flash-message {
    padding: 12px 0;
    text-align: center;
    font-weight: 500;
}
.flash-success { background: var(--color-success); color: #fff; }
.flash-error { background: var(--color-danger); color: #fff; }
.flash-warning { background: var(--color-warning); color: #fff; }
.flash-info { background: var(--color-primary); color: #fff; }

/* ---------- Responsive ---------- */
@media (max-width: 992px) {
    h1 { font-size: 34px; }
    h2 { font-size: 26px; }
    .hero { padding: 40px 0; }
}

@media (max-width: 768px) {
    h1 { font-size: 28px; }
    h2 { font-size: 22px; }
    .header-inner { flex-direction: column; gap: 8px; }
    .main-nav ul { gap: 16px; justify-content: center; }
    .hero-search form { flex-direction: column; }
    .hero-search form .btn { width: 100%; }
    section { padding: 30px 0; }
    .tools-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
    .categories-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
    .features-grid { grid-template-columns: 1fr 1fr; }
    .error-404 h1 { font-size: 56px; }
}

@media (max-width: 480px) {
    .features-grid { grid-template-columns: 1fr; }
    .footer-inner { grid-template-columns: 1fr; text-align: center; }
    .tools-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
    .categories-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
    .error-404 h1 { font-size: 42px; }
    .error-404 .btn-group { flex-direction: column; align-items: center; }
}/* ============================================
   HOMEPAGE TOOL CARDS (Phase 5)
   ============================================ */

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 24px;
}

.tool-card {
    display: block;
    text-align: center;
    padding: 24px 16px;
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    transition: all 0.3s;
    text-decoration: none;
    color: var(--text-primary);
    box-shadow: var(--shadow-card);
}

.tool-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
    border-color: var(--color-primary);
}

.tool-card.featured {
    border-color: var(--color-primary);
    background: linear-gradient(135deg, var(--bg-card), rgba(74, 111, 165, 0.05));
}

.tool-card-icon {
    font-size: 36px;
    margin-bottom: 10px;
    display: block;
}

.tool-card-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.tool-card-desc {
    font-size: 14px;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.4;
}

/* Categories Grid */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 20px;
}

.category-card {
    display: block;
    text-align: center;
    padding: 20px 16px;
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    transition: all 0.3s;
    text-decoration: none;
    color: var(--text-primary);
    box-shadow: var(--shadow-card);
}

.category-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
    border-color: var(--color-primary);
}

.category-icon {
    font-size: 30px;
    margin-bottom: 8px;
    display: block;
}

.category-name {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 2px;
}

.category-count {
    font-size: 13px;
    color: var(--text-muted);
}

/* Section spacing */
.homepage-tools,
.categories-section,
.featured-tools,
.recent-tools {
    padding: 40px 0;
}

.homepage-tools { background: var(--bg-body); }
.categories-section { background: var(--bg-hero); }
.featured-tools { background: var(--bg-body); }
.recent-tools { background: var(--bg-hero); }

/* Responsive */
@media (max-width: 768px) {
    .tools-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 16px;
    }
    .categories-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 14px;
    }
}

@media (max-width: 480px) {
    .tools-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 12px;
    }
    .categories-grid {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
        gap: 10px;
    }
    .tool-card { padding: 16px 12px; }
}