:root {
    /* Tipografi */
    --font-family: 'Inter', system-ui, -apple-system, sans-serif;
    --font-size-base: 16px;

    /* Daha geniş ve ferah bir görünüm için max-width artırıldı */
    --site-max-width: 1280px; 
    
    /* Ana renkler (Admin panelinden ezilebilir) */
    --color-primary: #3b82f6; 
    --color-primary-hover: #2563eb;
    --color-primary-soft: rgba(59, 130, 246, 0.1);

    /* Gece Modu (Dark) */
    --color-bg: #09090b; 
    --color-surface: #18181b; 
    --color-surface-2: #27272a; 
    --color-surface-hover: #3f3f46;

    --color-text: #f4f4f5; 
    --color-muted: #a1a1aa; 

    --color-danger: #ef4444;
    --color-success: #10b981;

    /* Modern oval hatlar */
    --radius-button: 999px;
    --radius-card: 24px;
    --radius-input: 16px;

    --header-height: 80px;

    /* Kenarlıklar ve Gölgeler */
    --border-color: rgba(255, 255, 255, 0.08);
    --border-color-strong: rgba(255, 255, 255, 0.15);

    --shadow-soft: 0 8px 32px rgba(0, 0, 0, 0.3);
    --shadow-hover: 0 16px 48px rgba(0, 0, 0, 0.5);
    --shadow-focus: 0 0 0 4px rgba(59, 130, 246, 0.25);

    /* Yumuşak ve akıcı animasyonlar */
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] {
    --color-bg: #f8fafc; 
    --color-surface: #ffffff;
    --color-surface-2: #f1f5f9; 
    --color-surface-hover: #e2e8f0;

    --color-text: #0f172a; 
    --color-muted: #64748b; 

    --border-color: rgba(15, 23, 42, 0.08);
    --border-color-strong: rgba(15, 23, 42, 0.15);

    --shadow-soft: 0 4px 24px rgba(15, 23, 42, 0.05);
    --shadow-hover: 0 12px 32px rgba(15, 23, 42, 0.08);
    --shadow-focus: 0 0 0 4px rgba(59, 130, 246, 0.2);
}

*, *::before, *::after { box-sizing: border-box; }

html {
    /* MASAÜSTÜ KÖK YAZI BOYUTU BURADAN BESLENİR */
    font-size: var(--font-size-base, 16px);
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

.theme-transitioning, .theme-transitioning *, .theme-transitioning *::before, .theme-transitioning *::after {
    transition: background-color var(--transition-smooth), border-color var(--transition-smooth), color var(--transition-smooth) !important;
}

body {
    margin: 0;
    font-family: var(--font-family);
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 500px;
    background: radial-gradient(circle at 50% 0%, var(--color-primary-soft), transparent 60%);
    pointer-events: none;
    z-index: -1;
}

/* =========================
   TEMEL SIFIRLAMALAR (RESETS) & TIPOGRAFI
========================= */
h1, h2, h3, h4, h5, h6 { 
    margin-top: 0; 
    margin-bottom: 0.5rem; 
    line-height: 1.3; 
    color: var(--color-text); 
}

/* YENİ: DİNAMİK BAŞLIK BÜYÜKLÜKLERİ */
h1 { font-size: var(--h1-scale, 2.2rem); }
h2 { font-size: var(--h2-scale, 1.8rem); }
h3 { font-size: var(--h3-scale, 1.5rem); }

p { 
    margin-top: 0; 
    margin-bottom: 0.6rem; 
}

img, video { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; transition: color var(--transition-fast), opacity var(--transition-fast); }
a:hover { opacity: 0.85; }
button, input, select, textarea { font: inherit; margin: 0; }
button { cursor: pointer; background: none; border: none; }

/* YENİ: Dinamik Masaüstü Dış Kenar Boşluğu */
.container { 
    width: calc(100% - (var(--margin-desktop, 20px) * 2)); 
    max-width: var(--site-max-width); 
    margin: 0 auto; 
}
.site-main { padding: 32px 0 64px; min-height: calc(100vh - var(--header-height) - 100px); }

/* =========================
   DİNAMİK SÜTUN & GRID DÜZENİ
========================= */
.layout-wrapper {
    display: grid;
    row-gap: 32px;
    column-gap: 10px;
    align-items: start;
}

.layout-1_col {
    grid-template-columns: minmax(0, 1fr);
    max-width: 900px;
    margin: 0 auto;
}

.layout-2_col {
    grid-template-columns: minmax(0, 1fr) 280px;
}

.layout-3_col {
    grid-template-columns: 160px minmax(0, 1fr) 280px;
}

.layout-sidebar { position: relative; height: 100%; }

.sidebar-sticky {
    position: sticky;
    top: calc(var(--header-height) + 24px);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* =========================
   GLOBAL SIDEBAR TASARIMLARI
========================= */
.sidebar-card {
    /* YENİ: SİDEBAR KARTLARINA X/Y BOŞLUĞU UYGULANDI */
    padding: var(--padding-y-desktop, 20px) var(--padding-x-desktop, 20px);
}

.sidebar-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0 0 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--color-text);
}

