* {
    box-sizing: border-box;
}

:root {
    /* Premium Light Theme (Slate-based) */
    --primary: #4f46e5;
    /* Indigo 600 */
    --primary-hover: #4338ca;
    /* Indigo 700 */
    --accent: #8b5cf6;
    /* Violet 500 */

    --bg: #ffffff;
    --surface: #f8fafc;
    /* Slate 50 */
    --surface-hover: #f1f5f9;
    /* Slate 100 */

    --text: #0f172a;
    /* Slate 900 */
    --text-muted: #64748b;
    /* Slate 500 */

    --border: #e2e8f0;
    /* Slate 200 */
    --radius: 12px;

    /* Typography */
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-family: var(--font-body);
    /* Fallback */

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

[data-theme="dark"] {
    /* Clean Solid Dark Theme */
    --primary: #818cf8;
    /* Indigo 400 */
    --primary-hover: #6366f1;
    --accent: #a78bfa;

    /* Single solid colors - No gradients */
    --bg: #111827;
    /* Gray 900 - Main Background (slightly lighter than nav) */
    --surface: #1f2937;
    /* Gray 800 - Cards/Surfaces */
    --surface-hover: #374151;
    /* Gray 700 */

    --text: #f9fafb;
    /* Gray 50 - High contrast text */
    --text-muted: #9ca3af;
    /* Gray 400 */

    --border: #374151;
    /* Gray 700 */

    /* Subtler shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.5);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.5);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.5);
}

/* --- Base --- */
body {
    transition: background-color 0.2s ease, color 0.2s ease;
    background-color: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    -webkit-font-smoothing: antialiased;
    margin: 0;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    letter-spacing: -0.02em;
    /* Tighten headings for modern feel */
}

/* Default Light Pattern */
body {
    background-color: var(--bg);
    background-image:
        radial-gradient(at 0% 0%, rgba(79, 70, 229, 0.05) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(139, 92, 246, 0.05) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(79, 70, 229, 0.05) 0px, transparent 50%),
        radial-gradient(at 0% 100%, rgba(139, 92, 246, 0.05) 0px, transparent 50%);
    background-size: 100% 100%;
    background-attachment: fixed;
}

body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background-image: url('bg.png');
    background-repeat: repeat;
    background-size: 25px;
    background-position: center;
    opacity: 0.1;
    /* High opacity within the mask */
    pointer-events: none;
    -webkit-mask-image: var(--spotlight-mask, radial-gradient(circle 0px at -100px -100px, transparent 100%));
    mask-image: var(--spotlight-mask, radial-gradient(circle 0px at -100px -100px, transparent 100%));
}

/* Dark Mode Background */
[data-theme="dark"] body {
    background-color: var(--bg);
    background-image:
        radial-gradient(at 0% 0%, rgba(79, 70, 229, 0.1) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(139, 92, 246, 0.1) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(79, 70, 229, 0.1) 0px, transparent 50%),
        radial-gradient(at 0% 100%, rgba(139, 92, 246, 0.1) 0px, transparent 50%);
    background-size: 100% 100%;
    background-attachment: fixed;
}

[data-theme="dark"] body::before {
    opacity: 0.15;
    /* Boosted for dark mode visibility */
    filter: invert(1) brightness(1.2);
    /* Make logos pop more */
}

/* --- Navigation --- */
nav {
    width: 100%;
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    transition: background-color 0.2s, border-color 0.2s;
}

[data-theme="dark"] nav {
    background: rgba(3, 7, 18, 0.7);
    /* Translucent very dark gray */
    backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px 32px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    /* Changed to give links more space and push right items to the end */
    gap: 32px;
    align-items: center;
}

.nav-links {
    display: flex;
    gap: 24px;
    align-items: center;
    justify-content: flex-start;
    /* Ensure links stay close to logo but with a gap */
}

.brand-logo {
    font-family: 'Outfit', sans-serif;
    font-size: 32px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
    text-decoration: none;
    display: flex;
    align-items: center;
}

.nav-links {
    display: flex;
    gap: 24px;
    align-items: center;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 14px;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: var(--primary);
}

.nav-right {
    display: flex;
    gap: 16px;
    align-items: center;
    justify-content: flex-end;
}

/* --- Search Bar --- */
/* --- Search Bar (Premium Design) --- */
.nav-search-container {
    position: relative;
    z-index: 200;
    display: flex;
    align-items: center;
    height: 36px;
    margin-top: 8px;
}

.nav-container .nav-search-input {
    background-color: #f1f5f9;
    /* Slate 100 - Visible but subtle */
    border: 1px solid #cbd5e1;
    /* Slate 300 - clearly defined border */
    border-radius: 12px;
    /* Modern rounded rect, not pill */
    padding: 0 16px 0 42px;
    /* Horizontal padding, vertical handled by height */
    height: 100%;
    font-size: 14px;
    font-weight: 500;
    width: 220px;
    /* Wider default */
    color: var(--text);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 14px center;
    background-size: 18px;
}

.nav-search-input:hover {
    background-color: #e2e8f0;
    /* Slate 200 */
    border-color: #94a3b8;
    /* Slate 400 */
    width: 230px;
}

.nav-search-input:focus {
    width: 340px;
    background-color: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.15), 0 10px 25px -5px rgba(0, 0, 0, 0.1);
}



