/* =============================================
   Panel Pracownika POSiR — styles
   ============================================= */

/* --- Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* --- Custom Properties --- */
:root {
  /* Colors */
  --bg-base:        #020617;
  --bg-deep:        #0f172a;
  --bg-card:        rgba(30, 41, 59, 0.45);
  --bg-input:       rgba(15, 23, 42, 0.70);

  --border-subtle:  rgba(255, 255, 255, 0.06);
  --border-default: rgba(255, 255, 255, 0.10);

  --text-primary:   #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted:     #64748b;

  --accent-blue:    #60a5fa;
  --accent-emerald: #34d399;
  --accent-red:     #f87171;
  --accent-amber:   #fbbf24;

  --glow-blue:      rgba(96, 165, 250, 0.40);
  --glow-emerald:   rgba(52, 211, 153, 0.40);
  --glow-amber:     rgba(251, 191, 36, 0.40);

  /* Typography */
  --font-display: 'Outfit', sans-serif;
  --font-body:    'DM Sans', sans-serif;
  --font-mono:    'DM Mono', monospace;

  /* Spacing */
  --space-xs:  0.375rem;
  --space-sm:  0.625rem;
  --space-md:  1rem;
  --space-lg:  1.5rem;
  --space-xl:  2.5rem;
  --space-2xl: 4rem;

  /* Radii */
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-pill: 100px;
}

/* --- Body & Background --- */
body {
  font-family: var(--font-body);
  background-color: var(--bg-base);
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(99, 102, 241, 0.12), transparent),
    radial-gradient(ellipse 60% 40% at 80% 80%, rgba(52, 211, 153, 0.06), transparent);
  color: var(--text-primary);
  min-height: 100vh;
  padding-bottom: var(--space-2xl);
  overflow-x: hidden;
}

/* --- Page Layout --- */
.page-wrap {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 var(--space-xl);
}

/* =============================================
   HEADER / CLOCK
   ============================================= */
.site-header {
  padding: var(--space-xl) var(--space-lg) var(--space-lg);
  text-align: center;
}

.clock {
  font-family: var(--font-display);
  font-size: clamp(3rem, 10vw, 5.5rem);
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: var(--space-xs);
  text-shadow: 0 0 40px rgba(255, 255, 255, 0.12);
}

.date {
  font-family: var(--font-mono);
  font-size: clamp(0.7rem, 2vw, 0.85rem);
  color: var(--accent-blue);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  opacity: 0.8;
}

/* =============================================
   SEARCH BAR
   ============================================= */
.search-wrap {
  max-width: 680px;
  margin: 0 auto var(--space-2xl);
  padding: 0 var(--space-lg);
}

.search-form {
  position: relative;
}

.search-input {
  width: 100%;
  padding: 0.9rem 3.5rem 0.9rem 1.4rem;
  background: var(--bg-input);
  border: 1.5px solid var(--border-default);
  border-radius: var(--radius-lg);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 1rem;
  outline: none;
  backdrop-filter: blur(12px);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-input:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.15);
}

.search-btn {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  padding: 0;
  transition: transform 0.2s;
}

.search-btn:hover {
  transform: translateY(-50%) scale(1.2);
}

/* =============================================
   SECTION HEADERS
   ============================================= */
.section-header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}

.section-label {
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  white-space: nowrap;
}

.section-label--blue    { color: var(--accent-blue); }
.section-label--emerald { color: var(--accent-emerald); }
.section-label--red     { color: var(--accent-red); }
.section-label--amber   { color: var(--accent-amber); }

.section-rule {
  flex: 1;
  height: 1px;
  border: none;
}

.section-rule--blue    { background: rgba(96, 165, 250, 0.15); }
.section-rule--emerald { background: rgba(52, 211, 153, 0.15); }
.section-rule--red     { background: rgba(248, 113, 113, 0.15); }
.section-rule--amber   { background: rgba(251, 191, 36, 0.15); }

/* =============================================
   CONTENT SECTIONS SPACING
   ============================================= */
.content-section {
  margin-bottom: var(--space-2xl);
}

/* =============================================
   LINK CARD GRID
   ============================================= */
.card-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.875rem;
}

/* =============================================
   LINK CARD (base)
   ============================================= */
.link-card {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: 1rem 1.25rem;
  min-height: 80px;
  background: var(--bg-card);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-md);
  backdrop-filter: blur(12px);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.22s ease, box-shadow 0.22s ease, transform 0.22s ease;
  position: relative;
  overflow: hidden;
}

/* Subtle shimmer line on top */
.link-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
}

.link-card__icon {
  font-size: 2.1rem;
  line-height: 1;
  flex-shrink: 0;
}

.link-card__text {
  min-width: 0;
}

.link-card__title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.25;
  margin-bottom: 0.3rem;
  letter-spacing: 0.01em;
}

.link-card__desc {
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 400;
  color: #475569;
  line-height: 1.4;
  white-space: normal;
}

/* Colour variants */
.link-card--blue:hover {
  border-color: var(--accent-blue);
  box-shadow: 0 0 22px var(--glow-blue), 0 4px 16px rgba(0,0,0,0.4);
  transform: translateY(-2px);
}

.link-card--emerald:hover {
  border-color: var(--accent-emerald);
  box-shadow: 0 0 22px var(--glow-emerald), 0 4px 16px rgba(0,0,0,0.4);
  transform: translateY(-2px);
}

.link-card--amber:hover {
  border-color: var(--accent-amber);
  box-shadow: 0 0 22px var(--glow-amber), 0 4px 16px rgba(0,0,0,0.4);
  transform: translateY(-2px);
}

