:root {
    --bg: #f6f7fb;
    --surface: rgba(255, 255, 255, 0.92);
    --surface-solid: #ffffff;
    --surface-soft: #f1f2f8;
    --text: #171927;
    --muted: #6c7085;
    --line: #e5e7f0;
    --primary: #6d5dfc;
    --primary-dark: #5546e8;
    --primary-soft: #edeaff;
    --shadow: 0 20px 60px rgba(42, 39, 92, 0.10);
    --shadow-hover: 0 24px 70px rgba(42, 39, 92, 0.17);
    --danger: #d94655;
    --success: #178f5d;
    --warning: #b96c08;
    --radius-xl: 28px;
    --radius-lg: 20px;
    --radius-md: 14px;
}

[data-theme="dark"] {
    --bg: #0c0e16;
    --surface: rgba(23, 25, 38, 0.92);
    --surface-solid: #171926;
    --surface-soft: #202332;
    --text: #f5f5fa;
    --muted: #a4a8bb;
    --line: #2e3244;
    --primary: #897cff;
    --primary-dark: #a399ff;
    --primary-soft: #292541;
    --shadow: 0 22px 70px rgba(0, 0, 0, 0.28);
    --shadow-hover: 0 28px 80px rgba(0, 0, 0, 0.42);
    --danger: #ff7d8a;
    --success: #5dd39e;
    --warning: #ffc266;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at 10% 0%, rgba(109, 93, 252, 0.11), transparent 30%),
        radial-gradient(circle at 95% 15%, rgba(43, 197, 220, 0.09), transparent 24%),
        var(--bg);
    color: var(--text);
    font-family: "Poppins", system-ui, sans-serif;
    transition: background-color .25s ease, color .25s ease;
}

button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    width: min(1240px, calc(100% - 32px));
    margin: 16px auto 0;
    padding: 12px 14px 12px 18px;
    border: 1px solid color-mix(in srgb, var(--line), transparent 18%);
    border-radius: 18px;
    background: color-mix(in srgb, var(--surface-solid), transparent 12%);
    box-shadow: 0 10px 35px rgba(20, 20, 50, 0.08);
    backdrop-filter: blur(18px);
}

.brand, .header-actions, .back-link, .theme-toggle { display: flex; align-items: center; }
.brand { gap: 12px; min-width: 0; }
.brand-icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 13px;
    color: #fff;
    background: linear-gradient(135deg, var(--primary), #9d58ec);
    box-shadow: 0 10px 25px rgba(109, 93, 252, .28);
}
.brand strong, .brand small { display: block; }
.brand strong { font-size: 1rem; line-height: 1.2; }
.brand small { margin-top: 2px; color: var(--muted); font-size: .72rem; }
.header-actions { gap: 10px; }
.back-link, .theme-toggle {
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    color: var(--text);
    background: var(--surface-solid);
    cursor: pointer;
    transition: transform .2s ease, border-color .2s ease, background .2s ease;
}
.back-link:hover, .theme-toggle:hover { transform: translateY(-2px); border-color: var(--primary); }

main { width: min(1240px, calc(100% - 32px)); margin: 0 auto; }

.hero {
    position: relative;
    overflow: visible;
    min-height: auto;
    margin-top: 16px;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    isolation: isolate;
}
.hero::before,
.hero-glow { display: none; }
.hero-content {
    max-width: none;
    padding: 4px 2px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}
