/* ============================================
   ESTILS LUNACIONS
   Reutilitza prog-table, prog-table-container,
   prog-planet-symbol, prog-aspect-symbol,
   prog-asp-*, prog-signo-glyph, prog-posicion-cell,
   prog-casa, prog-ingresso-*, prog-orbe-cell,
   prog-controls, prog-result-header, prog-alert,
   prog-loading-overlay, prog-no-data, etc.
   de progressions.css
   ============================================ */

/* Leyenda */
.lun-leyenda {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    padding: 10px 14px;
    background: var(--bg-secondary, #f9fafb);
    border-radius: 8px;
}

.lun-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
}

.lun-tag.new-moon       { background: #1a1a2e; color: #e0e0ff; }
.lun-tag.full-moon      { background: #fff3cd; color: #856404; }
.lun-tag.solar-eclipse  { background: #ffe0b2; color: #e65100; }
.lun-tag.lunar-eclipse  { background: #d1c4e9; color: #4527a0; }

/* Files d'eclipsis */
.lun-eclipse-solar { border-left: 3px solid #ef4444; }
.lun-eclipse-lunar { border-left: 3px solid #7c3aed; }

/* Cel·la de chips d'aspectes/ingressos */
.lun-chips-cell {
    max-width: 420px;
    min-width: 200px;
}

.lun-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    align-items: center;
}

/* Chip individual */
.lun-chip {
    display: inline-flex;
    align-items: center;
    gap: 1px;
    padding: 3px 9px;
    border-radius: 14px;
    background: var(--bg-cream, #f5f0e8);
    white-space: nowrap;
    font-size: 14px;
    line-height: 1;
}

.lun-chip .prog-planet-symbol {
    font-size: 30px;
}

.lun-chip .prog-aspect-symbol {
    font-size: 30px;
    margin-right: 20px;
}

/* Chip d'ingrés de casa */
.lun-chip-ingreso {
    border: 1px solid #c8d6b0;
    background: #f4f8ee;
}

.lun-chip-casa {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-dark, #3a5a7a);
}

/* Chip amb orbe ampliat */
.lun-chip-ampliado {
    opacity: 0.7;
    border-style: dashed;
}

.lun-orbe-ampliado {
    font-size: 18px;
    color: #555;
    font-weight: 400;
    margin-left: 20px;
    font-style: italic;
}

.lun-asp-ampliado {
    opacity: 0.5;
}

/* Tipus (text) */
.lun-tipo-cell {
    font-size: 18px;
    font-weight: 600;
    white-space: nowrap;
    color: var(--text-dark);
}

/* Ajustos per a la columna Lun (més petita) */
.lun-table td:first-child .prog-planet-symbol {
    font-size: 26px;
}

.prog-table.lun-table {
  table-layout: fixed;
  width: 100%;
}

.lun-saros-row td {
  max-width: 0; /* fuerza a que el colspan respete el ancho total de la tabla en vez de expandirse */
  width: 100%;
}

.lun-saros-card-inner {
  width: auto;
  max-width: 100%;
}

.prog-table-container {
  overflow-x: hidden; /* o overflow-x: auto si necesitas scroll, pero no debe afectar al texto interno */
}

table.prog-table.lun-table {
  table-layout: fixed !important;
  width: 100% !important;
}

.lun-saros-row > td {
  max-width: 0 !important;
  width: 100% !important;
}

.lun-saros-card,
.lun-saros-card-inner,
.lun-saros-resum,
.lun-saros-resum-curt {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  overflow-wrap: break-word !important;
  word-break: break-word !important;
}

/* Responsive */
@media (max-width: 768px) {
    .lun-chips-cell {
        max-width: 200px;
    }

    .lun-chip {
        padding: 2px 6px;
        font-size: 12px;
    }

    .lun-chip .prog-planet-symbol,
    .lun-chip .prog-aspect-symbol {
        font-size: 22px !important;
    }
}

/* ============================================
   PESTANYES INTERNES
   ============================================ */

.lun-internal-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border-color, #ddd);
    padding-bottom: 0;
}

.lun-internal-tab {
    padding: 10px 18px;
    font-size: 16px;
    font-weight: 500;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    color: var(--text-medium, #666);
    transition: all 0.2s;
    border-radius: 6px 6px 0 0;
}

.lun-internal-tab:hover {
    color: var(--text-dark, #333);
    background: var(--bg-hover, #f0f0f0);
}

.lun-internal-tab.active {
    color: var(--primary, #3a5a7a);
    border-bottom-color: var(--primary, #3a5a7a);
    font-weight: 600;
}

.lun-internal-pane {
    display: none;
}

.lun-internal-pane.active {
    display: block;
}

/* ============================================
   TARGETA SAROS
   ============================================ */

.lun-saros-row {
    background: transparent !important;
}

.lun-saros-card {
    padding: 8px;
}

.lun-saros-card-inner {
    background: var(--bg-secondary, #f8f9fa);
    border: 1px solid var(--border-color, #ddd);
    border-radius: 10px;
    padding: 16px 20px;
    margin: 4px 0;
    width: 90%;
    box-sizing: border-box;
}

.lun-saros-ambiguous {
    border: 2px solid #f59e0b;
}

.lun-saros-ambig-msg {
    background: #fef3c7;
    color: #92400e;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 16px;
    margin-bottom: 10px;
    font-weight: 500;
}

.lun-saros-header {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 8px;
}

.lun-saros-id {
    font-size: 22px;
    font-weight: 800;
    color: var(--primary-dark, #2c3e50);
}

.lun-saros-nom {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-medium, #666);
}

.lun-saros-classif {
    font-size: 16px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.lun-saros-badge {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
}

.lun-eclipse-badge-total {
    background: #dc2626;
    color: white;
}

.lun-eclipse-badge-ambiguous {
    background: #f59e0b;
    color: white;
}

.lun-eclipse-badge-partial {
    background: #f97316;
    color: white;
}

.lun-eclipse-badge-marginal {
    background: #94a3b8;
    color: white;
}

.lun-saros-orb {
    font-size: 16px;
    color: var(--text-medium, #666);
}

.lun-saros-dates {
    font-size: 16px;
    margin-bottom: 10px;
    line-height: 1.5;
}

.lun-saros-label {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark, #333);
}

.lun-saros-aspectes {
    font-size: 16px;
    margin-bottom: 10px;
}

.lun-saros-aspectes ul {
    margin: 4px 0 0 16px;
    padding: 0;
}

.lun-saros-aspectes li {
    margin-bottom: 2px;
    line-height: 1.5;
    font-size: 16px;
}

/* Eix de cases a la fila */
.lun-house-axis {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary, #3a5a7a);
    white-space: nowrap;
}

/* Eix de cases a la targeta Saros */
.lun-saros-axis {
    font-size: 16px;
    margin-bottom: 10px;
    padding: 6px 12px;
    background: #eef2ff;
    border-radius: 6px;
    display: inline-block;
}

.lun-saros-axis strong {
    font-size: 16px;
    color: var(--primary-dark, #2c3e50);
}

.lun-saros-resum {
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-dark, #333);
    overflow-wrap: break-word;
    word-break: break-word;
}

.lun-saros-resum-curt {
    margin-bottom: 4px;
    overflow-wrap: break-word;
    word-break: break-word;
}

.lun-saros-resum-llarg {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed var(--border-color, #ddd);
    overflow-wrap: break-word;
    word-break: break-word;
}

.lun-saros-expand {
    background: none;
    border: none;
    color: var(--primary, #3a5a7a);
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    text-decoration: underline;
    padding: 4px 0;
}

.lun-saros-expand:hover {
    color: var(--primary-dark, #2c3e50);
}

.lun-saros-toggle {
    background: none;
    border: 1px solid var(--border-color, #ccc);
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    padding: 2px 6px;
    margin-left: 6px;
    vertical-align: middle;
    transition: background 0.2s;
}

.lun-saros-toggle:hover {
    background: var(--bg-hover, #e9ecef);
}

/* ============================================
   CALENDARI D'ECLIPSIS
   ============================================ */

.lun-calendar-resum {
    font-size: 14px;
    max-width: 350px;
    white-space: normal;
}

.ecl-calendar-table td {
    vertical-align: middle;
}

.ecl-calendar-table strong {
    font-size: 16px;
}
