/* Estilos generales */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
  background-color: #f5f5f5;
  color: #333;
}

/* Login */
#login {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  background-color: #3498db;
}

.login-container {
  background-color: white;
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  width: 400px;
  max-width: 90%;
}

/* Aplicación principal */
header {
  background-color: #3498db;
  color: white;
  padding: 1rem 2rem;
  text-align: center;
}

.container {
  padding: 1rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

/* Tarjetas de estadísticas */
.cards-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  grid-gap: 1rem;
  margin-bottom: 1.5rem;
}

.card {
  background-color: white;
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  text-align: center;
  animation: scaleIn 0.5s ease-out;
  transition: transform 0.3s, box-shadow 0.3s;
}

.card-title {
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: #555;
}

.card-value {
  font-size: 2rem;
  font-weight: 700;
  color: #3498db;
}

/* Tabla de asociados */
.table-container {
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  overflow: auto;
  max-height: calc(100vh - 250px);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid #eee;
}

th {
  font-weight: 600;
  background-color: #f8f9fa;
  position: sticky;
  top: 0;
  z-index: 10;
}
#notification-message {
  padding: 1rem 1.5rem;
  line-height: 1.5;
}
tr:hover {
  background-color: #f9f9f9;
}

/* Modales */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  justify-content: center;
  align-items: center;
  z-index: 1000;
  animation: fadeIn 0.3s ease-out;
}

.modal-content {
  background-color: white;
  border-radius: 8px;
  width: 500px;
  max-width: 90%;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  overflow: hidden; /* Importante para mantener los bordes redondeados */
  max-height: 90vh; /* Limitar altura en pantallas pequeñas */
  display: flex;
  flex-direction: column; /* Organizar el contenido en columnas */
  padding-bottom: 0.5rem;
  animation: slideIn 0.3s ease-out;
}

@keyframes scaleIn {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background-color: #f8f9fa;
  border-bottom: 1px solid #eee;
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes slideIn {
  from { transform: translateY(-20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.modal-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0;
}

.modal-close {
  font-size: 1.5rem;
  background: none;
  border: none;
  cursor: pointer;
  color: #888;
}

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

.modal-close:hover {
  color: #333;
}
.modal-p {
  padding: 1rem 1.5rem;
  line-height: 1.5;
}
/* Mejorar el cuerpo del modal para asegurar que se vea correctamente */
.modal-content form {
  padding: 1rem;
  overflow-y: auto; /* Permitir scroll si el contenido es muy largo */
  flex-grow: 1; /* Permitir que el formulario crezca para ocupar el espacio */
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 1rem;
  background-color: #f8f9fa;
  border-top: 1px solid #eee;
}

/* Botones */
.btn {
  padding: 0.5rem 1rem;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  font-weight: 500;
  transition: background-color 0.2s;
  transition: transform 0.2s, background-color 0.2s;
}

.toast-message {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background-color: #3498db;
  color: white;
  padding: 12px 24px;
  border-radius: 4px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  z-index: 2000;
  animation: slideInRight 0.3s, fadeOut 0.3s 1.7s forwards;
}

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

#asociados-table tbody tr {
  opacity: 0;
  animation: fadeInUp 0.3s ease-out forwards;
}

#asociados-table tbody tr:nth-child(1) { animation-delay: 0.05s; }
#asociados-table tbody tr:nth-child(2) { animation-delay: 0.1s; }
#asociados-table tbody tr:nth-child(3) { animation-delay: 0.15s; }
#asociados-table tbody tr:nth-child(4) { animation-delay: 0.2s; }
#asociados-table tbody tr:nth-child(5) { animation-delay: 0.25s; }
#asociados-table tbody tr:nth-child(6) { animation-delay: 0.3s; }
#asociados-table tbody tr:nth-child(7) { animation-delay: 0.35s; }
#asociados-table tbody tr:nth-child(8) { animation-delay: 0.4s; }
#asociados-table tbody tr:nth-child(9) { animation-delay: 0.45s; }
#asociados-table tbody tr:nth-child(10) { animation-delay: 0.5s; }

#search-input {
  transition: all 0.3s;
  border: 1px solid #ddd;
}

#search-input:focus {
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
  border-color: #3498db;
}

