/* ==========================================================================
   TurboMC Wiki — Admin Paneli (Otantik Minecraft GUI)
   ========================================================================== */
:root {
    --accent: #5fce5a;
    --accent-dd: #2c5e1c;
    --gold: #fcdb4e;
    --diamond: #5fd9d4;
    --bg: #14161c;
    --panel: #2b313b;
    --panel-2: #232831;
    --slot: #15181e;
    --ink: #0a0c10;
    --line: rgba(0,0,0,.45);
    --text: #e9eef0;
    --text-dim: #9aa7ad;
    --danger: #e0564f;
    --danger-d: #b8413b;

    --font-pixel: 'Press Start 2P', monospace;
    --font-head: 'Pixelify Sans', 'Trebuchet MS', sans-serif;
    --font-body: 'Trebuchet MS', system-ui, 'Segoe UI', Roboto, sans-serif;

    --tex-stone: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24'%3E%3Crect width='24' height='24' fill='%232b313b'/%3E%3Crect width='12' height='12' fill='%232f3640'/%3E%3Crect x='12' y='12' width='12' height='12' fill='%2330373f'/%3E%3Crect x='3' y='4' width='3' height='3' fill='%23262b33'/%3E%3Crect x='16' y='3' width='3' height='3' fill='%23343b45'/%3E%3Crect x='8' y='15' width='3' height='3' fill='%23262b33'/%3E%3Crect x='18' y='17' width='3' height='3' fill='%23262b33'/%3E%3C/svg%3E");
    --tex-dark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24'%3E%3Crect width='24' height='24' fill='%23181b22'/%3E%3Crect width='12' height='12' fill='%231b1f27'/%3E%3Crect x='12' y='12' width='12' height='12' fill='%231b1f27'/%3E%3Crect x='4' y='5' width='3' height='3' fill='%2314171d'/%3E%3Crect x='15' y='16' width='3' height='3' fill='%2314171d'/%3E%3C/svg%3E");
}
* { box-sizing: border-box; margin: 0; padding: 0; }
img { image-rendering: pixelated; }
body { font-family: var(--font-body); background-color: var(--bg); background-image: var(--tex-dark); color: var(--text); line-height: 1.6; font-size: 15px; }
a { color: var(--accent); text-decoration: none; }
a:hover { filter: brightness(1.15); text-decoration: none; }
h1, h2, h3 { font-family: var(--font-head); letter-spacing: .5px; }
h1 { margin-bottom: 18px; font-size: 1.7rem; }
h2 { margin-bottom: 14px; font-size: 1.25rem; color: var(--gold); }
.muted { color: var(--text-dim); }
.small { font-size: .82rem; }

