/*
 * Archivo de estilos para el plugin WCFM Movimientos Manager
 */

/* Separar los contenedores del formulario y la tabla */
.wcfm-container .wcfm_product_manager_content {
  background-color: #ffffff;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  margin-bottom: 30px;
}

/* Estilo para el encabezado del formulario y la tabla */
#wcfm_product_manager_form_re_media_head {
  display: flex;
  align-items: center;
  margin-bottom: 20px;
  text-align: center;
  justify-content: center;
}

/* Centra los títulos del formulario y la tabla */
.wcfm_product_manager_content h2 {
    text-align: center;
}

/* Tamaño de los íconos */
#wcfm_product_manager_form_re_media_head .wcfm-page-head-icon {
  font-size: 24px;
  color: #0073aa;
  margin-right: 10px;
}

/* Espacio entre los elementos del formulario */
.wcfm-container .wcfm_ele {
  margin-bottom: 15px;
  max-width: 850px;
  margin-left: auto;
  margin-right: auto;
}

/* Estilo para los selectores de filtro y los botones de acción */
.wcfm-content form {
    display: flex-width;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
    
    width: 100% !important; 
    max-width: 700px !important;
}

/* Agrupamos los elementos de filtro y los botones para que se mantengan en una sola línea */
.wcfm-content form .filter-group,
.wcfm-content form .button-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Ajusta el tamaño de los selectores y campos de filtro */
.wcfm-content form select, 
.wcfm-content form input[type="number"] {
    max-width: 120px;
    padding: 8px;
    font-size: 14px;
}

/* Ajusta el tamaño de los botones */
.wcfm-content form input[type="submit"],
.wcfm-content form button {
    padding: 10px 15px;
    font-size: 14px;
}

.wcfm-content form label {
  margin: 0;
}

/* Contenedor responsivo para la tabla */
.responsive-table-container {
    overflow-x: auto;
}

/* Botones de acción en la tabla */
.wcfm_table_simple .wcfm_icon_button {
  color: #555;
  font-size: 16px;
  margin: 0 5px;
  text-decoration: none;
  transition: color 0.2s;
}

.wcfm_table_simple .wcfm_icon_button:hover {
  color: #0073aa;
}

/* Estilos para la tabla de movimientos */
.wcfm_table_simple tbody tr.gasto {
  color: #d63638; /* Color rojo para gastos */
}

.wcfm_table_simple tbody tr.entrada {
  color: #28a745; /* Color verde para entradas */
}

/* Estilo para la fila del total neto */
.wcfm_table_simple tfoot .total-neto {
  font-weight: bold;
  background-color: #f2f2f2;
}

/* --- Estilos para la tabla responsive (móviles) --- */
@media screen and (max-width: 768px) {
  /* Hace que los elementos de filtro y botones se apilen en móviles */
  .wcfm-content form,
  .wcfm-content form .filter-group,
  .wcfm-content form .button-group {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  /* Los selectores, campos y botones ocupan todo el ancho en móviles */
  .wcfm-content form select, 
  .wcfm-content form input[type="number"],
  .wcfm-content form input[type="submit"],
  .wcfm-content form button,
  .wcfm-content form label {
      width: 100%;
      box-sizing: border-box;
  }

  /* Reduce el espacio entre el título y el filtro en móviles */
  .wcfm-content form {
      margin-top: 5px;
  }
}

/* Contenedor del popup */
.wcfm-movimientos-popup-container {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgb(0,0,0);
    background-color: rgba(0,0,0,0.4);
    padding-top: 60px;
}

/* Contenido del popup */
.wcfm-movimientos-popup-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 90%;
    max-width: 600px;
    border-radius: 8px;
    position: relative;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* Botón de cerrar */
.wcfm-movimientos-popup-close {
    color: #aaa;
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.wcfm-movimientos-popup-close:hover,
.wcfm-movimientos-popup-close:focus {
    color: black;
    text-decoration: none;
}

/* Estilos de las estadísticas */
.wcfm-stats-container {
    padding: 20px;
}

.wcfm-stats-filter {
    text-align: right;
    margin-bottom: 20px;
}

.wcfm-stats-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
    margin-bottom: 20px;
}

.wcfm-chart-box {
    flex: 1 1 45%;
    background: #fff;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.wcfm-stats-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
}

.wcfm-summary-box {
    flex: 1 1 25%;
    text-align: center;
    padding: 15px;
    border-radius: 8px;
    color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.wcfm-summary-box.entrada {
    background-color: #28a745; /* Verde para ingresos */
}

.wcfm-summary-box.gasto {
    background-color: #dc3545; /* Rojo para gastos */
}

.wcfm-summary-box.neto {
    background-color: #007bff; /* Azul para el neto */
}

@media (max-width: 768px) {
    .wcfm-chart-box, .wcfm-summary-box {
        flex: 1 1 100%;
    }
}

/* Estilos de la tabla */
#movimientos-table tbody .gasto {
    background-color: #f8d7da; /* Rojo claro para gastos */
}

#movimientos-table tbody .entrada {
    background-color: #d4edda; /* Verde claro para entradas */
}

#movimientos-table tfoot .total-neto {
    font-weight: bold;
}