:root {
  --bg-1: #1b5fa3;
  --bg-2: #3f85c8;
  --ink: #102033;
  --muted: #5e7288;
  --card: #fffffff2;
  --line: #d5e3f2;
  --accent: #eb6325;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Barlow", sans-serif;
  color: var(--ink);
  background: linear-gradient(145deg, var(--bg-1) 0%, var(--bg-2) 55%, #74acd8 100%);
  min-height: 100vh;
}

.app-header,
.app-shell {
  position: relative;
  z-index: 1;
}

.app-header {
  padding: 1.1rem 1rem 0.15rem;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.app-header--program {
  justify-content: stretch;
  padding-left: 0;
  padding-right: 0;
}

.app-header-inner {
  width: 100%;
  max-width: 1500px;
  margin: 0 auto;
  padding: 0 0.9rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.app-header--program .event-logo {
  max-height: 130px;
  width: auto;
  max-width: calc(100% - 140px);
  object-fit: contain;
}

.back-to-home {
  background: #eb6325;
  border: none;
  color: #fff;
  border-radius: 8px;
  padding: 0.52rem 1.1rem;
  font-size: 0.82rem;
  font-weight: 700;
  font-family: "Barlow", sans-serif;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.15s;
}

.back-to-home:hover { background: #d45720; }

.empty-heart {
  font-size: 2.5rem;
  color: #d0e4f5;
  display: flex;
  align-items: center;
  justify-content: center;
}

.event-logo {
  width: min(980px, 96vw);
  max-height: 170px;
  object-fit: contain;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}

.app-shell {
  max-width: 1500px;
  margin: 0 auto;
  padding: 0.35rem 0.9rem 1.4rem;
}

.day-switcher {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.55rem;
  margin-bottom: 0.55rem;
  padding: 0.4rem;
  border-radius: 16px;
  background: #ffffff1f;
  border: 1px solid #ffffff2a;
}

.day-tab {
  border: 1px solid #ffffff33;
  background: #ffffff14;
  color: #fff;
  border-radius: 999px;
  padding: 0.58rem 0.95rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  min-width: 96px;
  text-align: center;
}

.day-tab:hover {
  transform: translateY(-1px);
  background: #ffffff24;
}

.day-tab.active {
  background: linear-gradient(135deg, #eb6325, #ff8a3d);
  color: #fff;
  border-color: transparent;
}

.day-tab--favorites {
  background: rgba(240, 62, 110, 0.5);
  border-color: rgba(255, 255, 255, 0.75);
  color: #fff;
}

.day-tab--favorites:hover {
  background: rgba(240, 62, 110, 0.65);
}

.day-tab--favorites.active {
  background: linear-gradient(135deg, #d63a6a, #f56b8a);
  border-color: transparent;
}

/* Serduszko na karcie sesji */
.fav-btn {
  position: absolute;
  top: 0.4rem;
  right: 0.4rem;
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 50%;
  background: #e8f2fc;
  border: none;
  padding: 0;
  font-size: 0.9rem;
  line-height: 1.7rem;
  text-align: center;
  color: #b8cfe8;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, transform 0.15s;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fav-btn:hover {
  background: #ffd6e0;
  color: #f03e6e;
  transform: scale(1.12);
}

.fav-btn--active {
  background: #f03e6e;
  color: #fff;
}

.fav-btn--active:hover {
  background: #d42f5c;
  color: #fff;
}

/* Serduszko w dialogu */
.dialog-fav-btn {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: #f0f5fc;
  border: 2px solid #dce8f5;
  font-size: 1.3rem;
  color: #b8cfe8;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.15s;
  flex-shrink: 0;
}

.dialog-fav-btn:hover {
  background: #ffd6e0;
  border-color: #f9a8c0;
  color: #f03e6e;
  transform: scale(1.1);
}

.dialog-fav-btn--active {
  background: #f03e6e;
  border-color: #d42f5c;
  color: #fff;
}

.dialog-fav-btn--active:hover {
  background: #d42f5c;
  border-color: #b8284f;
  color: #fff;
}

/* Widok ulubionych */
.favorites-view {
  padding: 0.5rem 0 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.favorites-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 3rem 1rem;
  color: var(--muted);
  text-align: center;
}

.favorites-empty span {
  font-size: 2.5rem;
  color: #d0e4f5;
}

.favorites-empty p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.6;
}

.fav-card {
  position: relative;
  background: var(--card);
  border-radius: 12px;
  padding: 1rem 3rem 1rem 1rem;
  border-left: 4px solid #f03e6e;
  cursor: pointer;
  transition: box-shadow 0.15s;
}

.fav-card:hover {
  box-shadow: 0 4px 16px #00000022;
}

.fav-card-meta {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.35rem;
}

.fav-remove {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  font-size: 1.1rem;
}

.controls-card {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 0.55rem;
  padding: 0.35rem 0;
  background: transparent;
  border: 0;
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 190px;
}

.control-grow {
  flex: 1;
}

.control-group label {
  font-size: 0.76rem;
  font-weight: 700;
  color: #eb6325;
  letter-spacing: 0.04em;
}

.control-group select,
.control-group input {
  border: 1px solid #cfd7e5;
  border-radius: 10px;
  padding: 0.55rem 0.6rem;
  background: #fff;
  font: inherit;
}

.view-switcher {
  display: flex;
  gap: 0.35rem;
}

.view-btn {
  border: 1px solid #cfd7e5;
  background: #fff;
  color: #33413c;
  border-radius: 10px;
  padding: 0.48rem 0.7rem;
  font-weight: 700;
  cursor: pointer;
}

.view-btn.active {
  background: linear-gradient(135deg, #1b5fa3, #154f89);
  color: #fff;
  border-color: transparent;
}

.schedule-card {
  background: #ffffffea;
  border: 1px solid #d7e4f3;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 12px 30px #0d1b1e1a;
}

.schedule-topbar {
  border-bottom: 1px solid var(--line);
  padding: 0.85rem 1rem;
  background: linear-gradient(135deg, #1b5fa3, #246bb4);
  color: #fff;
}

.schedule-topbar h2 {
  margin: 0;
  font-size: 1.08rem;
  font-weight: 600;
  letter-spacing: 0;
  color: #fff;
  font-family: "Poppins", sans-serif;
  text-align: center;
}

.schedule-root {
  overflow-x: auto;
  padding: 0.5rem;
}

.schedule-table {
  min-width: 1050px;
}

.row {
  display: grid;
  grid-template-columns: 110px repeat(var(--rooms), minmax(170px, 1fr));
  gap: 0.45rem;
  margin-bottom: 0.45rem;
}

.room-header {
  background: #eb6325;
  border: 1px solid #d97f3f;
  border-radius: 10px;
  padding: 0.52rem;
  text-align: center;
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.2;
  color: #fff;
}

.time-cell,
.break-cell,
.session-cell,
.empty-cell {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.time-cell {
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.8rem;
  background: #f7f9fd;
  color: #34506b;
  padding: 0.35rem;
}

.break-cell {
  grid-column: span var(--rooms);
  background: linear-gradient(135deg, #fff4ee, #ffe8dc);
  padding: 0.55rem 0.7rem;
  font-weight: 700;
  font-size: 0.85rem;
  color: #944018;
}

.session-cell {
  position: relative;
  padding: 0.58rem;
  min-height: 96px;
  cursor: pointer;
  transition: transform 0.14s ease, box-shadow 0.14s ease;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.session-cell:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px #11325417;
}

.session-cell-badge {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.15;
  font-weight: 900;
  color: #1b5fa3;
  letter-spacing: 0.03em;
}

.session-cell-type {
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.15;
  font-weight: 900;
  color: #eb6325;
  letter-spacing: 0.03em;
}

.session-title {
  margin: 0.1rem 0 0;
  font-size: 0.64rem;
  line-height: 1.28;
  font-weight: 700;
  white-space: pre-line;
  color: #173a5d;
}

.session-note {
  margin-top: auto;
  margin-bottom: 0;
  font-size: 0.7rem;
  line-height: 1.2;
  font-weight: 600;
  color: #1b5fa3;
  letter-spacing: 0.02em;
}

.session-dialog {
  width: min(900px, 96vw);
  border: none;
  border-radius: 18px;
  padding: 0;
  box-shadow: 0 20px 60px #0d1b2a4a;
}

.session-dialog::backdrop {
  background: #0f171d99;
}

.dialog-content {
  position: relative;
  padding: 0;
  max-height: 90vh;
  background: #fff;
  display: flex;
  flex-direction: column;
}

.dialog-header {
  background: linear-gradient(135deg, #1b5fa3 0%, #246bb4 50%, #154f89 100%);
  padding: 2rem 2rem 1.5rem;
  color: #fff;
  border-radius: 18px 18px 0 0;
  position: relative;
}

#dialogTitle {
  margin: 0 7.5rem 0.3rem 0;
  font-size: 1.35rem;
  line-height: 1.4;
  white-space: pre-line;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.dialog-moderators {
  margin: 0.5rem 7.5rem 0.8rem 0;
  font-size: 0.8rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 500;
}

.dialog-moderators strong {
  font-weight: 700;
  color: #fff;
}

.dialog-title-parts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.2rem;
}

.dialog-type-badge {
  border-radius: 8px;
  padding: 0.6rem 1.2rem;
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  display: inline-block;
  transition: all 0.2s ease;
}

.dialog-type-badge.blue {
  background: #fff;
  color: #1b5fa3;
  box-shadow: 0 4px 12px #1b5fa340;
}

.dialog-type-badge.blue:hover,
.dialog-type-badge.blue:active {
  background: #1b5fa3;
  color: #fff;
}

.dialog-type-badge.orange {
  background: #eb6325;
  color: #fff;
}

.dialog-type-badge.orange:hover,
.dialog-type-badge.orange:active {
  background: #fff;
  color: #eb6325;
  box-shadow: 0 4px 12px #eb632540;
}

.dialog-type-badge.mixed {
  display: flex;
  gap: 0.3rem;
}

.dialog-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  padding: 1.2rem 2rem 1.5rem;
  border-bottom: 1px solid #e8eef6;
}

.meta-pill {
  border: 1px solid #d0dce8;
  border-radius: 10px;
  background: #f3f8ff;
  color: #1b5fa3;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.45rem 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.meta-pill .icon {
  color: #eb6325;
  font-size: 1.05rem;
}

.dialog-body {
  padding: 1.8rem 2rem;
  overflow-y: auto;
  flex: 1;
  border-bottom: 1px solid #e8eef6;
}

#dialogLectures {
  margin: 0;
  padding: 0;
  list-style: none;
}

#dialogLectures li {
  margin-bottom: 1.1rem;
  font-size: 0.95rem;
  line-height: 1.55;
  white-space: pre-line;
  color: #2d4563;
  padding-left: 0;
}

#dialogLectures li strong {
  color: #1b5fa3;
  font-weight: 800;
  display: inline;
  margin-bottom: 0;
}

#dialogLectures li:last-child {
  margin-top: 0.8rem;
  font-weight: 600;
  color: #1b5fa3;
}

.lecture-number {
  color: #1b5fa3;
  font-weight: 900;
  font-size: 1.05rem;
  margin-right: 0.3rem;
  display: inline;
}

#dialogLectures li em {
  color: #606060;
  font-style: normal;
  font-weight: 500;
  display: block;
  margin-top: 0.35rem;
}

.error-box {
  border: 1px solid #e5b8b8;
  color: #6d2525;
  background: #fff0f0;
  border-radius: 10px;
  padding: 0.8rem;
  font-weight: 600;
}

.dialog-close {
  position: absolute;
  right: 1.5rem;
  top: 1.3rem;
  border: none;
  background: rgba(255, 255, 255, 0.2);
  font-size: 2rem;
  cursor: pointer;
  color: #fff;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
  z-index: 10;
}

.dialog-close:hover {
  background: rgba(255, 255, 255, 0.35);
  transform: rotate(90deg);
}

.dialog-nav-buttons {
  position: static;
  display: flex;
  gap: 0.8rem;
  z-index: 10;
  padding: 1.5rem 2rem;
  justify-content: space-between;
  align-items: center;
  background: transparent;
  border-top: none;
}

.dialog-nav-btn {
  background: #eb6325;
  border: 1px solid #d97f3f;
  color: #fff;
  font-size: 0.9rem;
  padding: 0.7rem 1.2rem;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  transition: all 0.2s ease;
  font-weight: 600;
  max-width: 150px;
}

.dialog-nav-btn:hover:not(:disabled) {
  background: #ff7533;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px #eb632540;
}

.dialog-nav-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  background: #a0a0a0;
}

@media (max-width: 880px) {
  .app-header {
    padding-top: 0.65rem;
  }

  .event-logo {
    max-height: 110px;
  }

  .app-shell {
    padding: 0.4rem 0.55rem 1rem;
  }

  .controls-card {
    padding: 0.1rem 0;
  }

  .control-group {
    min-width: 100%;
  }

  .day-switcher {
    padding: 0.35rem;
    gap: 0.4rem;
  }

  .day-tab {
    min-width: calc(50% - 0.2rem);
    padding: 0.5rem 0.65rem;
    font-size: 0.8rem;
  }

  .row {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }

  .schedule-table {
    min-width: 0;
  }

  .room-header {
    display: none;
  }

  .time-cell {
    justify-items: center;
    text-align: center;
    padding: 0.55rem 0.7rem;
  }

  .time-cell,
  .break-cell,
  .session-cell,
  .empty-cell {
    min-height: unset;
  }

  .break-cell {
    grid-column: auto;
    text-align: center;
  }

  .session-cell {
    padding: 0.7rem 0.75rem;
  }

  .session-title {
    font-size: 0.66rem;
  }

  .session-cell-badge {
    font-size: 0.9rem;
  }

  .session-cell-type {
    font-size: 0.8rem;
  }

  .session-dialog {
    width: 96vw;
  }

  .dialog-header {
    padding: 1.5rem 1.5rem 1rem;
  }

  #dialogTitle {
    font-size: 1.1rem;
    margin-bottom: 0.6rem;
  }

  .dialog-meta {
    padding: 0 1.5rem 1rem;
  }

  .dialog-body {
    padding: 1.2rem 1.5rem;
  }

  .dialog-meta {
    padding: 0.8rem 1.5rem 1rem;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 0.4rem;
  }

  .meta-pill {
    font-size: 0.7rem;
    padding: 0.35rem 0.65rem;
    white-space: nowrap;
  }

  .dialog-close {
    right: 1rem;
    top: 1rem;
    width: 2.2rem;
    height: 2.2rem;
    font-size: 1.8rem;
  }

  .dialog-header {
    padding: 1.5rem 1.5rem 1rem;
  }

  #dialogTitle {
    font-size: 1.1rem;
    margin-bottom: 0.6rem;
    margin-right: 0;
  }

  .dialog-moderators {
    margin: 0.3rem 0 0.5rem 0;
  }
}
