/* Explain: CSS for overall page structure, header, footer, and responsive layouts. */
/* ---------- Header ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, .88);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 6px 20px rgba(108, 92, 231, .07);
}

.header-inner { display: flex; align-items: center; gap: 1.25rem; height: 68px; }

.brand {
    display: flex;
    align-items: center;
    gap: .6rem;
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.15rem;
    color: var(--text-color);
}

.brand-mark {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--brand-gradient);
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 1rem;
    box-shadow: 0 6px 14px rgba(108, 92, 231, .35);
}

.brand-name span { color: var(--secondary-color); }

.main-nav { display: none; gap: 1.5rem; margin-left: auto; }

.main-nav .nav-link {
    font-size: .95rem;
    font-weight: 500;
    color: var(--text-muted);
    transition: color .2s;
}

.main-nav .nav-link:hover { color: var(--primary-color); }

.header-search {
    display: none;
    align-items: center;
    gap: .5rem;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    padding: .42rem .9rem;
    background: var(--surface-color);
}

.header-search input {
    border: none;
    background: transparent;
    outline: none;
    font-size: .9rem;
    width: 165px;
    color: var(--text-color);
}

.header-search i { color: var(--text-muted); font-size: .85rem; }

.header-search { flex: 0 1 auto; }
.header-search input { min-width: 0; width: 140px; }
.main-nav { flex-wrap: nowrap; }
.main-nav .nav-link { white-space: nowrap; }

.menu-toggle {
    margin-left: auto;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: #fff;
    color: var(--text-color);
    font-size: 1.05rem;
    cursor: pointer;
}

@media (min-width: 1024px) {
    .main-nav { display: flex; }
    .header-search { display: flex; }
    .menu-toggle { display: none; }
}

.mobile-drawer {
    border-top: 1px solid var(--border-color);
    background: #fff;
}

.mobile-drawer .container { display: flex; flex-direction: column; gap: .15rem; padding-top: 1rem; padding-bottom: 1.35rem; }

.mobile-link { padding: .8rem .5rem; font-weight: 600; border-radius: 10px; }
.mobile-link:hover { background: var(--surface-color); color: var(--primary-color); }

.mobile-search {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-top: .6rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: .55rem .8rem;
    background: var(--surface-color);
}

.mobile-search input { flex: 1; border: none; background: transparent; outline: none; font-size: .95rem; }

/* ---------- Hero ---------- */
.hero {
    padding: 3rem 0 2rem;
    background: var(--hero-gradient);
}

.hero-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1.15rem;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    background: #fff;
    border: 1px solid var(--border-color);
    color: var(--primary-color);
    font-size: .82rem;
    font-weight: 600;
    padding: .45rem 1rem;
    border-radius: 999px;
    box-shadow: var(--shadow-sm);
}

.hero-sub { max-width: 620px; color: var(--text-muted); font-size: 1.05rem; }

.hero-search {
    display: flex;
    align-items: center;
    gap: .5rem;
    width: 100%;
    max-width: 620px;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    padding: .4rem .4rem .4rem 1.1rem;
    box-shadow: var(--shadow-md);
    margin-top: .4rem;
}

.hero-search i { color: var(--text-muted); }
.hero-search input { flex: 1; border: none; outline: none; background: transparent; font-size: 1rem; padding: .55rem 0; min-width: 0; color: var(--text-color); }
.hero-search .btn-primary { border-radius: 999px; padding: .6rem 1.4rem; }

.hero-chips { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; margin-top: .4rem; }

.stats-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; padding-top: 3.5rem; }
@media (min-width: 768px) { .stats-row { grid-template-columns: repeat(4, 1fr); } }

.stat {
    text-align: center;
    padding: 1.25rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: #fff;
}

.stat .n { font-family: var(--font-heading); font-size: 1.75rem; font-weight: 800; color: var(--primary-color); }
.stat .l { font-size: .85rem; color: var(--text-muted); }

/* ---------- Tool page layout ---------- */
.tool-head { margin-bottom: 1.75rem; max-width: 72ch; }
.tool-head p { margin-top: .6rem; font-size: 1.02rem; color: var(--text-muted); }

.tool-grid {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: 1fr;
    margin-bottom: 2.5rem;
}

@media (min-width: 900px) {
    .tool-grid { grid-template-columns: 1fr 1fr; }
}

.tool-info { margin-bottom: 2.5rem; }
.related { margin-top: 1rem; }

/* ---------- Footer ---------- */
.site-footer {
    background: linear-gradient(160deg, #231a5c 0%, #43308f 52%, #0c7a74 100%);
    color: #c3c9e6;
    padding: 3rem 0 0;
    margin-top: 3rem;
}

.footer-grid { display: grid; gap: 2rem; grid-template-columns: 1fr; }
@media (min-width: 768px) { .footer-grid { grid-template-columns: 1.5fr 1fr 1fr 1fr; } }

.site-footer h4 { color: #fff; font-size: .95rem; margin-bottom: .9rem; font-family: var(--font-heading); }
.site-footer a { color: #c3c9e6; font-size: .9rem; display: block; padding: .25rem 0; transition: color .2s, transform .2s; }
.site-footer a:hover { color: #fff; }

.site-footer .brand { color: #fff; }
.site-footer .brand-name span { color: #57e0cf; }
.footer-desc { font-size: .9rem; margin-top: .9rem; max-width: 34ch; line-height: 1.6; }

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, .14);
    margin-top: 2.5rem;
    padding: 1.25rem 0;
    font-size: .85rem;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

/* ---------- Joyful accent details ---------- */
.stat { transition: transform .25s ease, box-shadow .25s ease; }
.stat:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }

.stats-row > :nth-child(1) { background: linear-gradient(170deg, #ffffff 42%, #efeaff); }
.stats-row > :nth-child(2) { background: linear-gradient(170deg, #ffffff 42%, #e2f2ff); }
.stats-row > :nth-child(3) { background: linear-gradient(170deg, #ffffff 42%, #dcf7f3); }
.stats-row > :nth-child(4) { background: linear-gradient(170deg, #ffffff 42%, #ffe9e0); }

.stats-row > :nth-child(1) .n { color: #6c5ce7; }
.stats-row > :nth-child(2) .n { color: #1f8fe0; }
.stats-row > :nth-child(3) .n { color: #00a99a; }
.stats-row > :nth-child(4) .n { color: #ff7a59; }

.hero-chips .chip { transition: transform .2s ease, box-shadow .2s ease; }
.hero-chips .chip:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }