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;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow-x: hidden;
}

#mainContainer {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 2fr); /* Igualamos las columnas para dar más espacio a la izquierda */
  width: 100%;
  padding: 10px;
  padding-left: 30px;
  box-sizing: border-box;
  gap: 40px;
  min-height: calc(100vh - 20px);
  align-items: start;
}

#rightColumn {
  display: flex;
  flex-direction: column;
  width: 100%;
  gap: 10px;
  min-height: 200px;
}

.form-container {
  display: flex;
  flex-direction: column;
  padding: 15px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
  backdrop-filter: blur(5px);
  margin: auto 0;
  width: 100%; /* Usamos todo el ancho disponible */
  max-width: none; /* Eliminamos la restricción de max-width */
}

form {
  background-color: rgba(0, 0, 0, 0.4);
  padding: 15px;
  border-radius: 6px;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(5px);
  margin-bottom: 8px;
  width: 100%; /* Aseguramos que el formulario ocupe todo el ancho del contenedor */
}

input[type="text"], button {
  width: 100%;
  padding: 10px;
  margin: 6px 0;
  border-radius: 4px;
  border: 1px solid #555;
  box-sizing: border-box;
  font-size: 16px;
  background-color: rgba(0, 0, 0, 0.4);
  color: white;
}

button {
  background-color: rgba(40, 167, 69, 0.6);
  cursor: pointer;
  font-weight: bold;
  border: none;
  transition: background-color 0.3s;
}

button:hover {
  background-color: rgba(33, 136, 56, 0.6);
}

button.search-btn {
  background-color: rgba(40, 167, 69, 0.6);
  cursor: pointer;
  font-weight: bold;
  border: none;
  transition: background-color 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
}

button.search-btn:hover {
  background-color: rgba(33, 136, 56, 0.6);
}

button.delete-btn {
  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;
  margin: 0;
}

#importGoogleButton {
  padding: 8px;
  margin: 4px 0;
  border-radius: 4px;
  background-color: rgba(66, 133, 244, 0.6);
  border: none;
  cursor: pointer;
  font-weight: bold;
  transition: background-color 0.3s;
}

#importGoogleButton:hover {
  background-color: rgba(53, 122, 189, 0.6);
}

#groupsContainer {
  display: flex !important;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0;
  max-height: calc(100vh - 40px);
  width: 100%;
  min-height: 100px;
}

.group-card {
  background: rgba(69, 62, 62, 0.6);
  padding: 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.3s, box-shadow 0.3s;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 85%;
  min-height: 70px;
  position: relative;
  backdrop-filter: blur(3px);
  overflow-x: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.group-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

.group-card.event-group {
  background: linear-gradient(135deg, rgba(255, 165, 0, 0.6), rgba(255, 87, 34, 0.6));
  border: 1px solid rgba(255, 165, 0, 0.8);
}

.group-card.personal-group {
  background: linear-gradient(135deg, rgba(0, 191, 255, 0.4), rgba(0, 123, 255, 0.4));
  border: 1px solid rgba(0, 191, 255, 0.6);
}

.group-header strong {
  font-size: 1.1em;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.group-header small {
  color: #d3d3d3;
  font-size: 0.85em;
}

.group-details {
  display: none;
}

.group-details small {
  color: #e0e0e0;
  font-size: 0.9em;
}

.member-list {
  max-height: 80px;
  overflow-y: auto;
  overflow-x: hidden;
  margin: 4px 0;
  padding-left: 10px;
  color: #d3d3d3;
}

.editor-code {
  color: #28a745;
  font-weight: bold;
  margin-top: 4px;
  padding: 4px 6px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 4px;
  border-left: 3px solid #28a745;
}

.group-actions button.delete-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background-color: rgba(220, 53, 69, 0.8);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.3s;
}

.group-actions button.delete-btn:hover {
  background-color: rgba(200, 35, 51, 0.9);
}

.group-card.personal-group small:first-child {
  display: none;
}

.personal-details {
  font-size: 0.8em;
  color: #e0f7fa;
}

#searchResults {
  display: none;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 10px;
  background-color: rgba(0, 0, 0, 0.4);
  border-radius: 6px;
  backdrop-filter: blur(5px);
  width: 100%;
  max-height: calc(100vh - 40px);
}

.search-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.close-button {
  background: none;
  border: none;
  color: white;
  font-size: 20px;
  cursor: pointer;
}

.event-result {
  background-color: rgba(69, 62, 62, 0.6);
  padding: 8px;
  border-radius: 6px;
  margin-bottom: 6px;
  backdrop-filter: blur(3px);
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.9em;
  max-width: 100%;
  box-sizing: border-box;
  transition: transform 0.2s;
}

.event-result:hover {
  transform: scale(1.01);
}

.event-result h4 {
  margin: 0;
  font-size: 1.1em;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.event-result small {
  color: #d3d3d3;
  font-size: 0.8em;
  line-height: 1.2;
}

.event-rating {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}

.rating-count {
  font-size: 0.8em;
  color: #ffffff;
}

.like-count {
  color: #28a745;
}

.dislike-count {
  color: #dc3545;
}

.join-event-button {
  background-color: rgba(40, 167, 69, 0.6);
  border: none;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9em;
  transition: background-color 0.3s;
  align-self: flex-start;
}

.join-event-button:hover {
  background-color: rgba(33, 136, 56, 0.6);
}

.group-actions {
  position: absolute;
  top: 8px;
  right: 8px;
}

#groupModal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  animation: fadeIn 0.3s ease-in-out;
}

.modal-content {
  background: linear-gradient(135deg, rgba(69, 62, 62, 0.95), rgba(40, 40, 40, 0.95));
  padding: 20px;
  border-radius: 12px;
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
  color: #fff;
  backdrop-filter: blur(8px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: transform 0.3s ease;
}

.modal-content:hover {
  transform: scale(1.02);
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(220, 53, 69, 0.8);
  border: none;
  color: white;
  font-size: 24px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.3s;
}

.modal-close:hover {
  background: rgba(200, 35, 51, 0.9);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (max-width: 768px) {
  #mainContainer {
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); /* Volvemos a 1fr 2fr para móviles */
    padding: 5px;
    padding-left: 20px;
    gap: 30px;
  }

  .form-container {
    padding: 10px;
    width: 100%;
    max-width: none; /* Sin límite en móviles para usar todo el ancho */
  }

  form {
    padding: 10px;
  }

  input[type="text"], button {
    padding: 8px;
    margin: 4px 0;
    font-size: 14px;
  }

  #groupsContainer {
    gap: 5px;
    max-height: calc(100vh - 30px);
  }

  .group-card {
    padding: 6px;
    min-height: 50px;
    font-size: 0.9em;
    width: 90%;
  }

  .event-result {
    padding: 6px;
    font-size: 0.85em;
  }

  .event-result h4 {
    font-size: 1em;
  }

  .join-event-button {
    padding: 3px 6px;
    font-size: 0.85em;
  }

  .modal-content {
    width: 95%;
    max-width: 400px;
    padding: 15px;
  }
}

@media (min-width: 1200px) {
  #mainContainer {
    grid-template-columns: 2fr 2fr; /* Mantenemos columnas iguales en pantallas grandes */
    padding-left: 40px;
    gap: 50px;
  }

  .form-container {
    max-width: none; /* Sin límite para usar todo el ancho disponible */
  }

  .group-card {
    width: 80%;
  }
}