/* style.css - BunchTool Global CSS */
@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;500&family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    /* Dark Mode (Default) */
    --bg: #0a0a14;
    --surface: #12121a;
    --surface2: #1c1c28;
    --border: #2a2a3c;
    --text: #e8e8f0;
    --text2: #7878a0;
    --accent: #22d3ee;
    --accent-dim: rgba(34, 211, 238, 0.1);
    --success: #4ade80;
    --warning: #fbbf24;
    --danger: #f87171;
    --radius: 12px;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
    --transition: all 0.3s ease;
}

[data-theme="light"] {
    --bg: #f4f4fb;
    --surface: #ffffff;
    --surface2: #eeeef8;
    --border: #e0e0ee;
    --text: #111120;
    --text2: #666680;
    --accent: #0891b2;
    --accent-dim: rgba(8, 145, 178, 0.1);
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.05);
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Outfit', sans-serif;
    color: var(--text);
}

h1 { font-size: 3rem; font-weight: 800; line-height: 1.2; }
h2 { font-size: 2rem; font-weight: 700; margin-bottom: 1.5rem; }
h3 { font-size: 1.5rem; font-weight: 700; margin-bottom: 1rem; }
code { font-family: 'Fira Code', monospace; font-size: 0.9rem; }

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

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

/* --- Navbar --- */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: rgba(18, 18, 26, 0.85); /* surface with opacity */
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}
[data-theme="light"] .navbar {
    background-color: rgba(255, 255, 255, 0.85);
}

.navbar .nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}

.logo {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}
.logo span { color: var(--accent); }

.nav-search {
    flex: 1;
    max-width: 400px;
    margin: 0 20px;
    position: relative;
}
.nav-search input {
    width: 100%;
    padding: 10px 40px 10px 16px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: var(--surface2);
    color: var(--text);
    font-family: inherit;
    outline: none;
    transition: var(--transition);
}
.nav-search input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-dim);
}
.search-icon {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text2);
    pointer-events: none;
}

.nav-controls { display: flex; align-items: center; gap: 16px; }
.theme-toggle {
    background: transparent;
    border: none;
    color: var(--text);
    font-size: 1.2rem;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}
.theme-toggle:hover { background: var(--surface2); }
.menu-toggle { display: none; background: transparent; border: none; color: var(--text); font-size: 1.5rem; cursor: pointer; }

/* Desktop category nav */
.cat-nav-desktop {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none;
}
.cat-nav-desktop::-webkit-scrollbar { display: none; }
.cat-nav-desktop .container {
    display: flex;
    gap: 20px;
    padding: 12px 20px;
}
.cat-nav-desktop a {
    color: var(--text2);
    font-size: 0.9rem;
    font-weight: 500;
}
.cat-nav-desktop a:hover { color: var(--accent); }

