/* ==========================================================================
   Calendario Legal – Obligations Lookup
   ========================================================================== */

/* ---------- 1. Formulario de búsqueda ---------- */

.obligations-form {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 20px;
  margin-bottom: 40px;
  padding-top: 40px;
}

.obligations-form .ol-input,
.obligations-form .ol-select {
  display: block;
  margin: 10px 0;
  padding: 0;
  border: none;
  border-bottom: 1px solid #fff;
  width: 100%;
  max-width: 200px;
  font-family: 'newblack_300', sans-serif;
  font-size: 18px;
  line-height: 1em;
  background-color: transparent;
  color: #fff;
}

.obligations-form .ol-input::placeholder {
  color: #fff;
}

.obligations-form .ol-input:focus,
.obligations-form .ol-select:focus {
  outline: none;
}

.obligations-form .ol-select option {
  background-color: #40708F;
  cursor: pointer;
}

.obligations-form .ol-btn {
  padding: 10px 20px;
  border-radius: 20px;
  border: 1px solid #183043;
  font-size: 18px;
}

/* ---------- 2. Tabla individual (vista por mes) ---------- */

.ol-title,
.ol-matrix-title {
  display: block !important;
  visibility: visible !important;
  margin: .5rem 0 !important;
  padding-top: 30px !important;
  font-size: 24px !important;
  color: #fff !important;
  text-align: center !important;
  font-weight: 700 !important;
  line-height: 1.3 !important;
}

.ol-table-wrap {
  overflow: auto;
  padding-top: 8px;
}

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

.ol-table th,
.ol-table td {
  border: 1px solid rgba(255, 255, 255, .25);
  padding: .5rem;
  text-align: left;
  color: #fff;
  font-size: 16px;
  text-transform: capitalize;
}

.ol-table th {
  text-align: center;
  font-size: 20px;
}

.ol-table thead th {
  background: rgba(255, 255, 255, .08);
}

/* ---------- 3. Nombre + observaciones ---------- */

.ol-name {
  position: relative;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  text-transform: capitalize;
}

.ol-name span {
  flex: 1 1 auto;
  min-width: 0;
}

.ol-obs-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: #fff;
  color: #111;
  font-weight: 700;
  border: 0;
  cursor: pointer;
  padding: 0;
}

/* ---------- 4. Popover de observaciones ---------- */

.ol-obs-popover {
  position: absolute;
  left: 0;
  bottom: 100%;
  transform: translateY(-10px);
  opacity: 0;
  visibility: hidden;
  z-index: 50;
}

.ol-obs-content {
  position: relative;
  max-width: 28rem;
  background: #111;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .25);
  padding: 20px;
  border-radius: .5rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .35);
}

.ol-obs-close {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 14px;
  height: 14px;
  background: transparent;
  border: 0;
  color: #fff;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  display: none;
}

/* ---------- 5. Tabla-matriz (vista "todos los meses") ---------- */

.ol-matrix-wrap {
  width: 100%;
  overflow-x: auto;
  padding-top: 8px;
}

.ol-matrix {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
}

.ol-matrix thead th,
.ol-matrix td {
  border: 1px solid rgba(255, 255, 255, .25);
  padding: .5rem;
  color: #fff;
  text-transform: capitalize;
  font-size: 16px;
}

.ol-matrix thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(255, 255, 255, .08);
  text-align: center;
  font-size: 20px;
  font-weight: 600;
}

.ol-matrix thead th:first-child {
  text-align: left;
}

.ol-matrix td {
  text-align: center;
  vertical-align: middle;
}

.ol-matrix td:first-child {
  text-align: left;
  white-space: nowrap;
}

.ol-matrix td.ol-mx-empty {
  opacity: .45;
}

.ol-matrix td.ol-mx-has {
  font-weight: 600;
}

.ol-matrix .ol-name {
  display: flex;
  gap: 8px;
  align-items: center;
}

.ol-matrix .ol-obs-btn {
  margin-left: 8px;
}

/* ---------- 6. Mensaje vacío ---------- */

.ol-empty {
  text-align: center;
  color: #fff;
  padding: 20px 0;
}

/* ==========================================================================
   Hover (dispositivos con ratón)
   ========================================================================== */

@media (hover: hover) {
  .ol-obs-btn {
    display: none;
  }
  .ol-has-obs:hover .ol-obs-popover {
    opacity: 1;
    visibility: visible;
    transform: translateY(-6px);
  }
}

/* ==========================================================================
   Touch (dispositivos táctiles)
   ========================================================================== */

@media (hover: none) {
  .ol-obs-popover {
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
  }
  .ol-obs-popover.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(-6px);
  }
}

/* ==========================================================================
   Mobile (max-width: 768px)
   ========================================================================== */

@media (max-width: 768px) {

  /* Formulario en columna */
  .obligations-form {
    flex-direction: column;
    gap: 12px;
    width: 100%;
    padding-top: 40px;
    margin-bottom: 40px;
  }

  .obligations-form .ol-input,
  .obligations-form .ol-select {
    max-width: 100%;
  }

  /* Tabla individual: texto más pequeño */
  .ol-table th,
  .ol-table td {
    font-size: 12px;
  }

  .ol-table th {
    font-size: 18px;
  }

  /* Nombre con word-break */
  .ol-name span {
    word-break: break-word;
  }

  /* Botón observaciones más pequeño */
  .ol-obs-btn {
    flex: 0 0 20px;
    min-width: 20px;
    width: 20px;
    height: 20px;
  }

  /* Mostrar botón cerrar en mobile */
  .ol-obs-close {
    display: block;
  }
}
