/* ================================================
   CALCULADORA DE FASES LUNARES - APP STYLES
   ================================================ */

.luna-app {
    --luna-silver: #a0aec0;
    --luna-gold: #ffd700;
    --luna-blue: #4299e1;
    --luna-purple: #805ad5;
    --luna-gradiente: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --luna-sombra: 0 10px 30px rgba(102, 126, 234, 0.15);
    --luna-sombra-hover: 0 15px 40px rgba(102, 126, 234, 0.25);
    --luna-radio: 16px;
    --luna-transicion: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    position: relative;
    overflow: hidden;
}

/* ================================================
   FASE FORMULARIO
   ================================================ */

.luna-fase {
    animation: lunaFadeIn 0.6s ease;
}

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

.luna-form-contenido {
    text-align: center;
    padding: 2.5rem 1rem;
}

.luna-icono-oraculo {
    font-size: 4rem;
    position: relative;
    display: inline-block;
    margin-bottom: 1.5rem;
    animation: lunaFlotar 3s ease-in-out infinite;
}

@keyframes lunaFlotar {
    0%, 100% { transform: scale(1) translateY(0); filter: brightness(1); }
    50% { transform: scale(1.1) translateY(-8px); filter: brightness(1.3); }
}

.luna-destello {
    position: absolute;
    font-size: 1rem;
    opacity: 0;
    animation: lunaDestello 3s ease-in-out infinite;
    pointer-events: none;
}

.luna-destello::before { content: '\2728'; }

.luna-d1 { animation-delay: -0.5s; top: -10px; left: 10px; }
.luna-d2 { animation-delay: -1.5s; top: -5px; right: 15px; }

@keyframes lunaDestello {
    0%, 100% { opacity: 0; transform: translateY(0) scale(0.5); }
    50% { opacity: 0.8; transform: translateY(-20px) scale(1); }
}

