/* =============================================
   GLOSARIO ESPACIAL — Estilos premium
   ============================================= */

/* --- Wrapper general --- */
.sp-glosario-wrapper {
    max-width: 960px;
    margin: 0 auto 4rem;
    padding: 0 1.5rem;
}

/* --- Barra de búsqueda --- */
.sp-glosario-search {
    position: sticky;
    top: 60px;
    z-index: 90;
    padding: 1rem 0;
    background: linear-gradient(180deg, rgba(10,10,20,0.98) 70%, rgba(10,10,20,0) 100%);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
.sp-search-inner {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 14px;
    padding: 0 1.25rem;
    transition: border-color 0.3s, box-shadow 0.3s;
}
.sp-search-inner:focus-within {
    border-color: rgba(0,212,255,0.5);
    box-shadow: 0 0 0 3px rgba(0,212,255,0.1), 0 4px 24px rgba(0,212,255,0.08);
}
.sp-search-icon {
    flex-shrink: 0;
    opacity: 0.4;
    color: #00d4ff !important;
}
#sp-glosario-input {
    flex: 1;
    background: none !important;
    border: none !important;
    outline: none !important;
    padding: 1rem 0.75rem !important;
    font-size: 1.05rem;
    font-family: 'Inter', sans-serif;
    color: #fff !important;
    box-shadow: none !important;
}
#sp-glosario-input::placeholder {
    color: rgba(255,255,255,0.3) !important;
}
.sp-search-count {
    flex-shrink: 0;
    font-size: 0.8rem;
    color: rgba(255,255,255,0.35) !important;
    font-variant-numeric: tabular-nums;
}

/* --- Índice alfabético --- */
.sp-alpha-index {
    position: sticky;
    top: 130px;
    z-index: 89;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    justify-content: center;
    padding: 0.75rem 0 1rem;
    background: linear-gradient(180deg, rgba(10,10,20,0.95) 80%, rgba(10,10,20,0) 100%);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.sp-alpha-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.06);
    background: rgba(255,255,255,0.03);
    color: rgba(255,255,255,0.5) !important;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none !important;
}
.sp-alpha-btn:hover {
    background: rgba(0,212,255,0.12);
    color: #00d4ff !important;
    border-color: rgba(0,212,255,0.3);
    transform: translateY(-1px);
}
.sp-alpha-btn.active {
    background: linear-gradient(135deg, rgba(0,212,255,0.2), rgba(100,100,255,0.15));
    color: #00d4ff !important;
    border-color: rgba(0,212,255,0.4);
    box-shadow: 0 0 12px rgba(0,212,255,0.15);
}
.sp-alpha-btn.disabled {
    opacity: 0.2;
    pointer-events: none;
}

/* --- Secciones por letra --- */
.sp-letter-section {
    margin-bottom: 2.5rem;
    scroll-margin-top: 200px;
}
.sp-letter-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.sp-letter-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(0,212,255,0.15), rgba(120,80,255,0.12));
    border: 1px solid rgba(0,212,255,0.2);
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: #00d4ff !important;
    text-shadow: 0 0 12px rgba(0,212,255,0.3);
}
.sp-letter-count {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.3) !important;
    font-family: 'Inter', sans-serif;
}

/* --- Grid de términos --- */
.sp-terms-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
}
.sp-term-card {
    background: rgba(255,255,255,0.025);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    transition: all 0.3s ease;
}
.sp-term-card:hover {
    background: rgba(255,255,255,0.045);
    border-color: rgba(0,212,255,0.15);
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    transform: translateY(-1px);
}
.sp-term-card.sp-highlight {
    border-color: rgba(0,212,255,0.4);
    background: rgba(0,212,255,0.06);
    box-shadow: 0 0 20px rgba(0,212,255,0.08);
}
.sp-term-name {
    font-family: 'Space Grotesk', sans-serif !important;
    font-size: 1.1rem !important;
    font-weight: 600 !important;
    margin: 0 0 0.5rem !important;
    color: #e0e8ff !important;
    line-height: 1.3 !important;
}
.sp-term-def {
    font-family: 'Inter', sans-serif;
    font-size: 0.92rem !important;
    line-height: 1.65 !important;
    margin: 0 !important;
    color: rgba(255,255,255,0.65) !important;
}
.sp-term-card.sp-hidden {
    display: none;
}

/* --- No resultados --- */
.sp-no-results {
    text-align: center;
    padding: 3rem 1rem;
    color: rgba(255,255,255,0.4) !important;
}
.sp-no-results p {
    margin-top: 1rem;
    font-size: 1.05rem;
    color: rgba(255,255,255,0.4) !important;
}
#sp-no-results-query {
    color: #00d4ff !important;
}


/* =============================================
   CALENDARIO ESPACIAL — Estilos premium
   ============================================= */

.sp-calendario-wrapper {
    max-width: 960px;
    margin: 0 auto 4rem;
    padding: 0 1.5rem;
}

