/* ─── HNews — style.css ─────────────────────────────────────────────────────
   YouTube-Style Premium Light Theme (3-Column Layout)
   Fonts: Calibri, Segoe UI, system-ui
────────────────────────────────────────────────────────────────────────────── */

:root {
  --bg:           #f9f9f9;
  --surface:      #ffffff;
  --surface-hover:#f2f2f2;
  --border:       #e5e5e5;
  --border-light: #f0f0f0;

  --accent:       #1a365d; /* Elegant deep blue for avatars/accents */
  --accent-dim:   #2a4365;
  
  --primary:      #0f0f0f; /* Pure dark for titles, like YouTube */
  --text-muted:   #606060; /* YouTube gray for channel names and metrics */
  --danger:       #cc0000; /* YouTube red */

  --font-sans:    'Calibri', 'Segoe UI', system-ui, sans-serif;

  --radius-sm:    8px;
  --radius:       12px;
  --radius-lg:    16px;

  --transition:   0.2s ease-in-out;
}

/* ── Reset ────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background-color: var(--bg);
  color: var(--primary);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
  overflow-y: scroll;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font-family: var(--font-sans); cursor: pointer; border: none; background: none; }

/* ── Header ─────────────────────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: var(--surface);
  height: 56px;
  display: flex;
  align-items: center;
  padding: 0 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05); /* Light shadow if desired */
}

.header-left {
  display: flex;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
}
.logo a {
  display: flex;
  align-items: baseline;
  padding: 0 8px;
}
.logo-h {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -1px;
}
.logo-news {
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--danger);
  margin-left: 2px;
}

/* ── Main Layout (3 Columns) ──────────────────────────────────────────────── */
.app-layout {
  display: grid;
  grid-template-columns: 240px 1fr 320px;
  gap: 24px;
  padding: 16px 24px;
  max-width: 100%; /* Full screen width */
  margin: 0;
}

/* ── Left Sidebar ─────────────────────────────────────────────────────────── */
.left-sidebar {
  position: sticky;
  top: 80px;
  height: calc(100vh - 80px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  padding-right: 12px;
}
.left-sidebar::-webkit-scrollbar { width: 6px; }
.left-sidebar::-webkit-scrollbar-thumb { background: #dcdcdc; border-radius: 4px; }

.menu-item {
  display: flex;
  align-items: center;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--primary);
  transition: background var(--transition);
}
.menu-item:hover { background: var(--surface-hover); }
.menu-item.active { background: #e5e5e5; font-weight: 600; }
.menu-icon { margin-right: 16px; font-size: 1.1rem; }

.sidebar-divider {
  height: 1px;
  background: var(--border);
  margin: 16px 0;
}

.sidebar-section-title {
  font-size: 0.95rem;
  font-weight: 600;
  padding: 8px 14px;
  color: var(--primary);
}

/* Channel styling in left menu */
.nav-link {
  display: block;
  padding: 8px 14px;
  font-size: 0.9rem;
  color: var(--primary);
  border-radius: var(--radius-sm);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background var(--transition);
}
.nav-link:hover { background: var(--surface-hover); }

/* Links styling in left menu */
.important-link {
  display: flex;
  flex-direction: column;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}
.important-link:hover { background: var(--surface-hover); }
.link-name { font-weight: 600; font-size: 0.9rem; color: var(--accent); }
.link-desc { font-size: 0.75rem; color: var(--text-muted); }

/* ── Main Content Area ────────────────────────────────────────────────────── */
.main-content {
  display: flex;
  flex-direction: column;
}

/* Category Filter Chips */
.category-tags {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  padding-bottom: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}
.category-tags::-webkit-scrollbar { display: none; }

.tag-btn {
  background: var(--surface-hover);
  color: var(--primary);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 8px;
  white-space: nowrap;
  transition: all var(--transition);
  border: 1px solid transparent;
}
.tag-btn:hover { background: #e5e5e5; }
.tag-btn.active {
  background: var(--primary);
  color: #fff;
}

/* YouTube Style Video Grid */
.video-grid {
  display: grid;
  /* Zorunlu 4 kolon için: */
  grid-template-columns: repeat(4, 1fr);
  gap: 32px 16px;
}

/* Video Card Structure */
.yt-card {
  display: flex;
  flex-direction: column;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
}

/* Thumbnail Area */
.yt-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--border-light);
  flex-shrink: 0;
}
.yt-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.yt-card:hover .yt-thumb img {
  transform: scale(1.05);
}

.play-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: background 0.3s ease;
  z-index: 3;
}
.yt-card:hover .play-overlay { background: rgba(0,0,0,0.1); opacity: 1; }
.play-overlay svg { color: white; display: none; }