.luna-titulo {
    color: #fff;
    font-size: 2rem;
    margin-bottom: 0.5rem;
    background: var(--luna-gradiente);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.luna-subtitulo {
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 2rem;
    font-size: 1rem;
}

.luna-form-campos {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1rem;
    max-width: 450px;
    margin: 0 auto 1.5rem;
}

.luna-campo {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.luna-label {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    text-align: left;
}

.luna-select {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 12px;
    padding: 0.8rem 1rem;
    color: #fff;
    font-family: inherit;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--luna-transicion);
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23667eea' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

.luna-select:focus {
    outline: none;
    border-color: var(--luna-blue);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
    background-color: rgba(255, 255, 255, 0.08);
}

.luna-select option {
    background: #1a1a2e;
    color: #fff;
}

.luna-btn-calcular {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    background: var(--luna-gradiente);
    color: #fff;
    border: none;
    border-radius: 50px;
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--luna-transicion);
    font-family: inherit;
    box-shadow: var(--luna-sombra);
    margin-bottom: 1rem;
}

.luna-btn-calcular:hover {
    transform: translateY(-2px);
    box-shadow: var(--luna-sombra-hover);
}

.luna-btn-calcular:active {
    transform: translateY(0);
}

.luna-instruccion {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

/* ================================================
   LOADING
   ================================================ */

.luna-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
}

.luna-loading-visual {
    position: relative;
    width: 100px;
    height: 100px;
    margin-bottom: 1.5rem;
}

.luna-orbita {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    animation: lunaOrbita 3s linear infinite;
}

.luna-orbita-2 {
    animation-duration: 4.5s;
    animation-direction: reverse;
}

.luna-orbita-punto {
    width: 14px;
    height: 14px;
    background: var(--luna-gold);
    border-radius: 50%;
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

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

.luna-loading-texto {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1rem;
    animation: lunaPulso 1.5s ease-in-out infinite;
}

@keyframes lunaPulso {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* ================================================
   FASE RESULTADO
   ================================================ */

.luna-resultado-contenido {
    padding: 2rem 1rem;
}

.luna-resultado-header {
    text-align: center;
    margin-bottom: 2rem;
}

.luna-fecha-consulta {
    color: var(--luna-blue);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
}

.luna-dia-ciclo {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.9rem;
}

.luna-seccion {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(102, 126, 234, 0.15);
    border-radius: var(--luna-radio);
    padding: 2rem;
    margin-bottom: 1.5rem;
    animation: lunaSlideIn 0.6s ease both;
}

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

.luna-seccion:nth-child(3) { animation-delay: 0.1s; }
.luna-seccion:nth-child(4) { animation-delay: 0.2s; }
.luna-seccion:nth-child(5) { animation-delay: 0.3s; }

/* Phase visual with moon sphere */
.luna-phase-visual {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-bottom: 2rem;
}

.luna-moon-display {
    position: relative;
    flex-shrink: 0;
}

.luna-moon-sphere {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #f5f5f0, #d4d0c8, #b8b4a8);
    position: relative;
    overflow: hidden;
    box-shadow:
        0 0 20px rgba(255, 215, 0, 0.3),
        0 0 60px rgba(255, 215, 0, 0.1),
        inset -5px -5px 15px rgba(0, 0, 0, 0.2);
}

.luna-moon-shadow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    transition: all 0.5s ease;
}

/* Moon phase shadow positions */
.luna-phase-nueva .luna-moon-shadow {
    background: rgba(26, 26, 46, 0.95);
    transform: translateX(0);
}

.luna-phase-creciente .luna-moon-shadow {
    background: rgba(26, 26, 46, 0.75);
    clip-path: polygon(50% 0%, 100% 0%, 100% 100%, 50% 100%, 75% 50%);
}

.luna-phase-cuarto-creciente .luna-moon-shadow {
    background: rgba(26, 26, 46, 0.65);
    clip-path: polygon(50% 0%, 100% 0%, 100% 100%, 50% 100%);
}

.luna-phase-gibosa-creciente .luna-moon-shadow {
    background: rgba(26, 26, 46, 0.35);
    clip-path: polygon(25% 0%, 100% 0%, 100% 100%, 25% 100%);
}

.luna-phase-llena .luna-moon-shadow {
    background: transparent;
}

.luna-phase-gibosa-menguante .luna-moon-shadow {
    background: rgba(26, 26, 46, 0.35);
    clip-path: polygon(0% 0%, 75% 0%, 75% 100%, 0% 100%);
}

.luna-phase-cuarto-menguante .luna-moon-shadow {
    background: rgba(26, 26, 46, 0.65);
    clip-path: polygon(0% 0%, 50% 0%, 50% 100%, 0% 100%);
}

.luna-phase-menguante .luna-moon-shadow {
    background: rgba(26, 26, 46, 0.75);
    clip-path: polygon(0% 0%, 50% 0%, 25% 50%, 50% 100%, 0% 100%);
}

.luna-phase-info {
    text-align: left;
}

.luna-phase-emoji {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    filter: drop-shadow(0 2px 6px rgba(255, 215, 0, 0.4));
}

.luna-phase-nombre {
    color: #fff;
    font-size: 1.5rem;
    margin-bottom: 0.3rem;
}

.luna-phase-energia {
    display: inline-block;
    background: rgba(255, 215, 0, 0.15);
    color: var(--luna-gold);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    border: 1px solid rgba(255, 215, 0, 0.3);
}

.luna-phase-titulo {
    color: #fff;
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.luna-phase-mensaje {
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.8;
    font-size: 1rem;
}

/* Energy card */
.luna-energy-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.luna-energy-icono {
    font-size: 2rem;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    background: rgba(102, 126, 234, 0.12);
    flex-shrink: 0;
}

.luna-energy-header h3 {
    color: #fff;
    font-size: 1.3rem;
}

.luna-iluminacion-barra {
    margin-bottom: 1.5rem;
}

.luna-iluminacion-labels {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
}

.luna-iluminacion-labels span:nth-child(2) {
    color: var(--luna-gold);
    font-weight: 600;
    font-size: 0.85rem;
}

.luna-iluminacion-fondo {
    height: 12px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.luna-iluminacion-relleno {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #ffd700);
    border-radius: 6px;
    transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.luna-iluminacion-valor {
    display: block;
    text-align: center;
    color: var(--luna-gold);
    font-size: 1.2rem;
    font-weight: 700;
}

.luna-palabras-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}

.luna-palabra {
    background: rgba(255, 215, 0, 0.1);
    color: #fff;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    border: 1px solid rgba(255, 215, 0, 0.25);
    transition: var(--luna-transicion);
}

.luna-palabra:hover {
    background: rgba(255, 215, 0, 0.2);
    transform: translateY(-2px);
}

/* Advice card */
.luna-consejo-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.luna-consejo-icono {
    font-size: 2rem;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    background: rgba(128, 90, 213, 0.12);
    flex-shrink: 0;
}

.luna-consejo-header h3 {
    color: #fff;
    font-size: 1.3rem;
}

.luna-consejo-contenido {
    background: rgba(128, 90, 213, 0.08);
    border-left: 3px solid var(--luna-purple);
    padding: 1.2rem 1.5rem;
    border-radius: 0 12px 12px 0;
    color: rgba(255, 255, 255, 0.85);
    font-size: 1rem;
    line-height: 1.8;
    font-style: italic;
}

/* Next phases card */
.luna-proximas-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.luna-proximas-icono {
    font-size: 2rem;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    background: rgba(66, 153, 225, 0.12);
    flex-shrink: 0;
}

.luna-proximas-header h3 {
    color: #fff;
    font-size: 1.3rem;
}

.luna-proximas-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.luna-proxima-fase {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 1.2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: var(--luna-transicion);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.luna-proxima-fase:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
}

.luna-proxima-emoji {
    font-size: 2rem;
    flex-shrink: 0;
    filter: drop-shadow(0 2px 4px rgba(255, 215, 0, 0.3));
}

.luna-proxima-info {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.luna-proxima-nombre {
    color: #fff;
    font-size: 0.95rem;
    font-weight: 600;
}

.luna-proxima-fecha {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
}

/* Boton nueva consulta */
.luna-btn-nueva {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border: 2px solid rgba(102, 126, 234, 0.3);
    border-radius: 50px;
    padding: 0.9rem 2rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--luna-transicion);
    margin-top: 1rem;
    font-family: inherit;
}

.luna-btn-nueva:hover {
    background: rgba(102, 126, 234, 0.15);
    border-color: var(--luna-blue);
    transform: translateY(-2px);
}

/* ================================================
   PARTICULAS DE FONDO
   ================================================ */

.luna-app::before {
    content: '';
    position: absolute;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: radial-gradient(circle at 30% 40%, rgba(102, 126, 234, 0.06) 0%, transparent 50%),
                radial-gradient(circle at 70% 30%, rgba(128, 90, 213, 0.04) 0%, transparent 50%),
                radial-gradient(circle at 50% 80%, rgba(255, 215, 0, 0.03) 0%, transparent 50%);
    animation: lunaFondo 30s linear infinite;
    pointer-events: none;
    z-index: 0;
}

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

.luna-fase { position: relative; z-index: 1; }
.luna-loading { position: relative; z-index: 1; }

/* ================================================
   RESPONSIVE
   ================================================ */

@media (max-width: 768px) {
    .luna-titulo { font-size: 1.6rem; }
    .luna-icono-oraculo { font-size: 3rem; }
    .luna-seccion { padding: 1.5rem; }
    .luna-phase-visual { flex-direction: column; text-align: center; }
    .luna-phase-info { text-align: center; }
    .luna-moon-sphere { width: 80px; height: 80px; }
    .luna-proximas-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .luna-form-contenido { padding: 1.5rem 0.5rem; }
    .luna-titulo { font-size: 1.4rem; }
    .luna-subtitulo { font-size: 0.85rem; }
    .luna-form-campos { grid-template-columns: 1fr; gap: 0.8rem; max-width: none; }
    .luna-seccion { padding: 1.2rem; }
    .luna-moon-sphere { width: 70px; height: 70px; }
    .luna-phase-emoji { font-size: 2rem; }
    .luna-phase-nombre { font-size: 1.2rem; }
    .luna-energy-header,
    .luna-consejo-header,
    .luna-proximas-header { flex-direction: column; text-align: center; }
    .luna-energy-icono,
    .luna-consejo-icono,
    .luna-proximas-icono { width: 50px; height: 50px; font-size: 1.5rem; }
    .luna-btn-nueva { padding: 0.8rem 1.5rem; font-size: 0.9rem; }
    .luna-btn-calcular { padding: 0.9rem 2rem; font-size: 1rem; }
    .luna-consejo-contenido { border-left: none; border-top: 3px solid var(--luna-purple); border-radius: 0 12px 12px 0; }
}

/* ================================================
   ACCESIBILIDAD
   ================================================ */

@media (prefers-reduced-motion: reduce) {
    .luna-app::before { animation: none; }
    .luna-icono-oraculo { animation: none; }
    .luna-destello { animation: none; display: none; }
    .luna-loading-visual { animation: none; }
    .luna-orbita { animation: none; }
    .luna-loading-texto { animation: none; opacity: 1; }
    .luna-seccion { animation: none; opacity: 1; transform: none; }
    * { transition-duration: 0.05ms !important; animation-duration: 0.05ms !important; }
}

@media (prefers-contrast: high) {
    .luna-seccion { border: 2px solid rgba(255, 255, 255, 0.5); }
    .luna-iluminacion-fondo { background: rgba(255, 255, 255, 0.2); }
}

@media print {
    .luna-app::before { display: none; }
    .luna-btn-nueva { display: none; }
    .luna-btn-calcular { display: none; }
    .luna-seccion { break-inside: avoid; }
}