/* =====================================================================
   FreewareTR.com — Ana Stil Dosyası
   Tema: CSS değişkenleri ile açık/koyu geçiş
   ===================================================================== */

/* ---- Tema Değişkenleri ---- */
:root {
  --bg-page:        #0f0f1a;
  --bg-panel:       #1a1a2e;
  --bg-card:        #16213e;
  --bg-hover:       #1e2a4a;
  --bg-active:      #1565c0;
  --border:         #2a2a4e;
  --text-primary:   #e8eaf6;
  --text-secondary: #9fa8da;
  --text-muted:     #616161;
  --accent:         #4fc3f7;
  --accent-2:       #81c784;
  --danger:         #ef5350;
  --shadow:         0 4px 24px rgba(0,0,0,.5);
  --radius:         10px;
  --transition:     .2s ease;
  --sidebar-width:  260px;
  --header-height:  56px;
}

[data-theme="light"] {
  --bg-page:        #f0f2f5;
  --bg-panel:       #ffffff;
  --bg-card:        #f8f9fa;
  --bg-hover:       #e8f0fe;
  --bg-active:      #1565c0;
  --border:         #dde1e7;
  --text-primary:   #1a1a2e;
  --text-secondary: #3949ab;
  --text-muted:     #9e9e9e;
  --accent:         #1565c0;
  --accent-2:       #2e7d32;
  --shadow:         0 2px 12px rgba(0,0,0,.1);
}

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg-page);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  transition: background var(--transition), color var(--transition);
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; display: block; }

/* ---- Header ---- */
.header {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--header-height);
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
  padding: 0 20px;
  z-index: 100;
  box-shadow: var(--shadow);
}

.menu-btn {
  display: none;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 7px; padding: 5px 10px; cursor: pointer;
  font-size: 1.1rem; color: var(--text-secondary); line-height: 1;
  align-items: center; justify-content: center;
  flex-shrink: 0;
}

.header-logo {
  display: flex; align-items: center; gap: 10px;
  font-size: 1.2rem; font-weight: 700;
  white-space: nowrap;
}
.logo-freeware { color: #ffffff; }
.logo-tr       { color: var(--accent); }
[data-theme="light"] .logo-freeware { color: #6b7280; }

.header-logo img { width: 28px; height: 28px; }

/* Üst sekme çubuğu (diğer freeware) */
.header-tabs {
  display: flex; align-items: center; gap: 4px;
  overflow-x: auto; flex: 1;
  scrollbar-width: none;
}
.header-tabs::-webkit-scrollbar { display: none; }

.htab {
  padding: 6px 14px;
  border-radius: 6px;
  font-size: .85rem;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  border: 1px solid transparent;
  transition: all var(--transition);
  background: none;
  font-family: inherit;
}
.htab:hover { background: var(--bg-hover); color: var(--text-primary); }
.htab.active {
  background: var(--bg-active);
  color: #fff;
  border-color: var(--bg-active);
}

/* Sağ kontroller */
.header-controls {
  display: flex; align-items: center; gap: 10px; margin-left: auto; flex-shrink: 0;
}

.theme-toggle {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 5px 12px;
  cursor: pointer;
  font-size: .82rem;
  color: var(--text-secondary);
  display: flex; align-items: center; gap: 6px;
  transition: all var(--transition);
  font-family: inherit;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }

/* ---- Dil Değiştirici ---- */
.lang-switcher { display: flex; gap: 4px; }
.lang-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: 5px;
  padding: 3px 9px;
  font-size: .75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
}
.lang-btn:hover  { background: var(--bg-card); color: var(--text-primary); }
.lang-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ---- Ana Layout ---- */
.layout {
  display: flex;
  margin-top: var(--header-height);
  min-height: calc(100vh - var(--header-height));
  overflow-x: hidden;
}

/* ---- Sidebar Backdrop (mobil) ---- */
.sidebar-backdrop {
  display: none; position: fixed; inset: 0;
  top: var(--header-height); background: rgba(0,0,0,.55); z-index: 49;
}

/* ---- Sol Panel (FreewareTR Uygulamaları) ---- */
.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  background: var(--bg-panel);
  border-right: 1px solid var(--border);
  padding: 16px 0;
  position: sticky;
  top: var(--header-height);
  height: calc(100vh - var(--header-height));
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
  transition: transform .3s ease;
}

