/* ================================================================
   BUders Duvar — style.css  (Dark Theme Merkezi Sistem)
   ================================================================ */

:root {
    --primary:        #1d9bf0;
    --primary-hover:  #1a8cd8;
    --primary-muted:  rgba(29,155,240,0.15);
    --danger:         #f4212e;
    --success:        #00ba7c;
    --warning:        #ffd400;

    --bg-base:        #000000;
    --bg-surface:     #0f0f0f;
    --bg-elevated:    #161616;
    --bg-hover:       #1a1a1a;
    --bg-input:       #202020;

    --border:         #2f2f2f;
    --border-light:   #1f1f1f;

    --text-primary:   #e7e9ea;
    --text-secondary: #71767b;
    --text-muted:     #3e4144;
    --text-link:      #1d9bf0;

    --radius-sm:   6px;
    --radius-md:   12px;
    --radius-lg:   16px;
    --radius-full: 9999px;

    --shadow-sm: 0 1px 3px rgba(0,0,0,.4);
    --shadow-md: 0 4px 12px rgba(0,0,0,.5);
    --shadow-lg: 0 8px 30px rgba(0,0,0,.6);

    --transition:  .2s ease;
    --sidebar-w:   280px;
    --feed-max:    600px;
    --header-h:    53px;
}

/* ── RESET ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                 "Helvetica Neue", Arial, sans-serif;
    background: var(--bg-base);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--text-link); text-decoration: none; transition: opacity var(--transition); }
a:hover { opacity: .85; }
img { display: block; max-width: 100%; }
button, input, textarea, select { font-family: inherit; font-size: 1rem; }

/* ── LAYOUT ─────────────────────────────────────────────────── */
.app-layout { display: flex; min-height: 100vh; max-width: 1200px; margin: 0 auto; }
.sidebar {
    width: var(--sidebar-w);
    position: sticky; top: 0; height: 100vh;
    display: flex; flex-direction: column;
    padding: 0 12px;
    border-right: 1px solid var(--border);
    flex-shrink: 0; overflow-y: auto;
}
.main-content {
    flex: 1; min-width: 0;
    max-width: var(--feed-max);
    border-right: 1px solid var(--border);
}
.right-sidebar { width: var(--sidebar-w); padding: 12px 16px; flex-shrink: 0; }

