* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: Arial, sans-serif;
  background-color: #0f172a;
  color: #e5e7eb;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

header {
  background: #111827;
  border-bottom: 1px solid #1f2937;
}

.top-nav {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem;
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.logo span {
  font-weight: 700;
  font-size: 1.1rem;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.filters input,
.filters select,
.filters button {
  padding: 0.4rem 0.6rem;
  border-radius: 0.5rem;
  border: 1px solid #374151;
  background: #020617;
  color: #e5e7eb;
}

/* BONUS: butonlara yumuşak geçiş */
.filters button,
.favorite-btn {
  transition: background-color 0.2s ease,
              color 0.2s ease,
              border-color 0.2s ease,
              transform 0.15s ease;
}

.filters button:hover {
  transform: translateY(-1px);
  border-color: #38bdf8;
}

.filters button.secondary-btn {
  border-color: #fbbf24;
}

main {
  max-width: 1200px;
  margin: 1rem auto;
  padding: 0 1rem 2rem;
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1rem;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.75rem;
}

.media-card {
  background: #020617;
  border-radius: 0.75rem;
  border: 1px solid #1f2937;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s ease,
              border-color 0.2s ease,
              box-shadow 0.2s ease;
}

/* BONUS: hover animasyonu daha belirgin */
.media-card:hover {
  transform: translateY(-4px) scale(1.02);
  border-color: #38bdf8;
  box-shadow: 0 12px 25px rgba(0, 0, 0, 0.5);
}

/* BONUS: klavye odak (A11y) */
.media-card:focus {
  outline: 2px solid #38bdf8;
  outline-offset: 2px;
}

.media-card img {
  width: 100%;
  height: 220px;
  object-fit: cover;
}

.media-card-body {
  padding: 0.6rem;
}

.media-card-title {
  font-size: 0.95rem;
  font-weight: 600;
}

.media-card-meta {
  font-size: 0.8rem;
  color: #9ca3af;
  display: flex;
  justify-content: space-between;
  margin-top: 0.2rem;
}

.badge {
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  border: 1px solid #4b5563;
  font-size: 0.7rem;
}

.favorite-btn {
  padding: 0.3rem 0.5rem;
  margin-top: 0.4rem;
  background: transparent;
  border: 1px solid #4b5563;
  color: #e5e7eb;
  border-radius: 20px;
  cursor: pointer;
}

.favorite-btn:hover {
  transform: translateY(-1px);
  border-color: #facc15;
}

.favorite-btn.is-favorite {
  color: #fbbf24;
  border-color: #fbbf24;
}

/* -------------------- DETAY PANELİ -------------------- */
#detailPanel {
  background: #020617;
  border-radius: 0.75rem;
  border: 1px solid #1f2937;
  padding: 1rem;

  /* okunurluk + sabit görünüm */
  position: sticky;
  top: 1rem;
  max-height: calc(100vh - 2rem);
  overflow: auto;
}

/* Detay iç layout: görsel + yazı yan yana */
.detail-content {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 0.9rem;
  align-items: start;
}

.detail-poster {
  width: 120px;
  height: 170px;
  object-fit: cover;
  border-radius: 0.75rem;
  border: 1px solid #1f2937;
}

.detail-text h2 {
  margin-bottom: 0.35rem;
  line-height: 1.2;
}

.detail-meta {
  margin-bottom: 0.6rem;
  color: #9ca3af;
  font-size: 0.9rem;
}

.detail-text p {
  line-height: 1.55;
  margin-top: 0.5rem;
}

#detailPanel p {
  margin-bottom: 0.4rem;
}

/* Detay paneli scrollbar */
#detailPanel::-webkit-scrollbar {
  width: 10px;
}
#detailPanel::-webkit-scrollbar-thumb {
  background: #1f2937;
  border-radius: 999px;
  border: 2px solid #020617;
}

footer {
  text-align: center;
  color: #9ca3af;
  padding: 1rem;
  margin-top: auto;
}

/* -------------------- MOBİL / TABLET -------------------- */
@media (max-width: 900px) {
  main {
    grid-template-columns: 1fr;
  }

  #mediaSection {
    order: 1;
  }

  #detailPanel {
    order: 2;
    margin-top: 1rem;
    position: static;
    max-height: none;
  }

  .detail-content {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .detail-poster {
    width: 60%;
    max-width: 220px;
    height: auto;
  }

  .detail-text {
    width: 100%;
  }
}

/* Mobil dokunma efekti */
@media (hover: none) and (pointer: coarse) {
  .media-card:active {
    transform: scale(0.97);
    border-color: #38bdf8;
    opacity: 0.9;
  }

  .favorite-btn:active {
    transform: scale(0.95);
    opacity: 0.8;
  }
}
