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

html {
  scroll-behavior: smooth;
  overflow: hidden;
}

body {
  font-family: 'Inter', sans-serif;
  overflow: hidden;
  height: 100vh;
  position: fixed;
  width: 100%;
}

/* HERO SECTION */
.hero {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  background-color: black;
  color: white;
  z-index: 1;
}

/* BACKGROUND IMAGE */
.hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 160%;
  object-fit: cover;
  opacity: 0.8;
}

/* TITLE */
/* .title {
  position: absolute;
  top: 0;
  left: 50%;
  width: 90%;
  transform: translateX(-50%);
  font-size: clamp(5rem, 15vw, 290px);
  font-weight: 900;
  line-height: 1;
  text-align: center;
  text-shadow: 0px 4px 4px rgba(0, 0, 0, 0.25);
  z-index: 2;
   letter-spacing: -0.02em; 
} */

/* TITLE */
.title {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%; /* or 95% if you want it even wider */
  max-width: 1446px; /* Maximum width from Figma */
  height: 286px; /* Fixed height from Figma */
  display: flex;
  flex-direction: column;
  justify-content: center;
  font-size: clamp(5rem, 20vw, 290px); /* Responsive font, max 290px */
  font-weight: 900;
  line-height: 0.95; /* 275.5/290 = 0.95 */
  text-align: center;
  text-shadow: 0px 4px 4px rgba(0, 0, 0, 0.25);
  z-index: 2;
}

/* SUBTITLE */
.subtitle {
  position: absolute;
  top: 55%;
  left: 50%;
  transform: translateX(-50%);
  max-width: 500px;
  width: 90%;
  font-size: 32px;
  font-weight: 900;
  text-align: center;
  z-index: 2;
}

/* BUTTONS */
.buttons {
  position: absolute;
  top: 70%;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 1.5rem;
  z-index: 2;
}

.btn {
  background: transparent;
  color: white;
  border: 1px solid white;
  border-radius: 43px;
  padding: 12px 40px;
  font-size: 20px;
  cursor: pointer;
  transition: 0.3s ease;
}

.btn:hover {
  background-color: white;
  color: black;
}

/* FOOTER TEXT */
.bottom-text {
  position: absolute;
  bottom: 20px;
  font-size: 16px;
  font-weight: 400;
  text-align: center;
  z-index: 2;
}

.bottom-text.left {
  left: 20px;
}

.bottom-text.right {
  right: 20px;
  cursor: pointer;
}

#sobreXammar:hover {
  opacity: 0.8;
}

/* ===== WRITE SECTION ===== */
.write-section {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background-color: black;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px 60px;
  z-index: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
}

.write-section.active {
  z-index: 2;
  opacity: 1;
  pointer-events: all;
}

/* BACK BUTTON */
.back-btn {
  position: absolute;
  left: 40px;
  width: 60px;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  top: 40px;
  width: 80px;
  height: 51px;
  border-radius: 43px;
  border: 1px solid white;
  background: transparent;
  z-index: 10;
}

.back-btn:hover {
  background-color: white;
  color: black;
}

.back-btn svg {
  width: 24px;
  height: 24px;
}

/* WRITE CONTAINER */
.write-container {
  display: flex;
  gap: 80px;
  max-width: 1400px;
  width: 100%;
  align-items: center;
  height: 100%;
}

/* WRITE INTRO */
.write-intro {
  flex: 0 0 400px;
  padding-right: 20px;
}

.write-intro h2 {
  font-size: 32px;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 20px;
}

.write-intro p {
  font-size: 32px;
  font-weight: 400;
  line-height: 1.2;
}

/* WRITE FORM */
.write-form {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 30px;
  max-width: 870px;
  height: 100%;
  justify-content: center;
}

.write-form textarea {
  width: 100%;
  background: #F5F5F5;
  border: none;
  border-radius: 17px;
  padding: 25px;
  font-family: 'Inter', sans-serif;
  font-size: 20px;
  color: #050505;
  resize: none;
}

