:root {
  /* Paletă pastelată ca să pară un proiect făcut pentru curs */
  --bg: #f2f4fb;
  --surface: #ffffff;
  --border: #c8cde3;
  --shadow: 4px 4px 0 #d8dcf1;
  --primary: #2f4d8a;
  --primary-dark: #1f3562;
  --accent: #f2c357;
  --accent-soft: #fff2c8;
  --text: #1f2233;
  --text-muted: #59607a;
}

body {
  /* Setare font și fundal general, cât mai „curat” */
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Trebuchet MS", "Segoe UI", Arial, sans-serif;
  line-height: 1.6;
}

body.home {
  /* Pentru prima pagină vreau să se vadă poza cerută */
  background: #e9ecfa url("img/extreme-close-up-shot-lines-code-displayed-computer-monitors.jpg") center/cover fixed;
}

a {
  color: var(--primary);
  text-decoration: underline;
}

a:hover {
  color: var(--primary-dark);
}

.main-nav {
  /* Navigație cu aspect de carnet, făcută din cadre simple */
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  margin: 20px auto;
  max-width: 960px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.main-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.main-nav li {
  display: flex;
}

.main-nav a {
  text-decoration: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 14px;
  font-weight: 600;
  color: var(--primary-dark);
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.main-nav a:hover,
.main-nav a:focus-visible {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.main-nav .logo {
  /* Logo-ul îl fac puțin mai evidențiat, dar tot simplu */
  padding: 6px 14px;
  border: 2px solid var(--primary);
  border-radius: 8px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--primary-dark);
  background: #fff;
  box-shadow: 3px 3px 0 #bac3e2;
}

.container {
  /* Cutia principală pentru conținutul paginilor */
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  margin: 0 auto 32px;
  max-width: 960px;
  padding: 26px 24px;
}

body.home .container,
body.home .main-nav,
body.home footer {
  /* În home folosesc transparență ca să se vadă fundalul cu imagine */
  background-color: rgba(255, 255, 255, 0.94);
}

h1, h2, h3 {
  color: var(--primary-dark);
  margin-bottom: 0.6em;
}

h1 {
  font-size: 2rem;
}

h2 {
  font-size: 1.6rem;
}

h3 {
  font-size: 1.3rem;
}

p {
  margin-bottom: 1rem;
}

ul {
  list-style: disc;
  padding-left: 1.3rem;
  margin-bottom: 1rem;
}

ol {
  list-style: decimal;
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

li {
  margin-bottom: 0.4rem;
}

.note {
  color: var(--text-muted);
  font-style: italic;
}

.requirement {
  /* Marcaj pentru cerințele pe care trebuie să le bifez */
  margin: 18px 0 10px;
  padding: 6px 12px;
  border-left: 5px solid var(--accent);
  background: var(--accent-soft);
  color: #5b4b2b;
  font-size: 0.92rem;
}

.red {
  /* Marker roșu pentru accent */
  color: #c73b3b;
  font-weight: 600;
}

.big,
.bigger {
  font-size: 1.25rem;
}

.small,
.smaller {
  font-size: 0.9rem;
}

.serif {
  font-family: "Times New Roman", Times, serif;
}

.mono,
code {
  font-family: "Courier New", monospace;
}

#special {
  font-weight: 600;
}

.center {
  text-align: center;
}

.right {
  text-align: right;
}

.accent {
  color: var(--primary);
  font-weight: 600;
}

.cols {
  /* Grid simplu folosit în capitolele cu exemple */
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  margin-bottom: 1.2rem;
}

.nested-list {
  list-style: circle;
  padding-left: 1.2rem;
}

.nested-list ul {
  list-style: square;
  margin-top: 0.4rem;
  padding-left: 1.1rem;
}

.float-img {
  /* Imagine flotantă folosită la obținerea de text în jur */
  float: right;
  max-width: 260px;
  border: 2px solid var(--border);
  border-radius: 10px;
  margin: 0 0 12px 18px;
}

.umbra {
  box-shadow: 3px 3px 0 #c6cbe4;
}

.zona {
  max-width: 420px;
}

blockquote {
  /* Citatele trebuie să iasă în evidență */
  border-left: 4px solid var(--primary);
  background: #eef2ff;
  padding: 12px 16px;
  margin: 1rem 0;
  border-radius: 8px;
}

pre {
  /* Blocuri de cod pe fundal închis, ca în editor */
  background: #171e32;
  color: #f2f4ff;
  padding: 12px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 0 0 1rem;
}

pre code {
  /* În blocurile pre vreau text luminos pe fundal închis, fără highlight deschis */
  color: inherit;
  background: transparent;
  padding: 0;
  display: block;
}

code {
  background: #eef1fb;
  padding: 2px 4px;
  border-radius: 4px;
}

hr {
  /* Liniile orizontale sunt folosite în pagina de intro */
  border: none;
  margin: 16px 0;
  height: 1px;
  background: var(--border);
}

hr.normala {
  height: 2px;
}

hr.ingrosata {
  height: 4px;
  background: var(--primary);
}

hr.colorata {
  height: 3px;
  background: var(--accent);
}

.table,
.mini {
  /* Stil comun pentru toate tabelele din proiect */
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.table th,
.table td,
.mini th,
.mini td {
  border-bottom: 1px solid var(--border);
  padding: 10px;
  text-align: left;
}

.table tr:last-child td,
.mini tr:last-child td {
  border-bottom: none;
}

.table th,
.mini th,
.merge {
  background: #edf1ff;
  color: var(--primary-dark);
  font-weight: 700;
}

.list-img {
  list-style-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12'%3E%3Ccircle cx='6' cy='6' r='4' fill='%23f2c357'/%3E%3C/svg%3E");
  padding-left: 28px;
}

.inline-demo {
  /* Un mic demo pentru diferența span/div */
  display: grid;
  gap: 10px;
  margin-bottom: 1.2rem;
}

.color-sample,
.bg-img {
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  background: #f8f9ff;
}

.bg-img {
  /* Casetă cu fundal texturat, să bifez cerința */
  background-image: url("img/bg-pattern.png");
  background-size: cover;
  background-repeat: repeat;
}

.parent {
  /* În CSS Basics trebuie să demonstrez selectorii */
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.child {
  font-weight: 600;
}

.navlike {
  list-style: none;
  padding-left: 0;
}

.navlike li {
  margin-bottom: 0.3rem;
}

.navlike li a {
  text-decoration: underline;
}

.demo,
.grid,
.links,
.media {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  margin-bottom: 1.2rem;
}

.example,
.card,
.tile {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
}

.tile {
  /* Cardurile din galerie, cu animație discretă */
  overflow: hidden;
  padding: 0;
  transition: transform 0.15s ease;
}

.tile img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-bottom: 2px solid var(--border);
}

.gallery-grid {
  /* Mosaic layout cu țigle de înălțimi și lățimi diferite */
  grid-auto-flow: dense;
  grid-auto-rows: 180px;
}

.gallery-grid .tile {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  margin: 0;
}

.gallery-grid .tile img {
  height: 100%;
}

.gallery-grid .tile--wide {
  grid-column: span 2;
}

.gallery-grid .tile--tall {
  grid-row: span 2;
}

.gallery-grid .tile--big {
  grid-column: span 2;
  grid-row: span 2;
}

.tile:hover {
  transform: translateY(-3px);
}

.caption {
  padding: 12px;
  font-size: 0.95rem;
}

.card h3,
.example h3 {
  margin-top: 0;
}

.img-link {
  display: inline-block;
  border: 2px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.15s ease;
}

.img-link:hover {
  transform: translateY(-2px);
}

.img-link img {
  display: block;
}

.iframe-wrap {
  /* Container responsiv pentru iframe-uri (video/hartă) */
  border: 2px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
  background: #000;
  position: relative;
  padding-top: 56.25%;
}

.iframe-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.map-container {
  position: relative;
  display: inline-block;
  max-width: 100%;
}

.map-img {
  display: block;
  max-width: 100%;
  height: auto;
  border: 2px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.map-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.map {
  width: 100%;
  border: 2px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  height: 350px;
}

.fixed-note {
  /* Notiță fixă ca să am element „lipit” la scroll */
  position: fixed;
  right: 16px;
  bottom: 16px;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 0.88rem;
  color: var(--primary-dark);
  box-shadow: var(--shadow);
}

.fixed-badge {
  position: fixed;
  bottom: 14px;
  right: 14px;
  width: 70px;
  border: 2px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.fixed-icon {
  position: fixed;
  right: 16px;
  bottom: 16px;
  width: 64px;
  border-radius: 50%;
  border: 2px solid var(--border);
  box-shadow: var(--shadow);
  transition: transform 0.15s ease;
}

.fixed-icon:hover {
  transform: scale(1.05);
}

.quiz,
.contact {
  /* Formularele principale arată la fel pe toate paginile */
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 18px;
  margin-bottom: 1.2rem;
}

.row {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

label {
  font-weight: 600;
  color: var(--primary-dark);
}

input,
textarea,
select,
button {
  font-family: inherit;
  font-size: 1rem;
}

input,
textarea,
select {
  border: 2px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  background: #f9faff;
  color: var(--text);
}

textarea {
  resize: vertical;
}

fieldset {
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 12px;
}

legend {
  font-weight: 700;
  color: var(--primary-dark);
  padding: 0 6px;
}

.actions {
  /* Zonă pentru butoane, ținută pe un singur rând */
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-top: 10px;
}

.btn,
.btn-img {
  /* Butoane cu iconiță, destul de simple */
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 8px 14px;
  background: #f9faff;
  color: var(--primary-dark);
  text-decoration: none;
  cursor: pointer;
  box-shadow: 2px 2px 0 #cdd2ea;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.btn:hover,
.btn-img:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.hint {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.profile {
  /* Carte de vizită pentru pagina Despre */
  display: flex;
  gap: 16px;
  align-items: center;
}

.profile img {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
  box-shadow: var(--shadow);
}

.badge {
  /* Badge drăguț pentru etichetele scoase în evidență */
  display: inline-block;
  border: 2px solid var(--border);
  border-radius: 999px;
  padding: 4px 10px;
  background: #eef1ff;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary-dark);
}

.wrap {
  /* Limitez lățimea conținutului pe pagina Despre */
  max-width: 900px;
  margin: 0 auto;
}

.media {
  /* Layout pentru secțiunea audio + gif */
  align-items: flex-start;
}

.links {
  margin-bottom: 1.2rem;
}

audio {
  /* Player audio ocupă toată lățimea cutiei */
  width: 100%;
  margin-bottom: 0.6rem;
}

#highlight {
  /* Casetă specială pentru selectorul ID */
  background: #eef1ff;
  border-left: 4px solid var(--primary);
  padding: 8px 10px;
  border-radius: 8px;
}

footer {
  /* Footer-ul e tot o cutie cu umbră ca restul site-ului */
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  margin: 0 auto 32px;
  max-width: 960px;
  padding: 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.95rem;
}

@media (max-width: 820px) {
  /* Încă testez breakpoint-urile astea pe telefonul meu vechi, sper să fie ok */
  .main-nav {
    /* Pe tablete pun meniul pe centru */
    justify-content: center;
  }

  .main-nav ul {
    justify-content: center;
  }

  .row {
    grid-template-columns: 1fr;
  }

  .profile {
    flex-direction: column;
    text-align: center;
  }
}

@media (max-width: 540px) {
  .main-nav {
    /* Pe telefoane micșorez padding-ul nav */
    padding: 12px;
  }

  .main-nav .logo {
    width: 100%;
    text-align: center;
  }

  .main-nav ul {
    width: 100%;
  }

  .main-nav li {
    /* Linkurile ocupa două coloane pe mobil */
    flex: 1 1 48%;
  }

  .container {
    /* Spațiu mai strâns pe ecrane foarte mici */
    padding: 20px 18px;
  }

  .gallery-grid {
    grid-auto-rows: auto;
  }

  .gallery-grid .tile {
    grid-template-rows: auto auto;
  }

  .gallery-grid .tile img {
    height: 180px;
  }

  .gallery-grid .tile--wide,
  .gallery-grid .tile--tall,
  .gallery-grid .tile--big {
    grid-column: span 1;
    grid-row: span 1;
  }
}