/* --- Forms & Buttons --- */
.input, .textarea, .select {
    width: 100%;
    padding: 12px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-family: inherit;
    font-size: 1rem;
    outline: none;
    transition: var(--transition);
}
.input:focus, .textarea:focus, .select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-dim);
}
.textarea { min-height: 120px; resize: vertical; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius);
    font-family: inherit;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    text-align: center;
}
.btn-primary { background: var(--accent); color: #000; }
[data-theme="light"] .btn-primary { color: #fff; }
.btn-primary:hover { opacity: 0.9; transform: translateY(-2px); box-shadow: 0 4px 12px var(--accent-dim); }

.btn-secondary { background: var(--surface2); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--border); }

.btn-danger { background: var(--danger); color: #fff; }

.btn-icon { width: 40px; height: 40px; padding: 0; border-radius: 8px; }

/* --- Cards & Grids --- */
.tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    transition: var(--transition);
    position: relative;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: var(--text);
}
.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
    border-color: var(--accent);
}
.card-icon {
    font-size: 2.5rem;
    margin-bottom: 16px;
    display: inline-block;
}
.card-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 8px;
}
.card-desc {
    color: var(--text2);
    font-size: 0.9rem;
    margin-bottom: 20px;
    flex: 1;
}
.card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}
.badge {
    background: var(--surface2);
    color: var(--text2);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.usage-count {
    font-size: 0.8rem;
    color: var(--text2);
}
.card-btn {
    width: 100%;
    text-align: center;
    background: var(--surface2);
    color: var(--accent);
    padding: 10px;
    border-radius: 8px;
    font-weight: 600;
    transition: var(--transition);
}
.card:hover .card-btn {
    background: var(--accent);
    color: #000;
}
[data-theme="light"] .card:hover .card-btn { color: #fff; }

/* --- Adsense --- */
.ad-slot {
    background: var(--surface);
    border: 1px dashed var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text2);
    font-size: 0.9rem;
    margin: 40px auto;
    position: relative;
}
.ad-slot::after { content: 'Advertisement'; position: absolute; top: 4px; left: 8px; font-size: 0.7rem; opacity: 0.5; }
.ad-leaderboard { width: 100%; max-width: 728px; height: 90px; }
.ad-mid { width: 300px; height: 250px; }

/* --- Search Results overlay --- */
.search-results-box {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 12px 12px;
    max-height: 400px;
    overflow-y: auto;
    box-shadow: var(--shadow);
    display: none;
    z-index: 101;
}
.search-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    text-decoration: none;
}
.search-item:last-child { border-bottom: none; }
.search-item:hover { background: var(--surface2); }
.search-item-icon { font-size: 1.5rem; }

/* --- UI Elements --- */
.breadcrumb {
    margin: 20px 0;
    font-size: 0.9rem;
    color: var(--text2);
}
.breadcrumb a { color: var(--text2); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb span { margin: 0 8px; }

.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 12px 24px;
    background: var(--surface);
    border-left: 4px solid var(--accent);
    border-radius: 8px;
    box-shadow: var(--shadow);
    color: var(--text);
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 1000;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast.success { border-color: var(--success); }
.toast.error { border-color: var(--danger); }

/* --- Footer --- */
.site-footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 60px 0 20px;
    margin-top: 80px;
}
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}
.footer-col h4 { font-family: 'Outfit', sans-serif; font-size: 1.1rem; margin-bottom: 20px; color: var(--text); }
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 12px; }
.footer-col a { color: var(--text2); font-size: 0.95rem; }
.footer-col a:hover { color: var(--accent); }
.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    color: var(--text2);
    font-size: 0.9rem;
}

/* Tool Interface Layout */
.tool-header { text-align: center; margin-bottom: 40px; }
.tool-desc { color: var(--text2); font-size: 1.1rem; max-width: 600px; margin: 0 auto; }
.tool-workspace {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 30px;
    margin-bottom: 40px;
}
.result-box {
    background: var(--surface2);
    padding: 20px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    position: relative;
    min-height: 80px;
    word-break: break-word;
    white-space: pre-wrap;
    font-family: 'Outfit', sans-serif;
}
.result-box.code-output {
    font-family: 'Fira Code', monospace;
    font-size: 0.9rem;
}
.copy-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}
.copy-btn:hover { color: var(--accent); border-color: var(--accent); }

/* SEO Content Section */
.seo-content {
    max-width: 800px;
    margin: 60px auto;
}
.seo-content h2 { font-size: 1.8rem; margin-top: 40px; }
.seo-content h3 { font-size: 1.3rem; margin-top: 30px; }
.seo-content p, .seo-content li { color: var(--text2); margin-bottom: 16px; font-size: 1.05rem; }
.seo-content ul, .seo-content ol { margin-left: 24px; margin-bottom: 24px; }

/* --- Responsive --- */
@media (max-width: 768px) {
    .nav-search { display: none; }
    .menu-toggle { display: block; }
    .footer-grid { grid-template-columns: 1fr; text-align: center; }
    .cat-nav-desktop { display: none; }
    h1 { font-size: 2.2rem; }
    .tool-workspace { padding: 16px; }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .footer-grid { grid-template-columns: 1fr 1fr; }
}