#titular {
  height: 200px;
}

#entradeta {
  height: 485px;
}

.write-form textarea:focus {
  outline: 2px solid #FF0080;
}

.write-form textarea::placeholder {
  color: #999;
  font-size: 20px;
}

/* GENERATE BUTTON */
.generate-btn {
  background: #FF0080;
  color: white;
  border: none;
  border-radius: 17px;
  padding: 25px 40px;
  font-size: 32px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
  height: auto;
}

.generate-btn:hover {
  background: #E6006F;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(255, 0, 128, 0.4);
}

/* ===== LOADING SECTION ===== */
.loading-section {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: #FF0080;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
}

.loading-section.active {
  z-index: 3;
  opacity: 1;
  pointer-events: all;
}

.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 40px;
}

.progress-bar-container {
  position: relative;
  width: 564px;
  height: 18px;
}

.progress-bar-bg {
  width: 100%;
  height: 100%;
  background: #F5F5F5;
  border-radius: 102px;
  position: absolute;
}

.progress-bar-fill {
  width: 0%;
  height: 7px;
  background: #FF0080;
  border-radius: 102px;
  position: absolute;
  top: 50%;
  left: 2.5%;
  transform: translateY(-50%);
  transition: width 0.3s ease;
  max-width: 95%;
}

.loading-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 10px;
}

.percentage {
  color: #F5F5F5;
  font-size: 32px;
  font-family: 'Inter', sans-serif;
  font-weight: 900;
  line-height: 30.4px;
}

.loading-label {
  color: #F5F5F5;
  font-size: 32px;
  font-family: 'Inter', sans-serif;
  font-weight: 400;
  line-height: 30.4px;
}

/* ===== RESULT SECTION ===== */
.result-section {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background-color: black;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  z-index: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
}

.result-section.active {
  z-index: 4;
  opacity: 1;
  pointer-events: all;
}

.result-container {
  position: relative;
  display: flex;
  gap: 0;
  max-width: 1200px;
  width: 80%;
  height: 90vh;
  max-height: 900px;
}

/* PDF DOWNLOAD BUTTON (vertical, left side) */
.pdf-button {
  position: relative;
  width: 60px;
  min-width: 60px;
  background: #FF0080;
  border-radius: 17px 0 0 17px;
  height: 30%;           
  min-height: 100px;     
  align-self: center;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
  padding: 0;
}

.pdf-button:hover {
  background: #E6006F;
  transform: translateX(-5px);
}

.pdf-button-text {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  color: white;
  font-size: 15px;
  font-weight: 900;
  text-align: center;
  white-space: nowrap;
  letter-spacing: 0.5px;
}

/* CONTENT BOX */
.result-content {
  flex: 1;
  background: #F5F5F5;
  border-radius: 17px 17px 17px 17px;
  padding: 50px 60px;
  overflow-y: auto;
  color: black;
  scrollbar-width: none; 
}

.result-content::-webkit-scrollbar {
  width: 8px;
}

.result-content::-webkit-scrollbar-track {
  background: #e0e0e0;
  border-radius: 10px;
}

.result-content::-webkit-scrollbar-thumb {
  background: #999;
  border-radius: 10px;
}

.result-content::-webkit-scrollbar-thumb:hover {
  background: #666;
}

/* ARTICLE TITLE */
.article-title {
  font-size: 24px;
  font-weight: 900;
  line-height: 1.2;
  color: black;
  margin-bottom: 25px;
}

/* ARTICLE LEAD (entradeta) */
.article-lead {
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
  color: black;
  margin-bottom: 25px;
}

/* GENERATED CONTEXT (blue text) */
.article-context {
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
  /* color: #009DFF; */
  color: black;
}

/* HOME BUTTON (bottom right) */
.home-button {
  position: fixed;
  bottom: 40px;
  right: 40px;
  background: transparent;
  border: 1px solid white;
  border-radius: 43px;
  padding: 12px 30px;
  color: white;
  font-size: 20px;
  font-weight: 400;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 10;
}

