/* ================================
   BLADE & SOUL EVENT TRACKER STYLE
================================ */

/* GLOBAL RESET */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: "Inter", Arial, sans-serif;
  color: #e8eef6;
  line-height: 1.45;
}

/* BACKGROUND (fixed + iOS fallback) */
body {
  background: #0b0f14 url('../images/bg.jpg') no-repeat center center fixed;
  background-size: cover;
  background-attachment: fixed;
}
@supports (-webkit-touch-callout: none) {
  body { background-attachment: scroll; }
  html::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background: #0b0f14 url('../images/bg.jpg') no-repeat center center;
    background-size: cover;
  }
}

.overlay {
  background: linear-gradient(rgba(2,6,12,0.65), rgba(2,6,12,0.65));
  min-height: 100vh;
  padding: 28px 16px 80px;
}

/* TOPBAR */
.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  max-width: 1100px;
  margin: 0 auto 18px;
  gap: 10px;
}
.topbar h1 {
  color: #ffd86b;
  text-shadow: 0 2px 12px rgba(0,0,0,0.7);
  font-size: 1.9rem;
  margin: 0 auto;
}

/* TIMEZONE */
.timezone-switch { display: flex; gap: 8px; align-items: center; }
.tz-flag {
  cursor: pointer;
  font-size: 1.8rem;
  filter: grayscale(100%);
  transition: .2s;
  user-select: none;
  background: transparent;
  border: 1px solid #444;
  border-radius: 8px;
  padding: 4px 8px;
  color: #fff;
}
.tz-flag.active {
  filter: none;
  transform: scale(1.05);
  border-color: #ffd86b;
}

/* SERVER CLOCK */
#server-time {
  text-align:center;
  font-size:1.1rem;
  margin: 8px auto 16px;
  color:#8fd3ff;
  font-weight:700;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

/* CONTROLS */
.controls {
  text-align: center;
  margin: 10px 0;
}
.controls button {
  background: #222;
  color: #ffd86b;
  border: 1px solid #555;
  border-radius: 8px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: .95rem;
  transition: background .2s, transform .1s, border-color .2s;
}
.controls button:hover {
  background: #333;
  transform: translateY(-1px);
  border-color: #777;
}

/* NOTIFICATIONS PANEL */
.notifications-panel {
  margin: 10px auto 20px;
  text-align: center;
  font-size: 15px;
  color: #ddd;
}
.notifications-panel label {
  margin-right: 10px;
  cursor: pointer;
}
.notifications-panel select {
  background: #111;
  color: #ffd700;
  border: 1px solid #333;
  border-radius: 6px;
  padding: 3px 8px;
  font-weight: 500;
}
.notifications-panel input[type="checkbox"] {
  accent-color: #ffd700;
  transform: scale(1.1);
  margin-right: 4px;
}

/* TABLE */
.event-table {
  display: grid;
  max-width: 1100px;
  margin: 0 auto 28px;
  width: 100%;
  border-radius: 10px;
  overflow: hidden;
}
.event.header,
.event-row {
  display: grid;
  grid-template-columns: 2fr 1.1fr 1.1fr 1.2fr;
  align-items: center;
  padding: 10px 12px;
}
.event.header {
  background: rgba(40,42,50,0.85);
  color: #ffd86b;
  font-weight: 800;
  letter-spacing: .02em;
  text-transform: uppercase;
  border-bottom: 1px solid rgba(255,255,255,0.12);
  position: sticky;
  top: 0;
  z-index: 2;
}
.event-row {
  background: rgba(20,22,26,0.70);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  position: relative;
  overflow: hidden;
  transition: background .2s ease;
}
.event-row:hover { background: rgba(35,38,44,0.75); }

.event.header > div,
.event-row > div { display:flex; align-items:center; justify-content:center; }
.event.header > div:first-child,
.event-row > div:first-child { justify-content:flex-start; }
.event.header > div:last-child,
.event-row > div:last-child { justify-content:flex-end; }

