/* =============================================================================
   STYLE DLA MODUŁU: WYWIADY I NAGRANIA WIDEO GPW (YOUTUBE)
   ============================================================================= */

/* Widok główny */
.recordings-view {
  display: none;
  flex-direction: column;
  gap: 24px;
  width: 100%;
  animation: fadeIn 0.3s ease-out;
}

.recordings-view.active {
  display: flex;
}

/* Header modułu */
.recordings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 24px;
  border-radius: 16px;
  background: var(--surface-card, rgba(18, 24, 38, 0.7));
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
}

.recordings-header__info {
  display: flex;
  align-items: center;
  gap: 18px;
}

.recordings-header__icon-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: rgba(0, 240, 255, 0.1);
  border: 1px solid rgba(0, 240, 255, 0.25);
  flex-shrink: 0;
}

.recordings-header__title {
  margin: 0 0 6px 0;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-main, #ffffff);
  letter-spacing: -0.02em;
}

.recordings-header__desc {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted, #94a3b8);
  line-height: 1.5;
  max-width: 650px;
}

/* Pigułki statystyk w nagłówku */
.recordings-header__stats {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.recordings-stat-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  min-width: 90px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
}

.recordings-stat-pill__value {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main, #ffffff);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.recordings-stat-pill__label {
  font-size: 0.72rem;
  text-transform: uppercase;
  color: var(--text-muted, #94a3b8);
  letter-spacing: 0.05em;
  margin-top: 2px;
}

.recordings-stat-pill--highlight {
  border-color: rgba(168, 85, 247, 0.3);
  background: rgba(168, 85, 247, 0.06);
}

.recordings-stat-pill--highlight .recordings-stat-pill__value {
  color: #c084fc;
}

/* Pasek filtrów */
.recordings-filters {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 18px 20px;
  border-radius: 14px;
  background: var(--surface-card, rgba(18, 24, 38, 0.7));
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
}

.recordings-filters__row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.recordings-scope-group {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(0, 0, 0, 0.25);
  padding: 3px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.recordings-filters__divider {
  width: 1px;
  height: 26px;
  background: rgba(255, 255, 255, 0.12);
  margin: 0 4px;
}

.recordings-filters__categories {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.recordings-cat-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted, #94a3b8);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition: all 0.2s ease;
}

.recordings-cat-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main, #ffffff);
  border-color: rgba(255, 255, 255, 0.15);
}

.recordings-cat-btn--active {
  background: rgba(0, 240, 255, 0.12);
  color: #00f0ff;
  border-color: rgba(0, 240, 255, 0.4);
  font-weight: 600;
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.15);
}

.recordings-filters__search-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.recordings-select-wrapper {
  position: relative;
  min-width: 220px;
}

.recordings-select {
  width: 100%;
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-main, #ffffff);
  font-size: 0.88rem;
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.recordings-select:focus {
  border-color: #00f0ff;
}

.recordings-search-box {
  flex: 1;
  min-width: 260px;
  position: relative;
  display: flex;
  align-items: center;
}

.recordings-search-box__icon {
  position: absolute;
  left: 12px;
  pointer-events: none;
}

.recordings-search-input {
  width: 100%;
  padding: 10px 36px 10px 38px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-main, #ffffff);
  font-size: 0.88rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.recordings-search-input:focus {
  border-color: #00f0ff;
  box-shadow: 0 0 0 2px rgba(0, 240, 255, 0.15);
}

.recordings-search-clear {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  color: var(--text-muted, #94a3b8);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
}

.recordings-search-clear:hover {
  color: #ffffff;
}

.recordings-refresh-btn {
  padding: 10px 14px;
  border-radius: 10px;
}

/* Siatka kart wideo */
.recordings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
  width: 100%;
}

/* Pojedyncza karta nagrania */
.recordings-card {
  display: flex;
  flex-direction: column;
  background: var(--surface-card, rgba(18, 24, 38, 0.7));
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
  border-radius: 14px;
  overflow: hidden;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  position: relative;
}

.recordings-card:hover {
  transform: translateY(-4px);
  border-color: rgba(0, 240, 255, 0.3);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), 0 0 16px rgba(0, 240, 255, 0.1);
}

.recordings-card--featured {
  border-color: rgba(168, 85, 247, 0.35);
}

.recordings-card--featured::before {
  content: "WYRÓŻNIONE";
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  background: linear-gradient(135deg, #a855f7, #6366f1);
  color: #ffffff;
  padding: 4px 8px;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

/* Miniatura wideo */
.recordings-card__thumb-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #090d16;
  overflow: hidden;
  cursor: pointer;
}

.recordings-card__thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.recordings-card:hover .recordings-card__thumb {
  transform: scale(1.05);
}

.recordings-card__play-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.85;
  transition: opacity 0.25s ease, background-color 0.25s ease;
}

.recordings-card:hover .recordings-card__play-overlay {
  opacity: 1;
  background: rgba(0, 0, 0, 0.15);
}

.recordings-card__play-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(0, 240, 255, 0.9);
  color: #0b0f19;
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.5);
  transition: transform 0.25s ease, background-color 0.25s ease;
}

.recordings-card:hover .recordings-card__play-btn {
  transform: scale(1.15);
  background: #00f0ff;
}