.sidebar-title {
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0 16px 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}

.app-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px;
  cursor: pointer;
  transition: background var(--transition);
  border-left: 3px solid transparent;
}
.app-item:hover { background: var(--bg-hover); }
.app-item.active {
  background: var(--bg-hover);
  border-left-color: var(--accent);
}

.app-item img {
  width: 36px; height: 36px;
  border-radius: 8px;
  object-fit: contain;
  background: var(--bg-card);
  padding: 4px;
  flex-shrink: 0;
}

.app-item-info { overflow: hidden; }
.app-item-name {
  font-size: .9rem; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.app-item-desc {
  font-size: .75rem; color: var(--text-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.app-item-badge {
  margin-left: auto; flex-shrink: 0;
  font-size: .65rem; padding: 2px 6px;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
}

/* ---- Sağ İçerik Alanı ---- */
.content {
  flex: 1; overflow-y: auto; overflow-x: hidden;
  padding: 28px 32px;
  min-width: 0;
}

/* Boş durum */
.empty-state {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  height: 60vh; gap: 16px; color: var(--text-muted);
  text-align: center;
}
.empty-state svg { opacity: .3; }
.empty-state p { font-size: 1.1rem; }

/* ---- Uygulama Detay Kartı ---- */
.app-detail { animation: fadeIn .25s ease; }

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

.app-detail-header {
  display: flex; align-items: flex-start; gap: 16px;
  margin-bottom: 18px;
}
.app-detail-header img {
  width: 64px; height: 64px;
  border-radius: 12px;
  object-fit: contain;
  background: var(--bg-panel);
  padding: 7px;
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.app-logo-ico {
  width: 64px; height: 64px; border-radius: 12px;
  background: var(--bg-card); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem; flex-shrink: 0;
}
.app-detail-meta { flex: 1; }
.app-detail-meta h2 { font-size: 1.45rem; color: var(--text-primary); }
.badges { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.badge {
  font-size: .7rem; padding: 2px 8px; border-radius: 10px;
  border: 1px solid var(--border); color: var(--text-secondary);
}
.badge.gray   { border-color: var(--text-muted); color: var(--text-muted); }
.badge.green  { border-color: var(--accent-2); color: var(--accent-2); }
.badge.blue   { border-color: var(--accent);   color: var(--accent); }

/* ---- 2 Sütun Layout ---- */
.detail-body {
  display: grid; grid-template-columns: 1fr 360px;
  gap: 20px; align-items: start; margin-bottom: 20px;
}
.right-col { display: flex; flex-direction: column; gap: 14px; }

/* ---- Açıklama Paneli ---- */
.desc-panel {
  background: var(--bg-panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px 20px; min-height: 260px;
  overflow: hidden; min-width: 0;
}
.desc-panel p, .desc-panel li { overflow-wrap: break-word; word-break: break-word; }
.desc-panel h3 { font-size: .95rem; color: var(--accent); margin: 14px 0 6px; font-weight: 700; }
.desc-panel h3:first-child { margin-top: 0; }
.desc-panel h4 { font-size: .85rem; color: var(--text-primary); margin: 10px 0 4px; font-weight: 600; }
.desc-panel em { color: var(--text-muted); font-style: italic; }
.desc-panel p  { font-size: .88rem; color: var(--text-secondary); margin-bottom: 8px; line-height: 1.7; }
.desc-panel ul { padding-left: 18px; margin-bottom: 8px; }
.desc-panel li { font-size: .86rem; color: var(--text-secondary); margin-bottom: 4px; line-height: 1.6; }
.desc-panel strong { color: var(--text-primary); }
.desc-panel code  { background: var(--bg-card); padding: 1px 5px; border-radius: 3px; font-size: .83rem; color: var(--accent); font-family: monospace; }
.desc-panel hr    { border: none; border-top: 1px solid var(--border); margin: 12px 0; }
.desc-panel a     { color: var(--accent); }
.desc-panel .tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 8px 0; }
.desc-panel table { width: 100%; border-collapse: collapse; font-size: .82rem; min-width: 320px; }
.desc-panel th, .desc-panel td { padding: 5px 8px; border: 1px solid var(--border); text-align: left; white-space: normal; }
.desc-panel th    { background: var(--bg-card); color: var(--text-secondary); }

/* ---- YouTube Placeholder ---- */
.yt-box {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); aspect-ratio: 16/9;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 8px;
}
.yt-box .yt-icon { font-size: 2.5rem; opacity: .4; }
.yt-box strong   { font-size: .9rem; color: var(--text-secondary); }
.yt-box p        { font-size: .8rem; color: var(--text-muted); }

.yt-embed {
  border-radius: var(--radius); overflow: hidden;
  aspect-ratio: 16/9; background: #000;
}
.yt-embed iframe { width: 100%; height: 100%; display: block; }

/* Carousel */
.carousel {
  position: relative; overflow: hidden;
  border-radius: var(--radius);
  background: var(--bg-card);
  border: 1px solid var(--border);
  aspect-ratio: 16/9;
}
.carousel-track {
  display: flex; height: 100%;
  transition: transform .5s ease;
}
.carousel-slide {
  min-width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
}
.carousel-slide img {
  width: 100%; height: 100%; object-fit: contain;
}
.carousel-dots {
  position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 6px;
}
.carousel-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: rgba(255,255,255,.3); cursor: pointer;
  transition: background var(--transition);
  border: none;
}
.carousel-dot.active { background: var(--accent); }

.carousel-btn {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(0,0,0,.4); border: none; color: #fff;
  width: 36px; height: 36px; border-radius: 50%; cursor: pointer;
  font-size: 1rem; display: flex; align-items: center; justify-content: center;
  transition: background var(--transition);
}
.carousel-btn:hover { background: rgba(0,0,0,.7); }
.carousel-btn.prev { left: 10px; }
.carousel-btn.next { right: 10px; }
.carousel-slide img { cursor: zoom-in; }

/* Lightbox */
.lightbox-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,.92);
  display: flex; align-items: center; justify-content: center;
  animation: lbFadeIn .15s ease;
}
@keyframes lbFadeIn { from { opacity: 0 } to { opacity: 1 } }
.lightbox-overlay.hidden { display: none; }
.lightbox-img {
  max-width: 92vw; max-height: 88vh;
  border-radius: 8px; object-fit: contain;
  box-shadow: 0 8px 48px rgba(0,0,0,.8);
  user-select: none;
}
.lightbox-close {
  position: fixed; top: 18px; right: 22px;
  background: none; border: none; color: #fff;
  font-size: 2rem; cursor: pointer; line-height: 1;
  opacity: .8; transition: opacity .15s;
}
.lightbox-close:hover { opacity: 1; }
.lightbox-nav {
  position: fixed; top: 50%; transform: translateY(-50%);
  background: rgba(255,255,255,.15); border: none; color: #fff;
  width: 48px; height: 48px; border-radius: 50%;
  font-size: 1.4rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.lightbox-nav:hover { background: rgba(255,255,255,.3); }
.lightbox-nav.prev { left: 16px; }
.lightbox-nav.next { right: 16px; }
.lightbox-counter {
  position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%);
  color: rgba(255,255,255,.7); font-size: .85rem;
}

/* İndirme Butonu */
.download-section {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 18px; flex-wrap: wrap;
}
.btn-download {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--bg-active);
  color: #fff; border: none; border-radius: 7px;
  padding: 9px 18px; font-size: .88rem; font-weight: 600;
  cursor: pointer; transition: all var(--transition);
  font-family: inherit;
}
.btn-download:hover { background: #1976d2; }

.btn-dl-linux { background: #2e7d32; }
.btn-dl-linux:hover { background: #388e3c; }

.dl-size {
  font-size: .72rem; opacity: .75;
  background: rgba(0,0,0,.25); border-radius: 4px;
  padding: 1px 5px; margin-left: 4px;
}
.btn-dl-mac   { background: #37474f; }
.btn-dl-mac:hover   { background: #455a64; }

.btn-github {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--border); border-radius: 8px;
  padding: 11px 18px; font-size: .9rem; color: var(--text-secondary);
  background: none; cursor: pointer; transition: all var(--transition);
  font-family: inherit;
}
.btn-github:hover { border-color: var(--text-primary); color: var(--text-primary); }

/* ---- Yorumlar ---- */
.comments-section { margin-top: 8px; }
.comments-section h3 { font-size: 1.1rem; margin-bottom: 16px; color: var(--text-primary); }

.comment-form {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
}
.comment-form h4 { font-size: .9rem; color: var(--text-secondary); margin-bottom: 12px; }

.form-group { margin-bottom: 12px; }
.form-group label { display: block; font-size: .8rem; color: var(--text-muted); margin-bottom: 5px; }
.form-group input,
.form-group textarea {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 9px 12px;
  color: var(--text-primary);
  font-size: .9rem;
  font-family: inherit;
  transition: border-color var(--transition);
  outline: none;
  resize: vertical;
}
.form-group input:focus,
.form-group textarea:focus { border-color: var(--accent); }

.btn-comment {
  background: var(--accent-2); color: #fff; border: none;
  border-radius: 6px; padding: 9px 20px;
  font-size: .9rem; cursor: pointer; font-family: inherit;
  transition: all var(--transition);
}
.btn-comment:hover { opacity: .85; }

.comment-list { display: flex; flex-direction: column; gap: 12px; }

.comment-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.comment-card .meta {
  display: flex; justify-content: space-between;
  font-size: .78rem; color: var(--text-muted); margin-bottom: 6px;
}
.comment-card .author { font-weight: 600; color: var(--text-secondary); }
.comment-card .text  { font-size: .9rem; line-height: 1.6; }

/* ---- KVKK Modal ---- */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.75);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.modal-overlay.hidden { display: none; }

.modal {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  max-width: 540px; width: 100%;
  padding: 32px;
  box-shadow: 0 20px 60px rgba(0,0,0,.6);
}
.modal h2 { font-size: 1.2rem; color: var(--accent); margin-bottom: 14px; }
.modal p  { font-size: .88rem; color: var(--text-secondary); line-height: 1.7; margin-bottom: 12px; }
.modal-actions { display: flex; gap: 12px; margin-top: 20px; flex-wrap: wrap; }

.btn-accept {
  flex: 1; background: var(--bg-active); color: #fff;
  border: none; border-radius: 8px; padding: 11px 20px;
  font-size: .95rem; font-weight: 600; cursor: pointer;
  font-family: inherit; transition: background var(--transition);
}
.btn-accept:hover { background: #1976d2; }

.btn-reject {
  background: none; border: 1px solid var(--border);
  border-radius: 8px; padding: 11px 20px;
  font-size: .95rem; color: var(--text-muted);
  cursor: pointer; font-family: inherit;
  transition: all var(--transition);
}
.btn-reject:hover { border-color: var(--danger); color: var(--danger); }

/* ---- Toast Bildirim ---- */
.toast {
  position: fixed; bottom: 24px; right: 24px;
  background: var(--bg-panel); border: 1px solid var(--border);
  border-radius: 8px; padding: 12px 18px;
  font-size: .88rem; color: var(--text-primary);
  box-shadow: var(--shadow); z-index: 300;
  animation: slideUp .3s ease;
  max-width: 300px;
}
.toast.success { border-color: var(--accent-2); }
.toast.error   { border-color: var(--danger); }

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

/* ---- Responsive ---- */
@media (max-width: 960px) {
  .detail-body { grid-template-columns: 1fr; }
  .right-col { flex-direction: row; flex-wrap: wrap; }
  .right-col .carousel, .right-col .yt-box, .right-col .yt-embed { flex: 1 1 280px; }
}

@media (max-width: 768px) {
  :root { --sidebar-width: 220px; }
  .content { padding: 20px 18px; }
  .app-detail-header img, .app-logo-ico { width: 52px; height: 52px; }
  .app-detail-meta h2 { font-size: 1.2rem; }
}

@media (max-width: 620px) {
  .menu-btn { display: flex; }
  .sidebar {
    position: fixed; left: 0; top: var(--header-height); z-index: 50;
    width: 270px !important; min-width: unset !important;
    height: calc(100vh - var(--header-height));
    transform: translateX(-100%);
    box-shadow: 4px 0 24px rgba(0,0,0,.5);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-backdrop.open { display: block; }
  .header-tabs { display: none; }
  .content { padding: 14px 14px; }
  .header { padding: 0 12px; gap: 8px; }
  .btn-download { padding: 8px 12px; font-size: .82rem; }
  .right-col { flex-direction: column; }
  .right-col .carousel, .right-col .yt-box, .right-col .yt-embed { flex: none; width: 100%; }
  .app-detail-header img, .app-logo-ico { width: 44px; height: 44px; }
  .app-detail-meta h2 { font-size: 1.05rem; }
}
