/* ============================================
   WhatsApp Tools Hub – Design System & Styles
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
    --wa-green: #25D366;
    --wa-green-dark: #128C7E;
    --wa-green-light: #DCF8C6;
    --wa-teal: #075E54;
    --primary: #25D366;
    --primary-hover: #1ebe5a;
    --primary-glow: rgba(37, 211, 102, 0.3);
    --bg: #f0f2f5;
    --bg-card: #ffffff;
    --bg-card-hover: #f8faf9;
    --bg-input: #ffffff;
    --bg-header: rgba(255, 255, 255, 0.85);
    --bg-output: #f7f9f8;
    --text: #1a1a2e;
    --text-secondary: #5a6072;
    --text-muted: #8e95a5;
    --border: #e0e3e8;
    --border-focus: #25D366;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.12);
    --shadow-card: 0 2px 12px rgba(0, 0, 0, 0.06);
    --shadow-card-hover: 0 8px 30px rgba(37, 211, 102, 0.15);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --max-width: 1100px;
}

/* --- Dark Mode --- */
[data-theme="dark"] {
    --bg: #0d1117;
    --bg-card: #161b22;
    --bg-card-hover: #1c2333;
    --bg-input: #1c2333;
    --bg-header: rgba(13, 17, 23, 0.9);
    --bg-output: #1c2333;
    --text: #e6edf3;
    --text-secondary: #a0aec0;
    --text-muted: #6b7a90;
    --border: #2d3748;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.4);
    --shadow-card: 0 2px 12px rgba(0, 0, 0, 0.2);
    --shadow-card-hover: 0 8px 30px rgba(37, 211, 102, 0.2);
}

/* --- Reset & Base --- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background var(--transition), color var(--transition);
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 16px;
}

/* --- Header --- */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--bg-header);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    transition: background var(--transition), border var(--transition);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
    gap: 12px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--wa-green);
    white-space: nowrap;
}

.logo i {
    font-size: 1.5rem;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-box {
    display: flex;
    align-items: center;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 6px 14px;
    gap: 8px;
    transition: border var(--transition), box-shadow var(--transition);
    width: 160px;
}

.search-box:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
    width: 220px;
}

.search-box i {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.search-box input {
    border: none;
    outline: none;
    background: transparent;
    font-family: var(--font);
    font-size: 0.85rem;
    color: var(--text);
    width: 100%;
}

.search-box input::placeholder {
    color: var(--text-muted);
}

.theme-toggle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text);
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

.theme-toggle:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    transform: rotate(20deg);
}

.mobile-menu-btn {
    display: none;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text);
    font-size: 1.1rem;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

/* --- Mobile Nav --- */
.mobile-nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.mobile-nav-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.mobile-nav {
    position: fixed;
    top: 0;
    right: -300px;
    width: 280px;
    height: 100vh;
    background: var(--bg-card);
    z-index: 1200;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.mobile-nav.active {
    right: 0;
}

.mobile-nav-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.mobile-nav-header .logo {
    font-size: 1.1rem;
}

.mobile-nav-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--bg);
    color: var(--text);
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-nav-links li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text);
    border-bottom: 1px solid var(--border);
    transition: all var(--transition);
}

.mobile-nav-links li a:hover,
.mobile-nav-links li a:active {
    background: var(--primary-glow);
    color: var(--primary);
}

.mobile-nav-links li a i {
    width: 20px;
    text-align: center;
    color: var(--primary);
}

/* --- Hero --- */
.hero {
    position: relative;
    padding: 120px 0 60px;
    overflow: hidden;
    background: linear-gradient(135deg, var(--wa-teal) 0%, var(--wa-green-dark) 50%, var(--wa-green) 100%);
    color: #fff;
    text-align: center;
}