.sidebar-title i { color: var(--color-primary); }

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: var(--radius-button);
    color: var(--color-text);
    font-weight: 600;
    font-size: 0.9rem;
    transition: all var(--transition-fast);
    text-decoration: none;
}

.sidebar-nav-item i {
    font-size: 1.05rem;
    color: var(--color-muted);
    width: 20px;
    text-align: center;
    transition: color var(--transition-fast);
}

/* YENİ: SOL MENÜ HOVER RENGİ DAHA BELİRGİN VE ŞIK YAPILDI */
.sidebar-nav-item:hover, 
.sidebar-nav-item.is-active {
    background: color-mix(in srgb, var(--color-primary) 12%, transparent);
    color: var(--color-primary);
}

.sidebar-nav-item:hover i, 
.sidebar-nav-item.is-active i {
    color: var(--color-primary);
}

.sidebar-section {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.stat-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px dashed var(--border-color);
}
.stat-item:last-child { border-bottom: none; }
.stat-label { color: var(--color-muted); font-size: 0.9rem; font-weight: 500; }
.stat-value { color: var(--color-text); font-weight: 700; font-size: 0.9rem; }

.tags-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-modern {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background: var(--color-surface-2);
    border-radius: var(--radius-button);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-text);
    transition: all var(--transition-fast);
    border: 1px solid transparent;
}

.tag-modern:hover {
    background: var(--color-surface-hover);
    border-color: var(--border-color-strong);
    color: var(--color-primary);
    transform: translateY(-2px);
}

.tag-hash { color: var(--color-primary); opacity: 0.7; }

/* YENİ EKLENEN: Sidebar Özel Sınıfları */
.sidebar-quick-start-desc { font-size: 0.9rem; margin-bottom: 12px; line-height: 1.4; color: var(--color-muted); }
.sidebar-empty-text { font-size: 0.9rem; color: var(--color-muted); }

.sidebar-ad-slot {
    border: 1px dashed var(--border-color-strong);
    background: var(--color-surface-2);
    text-align: center;
    padding: 32px 20px;
}
.sidebar-ad-label {
    display: block;
    font-size: 0.75rem;
    color: var(--color-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 12px;
}
.sidebar-ad-icon {
    font-size: 2rem;
    color: var(--color-muted);
    margin-bottom: 16px;
    opacity: 0.5;
}
.sidebar-ad-title {
    margin: 0 0 8px;
    font-size: 1rem;
    color: var(--color-text);
}
.sidebar-ad-desc {
    margin: 0;
    font-size: 0.85rem;
    color: var(--color-muted);
}

/* =========================
   FORM ELEMANLARI
========================= */
label { display: block; margin: 0 0 8px; font-size: 0.95rem; font-weight: 600; color: var(--color-text); letter-spacing: 0.01em; }
input[type="text"], input[type="email"], input[type="password"], input[type="search"], input[type="url"], input[type="number"], select, textarea {
    width: 100%; min-height: 54px; border: 1px solid var(--border-color); border-radius: var(--radius-input); background: var(--color-surface); color: var(--color-text); padding: 0 18px; outline: none; box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02); transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast); appearance: none; -webkit-appearance: none;
}
select { padding-right: 48px; background-image: linear-gradient(45deg, transparent 50%, var(--color-muted) 50%), linear-gradient(135deg, var(--color-muted) 50%, transparent 50%); background-position: calc(100% - 22px) calc(50% - 2px), calc(100% - 16px) calc(50% - 2px); background-size: 6px 6px, 6px 6px; background-repeat: no-repeat; }
textarea { min-height: 140px; padding: 16px 18px; resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--color-muted); }
input:hover, select:hover, textarea:hover { border-color: var(--border-color-strong); background: var(--color-surface-hover); }
input:focus, select:focus, textarea:focus { border-color: var(--color-primary); box-shadow: var(--shadow-focus); background: var(--color-surface); }
input:disabled, select:disabled, textarea:disabled, button:disabled { opacity: 0.5; cursor: not-allowed; }
.field-error { margin-top: 6px; color: var(--color-danger); font-size: 0.88rem; font-weight: 500; }

