/* ============================================================
   DailyTools — premium dark utility site
   Goal: high trust, high repeat usage, stable ad inventory
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
    --bg: #07080b;
    --bg-2: #0b0d12;
    --surface: rgba(255,255,255,0.035);
    --surface-2: rgba(255,255,255,0.055);
    --surface-3: rgba(255,255,255,0.08);
    --input: #10131c;
    --text: #f7f8f8;
    --text-2: #d0d6e0;
    --muted: #8a8f98;
    --faint: #62666d;
    --accent: #7170ff;
    --accent-2: #38bdf8;
    --accent-hover: #8b8aff;
    --green: #3ddc84;
    --yellow: #f7c948;
    --red: #ff6b6b;
    --border: rgba(255,255,255,0.08);
    --border-2: rgba(255,255,255,0.13);
    --shadow: 0 24px 80px rgba(0,0,0,.42);
    --radius-sm: 8px;
    --radius: 14px;
    --radius-lg: 22px;
    --container: 1240px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    min-height: 100vh;
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-feature-settings: "cv01", "ss03";
    background:
        radial-gradient(circle at 20% 0%, rgba(113,112,255,.16), transparent 34rem),
        radial-gradient(circle at 82% 10%, rgba(56,189,248,.10), transparent 32rem),
        linear-gradient(180deg, #08090d 0%, #07080b 55%, #050609 100%);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
    opacity: .028;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.container { width: min(100% - 40px, var(--container)); margin-inline: auto; }
a { color: inherit; }

/* Header */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(7,8,11,.76);
    backdrop-filter: blur(18px) saturate(160%);
    border-bottom: 1px solid rgba(255,255,255,.06);
}
.header .container { min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.03em;
}
.logo::before {
    content: '';
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    box-shadow: 0 0 30px rgba(113,112,255,.75);
}
nav { display: flex; align-items: center; gap: 6px; }
nav a {
    color: var(--muted);
    text-decoration: none;
    font-size: .88rem;
    font-weight: 520;
    padding: 8px 12px;
    border-radius: 999px;
    transition: color .18s ease, background .18s ease;
}
nav a:hover, .nav-active { color: var(--text) !important; background: rgba(255,255,255,.055) !important; }

/* Hero */
.hero {
    position: relative;
    padding: 92px 0 38px;
    text-align: center;
}
.hero-kicker, .eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-2);
    background: rgba(255,255,255,.045);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 7px 12px;
    font-size: .78rem;
    font-weight: 600;
    margin-bottom: 22px;
}
.hero h1 {
    max-width: 920px;
    margin: 0 auto 18px;
    font-size: clamp(2.35rem, 6vw, 5rem);
    line-height: .98;
    letter-spacing: -0.065em;
    font-weight: 650;
}
.subtitle {
    color: var(--muted);
    max-width: 720px;
    margin: 0 auto 28px;
    font-size: clamp(1rem, 1.8vw, 1.22rem);
}
.hero-actions { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; margin-bottom: 30px; }
.btn-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-radius: 999px;
    padding: 11px 18px;
    text-decoration: none;
    border: 1px solid var(--border);
    color: var(--text-2);
    background: rgba(255,255,255,.035);
    font-weight: 600;
    font-size: .92rem;
}
.btn-link.primary { background: var(--accent); color: #fff; border-color: transparent; box-shadow: 0 18px 44px rgba(113,112,255,.28); }
.btn-link:hover { border-color: var(--border-2); color: var(--text); transform: translateY(-1px); }
.trust-row { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; color: var(--faint); font-size: .84rem; }
.trust-pill { border: 1px solid var(--border); background: rgba(255,255,255,.025); border-radius: 999px; padding: 6px 10px; }

/* Stable ad blocks */
.ad-banner {
    position: relative;
    width: 100%;
    max-width: 760px;
    min-height: 118px;
    margin: 22px auto 42px;
    padding: 22px 16px 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.02));
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.ad-banner::before {
    content: 'Advertisement';
    position: absolute;
    top: 7px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--faint);
    font-size: 10px;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.ad-banner ins { display: block !important; max-width: 100% !important; overflow: hidden !important; }
.ad-banner iframe { max-width: 100% !important; }
.ad-banner:empty::after, .ad-banner .ad-placeholder {
    content: 'Ad space reserved';
    color: var(--faint);
    font-size: .82rem;
}