/* --- Pulsujące kafelki --- */
@keyframes pulse-amber {
  0%, 100% {
    border-color: rgba(251, 191, 36, 0.35);
    box-shadow: 0 0 0 0 rgba(251, 191, 36, 0.25);
  }
  50% {
    border-color: rgba(251, 191, 36, 0.9);
    box-shadow: 0 0 18px 4px rgba(251, 191, 36, 0.25);
  }
}

@keyframes pulse-blue {
  0%, 100% {
    border-color: rgba(96, 165, 250, 0.35);
    box-shadow: 0 0 0 0 rgba(96, 165, 250, 0.25);
  }
  50% {
    border-color: rgba(96, 165, 250, 0.9);
    box-shadow: 0 0 18px 4px rgba(96, 165, 250, 0.25);
  }
}

.link-card--pulse-amber {
  animation: pulse-amber 2.4s ease-in-out infinite;
}

.link-card--pulse-amber:hover {
  animation: none;
  border-color: var(--accent-amber);
  box-shadow: 0 0 28px var(--glow-amber), 0 4px 16px rgba(0,0,0,0.4);
  transform: translateY(-2px);
}

.link-card--pulse-blue {
  animation: pulse-blue 2.4s ease-in-out infinite;
}

.link-card--pulse-blue:hover {
  animation: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 28px var(--glow-blue), 0 4px 16px rgba(0,0,0,0.4);
  transform: translateY(-2px);
}

/* =============================================
   TRAINING LIST
   ============================================= */
.training-year-group {
  margin-bottom: var(--space-lg);
}

.year-badge-row {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: 0.6rem;
}

.year-badge {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent-red);
  background: rgba(248, 113, 113, 0.08);
  border: 1px solid rgba(248, 113, 113, 0.22);
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

.year-rule {
  flex: 1;
  height: 1px;
  background: rgba(248, 113, 113, 0.08);
  border: none;
}

.training-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Training row — reuses .link-card base + emerald hover */
.training-row {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: 0.8rem 1.1rem;
  background: var(--bg-card);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  backdrop-filter: blur(12px);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.22s ease, box-shadow 0.22s ease, transform 0.22s ease;
}

.training-row:hover {
  border-color: var(--accent-emerald);
  box-shadow: 0 0 18px var(--glow-emerald), 0 4px 14px rgba(0,0,0,0.35);
  transform: translateY(-1px);
}

.training-row__icon {
  font-size: 1.3rem;
  flex-shrink: 0;
  line-height: 1;
}

.training-row__title {
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.1rem;
}

.training-row__date {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

/* =============================================
   TABELA DOKUMENTÓW (podstrony pracownik)
   ============================================= */
.doc-table-wrap {
  overflow-x: auto;
}

.doc-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-body);
  font-size: 1rem;
}

.doc-table thead th {
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--border-default);
  text-align: left;
  white-space: nowrap;
}

.doc-table thead th:last-child {
  text-align: right;
}

.doc-table tbody tr {
  border-bottom: 1px solid var(--border-subtle);
  transition: background 0.15s;
}

.doc-table tbody tr:last-child {
  border-bottom: none;
}

.doc-table tbody tr:hover {
  background: rgba(255,255,255,0.03);
}

.doc-table td {
  padding: 0.75rem 1rem;
  color: var(--text-primary);
  vertical-align: middle;
}

.doc-table td:last-child {
  text-align: right;
  white-space: nowrap;
}

.doc-table .lp {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  width: 3rem;
}

.doc-badge {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-muted);
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border-default);
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-pill);
  letter-spacing: 0.05em;
}

.doc-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent-amber);
  background: rgba(251, 191, 36, 0.08);
  border: 1px solid rgba(251, 191, 36, 0.25);
  border-radius: var(--radius-pill);
  padding: 0.35rem 0.9rem;
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
  white-space: nowrap;
}

.doc-btn:hover {
  background: rgba(251, 191, 36, 0.18);
  border-color: var(--accent-amber);
  color: #fff;
}

/* Info box (np. dane do faktury, terminy) */
.info-box {
  background: var(--bg-card);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  margin-bottom: var(--space-lg);
  backdrop-filter: blur(12px);
}

.info-box__title {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent-amber);
  margin-bottom: var(--space-md);
}

.info-box__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-md);
}

.info-box__col strong {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
}

.info-box__col p {
  font-size: 0.88rem;
  color: var(--text-primary);
  line-height: 1.6;
}

.notice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-md);
  margin-top: var(--space-md);
}

.notice-card {
  background: var(--bg-card);
  border: 1.5px solid rgba(251, 191, 36, 0.15);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
}

.notice-card__title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent-amber);
  margin-bottom: 0.6rem;
}

.notice-card__text {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* =============================================
   BACK NAVIGATION (podstrony)
   ============================================= */
.back-bar {
  margin-bottom: var(--space-lg);
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.4rem 0.9rem 0.4rem 0.7rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  background: var(--bg-card);
  transition: color 0.2s, border-color 0.2s;
}

.back-link:hover {
  color: var(--accent-blue);
  border-color: var(--accent-blue);
}

/* =============================================
   RESPONSIVE
   ============================================= */

/* Tablet: 2 kolumny */
@media (max-width: 1024px) {
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .page-wrap {
    padding: 0 var(--space-lg);
  }
}

/* Mobile: 1 kolumna */
@media (max-width: 600px) {
  .card-grid {
    grid-template-columns: 1fr;
  }

  .site-header {
    padding: var(--space-lg) var(--space-md) var(--space-md);
  }

  .page-wrap {
    padding: 0 var(--space-md);
  }

  .search-wrap {
    padding: 0 var(--space-md);
  }
}