.home-button:hover {
  background: white;
  color: black;
}

/* ===== POPUP MODALE ===== */
.popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.popup {
  background: white;
  color: black;
  border-radius: 17px;
  padding: 40px;
  width: 80%;
  max-width: 750px;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.3);
  animation: fadeIn 0.3s ease;
  display: flex;
  flex-direction: column;
}

.close-btn {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: #eee;
  font-size: 18px;
  font-weight: bold;
  color: #333;
  cursor: pointer;
  transition: background 0.2s ease;
}

.close-btn:hover {
  background: #ddd;
}


 .popup-content {
  max-height: 60vh;
  overflow-y: auto;
  padding-right: 10px;
  scrollbar-width: none;   
  font-size: 20px;
  font-family: 'Inter', sans-serif;
  font-weight: 400;
  line-height: 1.5;
}

.popup-content::-webkit-scrollbar {
  width: 6px;
}

.popup-content::-webkit-scrollbar-track {
  background: #eee;
  border-radius: 10px;
}

.popup-content::-webkit-scrollbar-thumb {
  background: #999;
  border-radius: 10px;
}

.popup-content::-webkit-scrollbar-thumb:hover {
  background: #666;
}


.popup-content p {
  font-size: 20px;
  font-family: 'Inter', sans-serif;
  font-weight: 400;
  line-height: 19px;
  margin-bottom: 20px;
}

/* Animazione apertura */
@keyframes fadeIn {
  from { 
    opacity: 0; 
    transform: scale(0.9); 
  }
  to { 
    opacity: 1; 
    transform: scale(1); 
  }
}

/* RESPONSIVE */
@media (max-width: 1400px) {
  .write-container {
    gap: 40px;
    padding: 0 40px;
  }
  
  .write-intro {
    flex: 0 0 350px;
  }
  
  .write-form {
    max-width: 700px;
  }
}

@media (max-width: 1024px) {
  .write-section {
    padding: 60px 30px;
  }
  
  .write-container {
    flex-direction: column;
    gap: 30px;
    overflow-y: auto;
    justify-content: flex-start;
    padding-top: 80px;
  }
  
  .write-intro {
    flex: 1;
  }
  
  .write-intro h2,
  .write-intro p {
    font-size: 24px;
  }
  
  #titular {
    height: 150px;
  }
  
  #entradeta {
    height: 300px;
  }

  .result-section {
    padding: 20px;
  }

  .result-container {
    flex-direction: column;
    height: auto;
    max-height: none;
  }

  .pdf-button {
    width: 100%;
    min-width: auto;
    height: 50px;
    border-radius: 17px 17px 0 0;
  }

  .pdf-button-text {
    writing-mode: horizontal-tb;
    transform: none;
  }

  .result-content {
    border-radius: 0 0 17px 17px;
    padding: 30px 25px;
    max-height: calc(90vh - 50px);
  }

  .home-button {
    bottom: 20px;
    right: 20px;
    font-size: 16px;
    padding: 10px 25px;
  }
}

@media (max-width: 768px) {
  .subtitle {
    font-size: 24px;
    top: 400px;
  }
  
  .buttons {
    flex-direction: column;
    gap: 1rem;
    top: 550px;
  }
  
  .generate-btn {
    font-size: 24px;
  }

  .article-title {
    font-size: 20px;
  }

  .progress-bar-container {
    width: 90%;
    max-width: 400px;
  }
}


/* vull legir section  */
/* ===== READ SECTION ===== */

/* vull legir section  */
/* ===== READ SECTION ===== */
.read-section {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background-color: black;
  color: black;
  display: flex;
  flex-direction: column;
   padding: 0 40px 120px 40px;
  z-index: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
  overflow-y: auto;
}

.read-container {
  flex: 1;                    
  align-content: center;      
}


.read-section.active {
  z-index: 2;
  opacity: 1;
  pointer-events: all;
}