/* Sections */
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin: 34px 0 18px; }
.section-head h2, .monetize-section h2, .donate-section h2 { font-size: clamp(1.55rem, 3vw, 2.25rem); letter-spacing: -0.045em; line-height: 1.05; }
.section-head p { color: var(--muted); max-width: 560px; }

.tools-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 34px;
}
.tool-card {
    min-height: 178px;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: var(--text);
    background: linear-gradient(180deg, rgba(255,255,255,.055), rgba(255,255,255,.025));
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    transition: transform .22s ease, border-color .22s ease, background .22s ease, box-shadow .22s ease;
}
.tool-card::before {
    content: '';
    position: absolute;
    inset: -1px;
    background: radial-gradient(460px circle at var(--mouse-x, 50%) var(--mouse-y, 0%), rgba(113,112,255,.18), transparent 42%);
    opacity: 0;
    transition: opacity .22s ease;
}
.tool-card:hover { transform: translateY(-4px); border-color: rgba(113,112,255,.38); box-shadow: var(--shadow); background: linear-gradient(180deg, rgba(255,255,255,.075), rgba(255,255,255,.035)); }
.tool-card:hover::before { opacity: 1; }
.tool-card .icon, .tool-card h3, .tool-card p { position: relative; z-index: 1; }
.tool-card .icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    margin-bottom: 18px;
    background: rgba(255,255,255,.055);
    color: var(--text);
    font-size: 1.35rem;
    font-family: 'JetBrains Mono', monospace;
}
.tool-card h3 { font-size: 1.02rem; line-height: 1.18; letter-spacing: -0.025em; margin-bottom: 8px; }
.tool-card p { color: var(--muted); font-size: .86rem; line-height: 1.45; }

