/* ==========================================================================
   DIECAST TR - ANA STİL DOSYASI (Açık ve Koyu Tema Destekli)
   ========================================================================== */

/* ── KOYU TEMA (Varsayılan) ── */
:root {
  --bg: #0a0a0c;
  --bg2: #111116;
  --bg3: #18181f;
  --bg4: #1f1f28;
  --border: rgba(255,255,255,0.07);
  --border2: rgba(255,255,255,0.12);
  --text: #f0f0f5;
  --text2: #9090a8;
  --text3: #55556a;
  --accent: #ff4d1c;
  --accent2: #ff8c42;
  --gold: #f5c842;
  --blue: #3d8bff;
  --green: #22d47a;
  --card-bg: #14141c;
  --card-hover: #1a1a24;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 8px 32px rgba(0,0,0,0.5);
  --glow: 0 0 24px rgba(255,77,28,0.2);
}

/* ── AÇIK TEMA (Kullanıcı veya Sistem Tercih Ettiğinde Devreye Girer) ── */
[data-theme="light"] {
  --bg: #f8f9fa;
  --bg2: #ffffff;
  --bg3: #f1f3f5;
  --bg4: #e9ecef;
  --border: rgba(0,0,0,0.1);
  --border2: rgba(0,0,0,0.15);
  --text: #111116;
  --text2: #495057;
  --text3: #868e96;
  --card-bg: #ffffff;
  --card-hover: #fcfcfd;
  --shadow: 0 8px 32px rgba(0,0,0,0.06);
  --glow: 0 0 24px rgba(255,77,28,0.1);
}

/* ── TEMEL SIFIRLAMALAR ── */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 2px; }

/* ══════════════════════════════════════
   SOL MENÜ (SIDEBAR)
══════════════════════════════════════ */
.sidebar {
  position: fixed; left: 0; top: 0; bottom: 0;
  width: 240px;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  padding: 20px 0;
  z-index: 100;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.logo {
  padding: 0 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
}

.logo-icon {
  width: 38px; height: 38px;
  background: var(--accent);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  box-shadow: var(--glow);
}

.logo-text {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 22px;
  letter-spacing: 1px;
  line-height: 1;
}

.logo-text span {
  display: block;
  font-family: 'DM Sans', sans-serif;
  font-size: 10px;
  font-weight: 400;
  color: var(--text2);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-top: 1px;
}

.nav-section { margin-top: 16px; }

.nav-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text3);
  padding: 0 20px;
  margin-bottom: 4px;
}

.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 20px;
  color: var(--text2);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: all 0.15s;
  cursor: pointer;
  position: relative;
}

.nav-item:hover { color: var(--text); background: var(--bg3); }
.nav-item.active { color: var(--accent); border-left-color: var(--accent); background: rgba(255,77,28,0.06); }

.nav-icon { font-size: 18px; width: 22px; text-align: center; }

.nav-badge {
  margin-left: auto;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  width: 18px; height: 18px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}

.sidebar-profile {
  margin-top: auto;
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
  cursor: pointer;
  transition: background 0.15s;
  border-radius: var(--radius-sm);
  margin: auto 8px 0;
}

.sidebar-profile:hover { background: var(--bg3); }

.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; color: #fff;
  flex-shrink: 0;
}

.avatar.lg { width: 56px; height: 56px; font-size: 20px; }
.avatar.xl { width: 80px; height: 80px; font-size: 28px; border: 3px solid var(--accent); }
.avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

.profile-info { flex: 1; min-width: 0; }
.profile-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile-handle { font-size: 11px; color: var(--text2); }

/* ══════════════════════════════════════
   HİKAYELER (STORIES BAR)
══════════════════════════════════════ */
.stories-bar {
  display: flex; gap: 12px;
  padding: 16px 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.stories-bar::-webkit-scrollbar { display: none; }

.story-item {
  display: flex; flex-direction: column; align-items: center;
  gap: 6px; cursor: pointer; flex-shrink: 0;
}

.story-ring {
  padding: 2px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--gold), var(--accent2));
}

.story-ring.seen { background: var(--bg4); }

.story-avatar {
  width: 58px; height: 58px; border-radius: 50%;
  background: var(--bg3);
  border: 2px solid var(--bg2);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  overflow: hidden;
}

.story-avatar img { width: 100%; height: 100%; object-fit: cover; }

.story-name {
  font-size: 11px; color: var(--text2);
  white-space: nowrap; max-width: 64px;
  overflow: hidden; text-overflow: ellipsis;
  text-align: center;
}

.add-story .story-ring { background: var(--bg4); }
.add-story .story-avatar { background: var(--bg3); font-size: 24px; color: var(--accent); }
.add-story .story-name { color: var(--text); font-weight: 500; }