/* =========================
   BUTTONS (Pill Design)
========================= */
.btn, .icon-btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 50px; padding: 0 24px; border-radius: var(--radius-button); border: 1px solid var(--border-color); font-weight: 600; letter-spacing: 0.02em; transition: all var(--transition-fast); }
.btn:hover, .icon-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-soft); border-color: var(--border-color-strong); }
.btn:active { transform: translateY(0); }
.btn:focus-visible, .icon-btn:focus-visible, button:focus-visible, a:focus-visible { outline: none; box-shadow: var(--shadow-focus); }
.btn-primary { background: var(--color-primary); color: #fff; border-color: transparent; box-shadow: 0 4px 14px var(--color-primary-soft); }
.btn-primary:hover { background: var(--color-primary-hover); border-color: transparent; box-shadow: 0 6px 20px var(--color-primary-soft); }
.btn-secondary { background: var(--color-surface-2); color: var(--color-text); }
.icon-btn { background: var(--color-surface-2); color: var(--color-text); border-radius: var(--radius-button); padding: 0; width: 46px; height: 46px; min-height: auto; }

/* =========================
   ALERTS
========================= */
.alert { border-radius: var(--radius-card); padding: 16px 20px; margin-bottom: 24px; border: 1px solid transparent; font-size: 0.95rem; font-weight: 500; display: flex; align-items: center; gap: 12px; }
.alert-error { background: color-mix(in srgb, var(--color-danger) 10%, transparent); border-color: color-mix(in srgb, var(--color-danger) 20%, transparent); color: var(--color-danger); }
.alert-success { background: color-mix(in srgb, var(--color-success) 10%, transparent); border-color: color-mix(in srgb, var(--color-success) 20%, transparent); color: var(--color-success); }

/* =========================
   GENEL KART SİSTEMİ
========================= */
.card { 
    background: var(--color-surface); 
    border: 1px solid var(--border-color); 
    border-radius: var(--radius-card); 
    box-shadow: var(--shadow-soft); 
    transition: all var(--transition-smooth); 
    overflow: hidden; 
    content-visibility: auto; 
    /* YENİ: GENEL KARTLARA X/Y BOŞLUĞU UYGULANDI */
    padding: var(--padding-y-desktop, 20px) var(--padding-x-desktop, 20px);
}
.card:hover { box-shadow: var(--shadow-hover); border-color: var(--border-color-strong); }

/* =========================
   YARDIMCI SINIFLAR (UTILITIES)
========================= */
.text-muted { color: var(--color-muted); }
.text-primary { color: var(--color-primary) !important; }
.fw-bold { font-weight: 700 !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.w-100 { width: 100% !important; }
.mt-3 { margin-top: 1rem !important; }
.mt-4 { margin-top: 1.5rem !important; }
.ms-1 { margin-left: 0.25rem !important; }
.ms-2 { margin-left: 0.5rem !important; }
.input-lg { min-height: 60px !important; font-size: 1.1rem !important; }
.btn-lg { min-height: 60px !important; font-size: 1.1rem !important; }
.btn-sm { min-height: 40px !important; padding: 0 16px !important; font-size: 0.9rem !important; }
.mobile-only { display: none !important; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* =========================
   ETİKET (TAG) INPUT SİSTEMİ
========================= */
.tag-input-wrapper { display: flex; flex-wrap: wrap; gap: 8px; padding: 8px; background: var(--color-surface); border: 1px solid var(--border-color); border-radius: var(--radius-input); min-height: 54px; align-items: center; transition: border-color var(--transition-fast), box-shadow var(--transition-fast); }
.tag-input-wrapper:focus-within { border-color: var(--color-primary); box-shadow: var(--shadow-focus); }
.tag-input-box { flex: 1; min-width: 150px; border: none !important; background: transparent !important; color: var(--color-text); outline: none; padding: 4px 8px !important; box-shadow: none !important; min-height: auto !important; }
.tag-pill-input { display: inline-flex; align-items: center; background: color-mix(in srgb, var(--color-primary) 15%, transparent); color: var(--color-primary); padding: 6px 12px; border-radius: var(--radius-button); font-size: 0.9rem; font-weight: 600; }
.tag-pill-input .tag-remove { margin-left: 8px; cursor: pointer; font-weight: bold; display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: var(--radius-button); background: color-mix(in srgb, var(--color-primary) 25%, transparent); transition: background 0.2s, color 0.2s; }
.tag-pill-input .tag-remove:hover { background: var(--color-primary); color: #fff; }

/* =========================
   RESPONSIVE (Mobile First Mantığına Doğru)
========================= */
@media (max-width: 1024px) {
    .desktop-only { display: none !important; }
    .mobile-only { display: inline-flex !important; }
    
    .layout-wrapper {
        grid-template-columns: minmax(0, 1fr) !important;
    }
}

@media (max-width: 768px) {
    /* YENİ: MOBİL KÖK YAZI BOYUTU */
    /* Ekran 768px altına düştüğünde sistemdeki TÜM rem birimleri buna göre orantılı küçülür! */
    html {
        font-size: var(--font-size-mobile, 14px);
    }

    /* YENİ: DİNAMİK DIŞ KENAR BOŞLUĞU (MOBİL SARI ÇİZGİLER) */
    .container { 
        width: calc(100% - (var(--margin-mobile, 8px) * 2)); 
    }
    .site-main { padding: 24px 0 48px; }

    /* YENİ: GENEL KARTLAR & SİDEBAR KARTLARI İÇİN MOBİL X/Y BOŞLUĞU */
    .card, .sidebar-card {
        padding: var(--padding-y-mobile, 16px) var(--padding-x-mobile, 16px);
    }
}

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

/* =========================
   404 HATA SAYFASI
========================= */
.error-page-wrapper { 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    min-height: 65vh; 
    text-align: center; 
}
.error-card { 
    width: 100%;
    max-width: 100%; 
    padding: 3rem; 
    background: var(--color-surface); 
    border-radius: var(--radius-card); 
    box-shadow: var(--shadow-soft); 
}
.error-icon i { 
    font-size: 4.5rem; 
    color: var(--color-primary); 
    margin-bottom: 1.5rem; 
}
.error-title { 
    font-size: 6rem; 
    font-weight: 800; 
    line-height: 1; 
    margin: 0; 
    color: var(--color-text); 
}
.error-subtitle { 
    font-size: 1.5rem; 
    font-weight: 600; 
    margin-top: 0.5rem; 
    margin-bottom: 1rem; 
    color: var(--color-text); 
}
.error-message { 
    margin-bottom: 2rem; 
    color: var(--color-muted); 
    line-height: 1.6; 
    font-size: 1.05rem; 
}
.error-actions { 
    display: flex; 
    gap: 1rem; 
    justify-content: center; 
    flex-wrap: wrap; 
}

/* =========================
   İÇERİK İÇİ HASHTAG LINKLERİ
========================= */
.content-hashtag {
    color: var(--color-primary);
    font-weight: 600;
    text-decoration: none;
    transition: color var(--transition-fast);
}
.content-hashtag:hover {
    text-decoration: underline;
    color: var(--color-primary-hover);
}

/* =========================
   YENİ: DİNAMİK (SONSUZ) RENKLİ ETİKETLER (TAGS)
========================= */
.tag-pill {
    display: inline-flex; 
    align-items: center; 
    padding: 4px 12px; 
    border-radius: var(--radius-button); 
    font-size: 0.85rem; 
    font-weight: 600; 
    text-decoration: none; 
    transition: all var(--transition-fast); 
    white-space: nowrap; 
    min-height: 28px; 
    box-sizing: border-box; 
    line-height: 1;
    
    /* Dinamik Renk Formülü (PHP'den gelen --tag-hue açısını okur) */
    background: hsla(var(--tag-hue, 210), 80%, 50%, 0.12);
    color: hsl(var(--tag-hue, 210), 80%, 65%);
    border: 1px solid hsla(var(--tag-hue, 210), 80%, 50%, 0.2);
}

.tag-pill:hover { 
    transform: translateY(-2px); 
    box-shadow: var(--shadow-soft);
    background: hsl(var(--tag-hue, 210), 80%, 55%);
    color: #ffffff;
}

[data-theme="light"] .tag-pill {
    /* Açık temada okunabilirlik için rengi biraz koyulaştırırız */
    color: hsl(var(--tag-hue, 210), 80%, 40%);
}

/* =========================
   KÜÇÜK ETİKETLER (Global Kullanım)
========================= */
.tag-pill--sm {
    font-size: 0.75rem !important;
    padding: 2px 8px !important;
    font-weight: 600;
    opacity: 0.9;
}

.tag-pill--sm:hover {
    opacity: 1;
}