/* ==========================================================================
   Akademia Boskich Liderek i Liderów - Portal Szkoleniowy
   Stylistyka: Nowoczesna BIAŁO-CZERWONA, Ostre Krawędzie (Bez Zaokrągleń),
   Wyraziste Cienie (Drop Shadows)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700&family=Playfair+Display:ital,wght@0,600;0,700;1,400&display=swap');

:root {
  /* Kolorystyka Biało-Czerwona */
  --bg-main: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #ffffff;
  --bg-card: #ffffff;
  --bg-glass: rgba(255, 255, 255, 0.96);

  --red-primary: #dc2626;
  --red-light: #ef4444;
  --red-dark: #b91c1c;
  --red-glow: rgba(220, 38, 38, 0.2);
  --red-border: rgba(220, 38, 38, 0.3);

  --border-light: #e2e8f0;
  --border-subtle: #cbd5e1;

  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-red: #dc2626;

  --success: #16a34a;
  --success-glow: rgba(22, 163, 74, 0.2);
  --danger: #dc2626;

  --sidebar-width: 380px;
  --header-height: 74px;
  
  /* Brak okrągłości - ostre krawędzie */
  --radius-sm: 0px;
  --radius-md: 0px;
  --radius-lg: 0px;

  /* Wyraziste cienie pod elementami */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.08), 0 2px 6px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1), 0 4px 10px rgba(0, 0, 0, 0.05);
  --shadow-red: 0 4px 14px rgba(220, 38, 38, 0.25);
  
  --transition: all 0.2s ease;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  border-radius: 0 !important; /* Całkowite usunięcie okrągłości */
}

body {
  font-family: 'Montserrat', sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

h1, h2, h3, h4, .font-serif {
  font-family: 'Playfair Display', serif;
  letter-spacing: -0.01em;
}

/* ==========================================================================
   App Header (Biały pasek z cieniem i czerwonym akcentem)
   ========================================================================== */

.app-header {
  height: var(--header-height);
  background: var(--bg-surface);
  border-bottom: 2px solid var(--red-primary);
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.75rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 1rem;
  text-decoration: none;
}

.brand-logo-crest {
  width: 44px;
  height: 44px;
  border: 2px solid var(--red-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--red-primary);
  color: #ffffff;
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: 1.15rem;
  box-shadow: var(--shadow-red);
}

.brand-titles {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

.brand-sub {
  font-size: 0.75rem;
  color: var(--red-primary);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 600;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: #ffffff;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  padding: 0.45rem 0.9rem;
  font-size: 0.85rem;
  color: var(--text-main);
  font-weight: 500;
}

.user-badge .avatar-dot {
  width: 8px;
  height: 8px;
  background: var(--red-primary);
  box-shadow: 0 0 6px var(--red-glow);
}

/* ==========================================================================
   Przyciski (Ostre krawędzie, cienie, biało-czerwona paleta)
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.4rem;
  font-size: 0.875rem;
  font-weight: 600;
  font-family: 'Montserrat', sans-serif;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  text-decoration: none;
}

.btn-gold, .btn-red {
  background: var(--red-primary);
  color: #ffffff;
  box-shadow: var(--shadow-red);
}

.btn-gold:hover, .btn-red:hover {
  background: var(--red-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(220, 38, 38, 0.35);
}

.btn-outline-gold, .btn-outline-red {
  background: #ffffff;
  border: 1.5px solid var(--red-primary);
  color: var(--red-primary);
  box-shadow: var(--shadow-sm);
}

.btn-outline-gold:hover, .btn-outline-red:hover {
  background: var(--red-primary);
  color: #ffffff;
  box-shadow: var(--shadow-red);
}

.btn-dark {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
}

.btn-dark:hover {
  background: #f1f5f9;
  border-color: var(--text-main);
  transform: translateY(-1px);
}

.btn-success {
  background: var(--success);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 4px 12px var(--success-glow);
}

.btn-success:hover {
  background: #15803d;
}

/* ==========================================================================
   Układ Aplikacji
   ========================================================================== */

.app-container {
  display: flex;
  height: calc(100vh - var(--header-height));
  position: relative;
  overflow: hidden;
}

/* ==========================================================================
   Sidebar: Katalog Szkoleń (Same tytuły, bez numeracji, białe tło z cieniem)
   ========================================================================== */

.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-surface);
  border-right: 1px solid var(--border-light);
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  height: 100%;
  transition: var(--transition);
  z-index: 50;
}

