/* ---------- META VIEWPORT (da mettere nell'HTML) ---------- */
/* <meta name="viewport" content="width=device-width, initial-scale=1.0"> */

/* ---------- ROOT: TONALITÀ ROSSA ---------- */
:root {
  --grad-header: linear-gradient(to right, #e57373, #ef5350);
  --grad-section: linear-gradient(to right, #ffcdd2, #e57373);
  --grad-button: linear-gradient(to right, #ef5350, #e53935);
  --accento: #e53935;
  --sfondo-chiaro: #ffffff;
  --sfondo-scuro: #000000;
  --testo: #1e1e1e;
  --testo-titolo-sezioni: #8b0f06;
  --testo-titolo: #212121;
  --testo-chiaro: #f9f9f9;
  --transition-fast: 0.3s ease;
  --transition-smooth: 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- DARK THEME ---------- */
body.darktheme {
  --sfondo-chiaro: #0e0e0e;
  --sfondo-scuro: #000000;
  --testo: #f5f5f5;
  --testo-titolo-sezioni: #290000;
  --testo-titolo: #ffffff;
  --testo-chiaro: #ffffff;
  --grad-header: linear-gradient(to right, #8f1d1d, #8b1e1e, #580000, #310606);
  --grad-section: linear-gradient(to right, #cc3b3b, #991f1f, #660000, #3b0707);
  --grad-button: linear-gradient(to right, #8b0000, #600000, #3a0000, #220000);
  --accento: #ff4c4c;
}

body.darktheme::before {
  background: linear-gradient(120deg, #353535, #161616, #000000);
}

/* ---------- SFONDO ONDE ANIMATE ---------- */
@keyframes oceanWaves {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

body::before {
  content: "";
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  z-index: -1;
  background: linear-gradient(120deg, #ffcdd2, #e57373, #b71c1c, #9e0000);
  background-size: 300% 300%;
  animation: oceanWaves 15s ease infinite;
  opacity: 0.7;
}

/* ---------- STILI BASE ---------- */
body {
  font-family: 'Segoe UI', sans-serif;
  background-color: var(--sfondo-chiaro);
  color: var(--testo);
  line-height: 1.6;
  margin: 0;
  padding: 0;
  transition: background-color var(--transition-smooth), color var(--transition-smooth);
}

a {
  color: var(--accento);
  text-decoration: none;
  transition: color var(--transition-fast);
}
a:hover {
  color: white;
}

/* ---------- TITOLI ---------- */
h1.sezione {
  font-size: 2.5rem;
  text-align: center;
  color: var(--testo-titolo-sezioni);
}
h2.sezoni {
  font-size: 1.8rem;
  color: var(--testo);
  text-align: center;
}

  h3.TestoImg{
    font-size: 1.5rem;
    color: var(--testo);
  }
/* ---------- IMMAGINI RESPONSIVE ---------- */
img.homepage,
img.schedaelettrica,
img.ecgSpO2 {
  max-width: 100%;
  height: auto;
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}

img.homepage {
  border-radius: 10px;
  border: 4px solid rgb(139, 15, 6);
  box-shadow: 0 10px 25px rgba(139, 15, 6, 0.6);
}
img.homepage:hover {
  transform: scale(1.01);
  box-shadow: 0 10px 25px rgba(255, 69, 0, 0.6);
}

img.schedaelettrica {
  max-width: auto;
  border-radius: 25px;
  border: 3px solid #8b0f06;
  box-shadow: 0 10px 25px rgba(255, 69, 0, 0.6);
}
img.schedaelettrica:hover {
  transform: scale(1.01);
}

img.ecgSpO2 {
  margin: 45px auto 20px;
  border-radius: 100%;
  border: 4px solid rgb(219, 23, 23);
  box-shadow: 0px 5px 10px 5px rgba(255, 0, 0, 0.5);
}
img.ecgSpO2:hover {
  transform: scale(1.2);
}

/* ---------- HEADER E NAVIGATION ---------- */
header {
  background: var(--grad-header);
  color: white;
  padding: 10px 0;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  padding: 10px 40px;
}

nav h1 {
  font-size: 4rem;
  margin: 0;
  padding-left: 150px;
  background: linear-gradient(to right, #000000, #8b0000);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
  line-height: 1.2;
}

nav ul {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 15px;
  list-style: none;
}

nav ul li a,
nav ul li button {
  font-weight: bold;
  color: white;
  padding: 8px 16px;
  border: none;
  border-radius: 5px;
  background: transparent;
  font-size: 1rem;
  cursor: pointer;
  transition: background var(--transition-fast);
}

nav ul li a:hover,
nav ul li button:hover {
  background: var(--grad-button);
  color: #fff;
}

/* ---------- SEZIONI ---------- */
section {
  margin: 60px 0;
  padding: 30px;
  background: var(--grad-section);
  border-radius: 15px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
  transform: translateY(40px);
  opacity: 0;
  transition: opacity 1s ease, transform 1s ease;
}
section.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- FORM CONTATTI ---------- */
form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 500px;
  margin: auto;
}

input,
textarea {
  padding: 12px;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 8px;
  transition: border-color var(--transition-fast);
}

input:focus,
textarea:focus {
  border-color: var(--accento);
  outline: none;
}

button[type="submit"] {
  background: var(--grad-button);
  color: white;
  padding: 18px;
  border: none;
  border-radius: 8px;
  font-size: 1.2rem;
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

button[type="submit"]:hover {
  transform: scale(1.2);
  box-shadow: 0 4px 10px rgba(239, 83, 80, 0.5);
}

/* ---------- VIDEO CONTAINER ---------- */
.video-container {
  max-width: 800px;
  margin: 60px auto;
  padding: 4px;
  border-radius: 16px;
  background: linear-gradient(135deg, #e53935, #ef5350, #f48fb1);
  background-size: 400% 400%;
  animation: gradientShift 10s ease infinite;
  box-shadow: 0px 5px 10px 5px rgba(255, 0, 0, 0.5);
}

.video-container video,
.video-container iframe {
  width: 100%;
  height: auto;
  border: none;
  border-radius: 12px;
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ---------- FOOTER ---------- */
footer {
  text-align: center;
  padding: 20px;
  background: var(--grad-header);
  color: white;
  position: relative;
  width: 100%;
}

/* ---------- SOCIAL ---------- */
.social a {
  color: var(--accento);
  font-weight: bold;
  margin-right: 15px;
  transition: color var(--transition-fast);
}

.social a:hover {
  color: white;
}

/* ---------- MEDIA QUERIES RESPONSIVE ---------- */
@media (max-width: 1024px) {
  nav h1 {
    font-size: 3rem;
    padding-left: 80px;
  }
}

@media (max-width: 768px) {
  nav {
    flex-direction: column;
    align-items: center;
  }

  nav h1 {
    font-size: 2.5rem;
    padding-left: 0;
    text-align: center;
  }

  nav ul {
    flex-direction:column;
    padding: 0;
  }

  .video-container {
    margin: 30px 10px;
  }

  section {
    padding: 20px;
    margin: 40px 10px;
  }

  h1.sezione {
    font-size: 2rem;
  }

  h2.sezoni {
    font-size: 1.5rem;
  }
   h3.TestoImg{
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  nav h1 {
    font-size: 2rem;
  }

  nav ul li a,
  nav ul li button {
    font-size: 0.9rem;
    padding: 6px 12px;
  }

  button[type="submit"] {
    font-size: 1rem;
    padding: 14px;
  }

  .video-container {
    margin: 20px;
  }

  img.ecgSpO2,
  img.homepage,
  img.schedaelettrica {
    max-width: 90%;
    margin: 20px auto;
  }
}