[data-theme="dark"] .nav-search-input {
    background-color: #1e293b;
    /* Slate 800 */
    border-color: #334155;
    /* Slate 700 */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E");
    color: var(--text);
}

[data-theme="dark"] .nav-search-input:hover {
    background-color: #334155;
    /* Slate 700 */
    border-color: #64748b;
}

[data-theme="dark"] .nav-search-input:focus {
    background-color: #0f172a;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2), 0 10px 25px -5px rgba(0, 0, 0, 0.5);
}

/* --- Search Dropdown (Command Palette Style) --- */
.search-results {
    display: none;
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    width: 320px;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    /* Very subtle border */
    border-radius: 16px;
    /* Smooth corners */
    box-shadow:
        0 10px 15px -3px rgba(0, 0, 0, 0.1),
        0 4px 6px -2px rgba(0, 0, 0, 0.05),
        0 0 0 1px rgba(0, 0, 0, 0.02);
    /* Inner ring */
    max-height: 480px;
    overflow-y: auto;
    z-index: 200;
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
    transition:
        opacity 0.2s ease,
        transform 0.2s cubic-bezier(0.2, 0, 0, 1);
    padding: 6px;
}

[data-theme="dark"] .search-results {
    background: #1e293b;
    /* Slate 800 - distinct from bg */
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow:
        0 20px 25px -5px rgba(0, 0, 0, 0.5),
        0 8px 10px -6px rgba(0, 0, 0, 0.5);
}

.search-results.active {
    display: block;
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* Result Items */
.search-result-item {
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: none;
    /* Removed dividers */
    border-radius: 8px;
    /* Rounded items */
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s ease, transform 0.1s ease;
    margin-bottom: 2px;
}

.search-result-item:last-child {
    margin-bottom: 0;
}

.search-result-item:hover,
.search-result-item:focus {
    background: #f1f5f9;
    /* Slate 100 */
    transform: translateX(2px);
}

[data-theme="dark"] .search-result-item:hover,
[data-theme="dark"] .search-result-item:focus {
    background: #334155;
    /* Slate 700 */
}

/* Item Content */
.search-result-item h4 {
    margin: 0;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    line-height: 1.4;
}

.search-result-item span {
    display: none;
    /* Hide URL/Subtitle for cleaner look */
}

/* Optional: Add a fake icon via CSS */
.search-result-item::before {
    content: '';
    display: block;
    width: 28px;
    height: 28px;
    min-width: 28px;
    border-radius: 6px;
    background-color: rgba(79, 70, 229, 0.1);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%234338ca' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z'%3E%3C/path%3E%3C/svg%3E");
    /* Tool icon */
    background-repeat: no-repeat;
    background-position: center;
}

[data-theme="dark"] .search-result-item::before {
    background-color: rgba(129, 140, 248, 0.15);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23818cf8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z'%3E%3C/path%3E%3C/svg%3E");
}



/* --- Buttons --- */
@keyframes shine {
    0% {
        left: -100%;
        opacity: 0;
    }

    50% {
        opacity: 0.5;
    }

    100% {
        left: 100%;
        opacity: 0;
    }
}

.donate-btn-premium {
    height: 42px;
    padding: 0 24px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 99px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 8px 16px -4px rgba(79, 70, 229, 0.3);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
    text-decoration: none;
}

.donate-btn-premium::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: none;
}