.sidebar-header {
  padding: 1.25rem 1.25rem 0.85rem;
  border-bottom: 1px solid var(--border-light);
}

.sidebar-header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.85rem;
}

.sidebar-title {
  font-size: 1.15rem;
  color: var(--text-main);
  font-weight: 700;
}

/* Karta postępu - usunięto liczbę szkoleń, sam procent i pasek */
.progress-card {
  background: #f8fafc;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  padding: 1rem;
  margin-bottom: 0.85rem;
}

.progress-card-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
}

.progress-label {
  color: var(--text-muted);
  font-weight: 500;
}

.progress-percent {
  color: var(--red-primary);
  font-weight: 700;
  font-size: 0.95rem;
}

.progress-track {
  height: 7px;
  background: #e2e8f0;
  overflow: hidden;
  position: relative;
}

.progress-bar-fill {
  height: 100%;
  background: var(--red-primary);
  transition: width 0.4s ease;
}

/* Pole wyszukiwania */
.search-box {
  position: relative;
  margin-bottom: 0.75rem;
}

.search-box input {
  width: 100%;
  padding: 0.65rem 0.85rem 0.65rem 2.25rem;
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  font-size: 0.85rem;
  font-family: inherit;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.search-box input:focus {
  outline: none;
  border-color: var(--red-primary);
  box-shadow: 0 0 0 2px var(--red-glow);
}

.search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  font-size: 0.85rem;
}

/* Zakładki filtrów */
.filter-tabs {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.2rem;
  scrollbar-width: none;
}

.filter-tabs::-webkit-scrollbar {
  display: none;
}

.filter-tab {
  background: #ffffff;
  border: 1px solid var(--border-light);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.4rem 0.75rem;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.filter-tab:hover {
  color: var(--text-main);
  border-color: var(--text-muted);
}

.filter-tab.active {
  background: var(--red-primary);
  border-color: var(--red-primary);
  color: #ffffff;
  font-weight: 600;
  box-shadow: var(--shadow-red);
}

/* Lista Szkoleń */
.trainings-list {
  flex: 1;
  overflow-y: auto;
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  scrollbar-width: thin;
  scrollbar-color: var(--border-subtle) transparent;
}

.trainings-list::-webkit-scrollbar {
  width: 5px;
}

.trainings-list::-webkit-scrollbar-thumb {
  background: var(--border-subtle);
}

/* Element szkolenia (SAME TYTUŁY, BEZ NUMERACJI, CIENIE) */
.training-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 1rem;
  background: #ffffff;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: var(--transition);
  text-align: left;
  position: relative;
}

.training-item:hover {
  border-color: var(--red-primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.training-item.active {
  background: #ffffff;
  border-color: var(--red-primary);
  border-left: 4px solid var(--red-primary);
  box-shadow: var(--shadow-md);
}

.training-status-icon {
  width: 22px;
  height: 22px;
  border: 1.5px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: var(--transition);
  color: transparent;
  font-size: 0.75rem;
  background: #ffffff;
}

.training-item.completed .training-status-icon {
  background: var(--red-primary);
  border-color: var(--red-primary);
  color: #ffffff;
  box-shadow: 0 0 6px var(--red-glow);
}

.training-content {
  flex: 1;
  min-width: 0;
}

.training-title {
  font-size: 0.9rem;
  color: var(--text-main);
  font-weight: 500;
  line-height: 1.4;
  word-break: break-word;
}

.training-item.active .training-title {
  color: var(--red-primary);
  font-weight: 700;
}

.training-category {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ==========================================================================
   Widok Odtwarzacza & Szczegółów Lekcji
   ========================================================================== */

.main-content {
  flex: 1;
  overflow-y: auto;
  padding: 1.75rem 2.25rem 3rem;
  background: var(--bg-main);
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.video-container-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  position: relative;
}

.video-player-wrapper {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 */
  background: #0f172a;
}

.video-player-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.video-placeholder {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #0f172a;
  color: #94a3b8;
  text-align: center;
  padding: 2rem;
}

.video-placeholder .play-symbol {
  width: 64px;
  height: 64px;
  background: var(--red-primary);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-red);
}

.player-actions-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.4rem;
  background: #ffffff;
  border-top: 1px solid var(--border-light);
  flex-wrap: wrap;
  gap: 0.75rem;
}

.nav-buttons-group {
  display: flex;
  gap: 0.6rem;
}

/* Szczegóły Lekcji */
.lesson-details-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-md);
  padding: 2rem;
}