.recordings-card__duration-badge {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(9, 13, 22, 0.88);
  backdrop-filter: blur(4px);
  color: #f1f5f9;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 7px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

/* Treść karty */
.recordings-card__content {
  display: flex;
  flex-direction: column;
  padding: 16px;
  flex: 1;
}

.recordings-card__meta-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.recordings-card__ticker-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  background: rgba(0, 240, 255, 0.1);
  color: #00f0ff;
  border: 1px solid rgba(0, 240, 255, 0.25);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
}

.recordings-card__ticker-badge:hover {
  background: rgba(0, 240, 255, 0.2);
  transform: translateY(-1px);
}

.recordings-card__cat-badge {
  font-size: 0.72rem;
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 600;
  text-transform: uppercase;
}

.recordings-card__cat-badge--wywiad {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.25);
}

.recordings-card__cat-badge--webinar {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.25);
}

.recordings-card__cat-badge--analiza {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.25);
}

.recordings-card__cat-badge--wza {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.recordings-card__title {
  font-size: 0.98rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text-main, #ffffff);
  margin: 0 0 10px 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  cursor: pointer;
}

.recordings-card__title:hover {
  color: #00f0ff;
}

.recordings-card__speaker {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-muted, #94a3b8);
  margin-bottom: 8px;
}

.recordings-card__speaker strong {
  color: var(--text-main, #e2e8f0);
}

.recordings-card__channel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-muted, #94a3b8);
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.recordings-card__channel-name {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #cbd5e1;
  font-weight: 500;
}

.recordings-card__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}

.recordings-card__btn-play {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 12px;
  font-size: 0.84rem;
}

.recordings-card__btn-yt {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #ef4444;
  text-decoration: none;
  transition: all 0.2s ease;
}

.recordings-card__btn-yt:hover {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.3);
  transform: translateY(-1px);
}

/* Przycisk wczytywania kolejnej porcji nagrań (Pagination) */
.recordings-load-more {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 0 24px 0;
  width: 100%;
}

.recordings-load-more-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 28px;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 12px;
  cursor: pointer;
  background: var(--surface-card, rgba(18, 24, 38, 0.85));
  border: 1px solid rgba(0, 240, 255, 0.25);
  color: var(--text-main, #ffffff);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  transition: all 0.25s ease;
}

.recordings-load-more-btn:hover {
  background: rgba(0, 240, 255, 0.1);
  border-color: rgba(0, 240, 255, 0.5);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 240, 255, 0.15);
}

.recordings-load-more-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Stan pusty */
.recordings-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 48px 24px;
  border-radius: 16px;
  gap: 14px;
  background: var(--surface-card, rgba(18, 24, 38, 0.7));
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
}

.recordings-empty h3 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-main, #ffffff);
}

.recordings-empty p {
  margin: 0;
  max-width: 500px;
  font-size: 0.9rem;
  color: var(--text-muted, #94a3b8);
  line-height: 1.5;
}

/* Moduł odtwarzacza wideo (Modal) */
.recordings-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.recordings-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(9, 13, 22, 0.85);
  backdrop-filter: blur(8px);
}

.recordings-modal__dialog {
  position: relative;
  z-index: 10000;
  width: 100%;
  max-width: 840px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 16px;
  overflow-y: auto;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.8), 0 0 30px rgba(0, 240, 255, 0.2);
}

.recordings-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.recordings-modal__title-box {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.recordings-modal__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-main, #ffffff);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recordings-modal__close {
  background: none;
  border: none;
  color: var(--text-muted, #94a3b8);
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.recordings-modal__close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.recordings-modal__player-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000000;
}

.recordings-modal__iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.recordings-modal__body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.recordings-modal__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.recordings-modal__meta-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.recordings-modal__channel {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main, #ffffff);
}

.recordings-modal__speaker {
  font-size: 0.82rem;
  color: #00f0ff;
}

/* Sekcja AI TL;DR w modalu */
.recordings-ai-box {
  padding: 16px;
  border-radius: 12px;
  background: rgba(168, 85, 247, 0.08);
  border: 1px solid rgba(168, 85, 247, 0.25);
}

.recordings-ai-box__header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.recordings-ai-box__header h4 {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 700;
  color: #c084fc;
}

.recordings-ai-box__summary {
  margin: 0 0 10px 0;
  font-size: 0.86rem;
  color: #e2e8f0;
  line-height: 1.5;
}

.recordings-ai-box__list {
  margin: 0;
  padding-left: 20px;
  font-size: 0.82rem;
  color: #cbd5e1;
  line-height: 1.5;
}

.recordings-ai-box__list li {
  margin-bottom: 4px;
}

/* Sekcja w profilu spółki */
.company-profile__recordings-panel {
  padding: 20px;
  border-radius: 14px;
  margin-bottom: 24px;
}

.company-profile__recordings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.company-profile__recordings-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.company-profile__recordings-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main, #ffffff);
}

.company-profile__recordings-subtitle {
  margin: 2px 0 0 0;
  font-size: 0.82rem;
  color: var(--text-muted, #94a3b8);
}

.company-profile__recordings-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.company-profile__recordings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

/* Responsywność */
@media (max-width: 768px) {
  .recordings-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .recordings-filters__row {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .recordings-filters__divider {
    display: none;
  }

  .recordings-scope-group {
    width: 100%;
    justify-content: stretch;
  }

  .recordings-scope-group .recordings-cat-btn {
    flex: 1;
    justify-content: center;
  }

  .recordings-filters__search-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .recordings-select-wrapper,
  .recordings-search-box {
    width: 100%;
    min-width: 100%;
  }

  .recordings-grid {
    grid-template-columns: 1fr;
  }
}
