body {
  font-family: Arial, sans-serif;
  background: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)),
              url('imagenes/12_logo.png') center/cover no-repeat fixed;
  color: white;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  margin: 0;
  padding: 20px;
  box-sizing: border-box;
}

iframe {
  width: 100%;
  height: 100vh;
  border: none;
}

.main-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  width: 90%;
  max-width: 400px;
  margin-bottom: 20px;
}

.inline-form {
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: rgba(0, 0, 0, 0.4);
  padding: 10px;
  border-radius: 8px;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(5px);
  width: 100%;
}

form:not(.inline-form) {
  background-color: rgba(0, 0, 0, 0.4);
  padding: 15px;
  border-radius: 8px;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
  color: white;
  backdrop-filter: blur(5px);
  display: flex;
  flex-direction: column;
  align-items: center;
}

#eventDatesForm {
  width: 90%;
  max-width: 400px;
}

#eventDaysForm {
  width: 100%; /* Asegura que el formulario ocupe todo el ancho disponible */
  max-width: none; /* Elimina la restricción de ancho máximo */
  max-height: 70vh;
  overflow-y: auto;
  overflow-x: hidden;
  box-sizing: border-box;
}

.custom-icon {
  width: 25px;
  height: 25px;
  flex-shrink: 0;
}

input[type="text"],
input[type="date"] {
  padding: 8px;
  margin: 8px 0;
  border: 1px solid #555;
  border-radius: 4px;
  background-color: rgba(0, 0, 0, 0.4);
  color: white;
  box-sizing: border-box;
}

#groupName,
#eventName,
#editCodeInput {
  width: 18ch;
}

.day-name-input {
  width: 12ch;
}

#eventDatesForm label {
  display: block;
  margin-bottom: 4px;
  font-size: 0.8em;
  color: #888;
}

button {
  padding: 8px;
  margin: 8px 0;
  border: none;
  border-radius: 4px;
  background-color: rgba(40, 167, 69, 0.6);
  color: white;
  font-weight: bold;
  cursor: pointer;
  min-width: 80px;
}

button:hover {
  background-color: rgba(33, 136, 56, 0.6);
}

.cancel-button {
  width: 25px;
  height: 25px;
  border-radius: 4px;
  background-color: rgba(220, 53, 69, 0.6);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  margin: 0 8px;
}

.cancel-button:hover {
  background-color: rgba(180, 35, 55, 0.6);
}

.button-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.message {
  margin-top: 8px;
  padding: 10px;
  border-radius: 4px;
  text-align: center;
  width: 90%;
  max-width: 280px;
  display: none;
  background-color: rgba(0, 0, 0, 0.4);
  border: 1px solid #555;
  backdrop-filter: blur(5px);
}

.success-message {
  border-color: #28a745;
}

.error-message {
  border-color: #dc3545;
}

.green-text {
  color: #28a745;
}

.icon-selector {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
  gap: 4px;
  margin: 4px 0;
  background-color: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(5px);
  border: 1px solid #555;
  border-radius: 4px;
  padding: 8px;
}

.icon-option:hover {
  background: #3a3a3a;
}

.icon-option.selected {
  background: #28a745;
  border-color: #28a745;
}

.selected-icon {
  display: none;
}

#iconPanel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.4);
  padding: 10px;
  border: 1px solid #555;
  border-radius: 8px;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
  display: none;
  z-index: 1000;
  width: 90%;
  max-width: 400px;
  backdrop-filter: blur(5px);
}

#iconPanel button#closeIconPanel {
  background-color: rgba(220, 53, 69, 0.6);
}

#iconPanel button#closeIconPanel:hover {
  background-color: rgba(180, 35, 55, 0.6);
}

#iconsContainer {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
  gap: 4px;
  padding: 4px;
}

.icon-option {
  margin: 0;
  padding: 4px;
  cursor: pointer;
  font-size: clamp(0.6em, 2vw, 0.75em);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid #555;
  border-radius: 4px;
  color: white;
  box-sizing: border-box;
}

.icon-option:hover {
  background: #3a3a3a;
}

.icon-option.selected {
  background: #28a745;
  border-color: #28a745;
}

.selected-icon-preview {
  font-size: 1em;
  cursor: pointer;
  border: 2px dashed #ccc;
  padding: 2px;
  margin: 4px 0;
  min-height: 20px;
}