/* Titolo XAMMAR */
.read-header-title1 {
  text-align: center;
  font-size: 24px;
  font-weight: 900;
  color: black;
  margin-top: 20px;
}
.read-header-title {
  text-align: center;
  font-size: 24px;
  font-weight: 900;
  color: white;
  margin-top: 20px;
}



.read-section .back-btn {
  position: fixed;  /* ✅ CAMBIA da absolute a fixed */
  top: 20px;
  left: 40px;
  width: 80px;
  height: 51px;
  border-radius: 43px;
  border: 1px solid white;
  color: white;
  background: transparent;
  z-index: 10;
}

.read-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
  max-width: 1400px;
  margin: 0 auto;
  padding: 40px 60px 120px 60px;
}

.read-card {
  width: 100%;
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 17px;
  padding: 0;
  cursor: pointer;
  transition: 0.3s ease;
  overflow: hidden;
}

.read-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

.read-card-category {
  background: black;
  color: white;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 6px 12px;
  letter-spacing: 0.8px;
}

.read-img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
}

.read-title {
  font-size: 15px;
  font-weight: 700;
  padding: 15px;
  color: black;
  line-height: 1.4;
  margin: 0;
  background: white;
}

@media (max-width: 1024px) {
  .read-container {
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
  }
}

@media (max-width: 768px) {
  .read-section {
    padding: 100px 30px 80px;
  }
  
  .read-container {
    grid-template-columns: 1fr;
    gap: 25px;
  }
  
  .read-section .back-btn {
    bottom: 20px;
    left: 20px;
  }
}

/* POPUP ARTICLE */
.popup-article {
  max-width: 650px;
}

.choose-btn {
  margin-top: 20px;
  padding: 15px 20px;
  background: #FF0080;
  border: none;
  border-radius: 12px;
  color: white;
  font-size: 18px;
  cursor: pointer;
  width: 100%;
  position: sticky;
  bottom: 0;
}

.choose-btn:hover {
  background: #E6006F;
}

/* ===== TIME SECTION ===== */

.time-section {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
  overflow: hidden;
}

/* Attiva quando visibile */
.time-section.active {
  z-index: 5;
  opacity: 1;
  pointer-events: all;
}

/* Sfondo blur con immagine hero */
.time-blur-bg {
  position: absolute;
  width: 100%;
  height: 100%;
  background: url("assets/image.png") center/cover;
  filter: blur(25px) brightness(0.5);
  transform: scale(1.2);
}

/* Contenuto */
.time-content {
  position: relative;
  z-index: 10;
  text-align: center;
  color: white;
}

.time-title {
  font-size: 32px;
  font-weight: 900;
  margin-bottom: 60px;
  line-height: 1.2;
}

/* Bottoni tempo */
.time-buttons {
  display: flex;
  gap: 40px;
  justify-content: center;
}

.time-btn {
  width: 230px;
  height: 87px;
  border-radius: 43px;
  border: 1px solid white;
  background: transparent;
  color: white;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
  transition: 0.3s ease;
}

.time-btn:hover {
  background: white;
  color: black;
}

/* Freccia indietro stile mockup */
.time-back-btn {
  position: absolute;
  bottom: 40px;
  left: 40px;
  width: 80px;
  height: 51px;
  border-radius: 43px;
  border: 1px solid white;
  background: transparent;
  z-index: 10;
}

.time-back-btn:hover {
  background: white;
  color: black;
}


/* ===== EXPERTISE SECTION ===== */
.expertise-section {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
}

.expertise-section.active {
  z-index: 6;
  opacity: 1;
  pointer-events: all;
}
/* Bottoni expertise */

.expertise-btn {
  width: 230px;
  height: 87px;
  border-radius: 43px;
  border: 1px solid white;
  background: transparent;
  color: white;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
  transition: 0.3s ease;
}

.expertise-btn:hover {
  background: white;
  color: black;
}

.popup-content h4 {
  font-size: 16px;
  font-weight: 600;
  margin: 10px 0 20px;
  color: #555;
}


