/* styles.css — jasny, czytelny styl */
/* Lighter background and global color vars */
:root {
  --bg: #ffffff;
  --fg: #222;
  --muted: #555;
  --card-bg: #fff;
  --border: rgba(0,0,0,0.1);
  --shadow: 0 2px 4px rgba(0,0,0,0.05);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
  background: linear-gradient(180deg, #e5e5e5 0%, #ffffff 100%);
  background-attachment: fixed;
  color: var(--fg);
}

.container {
  width: min(1100px, 92vw);
  margin: 0 auto;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(4px);
  background: rgba(255,255,255,0.8);
  border-bottom: 1px solid var(--border);
}
.app-header .container { padding: 13px 0; position: relative; }
.app-header h1 { margin: 0; font-weight: 700; letter-spacing: 0.3px; }
.subtitle { margin: 6px 0 0; color: var(--muted); font-size: 0.95rem; }


.autorefresh-toggle {
  display: inline-flex;
  align-items: center;
  font-size: 0.9rem;
  align-self: auto;
}

.autorefresh-toggle input {
  margin-right: 4px;
}

.header-top {
  display: flex;
  align-items: flex-start;
  gap: 25px;
}

.header-left {
  flex: 0 0 auto;
  white-space: nowrap;
}

.header-filters {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  align-self: flex-end;
}

.header-filters .filters {
  margin-top: 0;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.filter-btn {
  padding: 4px 8px;
  font-size: 0.8rem;
  border: 1px solid var(--border);
  background: var(--card-bg);
  cursor: pointer;
}

.filter-btn--active {
  background: var(--fg);
  color: var(--bg);
}

.news-list { padding: 0end-mediumpx 0 60px; }

/* Wiersz nagłówka i dane */
.news-row {
  --tone: rgba(0,123,255,0.15);
  display: grid;
  grid-template-columns: minmax(90px, 160px) minmax(90px, 160px) 1fr minmax(70px, 100px) minmax(50px, 80px);
  gap: 8px;
  align-items: flex-start;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  background:
    linear-gradient(0deg, rgba(255,255,255,0.9), rgba(255,255,255,0.9)),
    linear-gradient(135deg, var(--tone), rgba(255,255,255,0.02));
  font-size: 0.85rem;
}

.news-row--header {
  font-weight: 700;
  background: var(--card-bg);
}

.news-row__time { font-size: 0.8rem; color: var(--muted); }
.news-row__company { font-weight: 600; font-size: 0.85rem; }
.news-row__header { margin: 0 0 4px; font-size: 0.9rem; }
.news-row__justification { margin: 0; font-size: 0.8rem; color: var(--muted); }

.show-details {
  color: var(--fg);
  text-decoration: underline;
  font-weight: 600;
  cursor: pointer;
  align-self: start;
  font-size: 0.8rem;
}

.news-row__influence {
  text-align: center;
  font-weight: 700;
  font-size: 0.85rem;
}

.news-row__details {
  grid-column: 1 / -1;
  margin-top: 6px;
  padding: 4px 0;
  font-size: 0.8rem;
  line-height: 1.45;
  white-space: pre-wrap;
}

.news-row__details p {
  margin: 0;
}

.alert, .end-msg {
  text-align: center;
  margin: 1px 0px;
  padding: 12px 14px;
  border: 1px dashed var(--border);
  color: var(--muted);
}

.sentinel { height: 1px; }

/* Layout dla widoku dwukolumnowego */
.two-cols {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.col {
  flex: 1;
}

.col__title {
  display: flex;
  align-items: center;
  font-weight: 700;
  font-size: 1.1rem;
  margin: 10px 0;
}

.arrow {
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  margin-right: 6px;
}
.arrow--up {
  border-bottom: 12px solid #0a0;
}
.arrow--down {
  border-top: 12px solid #a00;
}

.news-card {
  --tone: rgba(0,123,255,0.15);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  margin-bottom: 12px;
  padding: 8px 10px;
  background:
    linear-gradient(0deg, rgba(255,255,255,0.9), rgba(255,255,255,0.9)),
    linear-gradient(135deg, var(--tone), rgba(255,255,255,0.02));
  font-size: 0.85rem;
}

.news-card__summary {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--muted);
}

.news-card__influence {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--fg);
}

.news-card__main {
  margin-top: 6px;
}

.news-card__title {
  margin: 0 0 4px;
  font-size: 0.8rem;
  font-weight: 700;
}

.news-card__justification {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.toggle-details {
  display: inline-block;
  margin-top: 4px;
  font-size: 0.8rem;
  text-decoration: underline;
  cursor: pointer;
  font-weight: 600;
  color: var(--fg);
}

.news-card__details {
  margin-top: 6px;
  padding: 0;
  font-size: 0.8rem;
  line-height: 1.45;
  white-space: pre-wrap;
  color: var(--muted);
}

.news-card__details summary {
  list-style: none;
}

.news-card__details summary::-webkit-details-marker {
  display: none;
}

.news-card__details p {
  margin: 0;
}

@media (max-width: 600px) {
  .header-top {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .header-filters {
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    align-self: auto;
  }

  .header-filters .filters {
    margin-top: 8px;
  }

  .autorefresh-toggle {
    align-self: flex-start;
    margin-top: 8px;
  }
}