.lesson-badge-category {
  display: inline-block;
  padding: 0.25rem 0.85rem;
  background: rgba(220, 38, 38, 0.08);
  border: 1px solid var(--red-border);
  color: var(--red-primary);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.85rem;
}

.lesson-main-title {
  font-size: 1.95rem;
  color: var(--text-main);
  margin-bottom: 1rem;
  line-height: 1.3;
}

.lesson-description-text {
  color: #475569;
  font-size: 1rem;
  line-height: 1.7;
  margin-bottom: 1.5rem;
}

/* Box Podsumowania */
.takeaways-box {
  background: #f8fafc;
  border: 1px solid var(--border-light);
  border-left: 4px solid var(--red-primary);
  box-shadow: var(--shadow-sm);
  padding: 1.4rem;
  margin-top: 1rem;
}

.takeaways-box h4 {
  font-size: 1.05rem;
  color: var(--red-primary);
  margin-bottom: 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.takeaways-box ul {
  padding-left: 1.25rem;
  color: #334155;
  font-size: 0.925rem;
}

.takeaways-box li {
  margin-bottom: 0.4rem;
}

/* ==========================================================================
   Modale (Logowanie & Admin PIN)
   ========================================================================== */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition);
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: #ffffff;
  border-top: 4px solid var(--red-primary);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 480px;
  padding: 2.5rem;
  position: relative;
  text-align: center;
}

.modal-crest {
  width: 64px;
  height: 64px;
  background: var(--red-primary);
  color: #ffffff;
  margin: 0 auto 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  box-shadow: var(--shadow-red);
}

.modal-title {
  font-size: 1.8rem;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

.modal-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1.75rem;
}

.form-group {
  margin-bottom: 1.25rem;
  text-align: left;
}

.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-input {
  width: 100%;
  padding: 0.85rem 1rem;
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  font-size: 1rem;
  font-family: inherit;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.form-input:focus {
  outline: none;
  border-color: var(--red-primary);
  box-shadow: 0 0 0 2px var(--red-glow);
}

.form-textarea {
  width: 100%;
  min-height: 140px;
  padding: 0.85rem 1rem;
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  font-size: 0.9rem;
  font-family: monospace;
  line-height: 1.5;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  resize: vertical;
}

.form-textarea:focus {
  outline: none;
  border-color: var(--red-primary);
  box-shadow: 0 0 0 2px var(--red-glow);
}

.alert-message {
  padding: 0.85rem 1rem;
  font-size: 0.875rem;
  margin-bottom: 1.25rem;
  display: none;
}

.alert-message.error {
  background: #fef2f2;
  border-left: 4px solid var(--red-primary);
  color: #991b1b;
  display: block;
  box-shadow: var(--shadow-sm);
}

.alert-message.success {
  background: #f0fdf4;
  border-left: 4px solid var(--success);
  color: #166534;
  display: block;
  box-shadow: var(--shadow-sm);
}

/* ==========================================================================
   Toast Notifications
   ========================================================================== */

.toast-container {
  position: fixed;
  bottom: 1.75rem;
  right: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  z-index: 2000;
  pointer-events: none;
}

.toast {
  background: #ffffff;
  border-left: 4px solid var(--red-primary);
  color: var(--text-main);
  padding: 0.9rem 1.4rem;
  box-shadow: var(--shadow-lg);
  font-size: 0.9rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transform: translateY(20px);
  opacity: 0;
  animation: toastIn 0.3s forwards ease;
  pointer-events: auto;
}

@keyframes toastIn {
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Responsive */
.mobile-nav-toggle {
  display: none;
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  color: var(--red-primary);
  font-size: 1.3rem;
  padding: 0.4rem 0.75rem;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

@media (max-width: 960px) {
  :root {
    --sidebar-width: 100%;
  }

  .mobile-nav-toggle {
    display: block;
  }

  .app-container {
    flex-direction: column;
    height: auto;
    overflow: visible;
  }

  .sidebar {
    position: fixed;
    top: var(--header-height);
    left: -100%;
    width: 100%;
    height: calc(100vh - var(--header-height));
    z-index: 99;
  }

  .sidebar.mobile-open {
    left: 0;
  }

  .main-content {
    padding: 1rem 1rem 3rem;
  }

  .brand-sub {
    display: none;
  }
}