.donate-btn-premium:hover::before {
    animation: shine 0.7s forwards;
}

.donate-btn-premium:hover {
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 12px 24px -6px rgba(79, 70, 229, 0.45);
    filter: brightness(1.1);
}

.donate-btn-premium:active {
    transform: translateY(-1px) scale(0.98);
}

.donate-btn-premium span {
    font-size: 18px;
    transition: transform 0.3s ease;
}

.donate-btn-premium:hover span {
    transform: rotate(15deg) scale(1.2);
}

/* Clean Nav Donate Button - Modern & Sleek */
.donate-btn-nav {
    height: 42px;
    /* Slightly taller for elegance */
    padding: 0 24px;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
    font-family: var(--font-heading);
}

.donate-btn-nav:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(79, 70, 229, 0.45);
    filter: brightness(1.05);
}

/* Ensure no icon/span affects layout */
.donate-btn-nav span,
.donate-btn-nav i,
.donate-btn-nav svg {
    display: none !important;
}


[data-theme="dark"] .donate-btn-nav {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.1);
    color: var(--text);
}

[data-theme="dark"] .donate-btn-nav:hover {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: white;
    border-color: transparent;
}

.donate-btn-premium.sm {
    height: auto;
    padding: 8px 16px;
    font-size: 13px;
    width: 100%;
    justify-content: center;
}

/* --- Cards & Surfaces --- */
.tool-card,
.feature-card,
.method-card,
.canvas-wrapper,
.support-option {
    background: var(--surface);
    border: 1px solid var(--border);
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

[data-theme="dark"] .tool-card,
[data-theme="dark"] .feature-card,
[data-theme="dark"] .method-card,
[data-theme="dark"] .canvas-wrapper {
    background: var(--surface);
    /* Solid Gray 800 */
}

.tool-card:hover,
.method-card:hover,
.support-option:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
}

/* --- Breadcrumbs --- */
.breadcrumbs-premium {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 32px;
    font-size: 14px;
    color: var(--text-muted);
    font-family: var(--font-body);
}

.breadcrumbs-premium a {
    text-decoration: none;
    color: var(--text-muted);
    transition: all 0.2s ease;
    font-weight: 500;
    display: flex;
    align-items: center;
}

.breadcrumbs-premium a:hover {
    color: var(--primary);
}

.breadcrumbs-premium .sep {
    color: var(--border);
    font-size: 12px;
    font-weight: 300;
}