/* ══════════════════════════════════════
   ANA İSKELET VE YAPI
══════════════════════════════════════ */
.main-wrapper {
  margin-left: 240px;
  display: grid;
  grid-template-columns: 1fr 320px;
  min-height: 100vh;
}

.feed-col {
  border-right: 1px solid var(--border);
  padding: 0 0 40px;
}

.right-col { padding: 20px 20px 20px 24px; }

.feed-header {
  position: sticky; top: 0;
  background: rgba(var(--bg-rgb), 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 12px 20px;
  display: flex; align-items: center; justify-content: space-between;
  z-index: 50;
}

[data-theme="dark"] .feed-header { background: rgba(10,10,12,0.9); }
[data-theme="light"] .feed-header { background: rgba(255,255,255,0.9); }

.feed-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 20px; letter-spacing: 1px;
  color: var(--text);
}

.feed-tabs { display: flex; gap: 4px; }

.feed-tab {
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 12px; font-weight: 600;
  cursor: pointer; border: none;
  transition: all 0.15s;
  background: transparent; color: var(--text2);
}

.feed-tab.active { background: var(--accent); color: #fff; }
.feed-tab:hover:not(.active) { background: var(--bg3); color: var(--text); }

.feed-body { padding: 0 20px; }

/* ══════════════════════════════════════
   GÖNDERİ KARTI (POST CARD)
══════════════════════════════════════ */
.post-card {
  /* Arka planı temaya uyumlu hale getirdik */
  background: var(--bg2);
  /* Çizgi rengini de arka planla aynı yaptık (Beyaz modda beyaz, siyah modda siyah olur) */
  border: 1px solid var(--bg2) !important; 
  border-radius: var(--radius);
  margin-bottom: 30px;
  overflow: hidden;
  transition: box-shadow 0.2s, background-color 0.3s;
  animation: fadeUp 0.4s ease both;
  box-shadow: 0 4px 20px rgba(0,0,0,0.05); /* Yumuşak gölge */
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.post-card:nth-child(2) { animation-delay: 0.05s; }
.post-card:nth-child(3) { animation-delay: 0.1s; }
.post-card:nth-child(4) { animation-delay: 0.15s; }

.post-card:hover { box-shadow: 0 10px 40px rgba(0,0,0,0.1); }

.post-header {
  padding: 14px 18px;
  display: flex; align-items: center; gap: 12px;
  background: var(--bg2);
}

.post-user-info { flex: 1; }
.post-user-name {
  font-size: 13px; font-weight: 600;
  display: flex; align-items: center; gap: 6px;
}

.badge {
  font-size: 9px; font-weight: 700;
  padding: 2px 6px; border-radius: 4px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.badge-verified { background: rgba(61,139,255,0.15); color: var(--blue); }
.badge-seller { background: rgba(34,212,122,0.15); color: var(--green); }
.badge-champ { background: rgba(245,200,66,0.15); color: var(--gold); }
.badge-sale { background: rgba(255,77,28,0.15); color: var(--accent); }
.badge-trade { background: rgba(255,140,66,0.15); color: var(--accent2); }
.badge-sponsor { background: rgba(245,200,66,0.1); color: var(--gold); border: 1px solid rgba(245,200,66,0.2); }

.post-time { font-size: 11px; color: var(--text3); margin-top: 2px; }

.post-menu-btn {
  background: none; border: none; color: var(--text3);
  font-size: 18px; cursor: pointer; padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: color 0.15s;
}
.post-menu-btn:hover { color: var(--text); background: var(--bg3); }

.post-image {
  width: 100%; 
  /* Fotoğrafın tam oturmayan kısımları (boşlukları) temanın rengi olacak! */
  background: var(--bg2); 
  overflow: hidden; 
  position: relative;
  display: block;
}

.post-image img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.post-card:hover .post-image img { transform: scale(1.02); }

.image-tag {
  position: absolute; top: 10px; right: 10px;
  display: flex; gap: 6px;
}

.scale-chip {
  background: rgba(10,10,12,0.85);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border2);
  font-family: 'Space Mono', monospace;
  font-size: 11px; color: #fff;
  padding: 3px 8px; border-radius: 20px;
}

.post-actions {
  padding: 10px 16px;
  display: flex; align-items: center; gap: 4px;
}

.action-btn {
  display: flex; align-items: center; gap: 5px;
  background: none; border: none;
  color: var(--text2); font-size: 13px;
  padding: 6px 10px; border-radius: var(--radius-sm);
  cursor: pointer; font-family: inherit;
  transition: all 0.15s;
}

.action-btn:hover { color: var(--text); background: var(--bg3); }
.action-btn.liked { color: var(--accent); }
.action-btn .icon { font-size: 17px; }
.action-btn span { font-weight: 500; }

.save-btn { margin-left: auto; }

.post-content { padding: 0 16px 14px; }
.post-desc { font-size: 13px; line-height: 1.6; color: var(--text); }

.post-tags {
  margin-top: 8px;
  display: flex; flex-wrap: wrap; gap: 4px;
}

.tag { font-size: 12px; color: var(--blue); cursor: pointer; }
.tag:hover { text-decoration: underline; }

.post-comments {
  padding: 0 16px 14px;
  border-top: 1px solid var(--border);
}

.comment-preview {
  padding: 10px 0 4px;
  display: flex; align-items: flex-start; gap: 8px;
  font-size: 12px;
}

.comment-text { color: var(--text2); line-height: 1.5; }
.comment-text strong { color: var(--text); font-weight: 600; }

.view-comments {
  font-size: 12px; color: var(--text3);
  cursor: pointer; margin-top: 2px;
}
.view-comments:hover { color: var(--text2); }

/* AD CARD */
.ad-card { position: relative; }
.ad-label { position: absolute; top: 8px; left: 8px; z-index: 2; }

/* ══════════════════════════════════════
   SAĞ SÜTUN WIDGETLARI
══════════════════════════════════════ */
.widget {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}

.widget-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 16px; letter-spacing: 1px;
  color: var(--text);
  display: flex; align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.widget-link {
  font-family: 'DM Sans', sans-serif;
  font-size: 11px; font-weight: 600;
  color: var(--accent); text-decoration: none;
  letter-spacing: 0;
}

/* BUTONLAR */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px; padding: 9px 18px; border-radius: var(--radius-sm);
  font-family: inherit; font-size: 13px; font-weight: 600;
  cursor: pointer; border: none; transition: all 0.15s; text-decoration: none;
}
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 4px 14px rgba(255,77,28,0.25); }
.btn-primary:hover { background: #ff6340; transform: translateY(-1px); }
.btn-outline { background: transparent; color: var(--text); border: 1px solid var(--border2); }
.btn-outline:hover { background: var(--bg3); }
.btn-full { width: 100%; }

/* ══════════════════════════════════════
   KEŞFET SAYFASI
══════════════════════════════════════ */
.search-bar {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 7px 14px;
  margin-bottom: 16px;
  transition: border-color 0.15s;
}
.search-bar:focus-within { border-color: var(--accent); }
.search-bar input {
  background: none; border: none; outline: none;
  color: var(--text); font-family: inherit; font-size: 13px; flex: 1;
}
.search-bar input::placeholder { color: var(--text3); }
.search-bar .icon { color: var(--text3); font-size: 16px; }

/* ══════════════════════════════════════
   PAZAR YERİ EKRANI
══════════════════════════════════════ */
.market-filters {
  display: flex; gap: 8px; flex-wrap: wrap;
  padding: 12px 20px; border-bottom: 1px solid var(--border);
}
.filter-chip {
  padding: 5px 12px; border-radius: 20px;
  font-size: 12px; font-weight: 500;
  border: 1px solid var(--border2); color: var(--text2);
  background: transparent; cursor: pointer; font-family: inherit;
  transition: all 0.15s;
}
.filter-chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.filter-chip:hover:not(.active) { border-color: var(--text3); color: var(--text); }

/* ══════════════════════════════════════
   MOBİL ALT MENÜ (BOTTOM NAV)
══════════════════════════════════════ */
.bottom-nav {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0;
  background: rgba(var(--bg-rgb), 0.95);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  padding: 8px 0 env(safe-area-inset-bottom);
  z-index: 100;
}

[data-theme="dark"] .bottom-nav { background: rgba(10,10,12,0.95); }
[data-theme="light"] .bottom-nav { background: rgba(255,255,255,0.95); }

.bottom-nav-inner { display: flex; justify-content: space-around; align-items: center; }
.bottom-nav-item {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  cursor: pointer; padding: 4px 12px;
  color: var(--text3); font-size: 10px; transition: color 0.15s;
  text-decoration: none;
}
.bottom-nav-item.active { color: var(--accent); }
.bottom-nav-item .icon { font-size: 22px; }

/* ══════════════════════════════════════
   SAYFA SİSTEMİ (Gizleme/Gösterme)
══════════════════════════════════════ */
.page { display: none; }
.page.active { display: block; }

/* ══════════════════════════════════════
   RESPONSIVE (MOBİL UYUM) YAPI
══════════════════════════════════════ */
@media (max-width: 1100px) {
  .right-col { display: none; }
  .main-wrapper { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .sidebar { display: none; }
  .bottom-nav { display: block; }
  .main-wrapper { margin-left: 0; padding-bottom: 70px; }
  .market-grid { grid-template-columns: 1fr 1fr; }
  
  /* Mobilde kart tasarımı temizliği */
  .post-card { border-radius: 0; margin-bottom: 15px; box-shadow: none; border: none !important; }
}

/* ══════════════════════════════════════
   PROFIL SAYFASI (Düzeltilmiş Stiller)
══════════════════════════════════════ */
.profile-cover {
  height: 140px;
  background: linear-gradient(135deg, #1a0500, #0a0a1a, #001a12);
  position: relative;
  border-radius: 0 0 14px 14px;
}

.cover-pattern {
  position: absolute; inset: 0;
  background-image:
    radial-gradient(circle at 20% 50%, rgba(255,77,28,0.12) 0%, transparent 50%),
    radial-gradient(circle at 80% 30%, rgba(61,139,255,0.08) 0%, transparent 40%);
  border-radius: 0 0 14px 14px;
}

.profile-avatar-wrap { position: absolute; bottom: -40px; left: 20px; z-index: 10; }
.profile-body { padding: 52px 20px 20px; }

.profile-actions { display: flex; gap: 8px; justify-content: flex-end; margin-bottom: 12px; }
.profile-name-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.profile-name { font-family: 'Bebas Neue', sans-serif; font-size: 24px; letter-spacing: 1px; }

.profile-handle-text { color: var(--text2); font-size: 14px; }
.profile-bio { font-size: 13px; color: var(--text2); line-height: 1.6; margin: 8px 0; }

.profile-stats { display: flex; gap: 20px; margin: 12px 0; }
.stat-item { text-align: center; }
.stat-num { font-family: 'Bebas Neue', sans-serif; font-size: 22px; }
.stat-label { font-size: 11px; color: var(--text2); }

.profile-tabs { display: flex; border-bottom: 1px solid var(--border); margin-top: 16px; }
.profile-tab {
  padding: 10px 16px; font-size: 13px; font-weight: 600;
  color: var(--text2); cursor: pointer;
  border-bottom: 2px solid transparent; transition: all 0.15s;
  background: none; border-left: none; border-right: none; border-top: none; font-family: inherit;
}
.profile-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.profile-tab:hover:not(.active) { color: var(--text); }

.garage-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; margin-top: 1px; }

.garage-thumb {
  aspect-ratio: 1;
  background: var(--bg3); font-size: 36px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; position: relative; overflow: hidden;
}

.garage-thumb:hover .explore-overlay { opacity: 1; }

.explore-overlay {
  position: absolute; inset: 0; background: rgba(0,0,0,0.6);
  display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 4px;
  opacity: 0; transition: opacity 0.2s; color: white;
}

.explore-overlay span { font-size: 13px; font-weight: 600; text-align: center; padding: 0 5px; }
.explore-overlay small { font-size: 11px; color: #ccc; }

.top-nav { height: 60px; display: flex; align-items: center; background: var(--bg); border-bottom: 1px solid var(--border); padding: 0 20px; }
.search-bar-top { position: relative; display: flex; align-items: center; background: var(--bg3); border-radius: 8px; padding: 5px 12px; width: 250px; }
.search-bar-top i { font-size: 14px; color: var(--text3); margin-right: 8px; }
.search-bar-top input { background: transparent; border: none; color: var(--text); outline: none; font-size: 13px; width: 100%; }

.avatar.sm { width: 32px; height: 32px; font-size: 12px; }
.avatar.xl { width: 100px; height: 100px; font-size: 32px; border: 4px solid var(--bg); }

@media (max-width: 768px) {
    .sidebar { display: none; }
    .main-wrapper { display: block !important; padding: 0; margin-bottom: 70px; }
    .feed-col { width: 100% !important; max-width: 100% !important; padding: 0 !important; }
    .right-col { display: none; }
    .search-bar-top { display: none; }
    .profile-cover { height: 120px; }
    .profile-avatar-wrap { bottom: -40px; left: 20px; transform: none; }
    .avatar.xl { width: 80px; height: 80px; }
    .profile-body { padding: 50px 15px 20px 15px; }
    .profile-stats { justify-content: space-around; gap: 10px; }
    .stat-item .stat-num { font-size: 18px; }
    .garage-grid { grid-template-columns: repeat(3, 1fr) !important; gap: 2px; }
    .mobile-nav { display: flex !important; }
}

.mobile-nav {
    display: none; position: fixed; bottom: 0; left: 0; width: 100%; height: 65px;
    background: var(--bg); border-top: 1px solid var(--border);
    justify-content: space-around; align-items: center; z-index: 9999;
}

.mobile-nav-item {
    text-decoration: none; color: var(--text3); display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 10px;
}
.mobile-nav-item.active { color: var(--accent); }
.mobile-nav-item i { font-size: 20px; }
