/* Modern Design System for Countdown PWA */
:root {
  /* Color Palette */
  --bg-color-1: #090611;
  --bg-color-2: #140d2b;
  --text-main: #f3f1f8;
  --text-muted: #948ea5;
  
  --accent-gold: #f59e0b;
  --accent-gold-rgb: 245, 158, 11;
  --accent-purple: #8b5cf6;
  --accent-purple-rgb: 139, 92, 246;
  --accent-indigo: #6366f1;
  --accent-indigo-rgb: 99, 102, 241;
  
  /* Fonts */
  --font-header: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  
  /* Layout */
  --card-blur: 20px;
  --card-border: rgba(255, 255, 255, 0.08);
  --card-bg: rgba(18, 12, 38, 0.45);
}

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

body {
  background: radial-gradient(circle at 50% 30%, var(--bg-color-2) 0%, var(--bg-color-1) 80%);
  color: var(--text-main);
  font-family: var(--font-body);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Canvas Background */
#particle-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none; /* Allows user to click on elements underneath */
}

/* App Layout Container */
.app-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 900px;
  padding: 2.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2.5rem;
  text-align: center;
}

/* Header Styles */
.app-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.school-logo-container {
  position: relative;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 0.5rem;
}

.school-logo {
  height: clamp(80px, 12vw, 105px);
  width: auto;
  opacity: 0.85;
  filter: drop-shadow(0 0 10px rgba(139, 92, 246, 0.2))
          drop-shadow(0 0 1px rgba(255, 255, 255, 0.15));
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.school-logo:hover {
  opacity: 1;
  transform: scale(1.06) rotate(1deg);
  filter: drop-shadow(0 0 15px rgba(245, 158, 11, 0.35))
          drop-shadow(0 0 20px rgba(139, 92, 246, 0.25));
}

.logo-badge {
  background: rgba(139, 92, 246, 0.15);
  border: 1px solid rgba(139, 92, 246, 0.3);
  color: #c084fc;
  font-family: var(--font-header);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  padding: 0.4rem 1.2rem;
  border-radius: 9999px;
  text-transform: uppercase;
  backdrop-filter: blur(4px);
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.1);
  animation: pulse-glow 3s infinite alternate;
}

.header-title {
  font-family: var(--font-header);
  font-size: clamp(1.8rem, 5vw, 2.75rem);
  font-weight: 800;
  line-height: 1.25;
  color: var(--text-main);
  max-width: 800px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.highlight-gradient {
  background: linear-gradient(135deg, var(--accent-gold) 0%, #fbbf24 50%, #f59e0b 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
  position: relative;
}

.highlight-class {
  color: #a78bfa;
  text-shadow: 0 0 15px rgba(167, 139, 250, 0.4);
}

/* Countdown Main Card */
.countdown-section {
  width: 100%;
  display: flex;
  justify-content: center;
}

.countdown-card {
  position: relative;
  background: var(--card-bg);
  backdrop-filter: blur(var(--card-blur));
  -webkit-backdrop-filter: blur(var(--card-blur));
  border: 1px solid var(--card-border);
  border-radius: 24px;
  padding: 3rem 2rem;
  width: 100%;
  max-width: 650px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4),
              0 0 40px rgba(99, 102, 241, 0.05);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  overflow: hidden;
  transition: transform 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
}

.countdown-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, transparent, var(--accent-gold), var(--accent-purple), var(--accent-gold), transparent);
}

.countdown-card:hover {
  transform: translateY(-4px);
  border-color: rgba(99, 102, 241, 0.2);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5),
              0 0 50px rgba(99, 102, 241, 0.12);
}

/* Card ambient glow objects inside */
.card-glow-1 {
  position: absolute;
  top: -50px;
  left: -50px;
  width: 150px;
  height: 150px;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.15) 0%, transparent 70%);
  pointer-events: none;
}

.card-glow-2 {
  position: absolute;
  bottom: -50px;
  right: -50px;
  width: 150px;
  height: 150px;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.1) 0%, transparent 70%);
  pointer-events: none;
}

/* Main Hero Number */
.countdown-number-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.countdown-number {
  font-family: var(--font-header);
  font-size: clamp(5rem, 15vw, 8.5rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
  background: linear-gradient(to bottom, #ffffff 30%, #e0d7f5 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 25px rgba(255, 255, 255, 0.05));
  animation: number-float 6s ease-in-out infinite alternate;
}

.countdown-label {
  font-family: var(--font-header);
  font-size: clamp(1rem, 3vw, 1.25rem);
  font-weight: 700;
  letter-spacing: 0.3em;
  color: var(--accent-gold);
  margin-top: 0.5rem;
  text-shadow: 0 0 10px rgba(245, 158, 11, 0.3);
}

/* Sub units grid (Hours, Mins, Secs) */
.countdown-sub-grid {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.04);
  padding: 1rem 2rem;
  border-radius: 16px;
  width: 100%;
  max-width: 450px;
}

.sub-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
}