.breadcrumbs-premium .current {
    color: var(--text);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

[data-theme="dark"] .breadcrumbs-premium .current {
    color: #f8fafc;
}

/* --- Cards & Surfaces --- */
[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3,
[data-theme="dark"] h4 {
    color: var(--text);
}

[data-theme="dark"] p,
[data-theme="dark"] li,
[data-theme="dark"] .page-label {
    color: var(--text-muted);
}

/* --- Inputs --- */
input[type="text"],
input[type="number"],
input[type="file"],
select,
textarea,
.custom-input {
    background-color: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
    transition: all 0.2s;
}

[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea {
    background-color: #111827;
    /* Matches body bg */
    border-color: var(--border);
    color: var(--text);
}

[data-theme="dark"] input:focus,
[data-theme="dark"] select:focus,
[data-theme="dark"] textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
    outline: none;
}

/* Drop Zone */
.drop-zone,
.upload-box {
    background: var(--surface);
    border: 2px dashed var(--border);
    transition: all 0.2s;
}

[data-theme="dark"] .drop-zone,
[data-theme="dark"] .upload-box {
    background: #1f2937;
}

[data-theme="dark"] .drop-zone:hover,
[data-theme="dark"] .upload-box:hover {
    background: #374151;
    border-color: var(--primary);
}

/* --- Modals --- */
/* --- Modals --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.donation-modal,
.support-modal {
    background: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 28px;
    padding: 40px;
    max-width: 440px;
    width: 90%;
    margin: 0 auto;
    position: relative;
    box-shadow:
        0 20px 25px -5px rgba(0, 0, 0, 0.1),
        0 8px 10px -6px rgba(0, 0, 0, 0.1),
        0 0 0 1px rgba(0, 0, 0, 0.02);
    transform: scale(0.95) translateY(10px);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.active .donation-modal,
.modal-overlay.active .support-modal {
    transform: scale(1) translateY(0);
}

[data-theme="dark"] .donation-modal,
[data-theme="dark"] .support-modal {
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow:
        0 25px 50px -12px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.05);
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 20px;
    background: transparent;
    border: none;
    font-size: 24px;
    color: var(--text-muted);
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.close-modal:hover {
    background: var(--surface-hover);
    color: var(--text);
}

.support-title {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 12px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-align: center;
}

.support-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
    margin-bottom: 24px;
}

.support-option {
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: 16px;
    padding: 16px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.support-option:hover {
    transform: translateY(-4px);
    border-color: var(--primary);
    box-shadow: 0 10px 15px -3px rgba(79, 70, 229, 0.1);
}

.support-option.selected {
    background: #f5f3ff;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.1);
}

[data-theme="dark"] .support-option.selected {
    background: rgba(79, 70, 229, 0.15);
}

.option-amount {
    font-size: 24px;
    font-weight: 800;
    color: var(--text);
    font-family: var(--font-heading);
}

.option-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.support-option.selected .option-amount {
    color: var(--primary);
}

.support-option.selected .option-label {
    color: var(--primary);
}

.donate-submit-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: white;
    border: none;
    border-radius: 16px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 10px 15px -3px rgba(79, 70, 229, 0.3);
    position: relative;
    overflow: hidden;
}

.donate-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 25px -5px rgba(79, 70, 229, 0.4);
    filter: brightness(1.1);
}

.donate-submit-btn:active {
    transform: translateY(-1px);
}

.support-description {
    color: var(--text-muted);
    font-size: 15px;
    margin-bottom: 32px;
    line-height: 1.6;
    opacity: 0.9;
    padding: 0 20px;
    text-align: center;
}

.custom-amount-container {
    margin-bottom: 24px;
}

.custom-amount-toggle {
    cursor: pointer;
    padding: 14px;
    background: var(--surface);
    border: 1px dashed var(--border);
    border-radius: 12px;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.2s;
    text-align: center;
}

.custom-amount-toggle:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--surface-hover);
}

.custom-amount-wrapper {
    display: none;
    margin-top: 12px;
}

.custom-amount-wrapper.visible {
    display: block;
    animation: fadeIn 0.2s ease-out;
}

.secure-payment-badge {
    margin-top: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.6;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Toggle Button --- */
.theme-toggle {
    background: transparent;
    border: none;
    color: var(--text-muted);
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-left: 4px;
}

.theme-toggle:hover {
    background: var(--surface-hover);
    color: var(--text);
}

.theme-toggle svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* --- Sections & Grids --- */
/* --- Layout --- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 24px;
    width: 100%;
    box-sizing: border-box;
}

.section-wrapper {
    padding: 60px 24px;
}

.section-inner {
    max-width: 1200px;
    margin: 0 auto;
}

.section-header {
    text-align: center;
    margin-bottom: 40px;
}

.section-header h2,
.section-title {
    font-size: 32px;
    color: var(--text);
    margin-bottom: 16px;
    font-weight: 800;
}

.section-title {
    font-size: 24px;
    margin: 40px 0 24px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.section-header p {
    color: var(--text-muted);
    font-size: 18px;
    max-width: 600px;
    margin: 0 auto;
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

/* Glass Section Style */
.glass-section {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.03) 0%, rgba(139, 92, 246, 0.03) 100%);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.hero {
    padding: 80px 24px;
    text-align: center;
    background: radial-gradient(circle at 50% 0%, rgba(79, 70, 229, 0.1) 0%, transparent 70%);
}

.hero h1 {
    font-size: 48px;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 16px;
    color: var(--text);
    line-height: 1.1;
}

.hero h1 span {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p.subtitle {
    font-size: 20px;
    color: var(--text-muted);
    margin-bottom: 40px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.cta-button {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: white;
    padding: 16px 40px;
    border-radius: 99px;
    font-size: 18px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 25px -5px rgba(79, 70, 229, 0.4);
    border: none;
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 30px -10px rgba(79, 70, 229, 0.5);
    filter: brightness(1.1);
}

.header-section {
    text-align: center;
    margin-bottom: 0;
    padding: 100px 0 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 25vh;
}

.header-section h1 {
    font-size: 48px;
    font-weight: 800;
    margin-bottom: 16px;
    text-align: center;
}

.header-section p {
    text-align: center;
    margin-bottom: 0;
    font-size: 18px;
    max-width: 600px;
}

.search-container {
    position: relative;
    max-width: 600px;
    width: 100%;
    margin: 40px auto 0;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.05));
}

.search-input {
    width: 100%;
    padding: 20px 24px 20px 64px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-size: 17px;
    font-weight: 500;
    outline: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-sm);
    box-sizing: border-box;
}

