/* ==== CSS CONDIVISO - PROGETTO TRECCANI GENERATIVE AI ==== */

/* ==== FONT DECLARATIONS ==== */
@font-face {
  font-family: 'Avenir Book';
  src: url('font/Avenir-Book-01.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Avenir Medium';
  src: url('font/Avenir-Medium-09.ttf') format('truetype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Avenir Heavy';
  src: url('font/Avenir-Heavy-05.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ==== CUSTOM PROPERTIES ==== */
:root {
  --font-book: "Avenir Book", "Avenir", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-medium: "Avenir Medium", "Avenir", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-heavy: "Avenir Heavy", "Avenir", -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ==== RESET DI BASE ==== */
*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  height: 100%;
  margin: 0;
  font-family: var(--font-book);
  background: linear-gradient(135deg, #4a7c7e 0%, #2d5a5c 50%, #1a4245 100%);
  color: #ffffff;
  overflow-x: hidden;
}

html {
  min-height: 100vh;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ==== HEADER ==== */
header {
  background-color: rgba(26, 66, 69, 0.95);
  border-bottom: 2px solid rgba(255, 255, 255, 0.2);
  padding: 1.5rem 2rem;
  display: flex;
  align-items: center;
}

.logo {
  max-width: 260px;
  margin-right: 2rem;
  filter: brightness(1.2) contrast(1.1);
}

.intestazione-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 1;
  gap: 3rem;
}

.intestazione-header h2 {
  margin: 0;
  color: #ffffff;
  font-size: 1.6rem;
  font-family: var(--font-heavy);
}

.topnav {
  display: flex;
  gap: 2rem;
  font-size: 0.95rem;
}

.nav-link {
  text-decoration: none;
  color: rgba(255, 255, 255, 0.8);
  font-weight: normal;
  font-family: var(--font-medium);
  transition: color 0.2s ease;
}

.nav-link:hover {
  color: #ffffff;
  text-decoration: underline;
}

.nav-link.attivo {
  font-weight: bold;
  color: #ffffff;
  border-bottom: 2px solid #ffffff;
}

/* ==== LAYOUT PRINCIPALE ==== */
.container {
  display: flex;
  width: 100%;
  margin: 2rem 0;
  padding: 0 2rem;
  gap: 2rem;
  flex: 1;
}

.colonna-sinistra {
  width: 320px;
  padding: 1rem;
  background-color: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  overflow-y: auto;
  max-height: 500px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
  position: sticky;
  top: 2rem;
  border-radius: 6px;
  color: #ffffff;
}

.colonna-sinistra.attiva {
  opacity: 1;
  pointer-events: all;
}

.colonna-sinistra h4 {
  color: #ffffff;
  margin-top: 0;
  font-family: var(--font-heavy);
}

.chiudi-icon {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: none;
  border: none;
  font-size: 1.4rem;
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
}

.chiudi-icon:hover {
  color: #ffffff;
}

.colonna-destra {
  flex: 1;
  display: flex;
  min-height: 800px;
  flex-direction: column;
}

/* ==== MENU SUPERIORE ==== */
.menu {
  display: flex;
  flex-wrap: wrap;
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
  margin-bottom: 1.5rem;
}

.pulsante {
  text-decoration: none;
  background-color: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.8);
  border: none;
  padding: 0.6rem 1.2rem;
  font-size: 0.95rem;
  font-family: var(--font-medium);
  cursor: pointer;
  transition: border-color 0.3s ease, color 0.3s ease, background-color 0.3s ease;
  border-bottom: 3px solid transparent;
  margin-right: 0.5rem;
}

.pulsante:hover {
  color: #ffffff;
  background-color: rgba(255, 255, 255, 0.2);
  border-bottom: 3px solid rgba(255, 255, 255, 0.5);
}

.pulsante.attivo {
  border-bottom: 3px solid #ffffff;
  font-weight: bold;
  color: #ffffff;
  background-color: rgba(255, 255, 255, 0.2);
}

.pulsante.disabled {
  color: rgba(255, 255, 255, 0.4);
  cursor: not-allowed;
  pointer-events: none;
  background-color: rgba(255, 255, 255, 0.05);
}

.pulsante.disabled:hover {
  border-bottom-color: transparent;
}

/* ==== BOX CONTENUTO ==== */
.box {
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 1rem;
  margin-bottom: 1rem;
  background-color: rgba(255, 255, 255, 0.1);
  cursor: pointer;
  transition: background-color 0.3s ease, border-color 0.3s ease;
  width: 100%;
  border-radius: 6px;
  color: #ffffff;
}

.box:hover {
  background-color: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.5);
}

.box h3 {
  margin-top: 0;
  margin-bottom: 0.8rem;
  font-family: var(--font-heavy);
}

.box.selezionato {
  background-color: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.6);
}

.box-intestazione {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.box-intestazione a {
  color: #ffffff;
  text-decoration: none;
}

.box-intestazione a:hover {
  text-decoration: underline;
}

.box p {
  margin-top: 0.0rem;
  margin-bottom: 0.1rem;
  color: rgba(255, 255, 255, 0.9);
}

/* ==== ICONE E POPUP ==== */
.icone-box {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

.icone-box .popup-icon img {
  width: 18px;
  height: 18px;
}

.popup-icon {
  background: none;
  border: none;
  font-size: 1rem;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.8);
  padding: 0;
  line-height: 1;
  transition: transform 0.2s ease;
}

.popup-icon img {
  width: 18px;
  height: 18px;
  display: block;
  filter: brightness(0) invert(1);
  opacity: 0.8;
}

.popup-icon:hover img {
  transform: scale(1.2);
  transition: transform 0.2s ease;
  opacity: 1;
}

/* ==== POPUP CENTRALE ==== */
.popup-box {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 999;
  background: rgba(26, 66, 69, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
  padding: 1.5rem;
  width: 80%;
  max-width: 600px;
  max-height: 70vh;
  overflow-y: auto;
  overflow-anchor: none;
  border-radius: 8px;
  color: #ffffff;
}

.popup-contenuto {
  position: relative;
}

.chiudi-popup {
  position: absolute;
  top: 0.2rem;
  right: 0.2rem;
  background: none;
  border: none;
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
}

.chiudi-popup:hover {
  color: #ffffff;
}

/* ==== TABS PER RIASSUNTI ==== */
.riassunto-tabs {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin: 1rem 0 0.6rem;
}

.tab-btn {
  padding: 0.3rem 0.8rem;
  background-color: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 999px;
  font-size: 0.9rem;
  font-family: var(--font-medium);
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.tab-btn:hover {
  background-color: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

.tab-btn.attivo {
  background-color: rgba(255, 255, 255, 0.3);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.5);
  font-weight: bold;
}

/* ==== BOX CONTENUTO RIASSUNTO ==== */
.riassunto-box {
  border-top: 1px solid rgba(255, 255, 255, 0.3);
  padding-top: 0.8rem;
  font-size: 0.95rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.95);
}

/* ==== STILI SINOTTICI ==== */
.colonna-sinistra ul {
  padding-left: 1.2rem;
  margin-bottom: 1.2rem;
  list-style-type: disc;
}

.colonna-sinistra li {
  line-height: 1.5;
  margin: 0.3rem 0;
  color: rgba(255, 255, 255, 0.9);
}

.colonna-sinottica-section-title {
  font-weight: bold;
  color: rgba(255, 255, 255, 0.95);
  font-size: 1.05rem;
  margin-top: 1rem;
  display: block;
}

.colonna-sinistra ul ul {
  list-style-type: circle;
  margin-top: 0.3rem;
  margin-left: 1.2rem;
}

/* ==== FOOTER ==== */
footer {
  background-color: rgba(26, 66, 69, 0.9);
  color: rgba(255, 255, 255, 0.9);
  text-align: center;
  font-size: 0.9rem;
  padding: 1rem 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}

/* ==== ICONE AUDIO ==== */
.audio-icon {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
}

.audio-icon img {
  width: 22px;
  height: 22px;
  transition: transform 0.2s ease;
  filter: brightness(0) invert(1);
  opacity: 0.8;
}

.audio-icon:hover img {
  transform: scale(1.15);
}

.audio-icon.in-play img {
  animation: pulse 1.2s infinite;
}

/* ==== ANIMAZIONI ==== */
@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

/* ==== LOADER ==== */
.loader {
  border: 5px solid #f3f3f3;
  border-top: 5px solid #893B67;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: spin 1s linear infinite;
  margin: 5rem auto;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