.hero-bg-shapes {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.shape {
    position: absolute;
    border-radius: 50%;
    opacity: 0.1;
    background: #fff;
}

.shape-1 {
    width: 300px;
    height: 300px;
    top: -60px;
    right: -80px;
    animation: floatShape 8s ease-in-out infinite;
}

.shape-2 {
    width: 200px;
    height: 200px;
    bottom: -40px;
    left: -60px;
    animation: floatShape 10s ease-in-out infinite reverse;
}

.shape-3 {
    width: 150px;
    height: 150px;
    top: 40%;
    left: 60%;
    animation: floatShape 12s ease-in-out infinite 2s;
}

@keyframes floatShape {

    0%,
    100% {
        transform: translateY(0) scale(1);
    }

    50% {
        transform: translateY(-30px) scale(1.05);
    }
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    padding: 8px 20px;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 24px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.hero h1 {
    font-size: clamp(1.8rem, 5vw, 3rem);
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 16px;
}

.hero .gradient-text {
    background: linear-gradient(135deg, #fff 0%, var(--wa-green-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: clamp(0.95rem, 2.5vw, 1.15rem);
    opacity: 0.9;
    max-width: 520px;
    margin: 0 auto 32px;
    line-height: 1.7;
}

.hero-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    margin-bottom: 40px;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
}

.stat {
    text-align: center;
}

.stat-num {
    display: block;
    font-size: 1.5rem;
    font-weight: 800;
}

.stat-label {
    font-size: 0.8rem;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 25px var(--primary-glow);
}

.btn-secondary {
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    border-color: var(--primary);
    color: var(--primary);
}

.btn-outline {
    background: transparent;
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.4);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: #fff;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 1rem;
    border-radius: var(--radius-md);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.82rem;
}

.btn-block {
    width: 100%;
    justify-content: center;
}

/* --- Sections --- */
.section {
    padding: 60px 0;
}

.section-header {
    text-align: center;
    margin-bottom: 40px;
}

.section-title {
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 800;
    margin-bottom: 8px;
    color: var(--text);
}

.section-title i {
    color: var(--primary);
    margin-right: 8px;
}

.gradient-text {
    background: linear-gradient(135deg, var(--wa-green) 0%, var(--wa-green-dark) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-desc {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* --- Tools Grid --- */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
}

.tool-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 32px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    transition: all var(--transition);
    cursor: pointer;
}

.tool-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-card-hover);
    border-color: var(--primary);
}

.tool-icon {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--wa-green), var(--wa-green-dark));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    margin-bottom: 16px;
    transition: transform var(--transition);
}

.tool-card:hover .tool-icon {
    transform: scale(1.1) rotate(-5deg);
}

.tool-card h3 {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--text);
}

.tool-card p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Hide tool cards when search doesn't match */
.tool-card.hidden {
    display: none;
}

/* --- Tool Card Large (Tool Content) --- */
.tool-card-large {
    max-width: 600px;
    margin: 0 auto;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px 24px;
    box-shadow: var(--shadow-md);
    transition: background var(--transition), border var(--transition);
}

/* --- Forms --- */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 0.9rem;
    background: var(--bg-input);
    color: var(--text);
    transition: border var(--transition), box-shadow var(--transition);
    outline: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* --- Output Boxes --- */
.output-box {
    margin-top: 24px;
    padding: 20px;
    background: var(--bg-output);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    animation: fadeSlideIn 0.3s ease;
}

.output-box label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.output-link {
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    word-break: break-all;
    color: var(--primary);
    font-weight: 500;
    margin-bottom: 12px;
}

.output-text {
    padding: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--text);
    margin-bottom: 12px;
    white-space: pre-wrap;
}

.output-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

@keyframes fadeSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Emoji --- */
.emoji-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.emoji-cat-btn {
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}

.emoji-cat-btn:hover,
.emoji-cat-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(48px, 1fr));
    gap: 6px;
    max-height: 360px;
    overflow-y: auto;
    padding: 4px;
}

.emoji-item {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
    border: 1px solid transparent;
}

.emoji-item:hover {
    background: var(--primary-glow);
    border-color: var(--primary);
    transform: scale(1.2);
}

/* --- Fancy Text Results --- */
.fancy-results {
    margin-top: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    animation: fadeSlideIn 0.3s ease;
}

.fancy-result-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    background: var(--bg-output);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}

.fancy-result-item:hover {
    border-color: var(--primary);
}

.fancy-result-text {
    font-size: 1.05rem;
    flex: 1;
    word-break: break-word;
    color: var(--text);
}

.fancy-result-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

/* --- QR Code --- */
.qr-output {
    margin-top: 24px;
    text-align: center;
    animation: fadeSlideIn 0.3s ease;
}

.qr-code-container {
    display: inline-block;
    padding: 20px;
    background: #fff;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    margin-bottom: 12px;
}

.qr-code-container canvas,
.qr-code-container img {
    margin: 0 auto;
}

.qr-hint {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* --- Group Link Preview --- */
.group-link-preview {
    margin-bottom: 16px;
}

.group-link-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

.group-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--wa-green), var(--wa-green-dark));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.group-info h4 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 2px;
}

.group-info p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* --- Chat Button Preview --- */
.chatbtn-preview {
    position: relative;
    height: 120px;
    background: var(--bg);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    margin-bottom: 20px;
    overflow: hidden;
}

.chatbtn-preview-btn {
    position: absolute;
    bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: var(--wa-green);
    color: #fff;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4);
    animation: chatBtnBounce 2s ease-in-out infinite;
}

.chatbtn-preview-btn.right {
    right: 16px;
}

.chatbtn-preview-btn.left {
    left: 16px;
}

@keyframes chatBtnBounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-5px);
    }
}