.sub-number {
  font-family: var(--font-header);
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  font-weight: 600;
  color: var(--text-main);
  font-variant-numeric: tabular-nums;
}

.sub-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 0.2rem;
}

.sub-separator {
  font-family: var(--font-header);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--accent-purple);
  opacity: 0.6;
  padding-bottom: 12px;
}

/* Progress timeline */
.progress-timeline {
  width: 100%;
  max-width: 450px;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.timeline-bar {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  overflow: hidden;
}

.timeline-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-indigo), var(--accent-purple), var(--accent-gold));
  border-radius: 999px;
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
}

.timeline-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Footer Section */
.app-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.footer-text {
  font-size: 0.95rem;
  color: var(--text-muted);
}

.target-date-highlight {
  color: var(--text-main);
  font-weight: 600;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.3);
  padding-bottom: 2px;
}

/* PWA Install Button Banner */
.install-prompt-container {
  display: none; /* Controlled via JS */
  animation: fade-in 0.5s ease;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-main);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.btn .icon {
  opacity: 0.8;
}

/* Animations */
@keyframes pulse-glow {
  0% {
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.1);
    border-color: rgba(139, 92, 246, 0.25);
  }
  100% {
    box-shadow: 0 0 25px rgba(139, 92, 246, 0.25);
    border-color: rgba(139, 92, 246, 0.5);
  }
}

@keyframes number-float {
  0% {
    transform: translateY(0);
  }
  100% {
    transform: translateY(-6px);
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Lucky Person Card Styles */
.lucky-person-card {
  position: relative;
  background: var(--card-bg);
  backdrop-filter: blur(var(--card-blur));
  -webkit-backdrop-filter: blur(var(--card-blur));
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 2rem 1.5rem;
  width: 100%;
  max-width: 500px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3),
              0 0 30px rgba(139, 92, 246, 0.03);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  overflow: hidden;
  transition: transform 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
}

.lucky-person-card:hover {
  transform: translateY(-2px);
  border-color: rgba(245, 158, 11, 0.2);
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.4),
              0 0 35px rgba(245, 158, 11, 0.08);
}

.lucky-person-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--accent-purple), var(--accent-gold), var(--accent-purple), transparent);
}

.lucky-header {
  font-family: var(--font-header);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  text-transform: uppercase;
}

.lucky-name-wrapper {
  min-height: 2.8rem;
  display: flex;
  justify-content: center;
  align-items: center;
}

.lucky-name {
  font-family: var(--font-header);
  font-size: clamp(1.4rem, 4vw, 2.1rem);
  font-weight: 800;
  background: linear-gradient(to right, #ffffff, #e0d7f5, #ffffff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 15px rgba(255, 255, 255, 0.1);
  animation: name-fade-in 1s ease-out;
}

@keyframes name-fade-in {
  from {
    opacity: 0;
    transform: scale(0.95);
    filter: blur(4px);
  }
  to {
    opacity: 1;
    transform: scale(1);
    filter: blur(0);
  }
}

/* Responsive adjustments */
@media (max-width: 600px) {
  .app-container {
    padding: 1.5rem 1rem;
    gap: 1.5rem;
  }
  
  .lucky-person-card {
    padding: 1.5rem 1.25rem;
    max-width: 100%;
  }
  
  .countdown-card {
    padding: 2rem 1.25rem;
    gap: 1.5rem;
  }
  
  .countdown-sub-grid {
    padding: 0.75rem 1rem;
    gap: 0.5rem;
  }
}


/* --- STYLE ANKIETY I MODALA --- */
.poll-section {
  max-width: 600px;
  margin: 40px auto;
  padding: 0 20px;
  text-align: center;
  position: relative;
  z-index: 10;
}

.poll-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 15px;
}

.poll-box {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 20px 10px;
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  backdrop-filter: blur(var(--card-blur));
  transition: all 0.3s ease;
}

.poll-box small {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 400;
}

.poll-box:hover {
  border-color: var(--accent-gold);
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(245, 158, 11, 0.2);
}

.modal-overlay {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(9, 6, 17, 0.85);
  backdrop-filter: blur(5px);
  z-index: 1000;
  display: none; /* Domyślnie ukryte */
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.modal-content {
  background: linear-gradient(145deg, #1f153a, #140d2b);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 30px;
  border-radius: 20px;
  max-width: 400px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}

.modal-content select option {
  background: #140d2b;
  color: white;
}
