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

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Inter', sans-serif;
  -webkit-user-select: none; /* Chrome, Safari, Opera */
  -moz-user-select: none; /* Firefox */
  -ms-user-select: none; /* IE/Edge */
  user-select: none;
}

/* Permitir selección en inputs y textareas */
input, textarea {
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
}

html, body {
  background-color: #f4f4f4;
}

/* Login */
.login-container {
  background: #fff;
  padding: 25px;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  width: 90%;
  max-width: 400px;
  margin: 50px auto;
}

.login-container h2 {
  color: #2c3e50;
  margin-bottom: 20px;
  font-size: 1.8em;
  text-align: center;
}

#loginForm {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

#loginForm label {
  color: #4a5568;
  font-weight: 500;
}

#loginForm input {
  padding: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 16px;
  transition: border-color 0.3s ease;
}

#loginForm input:focus {
  border-color: #007bff;
  outline: none;
}

#loginResult {
  text-align: center;
  margin-top: 15px;
  font-size: 0.9em;
  color: #e53e3e;
}

#dashboardIframe {
  margin:0;
  padding:0;
  width: 100%;
  border: none;
  overflow: hidden;
}

/* Dashboard */
.dashboard-container {
  background: #fff;
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  width: 90%;
  max-width: 1200px;
  margin: 30px auto;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 20px;
  margin-bottom: 20px;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 15px;
}

/* Seccions */
.dashboard-section {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  margin-bottom: 15px;
  overflow: hidden;
}
.generate-btn{
  width: 100%;
  margin-bottom: 15px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px;
  background: #f8f9fa;
  transition: background 0.3s ease;
}

.section-header:hover {
  background: #f1f5f9;
}

.section-header h3 {
  color: #2c3e50;
  font-size: 1.1em;
  margin: 0;
}

.section-header span {
  transition: transform 0.3s ease;
}

.section-content {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  padding: 0 20px;
  transition: all 0.3s ease;
}
.section-content ul{
  list-style-type: none;
}

.section-active .section-content {
  max-height: 1000px;
  opacity: 1;
  padding: 20px;
}

.section-active .section-header span {
  transform: rotate(90deg);
}

/* Drag & Drop */
.drop-zone {
  border: 2px dashed #007bff;
  border-radius: 8px;
  padding: 30px;
  text-align: center;
  color: #666;
  cursor: pointer;
  transition: all 0.3s ease;
  min-height: 150px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  margin: 15px 0;
}

.dragover {
  background: #e3f2ff !important;
  border-color: #0056b3 !important;
}

.file-info {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 15px;
}

#fileName {
  color: #2c3e50;
  font-weight: 500;
  word-break: break-all;
}

/* Botons */
button {
  background: #007bff;
  color: white;
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: filter 0.3s ease;
}

button:hover {
  filter: brightness(0.9);
}

/* Ocultem els checkbox visuals */
.checkbox-list input[type="checkbox"] {
  display: none;
}

.checkbox-list label {
  cursor: pointer;
  font-size: 16px;
  color: black;
  font-weight: normal;
  transition: color 0.2s ease, font-weight 0.2s ease;
  display: inline;
  margin-right: 5px;
}

/* Quan el checkbox està marcat, canviar estil */
.checkbox-list input[type="checkbox"]:checked + label {
  font-weight: bold;
  color: blue;
}

/* Evitar coma després de l'últim element */
.checkbox-list label:last-of-type::after {
  content: "";
}
/* Transición suave para cambios de estado */
.checkbox-list label {
    transition: all 0.3s ease;
}

/* Estilo para checkboxes deshabilitados */
.checkbox-list input[type="checkbox"]:disabled + label {
    opacity: 0.5;
    cursor: not-allowed;
}


.change-file-btn {
  background: #6c757d;
  font-size: 0.9em;
}

.download-btn {
  background: #28a745;
  width: 100%;
  margin-top: 15px;
}

/* Configuració */
.config-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 400px;
  overflow-y: auto;
  padding-right: 10px;
}

.config-group label {
  background: #fff;
  border-radius: 6px;
  transition: background 0.3s ease;
}

.config-group label:hover {
  background: #f8f9fa;
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.5); /* Blanc semi-transparent */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999; /* Per assegurar que està per damunt de tot */
}
.spinner {
  border: 4px solid #f3f3f3;
  border-top: 4px solid #3498db;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  animation: spin 1s linear infinite;
}


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

.generate-btn {
  padding: 12px 20px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: filter 0.3s ease;
  font-size: 1em;
  text-align: center;
}


@media (max-width: 768px) {
  .dashboard-header {
    flex-direction: column;
    gap: 15px;
  }
  
  .user-info {
    flex-direction: column;
  }
  
  .section-header {
    padding: 15px;
  }
}