/* ACTIVE ROW + PROGRESS */
.active-row {
  background: rgba(0, 255, 100, 0.08);
  border-left: 3px solid #00ff91;
  box-shadow: inset 0 0 12px rgba(0,255,100,0.25);
}
.event-row .progress-bar {
  position: absolute;
  top: 0; left: 0;
  height: 100%; width: 0%;
  background: linear-gradient(90deg, rgba(0,255,100,0.2), rgba(0,255,150,0.6));
  border-radius: 0 8px 8px 0;
  z-index: 0;
  transition: width 1s linear;
}
.event-row.active-row .progress-bar { display: block; }
.event-row > div { position: relative; z-index: 1; }
.progress-bar::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.3) 50%, transparent 100%);
  opacity: 0.4;
  animation: shimmer 2.5s linear infinite;
}
@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.special-name { color: gold; font-weight: 700; }
.server-time { color: #8fd3ff; }
.local-time { color: #a6b9d6; }

.countdown {
  color:#ffb6b6;
  font-weight:800;
  text-align:right;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}
.active-row .countdown {
  color:#d2ffd2;
  text-shadow: 0 0 6px rgba(0,0,0,0.8);
}

/* WEEK VIEW (4+3) */
.week-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  max-width: 1100px;
  margin: 0 auto;
}
.day-col {
  background: rgba(20,22,26,0.82);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 10px;
  transition: border .25s, box-shadow .25s, background .25s;
}
.day-col h3 {
  text-align:center;
  color:#ffd86b;
  border-bottom:1px solid rgba(255,255,255,0.12);
  padding-bottom:6px;
  margin-bottom:8px;
  font-weight: 800;
}
.day-col.today {
  border: 2px solid #ffd86b;
  box-shadow: 0 0 14px rgba(255,216,107,0.25);
}
.week-event {
  padding: 6px 6px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  display: flex; justify-content: space-between; gap: 10px; align-items: baseline;
}
.week-event:last-child { border-bottom:none; }
.week-event-name { color: #fff; font-weight: 600; }
.week-event-name.special-name { color: gold; font-weight: 700; }
.week-event-time { color: #8fd3ff; font-weight: 600; }
.week-event-time .local-time { color: #a6b9d6; font-weight: 500; }

/* FILTER MODAL */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(3px);
  padding: 40px 12px;
}
.modal.show { display: flex; }
.modal-content {
  background: rgba(20,22,28,0.95);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 18px 20px;
  max-width: 640px;
  width: 100%;
  max-height: 85vh;
  color: #f5f5f5;
  box-shadow: 0 0 30px rgba(0,0,0,0.6);
  overflow: hidden;
  display: flex; flex-direction: column;
}
.modal-content h2 {
  color: #ffd86b;
  text-align: center;
  margin: 0 0 10px 0;
  font-size: 1.2rem;
}
#filterList {
  flex: 1 1 auto;
  min-height: 180px;
  max-height: 500px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-right: 6px;
  margin-top: 6px;
}
.filter-group {
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255,255,255,0.03);
}
.filter-group-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  background: rgba(255,255,255,0.07);
  font-weight: 800;
  color: #ffd86b;
  user-select: none;
  gap: 8px;
}
.group-label { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.group-checkbox { accent-color: #ffd86b; transform: scale(1.15); }
.group-arrow { cursor: pointer; font-size: .85em; transition: transform .28s ease; }
.filter-group.collapsed .group-arrow { transform: rotate(-90deg); }
.filter-group-content {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  padding: 0 10px;
  display: flex; flex-direction: column; gap: 6px;
  transition: max-height .35s ease, opacity .3s ease, padding .25s ease;
}
.filter-group:not(.collapsed) .filter-group-content {
  max-height: 800px;
  opacity: 1;
  padding: 8px 10px 10px;
}
.filter-item label {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,0.05);
  border-radius: 6px;
  padding: 6px 8px;
  cursor: pointer;
}
.filter-item input[type="checkbox"] { accent-color: #ffd86b; }

/* KO-FI BUTTON (.kofi-banner) */
.kofi-banner {
  position: fixed;
  bottom: 12px;
  right: 12px;
  z-index: 100;
}
.kofi-banner img {
  width: 90px;
  opacity: 0.8;
  transition: opacity 0.25s, transform 0.2s;
}
.kofi-banner img:hover {
  opacity: 1;
  transform: scale(1.05);
}
@media (max-width: 600px) {
  .kofi-banner img { width: 70px; }
}

/* RESPONSIVE */
@media (max-width: 980px) {
  .topbar h1 { font-size: 1.6rem; }
  .event.header, .event-row { grid-template-columns: 1.8fr 1fr 1fr 1.2fr; }
}
@media (max-width: 768px){
  .topbar { gap: 12px; }
  .topbar h1 { font-size: 1.4rem; }
  .week-grid { grid-template-columns: repeat(auto-fit, minmax(220px,1fr)); }
}
@media (max-width: 560px){
  .event.header, .event-row { grid-template-columns: 1.6fr .9fr .9fr 1.2fr; }
  .event-row { padding: 10px 10px; }
  .controls button { padding: 7px 10px; }
  .modal-content { padding: 16px; }
}
/* ================================
   FIX: Filter Modal Buttons Style
================================ */

.filter-controls button,
.modal-buttons button {
  background: #222;
  color: #ffd86b;
  border: 1px solid #555;
  border-radius: 8px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 0.95rem;
  transition: background 0.2s, transform 0.1s, border-color 0.2s;
}

.filter-controls button:hover,
.modal-buttons button:hover {
  background: #333;
  transform: translateY(-1px);
  border-color: #777;
}

/* wyrównanie przycisków w modalu */
.filter-controls {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 10px;
}

.modal-buttons {
  text-align: center;
  margin-top: 12px;
}
/* ================================
   FIX: Better text visibility on active event bar
================================ */

.event-row.active-row {
  background: rgba(0, 255, 100, 0.1);
  border-left: 3px solid #00ff91;
  box-shadow: inset 0 0 12px rgba(0, 255, 100, 0.25);
}

.event-row.active-row .progress-bar {
  background: linear-gradient(90deg, rgba(0, 255, 100, 0.25), rgba(0, 255, 150, 0.55));
}

.event-row.active-row > div {
  color: #fff !important;
  text-shadow: 0 0 3px rgba(0, 0, 0, 0.8), 0 0 6px rgba(0, 0, 0, 0.6);
}

.event-row.active-row .server-time,
.event-row.active-row .local-time,
.event-row.active-row .countdown {
  color: #ffffff !important;
  text-shadow: 0 0 4px rgba(0, 0, 0, 0.9);
  font-weight: 600;
}

.event-row.active-row .special-name {
  color: gold !important;
  text-shadow: 0 0 4px rgba(0, 0, 0, 0.7);
}
/* ===============================
   AUTHOR CREDIT
   =============================== */
#author-credit {
  position: fixed;
  bottom: 10px;
  left: 12px;
  font-size: 0.9em;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.55);
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8);
  z-index: 50;
  user-select: none;
  pointer-events: none;
}

@media (max-width: 768px) {
  #author-credit {
    font-size: 0.8em;
    left: 8px;
    bottom: 8px;
    opacity: 0.8;
  }
}