/* ── HEADER ─────────────────────────────────────────────────── */
.site-header {
    position: sticky; top: 0; z-index: 100;
    height: var(--header-h);
    background: rgba(0,0,0,.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 20px;
}
.site-header .logo {
    font-size: 1.3rem; font-weight: 800;
    color: var(--text-primary); letter-spacing: -.5px;
}
.site-header nav { display: flex; align-items: center; gap: 4px; }
.nav-link {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 14px; border-radius: var(--radius-full);
    color: var(--text-primary); font-size: .95rem; font-weight: 500;
    transition: background var(--transition); position: relative;
}
.nav-link:hover { background: var(--bg-hover); opacity: 1; }
.nav-link.active { color: var(--primary); }
.badge {
    background: var(--danger); color: #fff;
    font-size: 10px; font-weight: 700;
    padding: 1px 5px; border-radius: var(--radius-full);
    min-width: 18px; text-align: center; line-height: 16px;
    border: 2px solid var(--bg-base);
}

/* ── POST KARTI ─────────────────────────────────────────────── */
.post-card {
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    padding: 16px;
    transition: background var(--transition);
    position: relative;
}
.post-card:hover { background: var(--bg-elevated); }
.post-card:target,
.post-card.highlighted {
    border-left: 3px solid var(--primary);
    background: rgba(29,155,240,.05);
    animation: highlightFade 3s ease-out forwards;
}
@keyframes highlightFade {
    0%   { background: rgba(29,155,240,.15); }
    100% { background: var(--bg-surface); }
}

.post-header { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.post-avatar {
    width: 44px; height: 44px; border-radius: 50%;
    object-fit: cover; flex-shrink: 0; border: 2px solid var(--border);
}
.post-meta { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.post-username { font-weight: 700; color: var(--text-primary); font-size: .95rem; }
.post-username:hover { text-decoration: underline; }
.post-time { font-size: .8rem; color: var(--text-secondary); }

.post-body {
    font-size: .95rem; color: var(--text-primary);
    line-height: 1.6; word-wrap: break-word;
    overflow-wrap: break-word; white-space: pre-wrap;
    margin-bottom: 12px;
}
.post-body a { color: var(--primary); }

.post-media {
    border-radius: var(--radius-md); overflow: hidden;
    border: 1px solid var(--border); margin-bottom: 12px;
}
.post-media img {
    width: 100%; height: auto; max-height: 500px;
    object-fit: cover; transition: opacity var(--transition);
}
.post-media img:hover { opacity: .92; }

.retweet-label {
    display: flex; align-items: center; gap: 6px;
    font-size: .8rem; color: var(--text-secondary);
    margin-bottom: 8px; padding-left: 56px; font-weight: 600;
}

/* Post aksiyonları */
.post-actions {
    display: flex; align-items: center; gap: 4px;
    margin-top: 4px; padding-top: 10px;
    border-top: 1px solid var(--border-light);
}
.action-btn {
    display: flex; align-items: center; gap: 6px;
    padding: 6px 10px; border-radius: var(--radius-full);
    font-size: .85rem; color: var(--text-secondary);
    cursor: pointer; border: none; background: none;
    transition: color var(--transition), background var(--transition);
    flex: 1; justify-content: center;
}
.action-btn:hover { color: var(--primary); background: var(--primary-muted); }
.action-btn.liked { color: #f91880; }
.action-btn.liked:hover { color: #f91880; background: rgba(249,24,128,.1); }
.action-btn.disliked { color: var(--danger); }
.action-btn.retweeted { color: var(--success); }

/* ── COMPOSE KUTUSU ─────────────────────────────────────────── */
.compose-box { border-bottom: 1px solid var(--border); padding: 16px; }
.compose-inner { display: flex; gap: 12px; }
.compose-avatar {
    width: 44px; height: 44px; border-radius: 50%;
    object-fit: cover; flex-shrink: 0; border: 2px solid var(--border);
}
.compose-right { flex: 1; min-width: 0; }
.compose-textarea {
    width: 100%; background: transparent; border: none; outline: none;
    resize: none; color: var(--text-primary);
    font-size: 1.1rem; line-height: 1.5; min-height: 80px;
}
.compose-textarea::placeholder { color: var(--text-secondary); }
.compose-footer {
    display: flex; align-items: center; justify-content: space-between;
    margin-top: 12px; padding-top: 12px;
    border-top: 1px solid var(--border-light);
}
.char-counter { font-size: .8rem; color: var(--text-secondary); }
.char-counter.warning { color: var(--warning); }
.char-counter.danger  { color: var(--danger); }
.compose-actions { display: flex; align-items: center; gap: 8px; }
.compose-icon-btn {
    background: none; border: none; cursor: pointer;
    color: var(--primary); font-size: 1.1rem;
    padding: 6px; border-radius: 50%;
    transition: background var(--transition);
}
.compose-icon-btn:hover { background: var(--primary-muted); }
.image-preview-thumb {
    width: 72px; height: 72px; border-radius: var(--radius-md);
    object-fit: cover; border: 2px solid var(--primary);
    margin-top: 10px; display: none;
}

/* ── BUTONLAR ───────────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    gap: 8px; padding: 8px 20px; border-radius: var(--radius-full);
    font-weight: 700; font-size: .9rem; cursor: pointer;
    border: none; transition: background var(--transition), opacity var(--transition);
    white-space: nowrap;
}
.btn-primary   { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); opacity: 1; }
.btn-secondary { background: transparent; color: var(--text-primary); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--bg-hover); }
.btn-danger    { background: var(--danger); color: #fff; }
.btn-ghost     { background: transparent; color: var(--text-secondary); border: none; }
.btn-ghost:hover { color: var(--text-primary); background: var(--bg-hover); }
.btn:disabled  { opacity: .5; cursor: not-allowed; }
.btn-sm        { padding: 5px 14px; font-size: .82rem; }

/* ── FORM ELEMENTLERİ ───────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-group label {
    display: block; font-size: .85rem;
    color: var(--text-secondary); margin-bottom: 6px; font-weight: 600;
}
.form-input {
    width: 100%; background: var(--bg-input);
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    padding: 12px 16px; color: var(--text-primary); font-size: .95rem;
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-muted);
}
.form-input::placeholder { color: var(--text-secondary); }
textarea.form-input { resize: vertical; min-height: 100px; }
select.form-input { cursor: pointer; }

/* ── MODAL ──────────────────────────────────────────────────── */
.modal-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,.7); backdrop-filter: blur(4px);
    z-index: 9999; align-items: center; justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal-box {
    background: var(--bg-elevated); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 24px;
    width: 90%; max-width: 420px;
    box-shadow: var(--shadow-lg);
    animation: modalIn .2s ease-out;
    position: relative;
}
@keyframes modalIn {
    from { transform: scale(.95) translateY(-10px); opacity: 0; }
    to   { transform: scale(1) translateY(0); opacity: 1; }
}
.modal-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 16px; color: var(--text-primary); }
.modal-close {
    position: absolute; top: 16px; right: 16px;
    background: none; border: none; color: var(--text-secondary);
    font-size: 1.3rem; cursor: pointer; border-radius: 50%;
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    transition: background var(--transition);
}
.modal-close:hover { background: var(--bg-hover); color: var(--text-primary); }

/* ── YANIT (REPLY) ──────────────────────────────────────────── */
.reply-list {
    border-left: 2px solid var(--border);
    margin-left: 20px; padding-left: 12px; margin-top: 8px;
}
.reply-item {
    padding: 10px 12px; background: var(--bg-elevated);
    border-radius: var(--radius-md); margin-bottom: 8px;
    font-size: .88rem; border-left: 3px solid var(--primary);
    position: relative;
}
.reply-item.sub-reply { margin-left: 24px; border-left-color: var(--text-muted); }
.reply-compose { margin-top: 10px; display: flex; gap: 8px; }
.reply-compose textarea {
    flex: 1; background: var(--bg-input); border: 1px solid var(--border);
    border-radius: var(--radius-md); padding: 8px 12px;
    color: var(--text-primary); outline: none; resize: none;
    font-size: .88rem; min-height: 60px;
    transition: border-color var(--transition);
}
.reply-compose textarea:focus { border-color: var(--primary); }
.reply-compose textarea::placeholder { color: var(--text-secondary); }

/* ── MESAJLAŞMA ─────────────────────────────────────────────── */
.chat-container {
    display: flex; flex-direction: column;
    height: calc(100vh - var(--header-h) - 80px); max-height: 650px;
}
.chat-messages {
    flex: 1; overflow-y: auto; padding: 16px;
    display: flex; flex-direction: column; gap: 8px;
    scrollbar-width: thin; scrollbar-color: var(--border) transparent;
}
.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.bubble {
    max-width: 72%; padding: 10px 14px; border-radius: 18px;
    font-size: .9rem; line-height: 1.5;
    word-wrap: break-word; overflow-wrap: break-word; position: relative;
}
.bubble.me {
    background: var(--primary); color: #fff;
    align-self: flex-end; border-bottom-right-radius: 4px;
}
.bubble.other {
    background: var(--bg-elevated); color: var(--text-primary);
    align-self: flex-start; border-bottom-left-radius: 4px;
    border: 1px solid var(--border);
}
.bubble-footer { display: flex; justify-content: flex-end; align-items: center; gap: 4px; margin-top: 4px; }
.bubble-time   { font-size: .7rem; opacity: .7; }
.del-msg       { opacity: 0; transition: opacity var(--transition); font-size: .75rem; cursor: pointer; color: inherit; }
.bubble:hover .del-msg { opacity: .6; }
.del-msg:hover { opacity: 1 !important; }
.status-tick      { font-size: .7rem; opacity: .7; }
.status-tick.read { color: #53bdeb; opacity: 1; }

.chat-input-area {
    padding: 12px 16px; border-top: 1px solid var(--border);
    display: flex; gap: 10px; align-items: flex-end;
    background: var(--bg-surface);
}
.chat-input {
    flex: 1; background: var(--bg-input); border: 1px solid var(--border);
    border-radius: var(--radius-full); padding: 10px 16px;
    color: var(--text-primary); outline: none; resize: none;
    max-height: 120px; font-size: .9rem;
    transition: border-color var(--transition);
}
.chat-input:focus { border-color: var(--primary); }
.chat-input::placeholder { color: var(--text-secondary); }
.typing-indicator {
    font-size: .78rem; color: var(--primary);
    font-style: italic; padding: 4px 16px; min-height: 22px;
}

/* ── PROFİL ─────────────────────────────────────────────────── */
.profile-banner {
    height: 160px;
    background: linear-gradient(135deg, #0a1628 0%, #1a1a2e 50%, #0f3460 100%);
    position: relative;
}
.profile-avatar-wrap { position: absolute; bottom: -44px; left: 20px; }
.profile-avatar {
    width: 90px; height: 90px; border-radius: 50%;
    object-fit: cover; border: 4px solid var(--bg-base);
}
.online-indicator {
    width: 14px; height: 14px; background: var(--success);
    border: 3px solid var(--bg-base); border-radius: 50%;
    position: absolute; bottom: 4px; right: 4px;
}
.profile-info { padding: 12px 20px 16px; }
.profile-name  { font-size: 1.15rem; font-weight: 800; color: var(--text-primary); }
.profile-handle{ font-size: .9rem; color: var(--text-secondary); margin-top: 2px; }
.profile-bio   { font-size: .9rem; color: var(--text-primary); margin-top: 10px; line-height: 1.5; }
.profile-stats { display: flex; gap: 20px; margin-top: 12px; font-size: .9rem; flex-wrap: wrap; }
.stat-item strong { color: var(--text-primary); font-weight: 700; }
.stat-item span   { color: var(--text-secondary); }
.profile-actions  { padding: 12px 20px; display: flex; gap: 8px; flex-wrap: wrap; }

/* ── SIDEBAR / TREND ────────────────────────────────────────── */
.sidebar-box {
    background: var(--bg-surface); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 16px; margin-bottom: 16px;
}
.sidebar-title {
    font-size: 1rem; font-weight: 800; color: var(--text-primary);
    margin-bottom: 12px; padding-bottom: 10px;
    border-bottom: 1px solid var(--border-light);
}
.trend-item {
    padding: 10px 0; border-bottom: 1px solid var(--border-light);
    cursor: pointer; transition: opacity var(--transition);
}
.trend-item:last-child { border-bottom: none; }
.trend-item:hover { opacity: .8; }
.trend-tag   { font-weight: 700; color: var(--text-primary); font-size: .9rem; }
.trend-count { font-size: .78rem; color: var(--text-secondary); margin-top: 2px; }

/* ── SKELETON LOADER ────────────────────────────────────────── */
.skeleton {
    background: linear-gradient(90deg,
        var(--bg-elevated) 25%, var(--bg-hover) 50%, var(--bg-elevated) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}
@keyframes shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
.skeleton-avatar { width: 44px; height: 44px; border-radius: 50%; }
.skeleton-line   { height: 12px; margin-bottom: 8px; }
.skeleton-line.short  { width: 40%; }
.skeleton-line.medium { width: 70%; }
.skeleton-line.full   { width: 100%; }

/* ── ALERT ──────────────────────────────────────────────────── */
.alert { padding: 12px 16px; border-radius: var(--radius-md); font-size: .9rem; margin-bottom: 12px; display: flex; align-items: center; gap: 10px; }
.alert-error   { background: rgba(244,33,46,.15);  border: 1px solid rgba(244,33,46,.4);   color: #ff6b78; }
.alert-success { background: rgba(0,186,124,.15);  border: 1px solid rgba(0,186,124,.4);   color: #00ba7c; }
.alert-info    { background: var(--primary-muted); border: 1px solid rgba(29,155,240,.3); color: var(--primary); }

/* ── KULLANICI KARTI (explore) ──────────────────────────────── */
.user-card {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 16px; border-bottom: 1px solid var(--border-light);
    transition: background var(--transition);
}
.user-card:hover { background: var(--bg-hover); }
.user-card-info  { display: flex; align-items: center; gap: 12px; min-width: 0; }
.user-card-avatar{ width: 48px; height: 48px; border-radius: 50%; object-fit: cover; flex-shrink: 0; border: 1px solid var(--border); }
.user-card-name  { font-weight: 700; color: var(--text-primary); font-size: .9rem; }
.user-card-bio   { font-size: .8rem; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }

/* ── OPTIONS MENÜ (⋮) ───────────────────────────────────────── */
.options-wrap    { position: relative; }
.options-trigger {
    width: 34px; height: 34px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; color: var(--text-secondary); font-size: 1.1rem;
    background: none; border: none;
    transition: background var(--transition), color var(--transition);
}
.options-trigger:hover { background: var(--primary-muted); color: var(--primary); }
.options-menu {
    display: none; position: absolute; right: 0; top: 38px;
    background: var(--bg-elevated); border: 1px solid var(--border);
    border-radius: var(--radius-md); box-shadow: var(--shadow-md);
    min-width: 160px; z-index: 200; overflow: hidden;
}
.options-menu.open { display: block; }
.options-menu a,
.options-menu button {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 16px; font-size: .9rem; color: var(--text-primary);
    background: none; border: none; width: 100%;
    text-align: left; cursor: pointer;
    transition: background var(--transition); text-decoration: none;
}
.options-menu a:hover,
.options-menu button:hover { background: var(--bg-hover); opacity: 1; }
.options-menu .danger-item { color: var(--danger); }

/* ── UTILITY ────────────────────────────────────────────────── */
.text-primary   { color: var(--text-primary)   !important; }
.text-secondary { color: var(--text-secondary) !important; }
.text-muted     { color: var(--text-muted)     !important; }
.text-danger    { color: var(--danger)         !important; }
.text-success   { color: var(--success)        !important; }
.fw-bold        { font-weight: 700; }
.text-center    { text-align: center; }
.d-flex         { display: flex; }
.align-center   { align-items: center; }
.justify-between{ justify-content: space-between; }
.gap-1{gap:4px} .gap-2{gap:8px} .gap-3{gap:12px}
.w-full         { width: 100%; }
.hidden         { display: none !important; }
.mt-1{margin-top:4px}   .mt-2{margin-top:8px}   .mt-3{margin-top:12px}  .mt-4{margin-top:16px}
.mb-1{margin-bottom:4px}.mb-2{margin-bottom:8px}.mb-3{margin-bottom:12px}.mb-4{margin-bottom:16px}
.divider      { border: none; border-top: 1px solid var(--border); margin: 0; }
.empty-state  { text-align: center; padding: 60px 20px; color: var(--text-secondary); }
.empty-state .icon { font-size: 3rem; margin-bottom: 12px; display: block; }
.page-header  {
    position: sticky; top: 0; z-index: 50;
    background: rgba(0,0,0,.85); backdrop-filter: blur(12px);
    padding: 14px 20px; border-bottom: 1px solid var(--border);
    display: flex; align-items: center; gap: 16px;
}
.page-title   { font-size: 1rem; font-weight: 800; color: var(--text-primary); }

/* ── MOBİL ALT NAV ──────────────────────────────────────────── */
.mobile-nav {
    display: none; position: fixed; bottom: 0; left: 0; right: 0;
    background: rgba(0,0,0,.95); backdrop-filter: blur(12px);
    border-top: 1px solid var(--border); padding: 8px 0;
    z-index: 200; justify-content: space-around;
}
.mobile-nav-item {
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    padding: 6px 16px; color: var(--text-secondary); font-size: .65rem;
    cursor: pointer; border-radius: var(--radius-md);
    transition: color var(--transition); text-decoration: none;
}
.mobile-nav-item.active { color: var(--primary); }
.mobile-nav-item svg    { width: 22px; height: 22px; }

/* ── RESPONSIVE ─────────────────────────────────────────────── */
@media (max-width: 1100px) { .right-sidebar { display: none; } }

@media (max-width: 768px) {
    .sidebar     { display: none; }
    .main-content{ max-width: 100%; border-right: none; }
    body         { padding-bottom: 70px; }
    .post-card   { padding: 12px; }
    .bubble      { max-width: 85%; }
    .chat-container { height: calc(100vh - var(--header-h) - 70px); }
    .profile-stats  { gap: 12px; }
    .mobile-nav     { display: flex; }
}

/* ── SCROLLBAR ──────────────────────────────────────────────── */
::-webkit-scrollbar       { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ── TOAST BİLDİRİM ───────────────────────────────────────── */
#toast-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    pointer-events: none;
}

.toast {
    background: var(--bg-elevated);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    padding: 10px 20px;
    font-size: .9rem;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    pointer-events: auto;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity .25s, transform .25s;
    white-space: nowrap;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast.toast-success { border-color: var(--success); color: var(--success); }
.toast.toast-error   { border-color: var(--danger);  color: var(--danger);  }
.toast.toast-info    { border-color: var(--primary);  color: var(--primary); }