.hero-main {
    flex: 1;
    min-width: 0;
}
.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--primary-dark);
    font-size: .78rem;
    font-weight: 600;
    letter-spacing: .02em;
}
.hero h1 {
    margin: 6px 0 5px;
    font-size: clamp(1.35rem, 2.6vw, 2.1rem);
    line-height: 1.12;
    letter-spacing: -.04em;
}
.hero h1 span {
    color: transparent;
    background: linear-gradient(90deg, var(--primary), #bb53d6, #2bbfce);
    background-clip: text;
    -webkit-background-clip: text;
}
.hero p {
    max-width: 760px;
    margin: 0;
    color: var(--muted);
    font-size: .92rem;
    line-height: 1.6;
}
.hero-stats {
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
    margin-top: 0;
    flex: 0 0 auto;
}
.hero-stats div {
    min-width: 112px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: color-mix(in srgb, var(--surface-solid), transparent 8%);
    backdrop-filter: blur(10px);
    text-align: left;
}
.hero-stats strong, .hero-stats span { display: block; }
.hero-stats strong { font-size: 1.05rem; }
.hero-stats span { margin-top: 2px; color: var(--muted); font-size: .75rem; }

.tools-section { padding: 34px 0 30px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
.section-heading h2 { margin: 6px 0 0; font-size: clamp(1.55rem, 2.8vw, 2.4rem); letter-spacing: -.035em; }
.tool-search {
    display: flex;
    align-items: center;
    gap: 10px;
    width: min(340px, 100%);
    padding: 0 15px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface-solid);
    box-shadow: 0 8px 25px rgba(22, 22, 60, .05);
}
.tool-search i { color: var(--muted); }
.tool-search input { width: 100%; height: 48px; border: 0; outline: 0; color: var(--text); background: transparent; }

.category-filter { display: flex; flex-wrap: wrap; gap: 9px; margin-bottom: 28px; }
.filter-button {
    padding: 10px 16px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    background: var(--surface-solid);
    cursor: pointer;
    transition: .2s ease;
}
.filter-button:hover { color: var(--primary); border-color: var(--primary); }
.filter-button.active { color: #fff; border-color: var(--primary); background: var(--primary); box-shadow: 0 10px 22px rgba(109, 93, 252, .22); }

.tool-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; align-items: start; }
.calculator-card {
    overflow: hidden;
    padding: 26px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow);
    backdrop-filter: blur(16px);
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.calculator-card:hover { transform: translateY(-5px); border-color: color-mix(in srgb, var(--primary), var(--line) 56%); box-shadow: var(--shadow-hover); }
.calculator-card[hidden] { display: none; }
.card-header { display: flex; gap: 16px; align-items: flex-start; min-height: 116px; }
.card-icon {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: 54px;
    height: 54px;
    border-radius: 16px;
    color: #fff;
    font-size: 1.2rem;
    box-shadow: 0 10px 24px rgba(24, 24, 55, .15);
}
.card-icon.purple { background: linear-gradient(135deg, #695cf4, #9c5de5); }
.card-icon.orange { background: linear-gradient(135deg, #f18b36, #f05462); }
.card-icon.blue { background: linear-gradient(135deg, #3978eb, #35b9df); }
.card-icon.green { background: linear-gradient(135deg, #18a978, #54c680); }
.card-icon.pink { background: linear-gradient(135deg, #dc5ca5, #8c65e7); }
.card-icon.red { background: linear-gradient(135deg, #eb4b5d, #e28a3d); }
.card-icon.cyan { background: linear-gradient(135deg, #149da9, #3cc3dd); }
.card-icon.yellow { background: linear-gradient(135deg, #d99b22, #efc34b); }
.card-number { color: var(--primary); font-size: .72rem; font-weight: 700; letter-spacing: .1em; }
.card-header h3 { margin: 4px 0 6px; font-size: 1.22rem; }
.card-header p { margin: 0; color: var(--muted); font-size: .86rem; line-height: 1.55; }
.calculator-form { padding-top: 22px; border-top: 1px solid var(--line); }
.field-grid { display: grid; gap: 14px; }
.field-grid.two-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field > span { font-size: .78rem; font-weight: 600; }
.field small { color: var(--muted); font-size: .7rem; }
.field input, .field select {
    width: 100%;
    min-width: 0;
    height: 46px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    outline: none;
    color: var(--text);
    background: var(--surface-soft);
    transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
.field input:focus, .field select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary), transparent 84%); background: var(--surface-solid); }
.input-unit { display: flex; align-items: stretch; min-width: 0; }
.input-unit input { border-radius: 12px 0 0 12px; }
.input-unit b, .input-unit select {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    min-width: 52px;
    height: 46px;
    margin-left: -1px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: 0 12px 12px 0;
    color: var(--muted);
    background: var(--surface-soft);
    font-size: .72rem;
    font-weight: 600;
}
.input-unit select { width: auto; outline: none; cursor: pointer; }
.calculate-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    width: 100%;
    min-height: 48px;
    margin-top: 18px;
    border: 0;
    border-radius: 13px;
    color: #fff;
    background: linear-gradient(135deg, var(--primary), #865fe8);
    box-shadow: 0 12px 24px rgba(109, 93, 252, .23);
    cursor: pointer;
    font-weight: 600;
    transition: transform .2s ease, box-shadow .2s ease;
}
.calculate-button:hover { transform: translateY(-2px); box-shadow: 0 15px 30px rgba(109, 93, 252, .30); }
.calculate-button:active { transform: translateY(0); }

.result-panel {
    position: relative;
    min-height: 84px;
    margin-top: 18px;
    padding: 16px;
    border: 1px dashed color-mix(in srgb, var(--primary), var(--line) 58%);
    border-radius: 14px;
    background: color-mix(in srgb, var(--primary-soft), transparent 22%);
}
.result-placeholder { display: flex; align-items: center; min-height: 50px; color: var(--muted); font-size: .8rem; }
.result-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.result-item { padding: 10px 11px; border: 1px solid color-mix(in srgb, var(--line), transparent 18%); border-radius: 11px; background: color-mix(in srgb, var(--surface-solid), transparent 10%); }
.result-item span, .result-item strong { display: block; }
.result-item span { color: var(--muted); font-size: .68rem; }
.result-item strong { margin-top: 3px; overflow-wrap: anywhere; font-size: .92rem; }
.result-note { grid-column: 1 / -1; margin: 2px 0 0; color: var(--muted); font-size: .7rem; line-height: 1.55; }
.result-error { display: flex; align-items: flex-start; gap: 9px; color: var(--danger); font-size: .8rem; line-height: 1.5; }
.result-warning { color: var(--warning); }
.result-success { color: var(--success); }

.empty-state { padding: 70px 20px; border: 1px dashed var(--line); border-radius: var(--radius-lg); text-align: center; background: var(--surface); }
.empty-state i { color: var(--primary); font-size: 2rem; }
.empty-state h3 { margin: 16px 0 6px; }
.empty-state p { margin: 0; color: var(--muted); }
.info-section { padding: 46px 0 90px; }
.info-card { display: flex; gap: 18px; padding: 24px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface-solid); box-shadow: var(--shadow); }
.info-icon { display: grid; place-items: center; flex: 0 0 auto; width: 48px; height: 48px; border-radius: 15px; color: var(--primary); background: var(--primary-soft); }
.info-card h2 { margin: 0 0 7px; font-size: 1.05rem; }
.info-card p { margin: 0; color: var(--muted); font-size: .84rem; line-height: 1.7; }
.site-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    width: min(1240px, calc(100% - 32px));
    margin: 0 auto;
    padding: 24px 0 34px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: .8rem;
}
.site-footer p { margin: 0; }
.site-footer a:hover { color: var(--primary); }
.toast { position: fixed; right: 20px; bottom: 20px; z-index: 100; max-width: 360px; padding: 12px 16px; border-radius: 12px; color: #fff; background: #222536; box-shadow: 0 15px 40px rgba(0,0,0,.25); opacity: 0; pointer-events: none; transform: translateY(12px); transition: .25s ease; font-size: .78rem; }
.toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 900px) {
    .tool-grid { grid-template-columns: 1fr; }
    .hero-content { align-items: stretch; flex-direction: column; padding: 0; gap: 14px; }
    .hero-stats { width: 100%; flex-wrap: wrap; }
    .hero-stats div { flex: 1 1 140px; }
    .section-heading { align-items: stretch; flex-direction: column; }
    .tool-search { width: 100%; }
}

@media (max-width: 620px) {
    .site-header, main, .site-footer { width: min(100% - 20px, 1240px); }
    .site-header { margin-top: 10px; padding: 10px; }
    .brand small, .back-link span, .theme-toggle span { display: none; }
    .back-link, .theme-toggle { width: 42px; padding: 0; }
    .header-actions { gap: 7px; }
    .hero { margin-top: 12px; }
    .hero-content { padding: 0; gap: 12px; }
    .hero h1 { margin-top: 6px; font-size: 1.35rem; }
    .hero p { font-size: .86rem; line-height: 1.55; }
    .hero-stats { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
    .hero-stats div { min-width: 0; padding: 10px 12px; }
    .hero-stats strong { font-size: .92rem; }
    .hero-stats span { font-size: .68rem; }
    .tools-section { padding-top: 24px; }
    .category-filter { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 5px; scrollbar-width: none; }
    .category-filter::-webkit-scrollbar { display: none; }
    .filter-button { flex: 0 0 auto; }
    .calculator-card { padding: 20px; border-radius: 18px; }
    .card-header { min-height: 0; margin-bottom: 20px; }
    .card-icon { width: 48px; height: 48px; border-radius: 14px; }
    .field-grid.two-columns { grid-template-columns: 1fr; }
    .result-grid { grid-template-columns: 1fr; }
    .result-note { grid-column: 1; }
    .info-card { align-items: flex-start; }
    .site-footer { align-items: flex-start; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

/* ===== Açık temada seçili kategori görünürlüğü ===== */
.filter-button.active {
    color: #5546e8 !important;
    border-color: #8d7fff !important;
    background-color: #edeaff !important;
    background-image: linear-gradient(135deg, #f5f2ff, #e8e3ff) !important;
    box-shadow: 0 7px 18px rgba(109, 93, 252, 0.16) !important;
    font-weight: 600;
}

.filter-button.active::before {
    content: "✓";
    display: inline-block;
    margin-right: 7px;
    color: #6d5dfc;
    font-size: 0.82em;
    font-weight: 800;
}

[data-theme="dark"] .filter-button.active {
    color: #ffffff !important;
    border-color: #897cff !important;
    background-color: #6d5dfc !important;
    background-image: linear-gradient(135deg, #6d5dfc, #865fe8) !important;
    box-shadow: 0 9px 22px rgba(109, 93, 252, 0.28) !important;
}

[data-theme="dark"] .filter-button.active::before {
    color: #ffffff;
}

/* ===== ULTRA KOMPAKT TANITIM ALANI ===== */
.hero.hero-compact {
    min-height: 0;
    margin-top: 18px;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    isolation: auto;
}
.hero.hero-compact::before,
.hero.hero-compact .hero-glow { display: none; }
.hero.hero-compact .hero-content {
    max-width: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    padding: 22px 4px 18px;
    border-bottom: 1px solid var(--line);
}
.hero.hero-compact .hero-copy { min-width: 0; }
.hero.hero-compact .eyebrow { font-size: .76rem; }
.hero.hero-compact h1 {
    margin: 6px 0 5px;
    font-size: clamp(1.45rem, 2.5vw, 2.2rem);
    line-height: 1.08;
    letter-spacing: -.04em;
    white-space: nowrap;
}
.hero.hero-compact p {
    max-width: 760px;
    font-size: .88rem;
    line-height: 1.5;
}
.hero.hero-compact .hero-stats {
    flex: 0 0 auto;
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    margin: 0;
}
.hero.hero-compact .hero-stats div {
    min-width: 76px;
    padding: 8px 10px;
    text-align: center;
    border-radius: 11px;
    background: var(--surface-solid);
    box-shadow: none;
}
.hero.hero-compact .hero-stats strong { font-size: .95rem; }
.hero.hero-compact .hero-stats span { font-size: .64rem; }
.tools-section { padding-top: 34px; }

@media (max-width: 820px) {
    .hero.hero-compact .hero-content {
        align-items: flex-start;
        gap: 14px;
        padding: 16px 2px 14px;
    }
    .hero.hero-compact h1 {
        font-size: clamp(1.25rem, 5.5vw, 1.7rem);
        white-space: normal;
    }
    .hero.hero-compact p { font-size: .8rem; }
    .hero.hero-compact .hero-stats div { min-width: 62px; padding: 7px 8px; }
}

@media (max-width: 620px) {
    .hero.hero-compact .hero-content { display: block; }
    .hero.hero-compact .hero-stats { margin-top: 12px; }
    .hero.hero-compact .hero-stats div { flex: 1; }
    .tools-section { padding-top: 24px; }
}

/* ===== ULTRA KOMPAKT TANITIM ALANI v2 ===== */
.hero.compact-hero {
    min-height: 0 !important;
    margin-top: 14px !important;
    overflow: visible !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    isolation: auto !important;
}
.hero.compact-hero::before,
.hero.compact-hero .hero-glow { display: none !important; }
.hero.compact-hero .hero-content {
    max-width: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 24px !important;
    padding: 18px 4px 16px !important;
    border-bottom: 1px solid var(--line);
}
.hero.compact-hero .hero-main { min-width: 0; }
.hero.compact-hero .eyebrow { font-size: .74rem !important; }
.hero.compact-hero h1 {
    margin: 5px 0 4px !important;
    font-size: clamp(1.35rem, 2.35vw, 2rem) !important;
    line-height: 1.08 !important;
    letter-spacing: -.04em !important;
    white-space: nowrap;
}
.hero.compact-hero p {
    max-width: 720px !important;
    margin: 0 !important;
    font-size: .84rem !important;
    line-height: 1.45 !important;
}
.hero.compact-hero .hero-stats {
    flex: 0 0 auto !important;
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 7px !important;
    margin: 0 !important;
}
.hero.compact-hero .hero-stats div {
    min-width: 72px !important;
    padding: 7px 9px !important;
    text-align: center;
    border-radius: 10px !important;
    background: var(--surface-solid) !important;
    box-shadow: none !important;
}
.hero.compact-hero .hero-stats strong { font-size: .9rem !important; }
.hero.compact-hero .hero-stats span { margin-top: 0 !important; font-size: .61rem !important; }
.tools-section { padding-top: 28px !important; }

@media (max-width: 820px) {
    .hero.compact-hero .hero-content {
        align-items: flex-start !important;
        gap: 12px !important;
        padding: 14px 2px 13px !important;
    }
    .hero.compact-hero h1 {
        font-size: clamp(1.18rem, 5vw, 1.55rem) !important;
        white-space: normal;
    }
    .hero.compact-hero p { font-size: .78rem !important; }
    .hero.compact-hero .hero-stats div { min-width: 58px !important; padding: 6px 7px !important; }
}

@media (max-width: 620px) {
    .hero.compact-hero .hero-content { display: block !important; }
    .hero.compact-hero .hero-stats { margin-top: 10px !important; }
    .hero.compact-hero .hero-stats div { flex: 1; }
    .tools-section { padding-top: 20px !important; }
}