/* --- Controles --- */
.sp-cal-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.sp-cal-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    color: rgba(255,255,255,0.7) !important;
    cursor: pointer;
    padding: 0.5rem;
    transition: all 0.2s;
    font-family: 'Inter', sans-serif;
}
.sp-cal-btn:hover {
    background: rgba(0,212,255,0.1);
    border-color: rgba(0,212,255,0.3);
    color: #00d4ff !important;
}
.sp-cal-today-btn {
    padding: 0.45rem 1rem;
    font-size: 0.82rem;
    font-weight: 500;
    margin-left: 0.5rem;
}
.sp-cal-month-title {
    font-family: 'Space Grotesk', sans-serif !important;
    font-size: 1.5rem !important;
    font-weight: 600 !important;
    color: #fff !important;
    margin: 0 !important;
    min-width: 220px;
    text-align: center;
    text-transform: capitalize;
}

/* --- Filtros --- */
.sp-cal-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 2rem;
}
.sp-cal-filter {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 1rem;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.03);
    color: rgba(255,255,255,0.5) !important;
    font-family: 'Inter', sans-serif;
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}
.sp-cal-filter:hover {
    border-color: rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.8) !important;
}
.sp-cal-filter.active {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.2);
    color: #fff !important;
}
.sp-filter-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}
.sp-dot-all { background: #fff; }
.sp-dot-launch { background: #ff6b6b; }
.sp-dot-mission { background: #51cf66; }
.sp-dot-astronomy { background: #748ffc; }

/* --- Grid del calendario --- */
.sp-cal-grid-wrapper {
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 2rem;
}
.sp-cal-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: rgba(255,255,255,0.03);
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.sp-cal-weekdays span {
    text-align: center;
    padding: 0.75rem 0.25rem;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.78rem;
    font-weight: 600;
    color: rgba(255,255,255,0.4) !important;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.sp-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}
.sp-cal-day {
    position: relative;
    min-height: 80px;
    padding: 0.5rem;
    border-right: 1px solid rgba(255,255,255,0.03);
    border-bottom: 1px solid rgba(255,255,255,0.03);
    transition: background 0.2s;
    cursor: default;
}
.sp-cal-day:nth-child(7n) {
    border-right: none;
}
.sp-cal-day:hover {
    background: rgba(255,255,255,0.03);
}
.sp-cal-day.other-month {
    opacity: 0.25;
}
.sp-cal-day.today {
    background: rgba(0,212,255,0.06);
}
.sp-cal-day.today .sp-day-number {
    background: #00d4ff;
    color: #000 !important;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}
.sp-day-number {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    color: rgba(255,255,255,0.6) !important;
    margin-bottom: 0.25rem;
}
.sp-day-events {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.sp-day-event {
    font-size: 0.68rem;
    padding: 2px 5px;
    border-radius: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    transition: opacity 0.2s;
}
.sp-day-event:hover {
    opacity: 0.8;
}
.sp-day-event.cat-launch {
    background: rgba(255,107,107,0.2);
    color: #ff6b6b !important;
}
.sp-day-event.cat-mission {
    background: rgba(81,207,102,0.2);
    color: #51cf66 !important;
}
.sp-day-event.cat-astronomy {
    background: rgba(116,143,252,0.2);
    color: #748ffc !important;
}

/* --- Lista de eventos --- */
.sp-events-title {
    font-family: 'Space Grotesk', sans-serif !important;
    font-size: 1.15rem !important;
    font-weight: 600 !important;
    color: #fff !important;
    margin: 0 0 1rem !important;
}
.sp-events-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.sp-event-card {
    display: flex;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: rgba(255,255,255,0.025);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 12px;
    transition: all 0.3s;
    align-items: flex-start;
}
.sp-event-card:hover {
    background: rgba(255,255,255,0.045);
    border-color: rgba(255,255,255,0.1);
    transform: translateY(-1px);
}
.sp-event-card.sp-filtered-out {
    display: none;
}
.sp-event-date-col {
    flex-shrink: 0;
    text-align: center;
    min-width: 52px;
}
.sp-event-day-num {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1;
    color: #00d4ff !important;
}
.sp-event-day-name {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(255,255,255,0.35) !important;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
}
.sp-event-info {
    flex: 1;
    min-width: 0;
}
.sp-event-cat-badge {
    display: inline-block;
    font-size: 0.68rem;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.35rem;
}
.sp-event-cat-badge.cat-launch {
    background: rgba(255,107,107,0.15);
    color: #ff6b6b !important;
}
.sp-event-cat-badge.cat-mission {
    background: rgba(81,207,102,0.15);
    color: #51cf66 !important;
}
.sp-event-cat-badge.cat-astronomy {
    background: rgba(116,143,252,0.15);
    color: #748ffc !important;
}
.sp-event-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 0.3rem;
    color: #e0e8ff !important;
}
.sp-event-desc {
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    line-height: 1.55;
    margin: 0;
    color: rgba(255,255,255,0.5) !important;
}
.sp-events-empty {
    text-align: center;
    padding: 2rem;
    color: rgba(255,255,255,0.3) !important;
    font-style: italic;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .sp-cal-day {
        min-height: 60px;
        padding: 0.3rem;
    }
    .sp-day-event {
        font-size: 0.6rem;
        padding: 1px 3px;
    }
    .sp-cal-weekdays span {
        font-size: 0.7rem;
    }
    .sp-alpha-btn {
        width: 30px;
        height: 30px;
        font-size: 0.75rem;
    }
    .sp-cal-month-title {
        font-size: 1.15rem !important;
        min-width: 180px;
    }
    .sp-event-card {
        flex-direction: column;
        gap: 0.5rem;
    }
    .sp-event-date-col {
        display: flex;
        gap: 0.5rem;
        align-items: baseline;
    }
}
