/* ==========================================================================
   macOS / iOS Inspired Stylesheet for Plan Lekcji ZSM nr 1
   Apple Human Interface Guidelines — Vibrancy, SF Colors, Rounded Design
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  /* Apple System Colors */
  --apple-blue:    #007AFF;
  --apple-green:   #34C759;
  --apple-teal:    #5AC8FA;
  --apple-indigo:  #5856D6;
  --apple-orange:  #FF9500;
  --apple-pink:    #FF2D55;
  --apple-purple:  #AF52DE;
  --apple-red:     #FF3B30;
  --apple-yellow:  #FFCC00;

  /* Vibrancy / Frosted Glass Surfaces */
  --surface-1:     rgba(255, 255, 255, 0.75);
  --surface-2:     rgba(255, 255, 255, 0.60);
  --surface-border: rgba(255, 255, 255, 0.80);
  --subtle-border:  rgba(0, 0, 0, 0.07);

  /* Text */
  --text-primary:   #1c1c1e;
  --text-secondary: #3a3a3c;
  --text-tertiary:  #6b7280;
  --text-label:     rgba(28, 28, 30, 0.65);

  /* Background */
  --bg-base: #d1d5db;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  width: 100%;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Helvetica Neue', sans-serif;
  background-color: var(--bg-base);
  background-image:
    /* Apple-style light matte frosted overlay */
    linear-gradient(180deg,
      rgba(255, 255, 255, 0.30) 0%,
      rgba(242, 242, 247, 0.50) 40%,
      rgba(229, 229, 234, 0.55) 100%
    ),
    url("zsm.jpg");
  background-position: center;
  background-size: cover;
  background-attachment: fixed;
  background-repeat: no-repeat;
  color: var(--text-primary);
  text-align: center;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  display: flex;
  flex-direction: column;
}

/* ==========================================================================
   Header — SF Bar / Navigation Bar (Apple style)
   ========================================================================== */

header {
  background: rgba(249, 249, 249, 0.80);
  backdrop-filter: blur(28px) saturate(200%);
  -webkit-backdrop-filter: blur(28px) saturate(200%);
  border-bottom: 0.5px solid rgba(0, 0, 0, 0.10);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
  padding: 14px 24px;
  position: sticky;
  top: 0;
  z-index: 100;
}

h1#pierwsza {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  max-width: 1080px;
  padding: 0;
  color: var(--text-tertiary);
  font-family: 'Inter', -apple-system, sans-serif;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  position: relative;
}

h1#pierwsza a {
  display: inline-block;
  text-decoration: none;
}

.photo {
  width: 52px;
  height: 52px;
  border-radius: 13px; /* Apple icon rounding */
  background-color: #ffffff;
  background-image: url("logo.jpg");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.12),
    0 0 0 0.5px rgba(0, 0, 0, 0.08);
  transition:
    transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.3s ease;
  cursor: pointer;
  margin-bottom: 6px;
}

.photo:hover {
  transform: scale(1.07) rotate(-2deg);
  box-shadow:
    0 8px 24px rgba(0, 122, 255, 0.22),
    0 0 0 2px rgba(0, 122, 255, 0.45);
}

#powrot {
  display: none;
}

.plan {
  display: block;
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  text-transform: uppercase;
  margin-top: 2px;
  margin-bottom: 2px;
  -webkit-text-fill-color: var(--text-primary);
}

.modyfikacja {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 7px;
  padding: 5px 16px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.85);
  border: 0.5px solid rgba(0, 0, 0, 0.09);
  color: var(--apple-blue);
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-transform: none;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  backdrop-filter: blur(12px);
}

.modyfikacja::before {
  content: '';
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--apple-green);
  box-shadow: 0 0 6px var(--apple-green);
  animation: pulse-dot 2s infinite ease-in-out;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%        { opacity: 0.45; transform: scale(0.82); }
}

/* ==========================================================================
   Main Grouped Container (iOS List Style)
   ========================================================================== */

.container {
  width: 94%;
  max-width: 980px;
  margin: 28px auto 44px auto;
  padding: 28px 24px;
  background: var(--surface-1);
  backdrop-filter: blur(32px) saturate(200%);
  -webkit-backdrop-filter: blur(32px) saturate(200%);
  border: 0.5px solid var(--surface-border);
  border-radius: 22px;
  box-shadow:
    0 2px 6px rgba(0, 0, 0, 0.04),
    0 8px 24px rgba(0, 0, 0, 0.07);
  flex: 1 0 auto;
}

