/* ============================================================
   Berberim Eğitim Videoları — Training Videos Page
   Tamamen bağımsız, Akademi ile ilgisi yok.
   ============================================================ */

.brm-tv-root {
  --tv-primary: #2563eb;
  --tv-primary-dark: #1d4ed8;
  --tv-primary-light: #eff6ff;
  --tv-success: #10b981;
  --tv-bg: #f8fafc;
  --tv-card-bg: #ffffff;
  --tv-border: #e2e8f0;
  --tv-text: #1e293b;
  --tv-muted: #64748b;
  --tv-radius: 14px;

  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 16px 32px;
  color: var(--tv-text);
}

/* ── Header ── */
.brm-tv-header {
  text-align: center;
  margin-bottom: 32px;
  padding-top: 20px;
}

.brm-tv-header h1 {
  font-size: 28px;
  font-weight: 800;
  margin: 0 0 8px;
  letter-spacing: -0.5px;
  color: #0f172a;
}

.brm-tv-header p {
  font-size: 15px;
  color: var(--tv-muted);
  margin: 0;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
}

/* ── Category Tabs ── */
.brm-tv-categories {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 28px;
}

.brm-tv-cat-btn {
  padding: 8px 18px;
  border-radius: 999px;
  border: 1.5px solid var(--tv-border);
  background: var(--tv-card-bg);
  color: var(--tv-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.brm-tv-cat-btn:hover {
  border-color: var(--tv-primary);
  color: var(--tv-primary);
  background: var(--tv-primary-light);
}

.brm-tv-cat-btn.active {
  background: var(--tv-primary);
  color: #fff;
  border-color: var(--tv-primary);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

/* ── Video Grid ── */
.brm-tv-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

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

@media (max-width: 560px) {
  .brm-tv-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

/* ── Video Card ── */
.brm-tv-card {
  background: var(--tv-card-bg);
  border: 1px solid var(--tv-border);
  border-radius: var(--tv-radius);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
  display: flex;
  flex-direction: column;
}

.brm-tv-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.1);
  border-color: #bfdbfe;
}

.brm-tv-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #1e293b;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brm-tv-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.brm-tv-card:hover .brm-tv-thumb img {
  transform: scale(1.05);
}

.brm-tv-play-icon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.3);
  transition: background 0.3s ease;
}

.brm-tv-play-icon svg {
  width: 48px;
  height: 48px;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.4));
  transition: transform 0.3s ease;
}

.brm-tv-card:hover .brm-tv-play-icon svg {
  transform: scale(1.1);
}

.brm-tv-card-body {
  padding: 14px 16px 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.brm-tv-card-category {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--tv-primary);
  margin-bottom: 6px;
}

.brm-tv-card-title {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
  margin: 0 0 6px;
  color: #0f172a;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.brm-tv-card-desc {
  font-size: 13px;
  color: var(--tv-muted);
  line-height: 1.5;
  margin: 0;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.brm-tv-card-duration {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--tv-muted);
  margin-top: 10px;
  font-weight: 500;
}

.brm-tv-card-duration svg {
  width: 14px;
  height: 14px;
}

/* ── Modal ── */
.brm-tv-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.6);
  padding: 20px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.brm-tv-modal.open {
  display: flex;
}

.brm-tv-modal-backdrop {
  position: absolute;
  inset: 0;
}

.brm-tv-modal-panel {
  position: relative;
  width: 100%;
  max-width: 800px;
  max-height: 90vh;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 25px 60px rgba(15, 23, 42, 0.2);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: brmTvModalIn 0.25s ease-out;
}

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

.brm-tv-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 20px 24px 0;
  gap: 16px;
}

.brm-tv-modal-header h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.3;
  flex: 1;
}

.brm-tv-modal-close {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f1f5f9;
  border: none;
  border-radius: 9999px;
  font-size: 20px;
  color: #64748b;
  cursor: pointer;
  transition: all 0.2s ease;
  line-height: 1;
  padding: 0;
}

.brm-tv-modal-close:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.brm-tv-modal-video {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  margin-top: 16px;
}

.brm-tv-modal-video iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.brm-tv-modal-body {
  padding: 16px 24px 24px;
  overflow-y: auto;
}

.brm-tv-modal-body p {
  margin: 0 0 6px;
  font-size: 14px;
  color: var(--tv-muted);
  line-height: 1.7;
}

.brm-tv-modal-category {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--tv-primary);
  margin-bottom: 8px;
}

.brm-tv-modal-duration {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--tv-muted);
  font-weight: 500;
}

/* ── Loading / Empty States ── */
.brm-tv-loading {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: var(--tv-muted);
  gap: 12px;
}

.brm-tv-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--tv-border);
  border-top-color: var(--tv-primary);
  border-radius: 50%;
  animation: brmTvSpin 0.7s linear infinite;
}

@keyframes brmTvSpin {
  to { transform: rotate(360deg); }
}

/* ── Responsive tweaks ── */
@media (max-width: 480px) {
  .brm-tv-header h1 {
    font-size: 22px;
  }

  .brm-tv-modal-panel {
    border-radius: 14px;
  }

  .brm-tv-modal-header {
    padding: 16px 16px 0;
  }

  .brm-tv-modal-header h2 {
    font-size: 17px;
  }

  .brm-tv-modal-body {
    padding: 12px 16px 16px;
  }

  .brm-tv-cat-btn {
    font-size: 12px;
    padding: 6px 14px;
  }
}

/* ── No results ── */
.brm-tv-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 48px 20px;
  color: var(--tv-muted);
  font-size: 14px;
}

/* ── Duration badge on card thumb ── */
.brm-tv-duration-badge {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(15, 23, 42, 0.8);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  letter-spacing: 0.3px;
}