.feature-strip, .seo-panel, .feed-card {
    background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.022));
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
    margin: 22px 0;
}
.feature-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.feature-item strong { display: block; font-size: 1.3rem; letter-spacing: -0.04em; margin-bottom: 4px; }
.feature-item span { color: var(--muted); font-size: .86rem; }
.feed-card { display: flex; align-items: center; justify-content: space-between; gap: 18px; text-decoration: none; color: var(--text); }
.feed-card p { color: var(--muted); margin-top: 4px; }
.seo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 18px; }
.seo-grid div { background: rgba(255,255,255,.03); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.seo-grid h3 { letter-spacing: -0.025em; margin-bottom: 8px; }
.seo-grid p { color: var(--muted); font-size: .9rem; }

/* Tool page */
.tool-page { padding: 42px 0 0; }
.back-link { display: inline-flex; color: var(--muted); text-decoration: none; font-size: .88rem; margin-bottom: 18px; }
.back-link:hover { color: var(--text); }
.tool-page h1 { font-size: clamp(2rem, 4vw, 3.2rem); line-height: 1; letter-spacing: -0.055em; margin-bottom: 10px; }
.tool-intro, .tool-page > p { color: var(--muted); max-width: 720px; }
.tool-workspace { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; margin: 22px 0; }
.tool-panel {
    background: linear-gradient(180deg, rgba(255,255,255,.055), rgba(255,255,255,.025));
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 22px;
    min-width: 0;
}
.tool-panel:focus-within { border-color: rgba(113,112,255,.42); box-shadow: 0 0 0 3px rgba(113,112,255,.12); }
.tool-panel label { display: block; color: var(--muted); font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 10px; }
textarea, input[type="text"], input[type="number"], select {
    width: 100%;
    background: var(--input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    padding: 13px 14px;
    font-size: .93rem;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    transition: border-color .18s ease, box-shadow .18s ease;
}
textarea { min-height: 260px; resize: vertical; line-height: 1.6; }
textarea:focus, input:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(113,112,255,.16); }
select { width: auto; font-family: 'Inter', sans-serif; }
.options-row { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; margin: 12px 0; }
.options-row label { display: inline-flex; align-items: center; gap: 7px; color: var(--text-2); font-size: .9rem; text-transform: none; letter-spacing: 0; margin: 0; }
input[type="checkbox"] { accent-color: var(--accent); width: 16px; height: 16px; }

.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.btn {
    appearance: none;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 10px 16px;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-weight: 650;
    color: var(--text);
    background: rgba(255,255,255,.045);
    transition: transform .18s ease, background .18s ease, border-color .18s ease;
}
.btn:hover { transform: translateY(-1px); border-color: var(--border-2); background: rgba(255,255,255,.07); }
.btn-primary { background: var(--accent); border-color: transparent; color: #fff; }
.btn-copy { background: var(--green); border-color: transparent; color: #05100a; }
.btn-donate { background: #ff813f; color: white; text-decoration: none; }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; margin: 16px 0; }
.stat-box { background: rgba(255,255,255,.035); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; text-align: center; }
.stat-value { display: block; color: var(--accent-2); font-size: 1.55rem; font-weight: 700; letter-spacing: -0.04em; }
.stat-label { color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; }
.output-area { min-height: 64px; background: var(--input); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px; font-family: 'JetBrains Mono', monospace; white-space: pre-wrap; word-break: break-word; }
.qr-result { text-align: center; margin: 20px 0; }
.qr-result img { max-width: 240px; background: white; padding: 14px; border-radius: 18px; }
.markdown-preview { max-height: 560px; overflow: auto; line-height: 1.8; }
.markdown-preview h1, .markdown-preview h2, .markdown-preview h3 { margin: 20px 0 8px; }
.markdown-preview code, .markdown-preview pre { background: var(--input); border-radius: 8px; }
.markdown-preview code { padding: 2px 6px; }
.markdown-preview pre { padding: 16px; overflow-x: auto; }

/* Monetization */
.monetize-section { margin: 58px 0; }
.monetize-section > p { color: var(--muted); }
.affiliate-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 20px; }
.affiliate-card {
    display: flex;
    flex-direction: column;
    min-height: 188px;
    padding: 20px;
    text-decoration: none;
    color: var(--text);
    background: rgba(255,255,255,.035);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: transform .2s ease, border-color .2s ease, background .2s ease;
}
.affiliate-card:hover { transform: translateY(-3px); border-color: rgba(247,201,72,.38); background: rgba(255,255,255,.055); }
.aff-icon { font-size: 1.7rem; margin-bottom: 12px; }
.affiliate-card h3 { margin-bottom: 8px; letter-spacing: -0.025em; }
.affiliate-card p { color: var(--muted); font-size: .86rem; flex: 1; }
.aff-cta { color: var(--yellow); margin-top: 14px; font-weight: 650; }
.donate-section { text-align: center; padding: 34px; margin: 40px 0; background: rgba(255,255,255,.035); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.donate-section p { color: var(--muted); margin: 10px auto 18px; max-width: 640px; }
.affiliate-sidebar { margin-top: 18px; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius); background: rgba(255,255,255,.03); }
.affiliate-sidebar h4 { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 8px; }
.affiliate-sidebar a { display: block; color: var(--text-2); text-decoration: none; padding: 6px 0; font-size: .88rem; }
.affiliate-sidebar a:hover { color: var(--yellow); }

/* Feed */
.feed-page { padding: 42px 0; }
.feed-header { text-align: center; margin-bottom: 26px; }
.feed-header h1 { font-size: clamp(2rem, 4vw, 3.4rem); line-height: 1; letter-spacing: -0.055em; }
.feed-header small { color: var(--muted); }
.feed-filters { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-bottom: 24px; }
.filter-btn { border: 1px solid var(--border); background: rgba(255,255,255,.035); color: var(--muted); border-radius: 999px; padding: 8px 14px; cursor: pointer; }
.filter-btn.active, .filter-btn:hover { color: var(--text); border-color: var(--border-2); background: rgba(255,255,255,.07); }
.feed-list { display: flex; flex-direction: column; gap: 10px; }
.feed-item { display: flex; gap: 14px; padding: 17px; border: 1px solid var(--border); border-radius: var(--radius); background: rgba(255,255,255,.032); }
.feed-item:hover { background: rgba(255,255,255,.052); }
.feed-icon { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: rgba(255,255,255,.055); flex: 0 0 auto; }
.feed-title { color: var(--text); text-decoration: none; font-weight: 650; }
.feed-title:hover { color: var(--accent-2); }
.feed-meta { display: flex; gap: 12px; flex-wrap: wrap; color: var(--muted); font-size: .78rem; margin-top: 6px; }
.feed-source { color: var(--accent-2); font-weight: 700; }
.feed-desc { color: var(--muted); font-size: .88rem; margin-top: 7px; }

.footer { margin-top: 70px; padding: 34px 0; border-top: 1px solid var(--border); color: var(--muted); text-align: center; font-size: .84rem; }
.footer a { color: var(--text-2); text-decoration: none; }
.toast { position: fixed; right: 22px; bottom: 22px; background: var(--green); color: #031007; padding: 12px 18px; border-radius: 999px; font-weight: 700; opacity: 0; transform: translateY(8px); pointer-events: none; transition: .25s ease; z-index: 1000; }
.toast.show { opacity: 1; transform: translateY(0); }
.error-page { text-align: center; padding: 100px 0; }
.error-page h1 { font-size: 7rem; letter-spacing: -0.08em; }
.strength-strong { color: var(--green); }
.strength-medium { color: var(--yellow); }
.strength-weak { color: var(--red); }

@media (max-width: 1100px) {
    .tools-grid { grid-template-columns: repeat(3, 1fr); }
    .affiliate-grid { grid-template-columns: repeat(2, 1fr); }
    .feature-strip, .seo-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
    .container { width: min(100% - 28px, var(--container)); }
    .header .container { min-height: 58px; }
    .logo { font-size: .95rem; }
    nav a { font-size: .8rem; padding: 7px 8px; }
    .hero { padding: 58px 0 28px; }
    .tools-grid, .tool-workspace, .affiliate-grid, .feature-strip, .seo-grid { grid-template-columns: 1fr; }
    .tool-card { min-height: 150px; }
    .section-head, .feed-card { display: block; }
    .ad-banner { min-height: 112px; margin-bottom: 28px; border-radius: 12px; }
    textarea { min-height: 220px; }
}

/* Tool help content */
.tool-help-panel {
    margin: 28px 0 10px;
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: rgba(255,255,255,.03);
}
.tool-help-panel h2 {
    font-size: 1.25rem;
    letter-spacing: -0.035em;
    margin-bottom: 8px;
}
.tool-help-panel p {
    color: var(--muted);
    max-width: 760px;
}

/* Multilingual and ad refinements */
.language-switcher { display: flex; align-items: center; gap: 8px; }
.language-switcher label { color: var(--faint); font-size: .76rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.language-switcher select { max-width: 190px; padding: 7px 10px; border-radius: 999px; font-size: .82rem; background: rgba(255,255,255,.04); }
.latest-feed-panel, .tool-seo-panel {
    background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.022));
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
    margin: 26px 0;
}
.section-head.compact { margin-top: 0; }
.latest-feed-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.latest-feed-item { text-decoration: none; color: var(--text); border: 1px solid var(--border); border-radius: var(--radius); background: rgba(255,255,255,.03); padding: 14px; min-height: 150px; display: flex; flex-direction: column; gap: 8px; }
.latest-feed-item:hover { border-color: var(--border-2); background: rgba(255,255,255,.055); }
.latest-feed-item strong { font-size: .88rem; line-height: 1.35; }
.latest-feed-item small { color: var(--muted); margin-top: auto; }
.ad-banner .ad-placeholder { position: absolute; pointer-events: none; }
.ad-banner ins[data-ad-status="filled"] + .ad-placeholder { display: none; }
[dir="rtl"] .header .container, [dir="rtl"] .section-head, [dir="rtl"] .feed-card { direction: rtl; }
@media (max-width: 1100px) { .latest-feed-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 760px) { .header .container { flex-wrap: wrap; } .language-switcher { width: 100%; justify-content: flex-end; } .latest-feed-grid { grid-template-columns: 1fr; } }

/* FAQ and SEO content blocks */
.tool-seo-panel ul { color: var(--muted); padding-left: 18px; margin-top: 8px; }
.tool-seo-panel li { margin: 6px 0; }
.faq-list { margin-top: 24px; }
.faq-list h2 { margin-bottom: 12px; }
.faq-list details { border: 1px solid var(--border); border-radius: var(--radius); background: rgba(255,255,255,.025); padding: 14px 16px; margin-bottom: 10px; }
.faq-list summary { cursor: pointer; font-weight: 700; color: var(--text); }
.faq-list p { color: var(--muted); margin-top: 10px; }
.tool-dynamic-input input { margin-bottom: 8px; }

/* Fix native select contrast on dark header */
.language-switcher select,
.language-switcher select:focus {
    color: var(--text) !important;
    background-color: #10131c !important;
    border-color: var(--border-2) !important;
    color-scheme: dark;
}
.language-switcher select option {
    color: #111827 !important;
    background-color: #ffffff !important;
}
