/* ==========================================================================
   hesapkur.com — tasarım sistemi
   ========================================================================== */
:root {
    --bg: #f6f8fa;
    --surface: #ffffff;
    --text: #1a2332;
    --text-muted: #5b6b7f;
    --primary: #0d6e5f;
    --primary-dark: #0a5a4e;
    --primary-soft: #e3f2ef;
    --accent: #d97706;
    --border: #dde4ec;
    --danger: #b42318;
    --success: #067647;
    --radius: 10px;
    --shadow: 0 1px 3px rgba(16, 24, 40, .08), 0 1px 2px rgba(16, 24, 40, .04);
    --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    font-size: 16px;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img, svg { max-width: 100%; }

.container { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* --- Header ------------------------------------------------------------ */
.site-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 50;
}
.site-header .container {
    display: flex; align-items: center; gap: 24px;
    height: 60px;
}
.logo {
    font-size: 22px; font-weight: 800; letter-spacing: -.5px;
    color: var(--text);
}
.logo:hover { text-decoration: none; }
.logo span { color: var(--primary); }
.main-nav { display: flex; gap: 4px; flex-wrap: wrap; margin-left: auto; }
.main-nav a {
    padding: 6px 12px; border-radius: 8px;
    color: var(--text-muted); font-size: 14.5px; font-weight: 500;
}
.main-nav a:hover { background: var(--primary-soft); color: var(--primary); text-decoration: none; }

/* --- Fiyat şeridi (ticker) ------------------------------------------------ */
.ticker {
    overflow: hidden;
    background: #10241f;
    color: #e7f2ef;
    margin: -32px -20px 24px;
    font-size: 13.5px;
    border-bottom: 2px solid var(--primary);
}
.ticker-track {
    display: inline-flex; gap: 28px;
    white-space: nowrap; padding: 8px 0;
    animation: ticker-scroll 60s linear infinite;
}
.ticker:hover .ticker-track { animation-play-state: paused; }
.ticker-item { display: inline-flex; gap: 6px; align-items: baseline; }
.ticker-item strong { color: #9fd4c8; font-weight: 600; }
@keyframes ticker-scroll {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

/* --- Piyasa tabloları -------------------------------------------------------- */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.updated-badge {
    display: inline-flex; align-items: center; gap: 8px;
    font-size: 13px; color: var(--text-muted);
    background: var(--surface); border: 1px solid var(--border);
    padding: 6px 12px; border-radius: 999px;
}
.live-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: #12b76a; display: inline-block;
    animation: live-pulse 2s ease-in-out infinite;
}
@keyframes live-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

.markets { display: grid; grid-template-columns: 1.2fr 1fr 0.9fr; gap: 16px; align-items: start; }
.market-col { display: flex; flex-direction: column; gap: 16px; }
.market-card { padding: 16px 18px; }
.market-card h2 { margin: 0 0 10px; font-size: 17px; }
table.rates { font-size: 14.5px; }
table.rates td, table.rates th { padding: 8px 10px; }
table.rates td:first-child a { color: var(--text); font-weight: 500; }
.chg { font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.chg-up { color: var(--success); }
.chg-down { color: var(--danger); }
.chg-flat { color: var(--text-muted); }

.converter-card .field { margin-bottom: 10px; }
.cv-result {
    font-size: 26px; font-weight: 800; color: var(--primary-dark);
    font-variant-numeric: tabular-nums; margin: 10px 0 14px;
}

@media (max-width: 980px) { .markets { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .markets { grid-template-columns: 1fr; } }

/* --- İçerik ------------------------------------------------------------- */
.page { padding: 32px 0 56px; }
h1 { font-size: clamp(26px, 4vw, 34px); letter-spacing: -.5px; line-height: 1.2; margin: 0 0 8px; }
.lead { color: var(--text-muted); font-size: 17px; margin: 0 0 28px; max-width: 720px; }
h2 { font-size: 22px; margin: 36px 0 12px; }

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
}
.grid { display: grid; gap: 16px; }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }

/* --- Kur kartları -------------------------------------------------------- */
.rate-card { display: flex; flex-direction: column; gap: 4px; transition: transform .12s ease; }
.rate-card:hover { transform: translateY(-2px); text-decoration: none; }
.rate-card .name { color: var(--text-muted); font-size: 14px; font-weight: 600; }
.rate-card .value { font-size: 26px; font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; }
.rate-card .date { color: var(--text-muted); font-size: 12.5px; }

/* --- Hesaplayıcı kartları ------------------------------------------------ */
.tool-card { display: block; }
.tool-card:hover { text-decoration: none; border-color: var(--primary); }
.tool-card .icon { font-size: 26px; }
.tool-card h3 { margin: 8px 0 4px; font-size: 17px; color: var(--text); }
.tool-card p { margin: 0; color: var(--text-muted); font-size: 14px; }

/* --- Formlar ------------------------------------------------------------- */
.calc-form { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 160px; flex: 1; }
.field label { font-size: 13.5px; font-weight: 600; color: var(--text-muted); }
.field input, .field select {
    padding: 11px 14px; font-size: 16px;
    border: 1px solid var(--border); border-radius: 8px;
    background: var(--surface); color: var(--text);
    width: 100%;
}
.field input:focus, .field select:focus {
    outline: 2px solid var(--primary); outline-offset: -1px; border-color: var(--primary);
}
.btn {
    display: inline-block; padding: 11px 22px;
    background: var(--primary); color: #fff;
    border: 0; border-radius: 8px; font-size: 15.5px; font-weight: 600;
    cursor: pointer; font-family: var(--font);
}
.btn:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--bg); }
.btn-danger { background: var(--danger); }
.btn-sm { padding: 6px 12px; font-size: 13.5px; }