.code-output {
    margin-bottom: 12px;
}

.code-output pre {
    background: #1e1e2e;
    color: #a6e3a1;
    padding: 16px;
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    overflow-x: auto;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-all;
}

/* --- Text Formatter --- */
.format-reference {
    padding: 16px;
    background: var(--bg-output);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
}

.format-reference h4 {
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.format-ref-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 8px;
}

.format-ref-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
}

.format-ref-syntax {
    font-family: 'Courier New', monospace;
    font-weight: 600;
    color: var(--primary);
    white-space: nowrap;
}

.format-ref-result {
    color: var(--text-secondary);
}

.format-ref-result code {
    font-family: 'Courier New', monospace;
    background: var(--bg-output);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.8rem;
}

.format-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 20px;
}

.fmt-btn {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text);
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

.fmt-btn:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    transform: translateY(-2px);
}

.fmt-preview {
    padding: 16px;
    background: #e5ded8;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    line-height: 1.7;
    color: #111;
    margin-bottom: 12px;
    min-height: 60px;
    border: 1px solid #d5cec8;
}

[data-theme="dark"] .fmt-preview {
    background: #1a2e1a;
    color: #e6edf3;
    border-color: #2d4a2d;
}

.fmt-preview strong {
    font-weight: 700;
}

.fmt-preview em {
    font-style: italic;
}

.fmt-preview s {
    text-decoration: line-through;
}

.fmt-preview code {
    font-family: 'Courier New', monospace;
    background: rgba(0, 0, 0, 0.08);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.85rem;
}

[data-theme="dark"] .fmt-preview code {
    background: rgba(255, 255, 255, 0.1);
}

.fmt-preview .wa-quote {
    border-left: 3px solid var(--wa-green);
    padding-left: 10px;
    margin: 4px 0;
    color: #555;
}

[data-theme="dark"] .fmt-preview .wa-quote {
    color: #a0aec0;
}

/* --- Footer --- */
.footer {
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    padding: 48px 0 24px;
    transition: background var(--transition), border var(--transition);
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
    margin-bottom: 32px;
}

.footer-col h4 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer-col h4 i {
    color: var(--primary);
}

.footer-col p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

.footer-col ul li a {
    display: block;
    padding: 4px 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
    transition: color var(--transition);
}

.footer-col ul li a:hover {
    color: var(--primary);
}

.footer-bottom {
    text-align: center;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.footer-bottom p {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* --- Toast --- */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #1e1e2e;
    color: #fff;
    padding: 12px 28px;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 500;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: transform 0.3s ease, opacity 0.3s ease;
    white-space: nowrap;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: all;
}

/* --- Back to Top --- */
.back-to-top {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: 0 4px 20px var(--primary-glow);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 900;
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
    transition: all var(--transition);
}

.back-to-top.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}

.back-to-top:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 25px var(--primary-glow);
}

/* --- Tool sections alternate bg --- */
.tool-section:nth-child(even) {
    background: var(--bg-card);
}

/* ==============================
   RESPONSIVE
   ============================== */
@media (max-width: 768px) {
    .search-box {
        display: none;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .hero {
        padding: 100px 0 48px;
    }

    .hero-stats {
        gap: 24px;
    }

    .stat-num {
        font-size: 1.2rem;
    }

    .tools-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .tool-card {
        padding: 20px 14px;
    }

    .tool-icon {
        width: 48px;
        height: 48px;
        font-size: 1.1rem;
        margin-bottom: 12px;
    }

    .tool-card h3 {
        font-size: 0.9rem;
    }

    .tool-card p {
        font-size: 0.78rem;
    }

    .tool-card-large {
        padding: 24px 16px;
    }

    .section {
        padding: 40px 0;
    }

    .section-header {
        margin-bottom: 28px;
    }

    .emoji-grid {
        grid-template-columns: repeat(auto-fill, minmax(42px, 1fr));
    }

    .emoji-item {
        width: 42px;
        height: 42px;
        font-size: 1.3rem;
    }

    .footer-grid {
        gap: 24px;
    }
}

@media (min-width: 769px) {
    .mobile-menu-btn {
        display: none;
    }

    .search-box {
        width: 200px;
        transition: width 0.3s ease, border var(--transition), box-shadow var(--transition);
    }

    .search-box:focus-within {
        width: 280px;
    }

    .footer-grid {
        grid-template-columns: 2fr 1fr 1fr 1fr;
    }
}

@media (min-width: 1024px) {
    .container {
        padding: 0 24px;
    }

    .hero {
        padding: 140px 0 80px;
    }

    .tools-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* --- Utility animations --- */
@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

/* Smooth appearance for tool sections when scrolled into view */
.tool-section {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.tool-section.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}