.day-container {
  width: 100%; /* Cada día ocupa el ancho completo */
  margin-bottom: 8px;
  padding: 8px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 4px;
  border: 1px solid #555;
  backdrop-filter: blur(5px);
  box-sizing: border-box;
}

.day-active {
  border: 2px solid #28a745;
  padding: 6px;
  transform: scale(1.02);
}

#daysContainer {
  width: 100%; /* Ocupa todo el ancho del formulario */
  max-height: calc(70vh - 150px);
  overflow-y: auto;
  overflow-x: hidden;
  border: 1px solid #555;
  padding: 8px;
  margin-bottom: 8px;
  background-color: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(5px);
  box-sizing: border-box;
}

.day-container label {
  display: block;
  margin-bottom: 4px;
  font-size: 0.8em;
  color: #888;
}

.day-name-input,
.day-container textarea {
  width: 100%;
  margin: 4px 0;
  padding: 8px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid #555;
  color: white;
  font-size: 12px;
  border-radius: 4px;
  box-sizing: border-box;
}

.visibility-options {
  margin: 8px 0;
  padding: 8px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 4px;
  border: 1px solid #555;
  backdrop-filter: blur(5px);
  flex-shrink: 0;
  width: 100%;
  box-sizing: border-box;
}

.visibility-options label {
  display: flex;
  align-items: center;
  margin: 4px 0;
  font-size: 12px;
  color: #ccc;
}

.visibility-options input[type="radio"] {
  margin-right: 6px;
  accent-color: #28a745;
}

.slot-edit-container {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
}

.hours-form, .topics-form {
  flex: 1;
}

.hours-form label, .topics-form label {
  display: block;
  font-size: 0.9em;
  margin-bottom: 5px;
  color: white;
}

.time-input, .topic-input {
  width: 100%;
  padding: 5px;
  background: #2a2a2a;
  color: white;
  border: 1px solid #444;
  border-radius: 3px;
  font-size: 0.9em;
}

.add-slot-button {
  padding: 5px 10px;
  background: #28a745;
  color: white;
  border: none;
  border-radius: 3px;
  cursor: pointer;
}

.add-slot-button:hover {
  background: #218838;
}

.slots-textarea {
  width: 100%; /* Asegura que el textarea ocupe el ancho completo */
  min-height: 50px;
  height: auto; /* Altura automática para ajustarse al contenido */
  margin-top: 10px;
  padding: 5px;
  background: #2a2a2a;
  color: white;
  border: 1px solid #444;
  border-radius: 3px;
  resize: none; /* Desactiva el redimensionamiento manual */
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.9em;
  box-sizing: border-box;
}

.visibility-options {
  margin-top: 20px;
  display: grid;
  gap: 15px;
}

.visibility-table {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 10px;
  align-items: center;
  background: #2a2a2a;
  padding: 10px;
  border-radius: 5px;
}

.visibility-table label {
  margin: 0;
  color: white;
}

.logo-section {
  margin-top: 30px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.file-input-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
}

.add-slot-button {
  padding: 3px 8px;
  font-size: 12px;
}

.topic-input {
  min-width: 200px;
  max-width: 500px;
  width: auto;
  transition: width 0.2s ease;
  font-size: 14px;
  padding: 5px;
}

.topics-form {
  display: inline-block;
}

.slots-container {
  display: flex;
  flex-direction: column; /* Cambia a columna para que los botones estén debajo */
  align-items: flex-start;
  gap: 10px;
  width: 100%; /* Asegura que el contenedor ocupe todo el ancho */
}

.slots-container .textarea-wrapper {
  width: 100%; /* El área de texto ocupa todo el ancho */
}

.slots-container .buttons-wrapper {
  display: flex;
  flex-direction: row; /* Los botones en una fila horizontal */
  gap: 10px;
  width: 100%; /* Ocupa todo el ancho para alinear los botones */
  justify-content: flex-start; /* Alinea los botones a la izquierda */
}

.delete-slots-button {
  padding: 5px 10px;
  font-size: 14px;
  cursor: pointer;
  background: rgba(220, 53, 69, 0.6);
  color: white;
  border: none;
  border-radius: 3px;
}

.delete-slots-button:hover {
  background: rgba(180, 35, 55, 0.6);
}