/* --- Sonuç kutusu --------------------------------------------------------- */
.result-box {
    background: var(--primary-soft);
    border: 1px solid var(--primary);
    border-radius: var(--radius);
    padding: 22px 24px;
    margin: 24px 0;
}
.result-box .big { font-size: 32px; font-weight: 800; color: var(--primary-dark); font-variant-numeric: tabular-nums; }
.result-box .sub { color: var(--text-muted); font-size: 14px; }

/* --- Tablolar -------------------------------------------------------------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); }
table.data { width: 100%; border-collapse: collapse; font-size: 14.5px; }
table.data th, table.data td { padding: 10px 14px; text-align: right; white-space: nowrap; }
table.data th:first-child, table.data td:first-child { text-align: left; }
table.data thead th {
    background: var(--bg); color: var(--text-muted);
    font-size: 12.5px; text-transform: uppercase; letter-spacing: .4px;
    border-bottom: 1px solid var(--border);
}
table.data tbody tr:not(:last-child) td { border-bottom: 1px solid var(--border); }
table.data td { font-variant-numeric: tabular-nums; }

/* --- Sparkline / rozetler --------------------------------------------------- */
.sparkline { width: 100%; height: 120px; display: block; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; }
.badge-success { background: #e6f4ee; color: var(--success); }
.badge-error { background: #fdecea; color: var(--danger); }
.badge-muted { background: var(--bg); color: var(--text-muted); }

/* --- İçerik yazısı (SEO açıklama blokları) ----------------------------------- */
.prose { max-width: 760px; }
.prose p { margin: 0 0 14px; }
.prose ul { padding-left: 22px; }
.disclaimer { font-size: 13px; color: var(--text-muted); margin-top: 28px; border-top: 1px solid var(--border); padding-top: 14px; }

/* --- Footer -------------------------------------------------------------------- */
.site-footer {
    border-top: 1px solid var(--border);
    background: var(--surface);
    padding: 32px 0; margin-top: 40px;
    font-size: 14px; color: var(--text-muted);
}
.site-footer .cols { display: flex; flex-wrap: wrap; gap: 32px; justify-content: space-between; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 20px; }

/* --- Flash mesajları -------------------------------------------------------------- */
.flash { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-size: 14.5px; }
.flash-success { background: #e6f4ee; color: var(--success); border: 1px solid #b5e0cc; }
.flash-error { background: #fdecea; color: var(--danger); border: 1px solid #f5c6c0; }

/* ==========================================================================
   Admin panel
   ========================================================================== */
.admin-body { display: flex; min-height: 100vh; background: var(--bg); }
.admin-sidebar {
    width: 230px; flex-shrink: 0;
    background: #10241f; color: #cfe3dd;
    display: flex; flex-direction: column;
    padding: 20px 14px;
}
.admin-sidebar .logo { color: #fff; font-size: 20px; margin: 0 8px 24px; display: block; }
.admin-sidebar .logo span { color: #4fd1b5; }
.admin-sidebar nav { display: flex; flex-direction: column; gap: 2px; }
.admin-sidebar nav a {
    padding: 10px 12px; border-radius: 8px;
    color: #cfe3dd; font-size: 14.5px; font-weight: 500;
}
.admin-sidebar nav a:hover { background: rgba(255, 255, 255, .07); text-decoration: none; }
.admin-sidebar nav a.active { background: #0d6e5f; color: #fff; }
.admin-sidebar .spacer { flex: 1; }
.admin-main { flex: 1; padding: 28px 32px; min-width: 0; }
.admin-main h1 { font-size: 24px; margin-bottom: 20px; }

.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 24px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; }
.stat .label { font-size: 12.5px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .4px; }
.stat .value { font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; }

.admin-form-inline { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin: 14px 0; }
.admin-form-inline .field { min-width: 130px; flex: 0 1 auto; }
.admin-form-inline .field input, .admin-form-inline .field select { padding: 8px 10px; font-size: 14px; }

/* --- Login ---------------------------------------------------------------------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: #10241f; }
.login-card { width: 360px; max-width: 92vw; background: var(--surface); border-radius: 14px; padding: 32px; }
.login-card h1 { font-size: 22px; text-align: center; }
.login-card form { display: flex; flex-direction: column; gap: 14px; margin-top: 18px; }

@media (max-width: 760px) {
    .admin-body { flex-direction: column; }
    .admin-sidebar { width: 100%; flex-direction: row; align-items: center; overflow-x: auto; padding: 10px 14px; }
    .admin-sidebar .logo { margin: 0 16px 0 0; }
    .admin-sidebar nav { flex-direction: row; }
    .admin-main { padding: 20px 16px; }
    .site-header .container { height: auto; flex-wrap: wrap; padding: 10px 20px; }
}