.loading {
  position: relative;
  pointer-events: none;
}

.loading:after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  top: 50%;
  left: 50%;
  margin-top: -8px;
  margin-left: -8px;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: white;
  border-left-color: white;
  animation: spinAround 0.6s infinite linear;
}

@keyframes spinAround {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.payment-checkbox {
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: 2px solid #ddd;
  position: relative;
  transition: all 0.2s;
  cursor: pointer;
  outline: none;
}

.payment-checkbox:checked {
  background-color: #2ecc71;
  border-color: #2ecc71;
}

.payment-checkbox:checked:after {
  content: '✓';
  color: white;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 12px;
}

.payment-checkbox:hover {
  border-color: #aaa;
}

#login .login-container {
  animation: fadeInDown 0.8s;
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-30px); }
  to { opacity: 1; transform: translateY(0); }
}

.card-value {
  animation: countUp 1.5s;
}

@keyframes countUp {
  from { opacity: 0; transform: scale(0.8); }
  to { opacity: 1; transform: scale(1); }
}

.btn:hover {
  transform: translateY(-2px);
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background-color: #3498db;
  color: white;
}

.btn-primary:hover {
  background-color: #2980b9;
}

.btn-success {
  background-color: #2ecc71;
  color: white;
}

.btn-success:hover {
  background-color: #27ae60;
}

.btn-danger {
  background-color: #e74c3c;
  color: white;
}

.btn-danger:hover {
  background-color: #c0392b;
}

.btn-block {
  display: block;
  width: 100%;
}

.btn-icon {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  color: #555;
  font-size: 1rem;
}

.btn-icon:hover {
  color: #333;
}

/* Formularios */
input, textarea {
  width: 100%;
  padding: 0.5rem;
  border-radius: 4px;
  border: 1px solid #ddd;
  font-size: 1rem;
  margin-top: 0.25rem;
}

input:focus, textarea:focus {
  outline: none;
  border-color: #3498db;
}

label {
  font-weight: 500;
  display: block;
  margin-bottom: 0.25rem;
}

.mb-2 {
  margin-bottom: 1rem;
}

.mb-3 {
  margin-bottom: 1.5rem;
}

.mt-3 {
  margin-top: 1.5rem;
}

/* Flexbox utilities */
.d-flex {
  display: flex;
}

.justify-content-between {
  justify-content: space-between;
}

.align-items-center {
  align-items: center;
}

/* Checkbox para "Pagado" en la tabla */
.checkbox-cell {
  text-align: center;
}

.payment-checkbox {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

/* Texto centrado para casos de no datos */
.text-center {
  text-align: center;
}

/* Buscar input estilo mejorado */
#search-input {
  width: 300px;
  max-width: 100%;
  padding: 0.5rem 0.75rem;
  border-radius: 20px;
  border: 1px solid #ddd;
  background-color: white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* Hacer responsive el diseño */
@media (max-width: 768px) {
  .d-flex {
    flex-direction: column;
  }
  
  .align-items-center {
    align-items: stretch;
  }
  
  #search-input {
    width: 100%;
    margin-bottom: 1rem;
  }
  
  .cards-container {
    grid-template-columns: 1fr;
  }
}

/* Agregar estas mejoras visuales a styles.css */

/* Mejora del tema de color */
:root {
  --primary-color: #3498db;
  --primary-dark: #2980b9;
  --success-color: #2ecc71;
  --success-dark: #27ae60;
  --danger-color: #e74c3c;
  --danger-dark: #c0392b;
  --light-color: #f5f5f5;
  --dark-color: #333;
  --gray-color: #555;
  --light-gray: #eee;
  --border-radius: 8px;
  --box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

/* Actualizar colores basados en las variables */
body {
  background-color: var(--light-color);
  color: var(--dark-color);
}

.btn-primary {
  background-color: var(--primary-color);
}

.btn-primary:hover {
  background-color: var(--primary-dark);
}

.btn-success {
  background-color: var(--success-color);
}

.btn-success:hover {
  background-color: var(--success-dark);
}

.btn-danger {
  background-color: var(--danger-color);
}

.btn-danger:hover {
  background-color: var(--danger-dark);
}

/* Mejora visual para la tabla */
.table-container {
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  background-color: white;
  overflow: hidden;
  margin-bottom: 2rem;
}

table {
  border-collapse: separate;
  border-spacing: 0;
}

th {
  background-color: #f8f9fa;
  color: var(--gray-color);
  font-weight: 600;
  padding: 1rem;
  border-bottom: 2px solid var(--light-gray);
}

td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--light-gray);
  transition: background-color 0.2s;
}