/* ===== READ RESULT SECTION ===== */
.read-result-section {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background-color: #F5F5F5;
  z-index: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
  overflow-y: auto;
}

.read-result-section .back-btn {
  position: fixed;  
  top: 20px;
  left: 40px;
  width: 80px;
  height: 51px;
  border-radius: 43px;
  border: 1px solid black;
  color: black;
  background: transparent;
  z-index: 10;
}

.read-result-section .back-btn:hover {
  background-color: black;
  color: white;
}

.read-result-section.active {
  z-index: 7;
  opacity: 1;
  pointer-events: all;
}

.read-result-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px 40px 60px;
  min-height: 100vh;
  overflow-y: hidden;
  display: flex;
  flex-direction: column;
}

.read-result-header {
  position: relative;
}

.read-result-category {
  color: white;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  position: absolute;
  top: 20px;
  left: 20px;
  z-index: 2;
}

.read-result-title {
  color: white;
  font-size: 42px;
  font-weight: 900;
  line-height: 1.1;
  position: absolute;
  bottom: 30px;
  left: 20px;
  right: 20px;
  z-index: 2;
  text-shadow: 0px 2px 10px rgba(0, 0, 0, 0.5);
}

.read-result-image {
  width: 100%;
  height: 400px;
  object-fit: cover;
  border-radius: 17px 17px 0 0;
  display: block;
}


.read-result-content {
  background: white;
  border-radius: 0 0 17px 17px;
  padding: 40px 90px 40px 90px;
  color: black;
  font-size: 18px;
  font-weight: 400;
  line-height: 1.6;
  min-height: 200px;
  overflow-y: auto;
  margin-bottom: 30px;
  scrollbar-width: none;   
  margin-left: auto;
  margin-right: auto;
}

.read-result-content::-webkit-scrollbar {
  width: 8px;
}

.read-result-content::-webkit-scrollbar-track {
  background: #e0e0e0;
  border-radius: 10px;
}

.read-result-content::-webkit-scrollbar-thumb {
  background: #999;
  border-radius: 10px;
}

.read-result-content::-webkit-scrollbar-thumb:hover {
  background: #666;
}

.read-result-content p {
  margin-bottom: 20px;
}

.redefine-btn {
  background: transparent;
  border: 1px solid black;
  border-radius: 43px;
  padding: 12px 30px;
  color: black;
  font-size: 16px;
  font-weight: 400;
  cursor: pointer;
  transition: all 0.3s ease;
  float: right;
}

.redefine-btn:hover {
  background: black;
  color: white;
}

@media (max-width: 768px) {
  .read-result-title {
    font-size: 28px;
    bottom: 20px;
  }
  
  .read-result-image {
    height: 300px;
  }
  
  .read-result-content {
    padding: 25px;
    font-size: 16px;
  }
}


/* ===== LOGIN OVERLAY ===== */
.login-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: rgba(0, 0, 0, 0.95);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.login-popup {
  background: white;
  border-radius: 17px;
  padding: 50px;
  width: 90%;
  max-width: 400px;
  text-align: center;
}

.login-popup h2 {
  color: black;
  font-size: 32px;
  font-weight: 900;
  margin-bottom: 30px;
}

.login-popup input {
  width: 100%;
  padding: 15px;
  margin-bottom: 15px;
  border: 1px solid #ddd;
  border-radius: 10px;
  font-size: 16px;
  font-family: 'Inter', sans-serif;
}

.login-popup input:focus {
  outline: 2px solid #FF0080;
  border-color: #FF0080;
}

.login-btn {
  width: 100%;
  background: #FF0080;
  color: white;
  border: none;
  border-radius: 10px;
  padding: 15px;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  transition: 0.3s ease;
  margin-top: 10px;
}

.login-btn:hover {
  background: #E6006F;
}

.login-error {
  color: #FF0080;
  font-size: 14px;
  margin-top: 15px;
  min-height: 20px;
}