[data-theme="light"] .search-input {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    border-color: rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .search-input {
    background: rgba(31, 41, 55, 0.6);
    backdrop-filter: blur(10px);
}

.search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1), 0 20px 40px -10px rgba(0, 0, 0, 0.1);
    background: var(--bg);
    transform: translateY(-2px);
}

.search-input::placeholder {
    color: var(--text-muted);
    opacity: 0.6;
    transition: opacity 0.3s;
}

.search-input:focus::placeholder {
    opacity: 0.3;
}

.search-icon {
    position: absolute;
    left: 24px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    pointer-events: none;
}

.search-container:focus-within .search-icon {
    color: var(--primary);
    transform: translateY(-50%) scale(1.1);
}

.search-icon svg {
    width: 22px;
    height: 22px;
}

/* Fix double padding in tools page */
.container .section-wrapper {
    padding-top: 0;
    padding-left: 0;
    padding-right: 0;
}


.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

[data-theme="dark"] .glass-section {
    background: linear-gradient(135deg, rgba(129, 140, 248, 0.05) 0%, rgba(167, 139, 250, 0.05) 100%);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* Tool & Category Cards */
.tool-card,
.category-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    text-decoration: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.category-card {
    padding: 32px;
    text-align: center;
    align-items: center;
}

.tool-card:hover,
.category-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
    background: var(--surface-hover);
}

.tool-card h3,
.category-card h3 {
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
}

.category-card h3 {
    font-size: 20px;
}

.tool-card p,
.category-card p {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.5;
    margin: 0 0 16px 0;
}

.tool-card span {
    font-size: 13px;
    color: var(--primary);
    font-weight: 600;
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 4px;
}

.tool-card span::after {
    content: '→';
    transition: transform 0.2s;
}

.tool-card:hover span::after {
    transform: translateX(4px);
}

/* Footer */
[data-theme="dark"] footer {
    background: #030712;
    /* Matches Nav */
    border-top: 1px solid var(--border);
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    text-align: center;
}

.footer-col h4 {
    color: var(--text);
    font-weight: 700;
    margin-bottom: 24px;
}

.footer-col a {
    display: block;
    color: var(--text-muted);
    text-decoration: none;
    margin-bottom: 12px;
    transition: color 0.2s;
    font-size: 14px;
}

.footer-col a:hover {
    color: var(--primary);
}

.footer-copyright {
    margin-top: 60px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    width: 100%;
}

/* --- Responsive Nav --- */
@media (max-width: 768px) {
    .nav-container {
        padding: 16px;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 16px;
        padding-bottom: 24px;
    }

    .nav-links {
        order: 1;
        /* Links below logo */
        width: 100%;
        gap: 20px;
        justify-content: center;
        margin: 0;
    }

    .nav-right {
        order: 2;
        /* Actions below links */
        width: 100%;
        display: flex;
        flex-direction: row;
        /* Horizontal layout for actions */
        flex-wrap: wrap;
        gap: 12px;
        margin-left: 0;
        align-items: center;
        justify-content: center;
    }

    .nav-search-container {
        width: 100%;
        margin: 0;
        order: -1;
        /* Search at the top of the group */
    }

    .nav-search-input {
        width: 100% !important;
        height: 44px;
        /* Larger touch target */
        font-size: 16px;
        /* Prevents iOS auto-zoom */
    }

    .nav-search-input:focus {
        width: 100%;
    }

    .donate-btn-premium {
        width: auto;
        flex: 1;
        height: 40px;
        padding: 0 20px;
        justify-content: center;
        background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
        border: none;
        color: white;
        box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2);
    }

    .donate-btn-nav {
        width: auto;
        padding: 0 16px;
        margin-left: 0;
    }

    [data-theme="dark"] .donate-btn-premium {
        border-color: var(--primary);
        color: var(--primary);
    }

    .donate-btn-premium::before {
        display: none;
    }

    .theme-toggle {
        margin: 0 0 0 12px;
        width: 40px;
        height: 40px;
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: 99px;
    }

    /* Results can cover content on mobile */
    .search-results {
        width: 100%;
        left: 0;
        right: 0;
    }

    /* Global Layout Optimizations */
    .container,
    .section-wrapper,
    .article-container {
        padding: 32px 16px !important;
    }

    h1 {
        font-size: 28px !important;
        /* Slightly smaller for mobile headers */
        line-height: 1.2;
    }

    .hero {
        padding: 48px 16px;
    }

    .hero p.subtitle {
        font-size: 16px;
        margin-bottom: 32px;
    }

    /* Stack grid containers (categories/tools) on mobile */
    .grid-container,
    .tools-grid {
        grid-template-columns: 1fr !important;
        gap: 16px;
    }

    /* Stack footer columns on mobile */
    .footer-container {
        grid-template-columns: 1fr !important;
        gap: 32px;
        text-align: center;
    }
}