tr:last-child td {
  border-bottom: none;
}

tr:hover td {
  background-color: rgba(52, 152, 219, 0.05);
}

/* Mejora visual de las cards */
.card {
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  overflow: hidden;
  border-top: 4px solid var(--primary-color);
  padding: 1.5rem;
}

.card-title {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--gray-color);
}

.card-value {
  color: var(--primary-color);
  font-size: 2.5rem;
  font-weight: 700;
  margin-top: 0.5rem;
}

/* Mejora visual para los botones de acción en la tabla */
.btn-icon {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s;
  margin-right: 0.25rem;
}

.btn-icon:hover {
  background-color: #f1f1f1;
}

.edit-btn:hover {
  color: var(--primary-color);
}

.delete-btn:hover {
  color: var(--danger-color);
}

/* Mejora visual para la pantalla de login */
#login {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  min-height: 100vh;
}

.login-container {
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  padding: 2.5rem;
  max-width: 400px;
}

.login-container h1, .login-container h2 {
  color: var(--dark-color);
  text-align: center;
}

.login-container h1 {
  font-size: 1.8rem;
  margin-bottom: 0.5rem;
}

.login-container h2 {
  font-size: 1.2rem;
  color: var(--gray-color);
  margin-bottom: 2rem;
}

/* Mejorar el diseño de los modales */
.modal-content {
  border-radius: var(--border-radius);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  overflow: hidden;
}

.modal-header {
  padding: 1.25rem 1.5rem;
  background: linear-gradient(to right, var(--primary-color), var(--primary-dark));
  color: white;
  border-bottom: none;
}

.modal-title {
  color: white;
  font-weight: 600;
}

.modal-close {
  color: rgba(255, 255, 255, 0.8);
  font-size: 1.5rem;
  transition: color 0.2s;
}

.modal-close:hover {
  color: white;
}

.modal-footer {
  border-top: 1px solid var(--light-gray);
  padding: 1.25rem 1.5rem;
}

/* Estilo para las notificaciones de tipo toast */
.toast-message {
  border-radius: var(--border-radius);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  padding: 12px 20px;
}

.toast-message.success {
  background-color: var(--success-color);
  color: white;
}

.toast-message.error {
  background-color: var(--danger-color);
  color: white;
}

.toast-message.info {
  background-color: var(--primary-color);
  color: white;
}

/* Mejora visual para los inputs */
input, textarea {
  border-radius: 4px;
  border: 1px solid #ddd;
  padding: 0.75rem;
  font-size: 1rem;
  transition: all 0.2s;
}

input:focus, textarea:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

label {
  font-weight: 600;
  color: var(--gray-color);
  margin-bottom: 0.5rem;
}

/* Estilo mejorado para barra de búsqueda */
#search-input {
  background-color: white;
  border-radius: 50px;
  padding: 0.75rem 1.25rem 0.75rem 2.5rem;
  border: 1px solid #ddd;
  width: 350px;
  max-width: 100%;
  position: relative;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="%23999" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="11" cy="11" r="8"></circle><line x1="21" y1="21" x2="16.65" y2="16.65"></line></svg>');
  background-repeat: no-repeat;
  background-position: 12px center;
  background-size: 16px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

#search-input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

/* Mejoras para responsive design */
@media (max-width: 768px) {
  .container {
    padding: 1rem;
  }
  
  .d-flex {
    flex-direction: column;
  }
  
  #search-input {
    width: 100%;
    margin-bottom: 1rem;
  }
  
  .modal-content {
    width: 95%;
  }
}