/* ===== Butonlar (MC 3D) ===== */
.btn-primary {
    font-family: var(--font-head); font-weight: 700; font-size: .95rem;
    color: #11260a; background: linear-gradient(#74cf52, #4e9b34); border: 3px solid #102309;
    padding: 10px 20px; cursor: pointer;
    box-shadow: inset 2px 2px 0 rgba(255,255,255,.45), inset -3px -3px 0 rgba(0,0,0,.3), 0 5px 0 var(--accent-dd), 0 7px 8px rgba(0,0,0,.4);
    transition: transform .04s, box-shadow .04s, filter .1s;
}
.btn-primary:hover { filter: brightness(1.08); text-decoration: none; }
.btn-primary:active { transform: translateY(5px); box-shadow: inset 2px 2px 0 rgba(255,255,255,.4), inset -3px -3px 0 rgba(0,0,0,.3), 0 0 0 var(--accent-dd); }
.btn-block { width: 100%; margin-top: 22px; }
.btn-sm {
    display: inline-block; font-family: var(--font-head); font-weight: 700;
    background: linear-gradient(#9aa3ad,#6e7782); color: #14171c; border: 2px solid var(--ink);
    padding: 6px 12px; font-size: .82rem; cursor: pointer;
    box-shadow: inset 2px 2px 0 rgba(255,255,255,.4), 0 3px 0 #3a4049;
}
.btn-sm:hover { filter: brightness(1.08); text-decoration: none; }
.btn-sm:active { transform: translateY(3px); box-shadow: inset 2px 2px 0 rgba(255,255,255,.4), 0 0 0 #3a4049; }
.btn-danger { background: linear-gradient(#e8675f,#c0433c); color: #fff; border-color: #4a1714; box-shadow: inset 2px 2px 0 rgba(255,255,255,.3), 0 3px 0 var(--danger-d); }
.btn-danger:active { box-shadow: inset 2px 2px 0 rgba(255,255,255,.3), 0 0 0 var(--danger-d); }

/* ===== Giriş ekranı (Minecraft) ===== */
.login-page {
    display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 20px;
    background:
        linear-gradient(rgba(10,14,20,.78), rgba(10,14,20,.92)),
        linear-gradient(#6db4ff 0%, #9fd3ff 40%, #5fae3a 60%, #6b4a2d 60%, #4a3420 100%);
}
.login-box {
    background-color: var(--panel); background-image: var(--tex-stone);
    border: 3px solid var(--ink); padding: 34px 32px; width: 100%; max-width: 400px; text-align: center;
    box-shadow: inset 2px 2px 0 rgba(255,255,255,.12), inset -3px -3px 0 rgba(0,0,0,.4), 0 8px 0 rgba(0,0,0,.5), 0 14px 30px rgba(0,0,0,.6);
}
.login-box h1 { font-family: var(--font-pixel); font-size: 1.15rem; color: var(--accent); text-shadow: 2px 2px 0 var(--ink); margin-bottom: 10px; line-height: 1.5; }
.login-sub { color: var(--text-dim); margin-bottom: 22px; font-family: var(--font-head); }
.login-box label { display: block; text-align: left; margin: 14px 0 6px; font-family: var(--font-head); font-size: .95rem; color: var(--gold); }
.login-box input {
    width: 100%; font-family: var(--font-body); background: var(--slot); border: 3px solid var(--ink);
    color: var(--text); padding: 11px 12px; outline: none; box-shadow: inset 3px 3px 0 rgba(0,0,0,.5);
}
.login-box input:focus { box-shadow: inset 3px 3px 0 rgba(0,0,0,.5), 0 0 0 2px var(--accent); }
.back-link { display: inline-block; margin-top: 20px; color: var(--text-dim); font-size: .9rem; }

/* ===== Üst bar ===== */
.admin-topbar {
    display: flex; align-items: center; gap: 16px; position: sticky; top: 0; z-index: 50; padding: 12px 20px;
    background-color: var(--panel-2); background-image: var(--tex-stone); border-bottom: 4px solid var(--ink);
    box-shadow: 0 4px 0 rgba(0,0,0,.35);
}
.admin-brand { font-family: var(--font-pixel); font-size: .85rem; color: var(--accent); text-shadow: 2px 2px 0 var(--ink); }
.admin-brand:hover { filter: none; }
.admin-topbar-right { margin-left: auto; display: flex; align-items: center; gap: 14px; font-size: .9rem; }
.admin-user { color: var(--text-dim); font-family: var(--font-head); }
.view-site { color: var(--diamond); font-family: var(--font-head); }
.logout {
    font-family: var(--font-head); font-weight: 700; color: #fff; background: linear-gradient(#e8675f,#c0433c);
    border: 2px solid #4a1714; padding: 5px 12px; box-shadow: inset 2px 2px 0 rgba(255,255,255,.3), 0 3px 0 var(--danger-d);
}
.logout:hover { filter: brightness(1.08); }
.admin-menu-toggle { display: none; font-family: var(--font-head); background: var(--slot); border: 3px solid var(--ink); color: var(--text); font-size: 16px; padding: 4px 12px; cursor: pointer; }

/* ===== Yerleşim ===== */
.admin-layout { display: flex; min-height: calc(100vh - 56px); }
.admin-sidebar {
    width: 240px; flex-shrink: 0; padding: 16px 12px;
    background-color: var(--panel); background-image: var(--tex-stone); border-right: 4px solid var(--ink);
}
.admin-sidebar nav a {
    display: block; font-family: var(--font-head); font-weight: 700; padding: 11px 14px; margin-bottom: 6px;
    color: var(--text); background: var(--slot); border: 2px solid var(--ink); box-shadow: inset 2px 2px 0 rgba(0,0,0,.4);
}
.admin-sidebar nav a:hover { color: var(--accent); text-decoration: none; box-shadow: inset 2px 2px 0 rgba(0,0,0,.4), 0 0 0 2px var(--accent); }
.admin-sidebar nav a.active { background: linear-gradient(#74cf52,#4e9b34); color: #11260a; border-color: #102309; box-shadow: inset 2px 2px 0 rgba(255,255,255,.4); }
.admin-nav-divider { font-family: var(--font-head); color: var(--gold); font-size: .8rem; letter-spacing: 1px; padding: 16px 14px 8px; margin-top: 8px; border-top: 2px solid var(--line); }
.admin-content { flex: 1; padding: 28px 32px; min-width: 0; }

/* ===== Uyarılar ===== */
.alert { font-family: var(--font-head); font-weight: 700; padding: 12px 16px; margin-bottom: 20px; border: 3px solid var(--ink); box-shadow: inset 2px 2px 0 rgba(255,255,255,.1); }
.alert-success { background: #2e6b2a; color: #d8ffcf; }
.alert-error { background: #7a2e2a; color: #ffd8d4; }

/* ===== Kartlar (taş panel) ===== */
.card {
    background-color: var(--panel); background-image: var(--tex-stone); border: 3px solid var(--ink);
    padding: 22px 24px; margin-bottom: 22px;
    box-shadow: inset 2px 2px 0 rgba(255,255,255,.1), inset -3px -3px 0 rgba(0,0,0,.4);
}
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.card-head h2 { margin: 0; }
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.page-head h1 { margin: 0; }
.two-col { display: grid; grid-template-columns: 360px 1fr; gap: 22px; align-items: start; }

/* ===== Hızlı işlemler + dashboard sütunları ===== */
.quick-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 18px 0 26px; }
.dash-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items: start; }
@media (max-width: 900px) { .dash-cols { grid-template-columns: 1fr; } }

/* ===== İstatistik slot kartları ===== */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; margin-bottom: 26px; }
.stat-card {
    display: flex; flex-direction: column; gap: 6px; padding: 22px; color: var(--text);
    background: var(--slot); border: 3px solid var(--ink);
    box-shadow: inset 3px 3px 0 rgba(0,0,0,.5), inset -2px -2px 0 rgba(255,255,255,.06);
    transition: transform .08s, box-shadow .08s;
}
.stat-card:hover { text-decoration: none; transform: translateY(-4px); box-shadow: inset 3px 3px 0 rgba(0,0,0,.5), 0 0 0 3px var(--accent); }
.stat-num { font-family: var(--font-pixel); font-size: 1.7rem; color: var(--accent); text-shadow: 2px 2px 0 var(--ink); }
.stat-label { color: var(--text-dim); font-family: var(--font-head); font-weight: 700; }

/* ===== Tablo filtreleme ===== */
.table-filter { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.table-filter #pageSearch { flex: 1; min-width: 180px; }
.table-filter select { width: auto; }
.filter-count { font-size: .85rem; }

/* Form ayracı */
.form-sep { border: none; border-top: 2px solid var(--line); margin: 24px 0 18px; }

/* ===== Tablolar ===== */
.data-table { width: 100%; border-collapse: collapse; border: 3px solid var(--ink); }
.data-table th, .data-table td { text-align: left; padding: 11px 12px; border: 2px solid var(--ink); vertical-align: middle; }
.data-table th { font-family: var(--font-head); color: var(--gold); background: var(--panel-2); font-size: .9rem; letter-spacing: .5px; }
.data-table tr:nth-child(even) td { background: rgba(0,0,0,.18); }
.data-table tr:hover td { background: rgba(95,206,90,.08); }
.actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.inline-form { display: inline; }
.badge { font-family: var(--font-head); font-weight: 700; display: inline-block; padding: 2px 10px; font-size: .78rem; border: 2px solid var(--ink); }
.badge-on { background: #2e6b2a; color: #d8ffcf; }
.badge-off { background: #7a5e1e; color: #ffeeb0; }

/* ===== Formlar ===== */
.form-grid { display: flex; flex-direction: column; gap: 16px; }
.form-row { display: flex; flex-direction: column; gap: 6px; }
.form-row label { font-family: var(--font-head); font-weight: 700; font-size: .92rem; color: var(--gold); }
.form-cols { display: flex; gap: 16px; flex-wrap: wrap; }
.form-cols .form-row { flex: 1; min-width: 180px; }
.form-row-sm { max-width: 130px; flex: 0 0 auto !important; }
input[type=text], input[type=password], input[type=number], input[type=color], select, textarea {
    font-family: var(--font-body); font-size: .95rem; width: 100%;
    background: var(--slot); border: 3px solid var(--ink); color: var(--text); padding: 9px 12px; outline: none;
    box-shadow: inset 3px 3px 0 rgba(0,0,0,.5);
}
input:focus, select:focus, textarea:focus { box-shadow: inset 3px 3px 0 rgba(0,0,0,.5), 0 0 0 2px var(--accent); }
textarea { resize: vertical; line-height: 1.5; }
input[type=color] { height: 44px; padding: 4px; cursor: pointer; }
.checkbox { flex-direction: row !important; align-items: center; gap: 8px; cursor: pointer; color: var(--text) !important; }
.checkbox input { width: auto; }
.form-actions { display: flex; gap: 12px; align-items: center; margin-top: 6px; }
.md-hint { display: block; font-family: var(--font-body); font-size: .8rem; color: var(--text-dim); font-weight: normal; margin-top: 3px; }

/* ===== Hazır Markdown dosyası yükleme ===== */
.md-import {
    background: var(--slot); border: 3px dashed var(--accent); padding: 14px 16px;
    box-shadow: inset 2px 2px 0 rgba(0,0,0,.4);
}
.md-import-label { color: var(--accent) !important; }
.md-import input[type=file] { margin-top: 8px; font-family: var(--font-body); color: var(--text); }
.md-file-info { display: block; margin-top: 8px; font-size: .88rem; }
.md-file-info.ok { color: var(--accent); }
.md-file-info.error { color: var(--danger); }

/* ===== Markdown editör ===== */
.editor-split { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.editor-split textarea { min-height: 420px; font-family: 'Consolas', monospace; }
.md-preview { background: var(--slot); border: 3px solid var(--ink); padding: 16px 18px; min-height: 420px; max-height: 600px; overflow-y: auto; box-shadow: inset 3px 3px 0 rgba(0,0,0,.5); }
.md-preview h1, .md-preview h2, .md-preview h3 { font-family: var(--font-head); margin: .8em 0 .4em; }
.md-preview h1 { border-bottom: 2px solid var(--line); padding-bottom: .3em; }
.md-preview h2 { color: var(--accent); }
.md-preview code { background: var(--panel-2); padding: 1px 6px; font-family: var(--font-pixel); font-size: .72em; color: var(--accent); border: 2px solid var(--ink); }
.md-preview pre { background: var(--panel-2); padding: 12px; overflow-x: auto; border: 2px solid var(--ink); }
.md-preview pre code { background: none; color: var(--text); border: none; }
.md-preview blockquote { border-left: 6px solid var(--accent); padding: 6px 14px; color: var(--text-dim); background: var(--panel-2); margin: .8em 0; }
.md-preview table { width: 100%; border-collapse: collapse; margin: .8em 0; }
.md-preview th, .md-preview td { border: 2px solid var(--ink); padding: 6px 10px; }
.md-preview th { color: var(--gold); background: var(--panel-2); }
.md-preview img { max-width: 100%; border: 2px solid var(--ink); }
.md-preview ul, .md-preview ol { margin-left: 1.4em; }

/* ===== Kategori satırı ===== */
.cat-edit-row { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.cat-edit-row .icon-input { width: 56px; text-align: center; }
.cat-edit-row .name-input { flex: 1; }
.cat-edit-row .sort-input { width: 72px; }
.form-grid-tight { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.form-grid-tight select { width: auto; }
.form-grid-tight input { width: auto; flex: 1; min-width: 140px; }

/* ===== Medya ===== */
.upload-form { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.upload-form input[type=file] { width: auto; font-family: var(--font-body); }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.media-item { background: var(--slot); border: 3px solid var(--ink); overflow: hidden; box-shadow: inset 2px 2px 0 rgba(0,0,0,.4); }
.media-thumb { height: 140px; background: var(--panel-2); display: flex; align-items: center; justify-content: center; border-bottom: 2px solid var(--ink); }
.media-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.media-info { padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.media-name { font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.media-url { font-size: .72rem !important; font-family: 'Consolas', monospace; padding: 6px 8px !important; }
.media-actions { display: flex; gap: 6px; }

/* ===== Responsive ===== */
@media (max-width: 900px) {
    .two-col { grid-template-columns: 1fr; }
    .editor-split { grid-template-columns: 1fr; }
    .editor-split textarea, .md-preview { min-height: 260px; }
    .admin-menu-toggle { display: block; }
    .admin-sidebar { position: fixed; top: 56px; bottom: 0; left: 0; z-index: 60; width: 80%; max-width: 280px; transform: translateX(-100%); transition: transform .25s; }
    .admin-sidebar.open { transform: translateX(0); box-shadow: 6px 0 30px rgba(0,0,0,.7); }
    .admin-content { padding: 20px 16px; }
    .admin-user { display: none; }
}

/* Geniş tabloları küçük ekranda yatay kaydır */
@media (max-width: 700px) {
    .data-table { display: block; overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; }
    .stat-grid { grid-template-columns: 1fr 1fr; }
}

/* Telefon */
@media (max-width: 520px) {
    body { font-size: 14px; }
    .admin-content { padding: 16px 12px; }
    .admin-topbar { padding: 10px 12px; gap: 10px; }
    .admin-brand { font-size: .68rem; }
    .view-site { display: none; }
    .card { padding: 16px 14px; }
    .page-head { flex-direction: column; align-items: flex-start; gap: 12px; }
    .quick-actions { gap: 8px; }
    .stat-num { font-size: 1.4rem; }
}