/* Video Preview iframe hover */
.preview-wrapper {
  position: absolute;
  inset: 0;
  z-index: 5;
  opacity: 0;
  animation: fadeInPreview 0.5s forwards;
  pointer-events: none;
}
.preview-wrapper iframe {
  width: 100%;
  height: 100%;
  border: none;
}
.preview-sound-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0,0,0,0.7);
  color: white;
  border: none;
  border-radius: 4px;
  width: 32px;
  height: 32px;
  cursor: pointer;
  pointer-events: auto; /* So it can be clicked */
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.2s;
  font-size: 16px;
}
.preview-sound-btn:hover {
  background: rgba(0,0,0,0.9);
  transform: scale(1.05);
}
@keyframes fadeInPreview {
  to { opacity: 1; }
}

/* Video Info Area */
.yt-info {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 12px;
  padding: 12px 12px 0 0;
  align-items: start;
}

.grid-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 600;
  margin-top: 2px;
}

.info-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.yt-title {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 2px;
}

.yt-channel, .yt-time {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.2;
}

/* ── Right Sidebar (News) ─────────────────────────────────────────────────── */
.right-sidebar {
  position: sticky;
  top: 80px;
  height: calc(100vh - 80px);
  overflow-y: auto;
}
.right-sidebar::-webkit-scrollbar { width: 6px; }
.right-sidebar::-webkit-scrollbar-thumb { background: #dcdcdc; border-radius: 4px; }

.news-widget {
  background: #f0f0f0; /* Çok hafif gri tonu */
  border-radius: var(--radius);
  padding: 16px;
  border: 1px solid var(--border-light);
}

.sidebar-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 16px;
  padding-left: 0;
}

.news-source {
  margin-bottom: 24px;
}

.news-source-header {
  margin-bottom: 8px;
}
.news-source-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  padding-left: 8px;
}

.news-item {
  display: block;
  padding: 8px;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
  margin-bottom: 4px;
}
.news-item:hover { background: var(--surface-hover); }

.news-title {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--primary);
  line-height: 1.4;
  margin-bottom: 4px;
}
.news-time {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ── Modal (Pop-up Player) ──────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}
.modal-overlay.active { display: flex; }

.modal {
  background: var(--surface);
  border-radius: var(--radius);
  width: 100%;
  max-width: 960px;
  position: relative;
  box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

.modal-close {
  position: absolute;
  top: -12px;
  right: -12px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
  color: var(--primary);
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

.video-wrapper {
  aspect-ratio: 16 / 9;
  background: #000;
  overflow: hidden;
  border-top-left-radius: var(--radius);
  border-top-right-radius: var(--radius);
}
.video-wrapper iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.modal-info { padding: 20px; }
.modal-title { font-size: 1.2rem; font-weight: 600; }
.modal-channel { font-size: 0.9rem; color: var(--text-muted); margin-top: 4px; display: block; }

/* ── Utilities ────────────────────────────────────────────────────────────── */
.loading {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--text-muted);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.empty, .error, .empty-small {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
}
.error { color: var(--danger); }

/* ── Responsive breakpoints ───────────────────────────────────────────────── */
@media (max-width: 1500px) {
  .app-layout { grid-template-columns: 240px 1fr 300px; }
  .video-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 1200px) {
  .app-layout {
    grid-template-columns: 200px 1fr; /* Hide right sidebar */
  }
  .right-sidebar { display: none; }
  .video-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 900px) {
  .video-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 860px) {
  .app-layout {
    grid-template-columns: 1fr; /* Hide left sidebar */
    padding: 16px;
  }
  .left-sidebar { display: none; }
  .video-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 500px) {
  .video-grid { grid-template-columns: 1fr; }
  .yt-thumb { border-radius: 0; }
  .app-layout { padding: 0; gap: 16px; }
  .category-tags { padding: 0 16px; }
  .yt-info { padding: 12px 16px; }
}