.nav-menu {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Grade Section Titles — iOS section headers */
.nav-menu p {
  width: 100%;
  box-sizing: border-box;
  margin: 8px 0 4px 0;
  padding: 9px 18px;
  border-radius: 12px;
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 9px;
  border: 0.5px solid transparent;
}

.nav-menu p::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

/* Klasa 1 — Apple Green */
p.a {
  background: rgba(52, 199, 89, 0.10);
  color: #186a2e;
  border-color: rgba(52, 199, 89, 0.28);
}
p.a::before {
  background: var(--apple-green);
  box-shadow: 0 0 6px rgba(52, 199, 89, 0.6);
}

/* Klasa 2 — Apple Teal/Sky */
p.b {
  background: rgba(90, 200, 250, 0.12);
  color: #0066a8;
  border-color: rgba(90, 200, 250, 0.32);
}
p.b::before {
  background: var(--apple-teal);
  box-shadow: 0 0 6px rgba(90, 200, 250, 0.6);
}

/* Klasa 3 — Apple Blue */
p.c {
  background: rgba(0, 122, 255, 0.09);
  color: #004ca8;
  border-color: rgba(0, 122, 255, 0.28);
}
p.c::before {
  background: var(--apple-blue);
  box-shadow: 0 0 6px rgba(0, 122, 255, 0.55);
}

/* Klasa 4 — Apple Indigo */
p.d {
  background: rgba(88, 86, 214, 0.10);
  color: #3a38a0;
  border-color: rgba(88, 86, 214, 0.28);
}
p.d::before {
  background: var(--apple-indigo);
  box-shadow: 0 0 6px rgba(88, 86, 214, 0.55);
}

/* Klasa 5 — Apple Purple */
p.e {
  background: rgba(175, 82, 222, 0.10);
  color: #742a9e;
  border-color: rgba(175, 82, 222, 0.28);
}
p.e::before {
  background: var(--apple-purple);
  box-shadow: 0 0 6px rgba(175, 82, 222, 0.55);
}

.zoom {
  transform: none !important;
  transition: all 0.18s ease;
}
.zoom:hover {
  filter: brightness(0.97);
}

/* Container for boxes of each grade */
.grade-boxes {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-start;
  align-items: center;
  margin-bottom: 6px;
}

.grade-boxes a,
.nav-menu a {
  text-decoration: none;
  display: inline-flex;
}

/* ==========================================================================
   Class Boxes — Apple Tinted Glass Buttons
   ========================================================================== */

.box {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 96px;
  height: 70px;
  padding: 0 14px;
  border-radius: 16px; /* Apple icon corner radius */
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.8) inset,
    0 3px 8px rgba(0, 0, 0, 0.06);
}

/* Subtle top gloss */
.box::after {
  content: '';
  position: absolute;
  inset: 0;
  top: 0;
  height: 50%;
  background: linear-gradient(180deg, rgba(255,255,255,0.38) 0%, rgba(255,255,255,0) 100%);
  border-radius: 16px 16px 0 0;
  pointer-events: none;
}

/* Klasa 1 — Apple Green tint */
.box.a {
  background: rgba(52, 199, 89, 0.18);
  color: #186a2e;
  border: 0.5px solid rgba(52, 199, 89, 0.35);
}
.box.a:hover {
  background: rgba(52, 199, 89, 0.30);
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 8px 20px rgba(52, 199, 89, 0.22), 0 0 0 2px rgba(52, 199, 89, 0.4);
}

/* Klasa 2 — Apple Teal tint */
.box.b {
  background: rgba(90, 200, 250, 0.18);
  color: #005c96;
  border: 0.5px solid rgba(90, 200, 250, 0.38);
}
.box.b:hover {
  background: rgba(90, 200, 250, 0.32);
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 8px 20px rgba(90, 200, 250, 0.22), 0 0 0 2px rgba(90, 200, 250, 0.45);
}

/* Klasa 3 — Apple Blue tint */
.box.c {
  background: rgba(0, 122, 255, 0.13);
  color: #004aba;
  border: 0.5px solid rgba(0, 122, 255, 0.30);
}
.box.c:hover {
  background: rgba(0, 122, 255, 0.24);
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 8px 20px rgba(0, 122, 255, 0.20), 0 0 0 2px rgba(0, 122, 255, 0.42);
}

/* Klasa 4 — Apple Indigo tint */
.box.d {
  background: rgba(88, 86, 214, 0.13);
  color: #3533a0;
  border: 0.5px solid rgba(88, 86, 214, 0.30);
}
.box.d:hover {
  background: rgba(88, 86, 214, 0.24);
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 8px 20px rgba(88, 86, 214, 0.20), 0 0 0 2px rgba(88, 86, 214, 0.42);
}

/* Klasa 5 — Apple Purple tint */
.box.e {
  background: rgba(175, 82, 222, 0.13);
  color: #6d1f8e;
  border: 0.5px solid rgba(175, 82, 222, 0.30);
}
.box.e:hover {
  background: rgba(175, 82, 222, 0.24);
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 8px 20px rgba(175, 82, 222, 0.20), 0 0 0 2px rgba(175, 82, 222, 0.42);
}

.box:active {
  transform: scale(0.97);
  opacity: 0.9;
}

/* ==========================================================================
   Footer
   ========================================================================== */

footer {
  text-transform: none;
  background: rgba(249, 249, 249, 0.75);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-top: 0.5px solid rgba(0, 0, 0, 0.10);
  padding: 14px 20px;
  color: var(--text-tertiary);
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.01em;
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */

@media (min-width: 640px) {
  header { padding: 16px 32px; }

  h1#pierwsza {
    flex-direction: row;
    gap: 18px;
  }

  .photo {
    width: 56px;
    height: 56px;
    margin-bottom: 0;
  }

  .plan { font-size: 28px; }

  .box {
    min-width: 102px;
    height: 76px;
    font-size: 19px;
  }
}

@media (min-width: 1024px) {
  .container { padding: 34px 40px; }
  .box {
    min-width: 106px;
    height: 80px;
    font-size: 20px;
  }
}