:root {
  --bg-color: #07070b;
  /* Kafelki jaśniejsze od tła – "unoszą się" nad nim */
  --card-bg: rgba(34, 34, 54, 0.82);
  --card-border: rgba(255, 255, 255, 0.22);
  --text-primary: #ffffff;
  --text-secondary: #c8c8d4;
  --accent-color: #6366f1;
  /* Indigo */
  --accent-glow: rgba(99, 102, 241, 0.4);
  /* Kolor ikon w kafelkach */
  --icon-color: #a5b4fc;
  --icon-color-hover: #ffffff;
  --font-main: "Inter", sans-serif;
  /* Zdefiniowanie głębszego cienia dla efektu 'pop-out' */
  --card-shadow:
    0 15px 35px 0 rgba(0, 0, 0, 0.65),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
  --card-shadow-hover:
    0 25px 50px rgba(0, 0, 0, 0.6),
    0 0 20px rgba(99, 102, 241, 0.4);
  --text-hover: #ffffff;
  --text-muted: rgba(255, 255, 255, 0.4);
  --search-focus-bg: rgba(46, 46, 72, 0.92);
  --subtle-bg: rgba(255, 255, 255, 0.05);
  --subtle-border: rgba(255, 255, 255, 0.06);
  --scrollbar: rgba(255, 255, 255, 0.2);
  --precip-color: #7dd3fc;
  --icon-glow: rgba(129, 140, 248, 0.35);
  --clock-gradient: linear-gradient(to right, #fff, #a5b4fc);
  --clock-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  --featured-tint: linear-gradient(
    145deg,
    rgba(236, 72, 153, 0.35),
    rgba(249, 115, 22, 0.25)
  );
  --featured-text: #fbcfe8;
  color-scheme: dark;
}

/* --- TRYB JASNY --- */
/* Ustawiany przez js/theme.js (atrybut data-theme na <html>) */
:root[data-theme="light"] {
  --bg-color: #f3f2fa;
  --card-bg: rgba(255, 255, 255, 0.72);
  --card-border: rgba(30, 27, 75, 0.1);
  --text-primary: #1e1b4b;
  --text-secondary: #57557a;
  --accent-color: #6366f1;
  --accent-glow: rgba(99, 102, 241, 0.18);
  --icon-color: #5b5fe0;
  --icon-color-hover: #312e81;
  --card-shadow:
    0 10px 30px rgba(30, 27, 75, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  --card-shadow-hover:
    0 20px 40px rgba(30, 27, 75, 0.16),
    0 0 20px rgba(99, 102, 241, 0.2);
  --text-hover: #1e1b4b;
  --text-muted: rgba(30, 27, 75, 0.45);
  --search-focus-bg: rgba(255, 255, 255, 0.95);
  --subtle-bg: rgba(99, 102, 241, 0.06);
  --subtle-border: rgba(99, 102, 241, 0.1);
  --scrollbar: rgba(30, 27, 75, 0.2);
  --precip-color: #0284c7;
  --icon-glow: rgba(99, 102, 241, 0.15);
  --clock-gradient: linear-gradient(to right, #1e1b4b, #6366f1);
  --clock-shadow: 0 8px 24px rgba(99, 102, 241, 0.12);
  --featured-tint: linear-gradient(
    145deg,
    rgba(236, 72, 153, 0.2),
    rgba(249, 115, 22, 0.14)
  );
  --featured-text: #be185d;
  color-scheme: light;
}

/* Zorza w jasnym trybie: pastelowe plamy na złamanej bieli */
:root[data-theme="light"] .aurora-blob {
  mix-blend-mode: multiply;
}

/* Pastele są blade, więc plamy są mniej przezroczyste (bez plamy za kursorem) */
:root[data-theme="light"] .aurora-blob:not(.aurora-blob--cursor) {
  opacity: 0.85;
}

:root[data-theme="light"] .aurora-blob--1 {
  background: #c7d2fe;
}

:root[data-theme="light"] .aurora-blob--2 {
  background: #fbcfe8;
}

:root[data-theme="light"] .aurora-blob--3 {
  background: #fed7aa;
}

:root[data-theme="light"] .aurora-blob--4 {
  background: #ddd6fe;
}

:root[data-theme="light"] .aurora-blob--cursor {
  background: linear-gradient(135deg, #c7d2fe, #fbcfe8);
}

:root[data-theme="light"] .aurora::after {
  background: radial-gradient(
    ellipse at center,
    rgba(243, 242, 250, 0) 0%,
    rgba(243, 242, 250, 0.45) 100%
  );
}

/* Płynne przejście przy zmianie trybu (klasę dodaje js/theme.js na chwilę) */
.theme-transition,
.theme-transition *,
.theme-transition *::before,
.theme-transition *::after {
  transition:
    background-color 0.4s ease,
    background 0.4s ease,
    color 0.4s ease,
    border-color 0.4s ease,
    box-shadow 0.4s ease !important;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-color);
  color: var(--text-primary);
  font-family: var(--font-main);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  position: relative;
  overflow-x: hidden;
}

/* --- TŁO: ZORZA --- */
/* Duże, mocno rozmyte plamy koloru, które powoli przepływają w tle */
.aurora {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  background: var(--bg-color);
}

.aurora-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.55;
  mix-blend-mode: screen;
  will-change: transform;
}

.aurora-blob--1 {
  width: 55vmax;
  height: 55vmax;
  top: -15vmax;
  left: -10vmax;
  background: #6366f1; /* Indygo */
  animation: auroraDrift1 26s ease-in-out infinite alternate;
}

.aurora-blob--2 {
  width: 50vmax;
  height: 50vmax;
  bottom: -20vmax;
  right: -10vmax;
  background: #ec4899; /* Róż */
  animation: auroraDrift2 32s ease-in-out infinite alternate;
}

.aurora-blob--3 {
  width: 35vmax;
  height: 35vmax;
  top: 10%;
  right: 15%;
  background: #f97316; /* Pomarańcz */
  opacity: 0.35;
  animation: auroraDrift3 22s ease-in-out infinite alternate;
}

.aurora-blob--4 {
  width: 40vmax;
  height: 40vmax;
  bottom: -10vmax;
  left: 10%;
  background: #8b5cf6; /* Fiolet */
  opacity: 0.45;
  animation: auroraDrift4 28s ease-in-out infinite alternate;
}

/* Plama podążająca za kursorem – pozycję ustawia js/script.js */
.aurora-blob--cursor {
  width: 30vmax;
  height: 30vmax;
  top: 0;
  left: 0;
  background: linear-gradient(135deg, #818cf8, #ec4899);
  opacity: 0;
  transition: opacity 1.5s ease;
}

.aurora-blob--cursor.is-active {
  opacity: 0.4;
}

/* Delikatne przyciemnienie od góry i dołu – zawartość lepiej się odcina */
.aurora::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse at center,
    rgba(7, 7, 11, 0.35) 0%,
    rgba(7, 7, 11, 0.65) 100%
  );
}

@keyframes auroraDrift1 {
  to {
    transform: translate(25vw, 20vh) scale(1.15);
  }
}

@keyframes auroraDrift2 {
  to {
    transform: translate(-30vw, -25vh) scale(0.9);
  }
}

@keyframes auroraDrift3 {
  to {
    transform: translate(-35vw, 30vh) scale(1.25);
  }
}

@keyframes auroraDrift4 {
  to {
    transform: translate(30vw, -35vh) scale(1.1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .aurora-blob {
    animation: none;
  }
}

.container {
  width: 100%;
  max-width: 1000px;
  display: flex;
  flex-direction: column;
  gap: 40px;
  animation: fadeIn 1s ease-out;
  position: relative;
  z-index: 1;
}

/* --- HEADER --- */
.header-section {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.time-widget {
  display: flex;
  flex-direction: column;
}

.clock {
  font-size: 5rem;
  font-weight: 700;
  letter-spacing: -2px;
  line-height: 1;
  background: var(--clock-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: var(--clock-shadow);
}

.date {
  font-size: 1.2rem;
  color: var(--text-secondary);
  margin-top: 5px;
  font-weight: 300;
}

.greeting {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 5px;
  background: linear-gradient(90deg, var(--accent-color), #ec4899);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.5px;
}


.weather-widget {
  background: var(--card-bg);
  backdrop-filter: blur(16px);
  border: 1px solid var(--card-border);
  padding: 15px 25px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 15px;
  min-width: 200px;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  /* Dodano cień */
  box-shadow: var(--card-shadow);
}

.weather-widget:hover {
  transform: translateY(-5px);
  /* Mocniejsze uniesienie */
  border-color: var(--accent-color);
  box-shadow: 0 20px 50px rgba(99, 102, 241, 0.3);
  /* Znacznie głębszy cień */
}

/* Widżet pogody jest przyciskiem – reset domyślnego wyglądu */
button.weather-widget {
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.weather-widget:focus-visible {
  outline: 2px solid var(--accent-color);
  outline-offset: 3px;
}

.weather-chevron {
  margin-left: auto;
  font-size: 0.85rem;
  color: var(--text-secondary);
  transition: transform 0.3s ease;
}

.weather-widget[aria-expanded="true"] .weather-chevron {
  transform: rotate(180deg);
}

/* --- PANEL PROGNOZY --- */
.weather-panel {
  background: var(--card-bg);
  backdrop-filter: blur(16px);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 22px 24px;
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
  gap: 22px;
  animation: panelIn 0.35s ease-out;
}

.weather-panel[hidden] {
  display: none;
}

.weather-panel-title {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.weather-details {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 28px;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.weather-details i {
  color: var(--accent-color);
  margin-right: 6px;
}

.weather-details strong {
  color: var(--text-primary);
  font-weight: 600;
}

.weather-hourly {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar) transparent;
}

.hour,
.day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  border-radius: 14px;
  background: var(--subtle-bg);
  border: 1px solid var(--subtle-border);
}

.hour {
  flex: 0 0 66px;
  padding: 10px 0;
  font-size: 0.85rem;
}

.hour-time {
  color: var(--text-secondary);
}

.hour i {
  font-size: 1.2rem;
  color: var(--accent-color);
}

.hour-temp {
  font-weight: 600;
}

.precip {
  font-size: 0.75rem;
  color: var(--precip-color);
}

/* Kropla ma rozmiar tekstu, a nie dużej ikony pogody */
.hour .precip i,
.day .precip i {
  font-size: inherit;
  color: inherit;
  margin: 0;
}

.weather-daily {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.day {
  padding: 14px 8px;
  text-align: center;
}

.day-name {
  font-weight: 600;
  font-size: 0.95rem;
}

.day i {
  font-size: 1.7rem;
  color: var(--accent-color);
  margin: 4px 0;
}

.day-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.day-min {
  color: var(--text-secondary);
  margin-left: 8px;
}

@media (max-width: 480px) {
  .weather-daily {
    grid-template-columns: repeat(2, 1fr);
  }
}

@keyframes panelIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }

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

.weather-icon {
  font-size: 2.5rem;
  color: var(--accent-color);
}

.weather-info {
  display: flex;
  flex-direction: column;
}

.temperature {
  font-size: 1.8rem;
  font-weight: 600;
}

.weather-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  text-transform: capitalize;
}

/* --- SEARCH --- */
.search-container {
  width: 100%;
  position: relative;
}

.search-bar {
  width: 100%;
  padding: 18px 25px;
  border-radius: 15px;
  background: var(--card-bg);
  backdrop-filter: blur(16px);
  border: 1px solid var(--card-border);
  color: var(--text-primary);
  font-size: 1.1rem;
  font-family: var(--font-main);
  outline: none;
  transition: all 0.3s ease;
  padding-left: 55px;
  /* Dodano cień */
  box-shadow: var(--card-shadow);
}

.search-icon {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
  pointer-events: none;
  z-index: 10;
}

.search-bar:focus {
  background: var(--search-focus-bg);
  border-color: var(--accent-color);
  box-shadow: 0 0 25px var(--accent-glow);
}

/* --- LINKS GRID --- */
.links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 15px;
}

.link-card {
  background: var(--card-bg);
  backdrop-filter: blur(16px);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  aspect-ratio: 1/1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-decoration: none;
  color: var(--text-primary);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  /* Bardziej sprężysta animacja */
  position: relative;
  overflow: hidden;
  z-index: 1;
  /* Dodano cień */
  box-shadow: var(--card-shadow);
}

.link-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(
    circle at center,
    var(--accent-glow),
    transparent 70%
  );
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: -1;
}

.link-card:hover {
  transform: translateY(-8px) scale(1.02);
  /* Wyższe uniesienie */
  border-color: var(--accent-color);
  /* Bardzo głęboki cień i poświata przy najechaniu */
  box-shadow: var(--card-shadow-hover);
}

.link-card:hover::before {
  opacity: 1;
}

.link-card span {
  font-size: 0.85rem;
  font-weight: 500;
  z-index: 1;
  color: var(--text-secondary);
  transition: color 0.3s ease;
}

.link-card:hover span {
  color: var(--text-hover);
}

/* --- IKONY KAFELKÓW (jeden kolor) --- */
/* Dwa źródła: Font Awesome (<i class="card-icon fa-...">)
   oraz logo marek z Simple Icons (<span class="card-icon si-...">) */
.link-card .card-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
  font-size: 28px;
  color: var(--icon-color);
  filter: drop-shadow(0 0 10px var(--icon-glow));
  transition:
    transform 0.3s ease,
    color 0.3s ease,
    background-color 0.3s ease;
}

/* Logo marek: plik SVG służy jako maska, a kolor daje tło */
.link-card .card-icon[class*="si-"] {
  background-color: var(--icon-color);
  -webkit-mask: var(--icon) center / 30px no-repeat;
  mask: var(--icon) center / 30px no-repeat;
}

.link-card:hover .card-icon {
  transform: scale(1.1);
  color: var(--icon-color-hover);
}

.link-card:hover .card-icon[class*="si-"] {
  background-color: var(--icon-color-hover);
}

/* Adresy logo marek (Simple Icons, przypięta wersja) */
.si-googlegemini { --icon: url("https://cdn.jsdelivr.net/npm/simple-icons@16.30.0/icons/googlegemini.svg"); }
.si-youtube { --icon: url("https://cdn.jsdelivr.net/npm/simple-icons@16.30.0/icons/youtube.svg"); }
.si-gmail { --icon: url("https://cdn.jsdelivr.net/npm/simple-icons@16.30.0/icons/gmail.svg"); }
.si-googlemaps { --icon: url("https://cdn.jsdelivr.net/npm/simple-icons@16.30.0/icons/googlemaps.svg"); }
.si-googledrive { --icon: url("https://cdn.jsdelivr.net/npm/simple-icons@16.30.0/icons/googledrive.svg"); }
.si-hetzner { --icon: url("https://cdn.jsdelivr.net/npm/simple-icons@16.30.0/icons/hetzner.svg"); }
.si-cloudflare { --icon: url("https://cdn.jsdelivr.net/npm/simple-icons@16.30.0/icons/cloudflare.svg"); }
.si-github { --icon: url("https://cdn.jsdelivr.net/npm/simple-icons@16.30.0/icons/github.svg"); }
.si-netflix { --icon: url("https://cdn.jsdelivr.net/npm/simple-icons@16.30.0/icons/netflix.svg"); }

.link-card .letters {
  height: 44px;
  max-height: 44px;
  min-height: 44px;
  width: 44px;
  max-width: 44px;
  min-width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid #6b64ec;
  border-radius: 50%;
  color: #6b64ec;
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 8px;
}

.link-card:hover .letters {
  transform: scale(1.1);
}

.link-card .name {
  font-size: 12px !important;
  font-weight: 700;
}

/* --- WYRÓŻNIONY KAFELEK (Lena) --- */
.link-card--featured {
  background: var(--featured-tint), var(--card-bg);
  border: 2px solid #ec4899;
  animation: featuredPulse 2.5s ease-in-out infinite;
}

.link-card--featured::before {
  background: radial-gradient(
    circle at center,
    rgba(236, 72, 153, 0.55),
    transparent 70%
  );
}

.link-card--featured .letters {
  border-color: transparent;
  background: linear-gradient(135deg, #ec4899, #f97316);
  color: #ffffff;
  box-shadow: 0 0 18px rgba(236, 72, 153, 0.7);
  transition: transform 0.3s ease;
}

.link-card--featured span,
.link-card--featured:hover span {
  color: var(--featured-text);
}

.link-card--featured:hover {
  border-color: #f97316;
  animation: none;
  box-shadow:
    var(--card-shadow-hover),
    0 0 35px rgba(236, 72, 153, 0.8);
}

@keyframes featuredPulse {
  0%,
  100% {
    box-shadow:
      var(--card-shadow),
      0 0 12px rgba(236, 72, 153, 0.45);
  }

  50% {
    box-shadow:
      var(--card-shadow),
      0 0 28px rgba(236, 72, 153, 0.85);
  }
}

@media (prefers-reduced-motion: reduce) {
  .link-card--featured {
    animation: none;
  }
}

.footer {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  width: 100%;
  font-weight: 300;
  letter-spacing: 0.5px;
}

/* --- PRZEŁĄCZNIK TRYBU --- */
.theme-switch {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: var(--card-bg);
  backdrop-filter: blur(16px);
  border: 1px solid var(--card-border);
  box-shadow: var(--card-shadow);
}

.theme-option {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0;
  cursor: pointer;
  transition:
    background-color 0.25s ease,
    color 0.25s ease;
}

.theme-option:hover {
  color: var(--text-primary);
}

.theme-option:focus-visible {
  outline: 2px solid var(--accent-color);
  outline-offset: 2px;
}

.theme-option[aria-pressed="true"] {
  background: var(--accent-color);
  color: #ffffff;
  box-shadow: 0 4px 14px var(--accent-glow);
}

/* Responsive */
@media (max-width: 768px) {
  .header-section {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .clock {
    font-size: 3.5rem;
  }

  .weather-widget {
    width: 100%;
    justify-content: center;
  }

  .links-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 480px) {
  .links-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .container {
    gap: 25px;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

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