.notice-box {
    background-color: #e6fffa;
    color: #1e293b;
    /* Dark Slate for readability on light bg */
    padding: 24px;
    border-left: 4px solid #0070f3;
    border-radius: 12px;
    margin-bottom: 40px;
}

[data-theme="dark"] .notice-box {
    background-color: rgba(6, 182, 212, 0.1);
    /* Cyan-500 with low opacity */
    border-left-color: #06b6d4;
    /* Cyan-500 */
    color: #e2e8f0;
}

.notice-title {
    color: #0070f3;
    display: block;
    margin-bottom: 8px;
    font-weight: 700;
}

[data-theme="dark"] .notice-title {
    color: #22d3ee;
    /* Cyan-400 */
}

/* Feedback Button */
.feedback-btn {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: var(--surface);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border);
    padding: 10px 20px;
    border-radius: 99px;
    cursor: pointer;
    font-weight: 600;
    z-index: 900;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.feedback-btn:hover {
    transform: translateY(-2px);
    color: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.feedback-emoji-btn {
    font-size: 32px;
    background: none;
    border: none;
    cursor: pointer;
    transition: transform 0.2s;
    opacity: 0.5;
    filter: grayscale(1);
}

.feedback-emoji-btn:hover,
.feedback-emoji-btn.selected {
    transform: scale(1.2);
    opacity: 1;
    filter: grayscale(0);
}

/* Dark Mode Overrides */
[data-theme="dark"] .feedback-btn {
    background: var(--surface);
    /* Ensure surface color is used */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* --- Donation Nudge (Premium) --- */
.donation-nudge {
    display: none;
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1000;
    width: 380px;
    max-width: calc(100vw - 48px);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    animation: nudgeSlideUp 0.6s cubic-bezier(0.19, 1, 0.22, 1);
    backdrop-filter: blur(20px);
}

[data-theme="dark"] .donation-nudge {
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

@keyframes nudgeSlideUp {
    from {
        transform: translateY(100%) scale(0.9);
        opacity: 0;
    }

    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.nudge-content {
    padding: 24px;
    position: relative;
}

.nudge-icon {
    font-size: 32px;
    margin-bottom: 12px;
}

.nudge-text h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--text);
}

.nudge-text p {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.nudge-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: transparent;
    border: none;
    font-size: 20px;
    color: var(--text-muted);
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

.nudge-close:hover {
    background: var(--surface-hover);
    color: var(--text);
}

/* --- Global Feedback Button --- */
.feedback-btn {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 100;
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 10px 20px;
    border-radius: 99px;
    font-weight: 600;
    font-size: 14px;
    color: var(--text);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: var(--shadow-md);
    transition: all 0.2s;
}

.feedback-btn:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
    box-shadow: 0 8px 16px rgba(79, 70, 229, 0.15);
}

.feedback-emoji-btn {
    background: var(--surface);
    border: 1px solid var(--border);
    font-size: 24px;
    padding: 12px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    flex: 1;
}

.feedback-emoji-btn:hover,
.feedback-emoji-btn.selected {
    border-color: var(--primary);
    background: rgba(79, 70, 229, 0.05);
    transform: translateY(-2px);
}

@media (max-width: 768px) {
    .donation-nudge {
        bottom: 20px;
        right: 20px;
        left: 20px;
        width: auto;
    }

    .feedback-btn {
        display: none;
        /* Hide on mobile to avoid clutter */
    }
}

/* --- Premium Support Modal (Version 2.1) --- */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(2, 6, 23, 0.85);
    /* Darker backdrop */
    backdrop-filter: blur(16px);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.active {
    display: flex !important;
    opacity: 1;
}

.support-modal {
    padding: 48px 40px;
    border-radius: 32px;
    width: 95%;
    max-width: 420px;
    text-align: center;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow:
        0 40px 100px -20px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.05),
        inset 0 1px 1px rgba(255, 255, 255, 0.1);
    position: relative;
    transform: translateY(30px) scale(0.95);
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    color: #f8fafc;
    overflow: hidden;
}

.modal-overlay.active .support-modal {
    transform: translateY(0) scale(1);
}

.support-modal::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, rgba(99, 102, 241, 0.15) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.support-title {
    position: relative;
    z-index: 1;
    font-size: 32px;
    font-weight: 900;
    margin-bottom: 16px;
    background: linear-gradient(to right, #ffffff 0%, #a5b4fc 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-family: var(--font-heading);
    letter-spacing: -1px;
}

.support-description {
    position: relative;
    z-index: 1;
    color: #94a3b8;
    font-size: 16px;
    margin-bottom: 40px;
    line-height: 1.6;
    padding: 0 10px;
}

/* --- Support Options Grid --- */
.support-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}

.support-option {
    background: rgba(30, 41, 59, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 24px 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.support-option:hover {
    background: rgba(51, 65, 85, 0.6);
    border-color: rgba(99, 102, 241, 0.5);
    transform: translateY(-4px);
    box-shadow: 0 12px 24px -10px rgba(0, 0, 0, 0.3);
}

.support-option.selected {
    background: rgba(79, 70, 229, 0.2);
    border-color: #6366f1;
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.3);
}

.option-amount {
    font-size: 28px;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 4px;
}

.option-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #64748b;
    transition: color 0.3s;
}

.support-option:hover .option-label,
.support-option.selected .option-label {
    color: #a5b4fc;
}

/* --- Custom Amount UI --- */
.custom-amount-container {
    position: relative;
    z-index: 1;
    margin-bottom: 32px;
}

.custom-amount-toggle {
    cursor: pointer;
    padding: 18px;
    background: rgba(15, 23, 42, 0.3);
    border: 1px dashed rgba(148, 163, 184, 0.3);
    border-radius: 20px;
    color: #64748b;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    transition: all 0.3s;
}

.custom-amount-toggle:hover {
    background: rgba(15, 23, 42, 0.5);
    border-color: rgba(148, 163, 184, 0.6);
    color: #94a3b8;
}

.custom-input {
    width: 100%;
    padding: 18px;
    background: #020617;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    color: #ffffff;
    font-size: 20px;
    font-weight: 800;
    text-align: center;
    outline: none;
    transition: all 0.3s;
}

.custom-input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
}

/* --- Premium CTA Button --- */
.donate-submit-btn {
    position: relative;
    z-index: 1;
    width: 100%;
    padding: 20px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: #ffffff;
    border: none;
    border-radius: 18px;
    font-size: 20px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 10px 30px -10px rgba(99, 102, 241, 0.5);
}

.donate-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 40px -10px rgba(99, 102, 241, 0.6);
    filter: brightness(1.1);
}

.donate-submit-btn:active {
    transform: translateY(0);
}

/* --- Secure Badge --- */
.secure-payment-badge {
    position: relative;
    z-index: 1;
    margin-top: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #475569;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.secure-payment-badge svg {
    opacity: 0.5;
}

/* --- Refined Close Button --- */
.close-modal {
    position: absolute;
    top: 24px;
    right: 24px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: #94a3b8;
    cursor: pointer;
    font-size: 24px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    transition: all 0.3s;
    z-index: 10;
}

.close-modal:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    transform: rotate(90deg);
}

/* --- Version Tag --- */
.support-version {
    position: absolute;
    bottom: 12px;
    right: 20px;
    font-size: 10px;
    color: #334155;
    opacity: 0.5;
    letter-spacing: 1px;
}