/* ================================================
   ORACULO DE HIDROMANCIA - APP STYLES
   ================================================ */

.oha-app {
    --oha-agua: #1565c0;
    --oha-agua-claro: #42a5f5;
    --oha-cyan: #00bcd4;
    --oha-cyan-oscuro: #00838f;
    --oha-plata: #b0bec5;
    --oha-dorado: #ffd700;
    --oha-gradiante-agua: linear-gradient(135deg, #1565c0 0%, #42a5f5 50%, #00bcd4 100%);
    --oha-gradiante-mistico: linear-gradient(135deg, #00838f 0%, #00bcd4 50%, #4dd0e1 100%);
    --oha-sombra: 0 10px 30px rgba(21, 101, 192, 0.15);
    --oha-sombra-hover: 0 15px 40px rgba(21, 101, 192, 0.25);
    --oha-radio: 16px;
    --oha-transicion: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    position: relative;
    overflow: hidden;
}

/* ================================================
   FASE PREGUNTA
   ================================================ */

.oha-fase {
    animation: ohaFadeIn 0.6s ease;
}

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

.oha-pregunta-contenido {
    text-align: center;
    padding: 2rem 1rem;
}

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

@keyframes ohaGlow {
    0%, 100% { filter: drop-shadow(0 0 10px rgba(0, 188, 212, 0.3)); }
    50% { filter: drop-shadow(0 0 20px rgba(0, 188, 212, 0.6)); }
}

.oha-simbolo-flotante {
    position: absolute;
    font-size: 1rem;
    opacity: 0;
    animation: ohaSimboloFloat 3s ease-in-out infinite;
    pointer-events: none;
}

.oha-simbolo-flotante::before { content: '💧'; }
.oha-sf2::before { content: '〰️'; }
.oha-sf3::before { content: '🌙'; }

.oha-sf2 { animation-delay: -1s; top: -10px; left: 30px; }
.oha-sf3 { animation-delay: -2s; top: 10px; right: 20px; }

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

.oha-titulo-pregunta {
    color: #fff;
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    background: var(--oha-gradiante-agua);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

/* Textarea */
.oha-textarea-contenedor {
    position: relative;
    max-width: 500px;
    margin: 0 auto 2rem;
}

.oha-pregunta-input {
    width: 100%;
    padding: 1rem 1.2rem;
    padding-bottom: 2rem;
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid rgba(0, 188, 212, 0.3);
    border-radius: 14px;
    color: #fff;
    font-size: 1rem;
    font-family: inherit;
    resize: none;
    transition: var(--oha-transicion);
}

.oha-pregunta-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.oha-pregunta-input:focus {
    outline: none;
    border-color: var(--oha-cyan);
    box-shadow: 0 0 20px rgba(0, 188, 212, 0.2);
    background: rgba(255, 255, 255, 0.12);
}

.oha-contador {
    position: absolute;
    bottom: 8px;
    right: 14px;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
}

/* Tiradas */
.oha-tiradas {
    max-width: 600px;
    margin: 0 auto 2rem;
}

.oha-tiradas-label {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.oha-tiradas-opciones {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.oha-tirada-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--oha-radio);
    padding: 1.2rem 0.8rem;
    cursor: pointer;
    transition: var(--oha-transicion);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    color: #fff;
}

.oha-tirada-btn:hover {
    border-color: rgba(0, 188, 212, 0.5);
    background: rgba(0, 188, 212, 0.1);
    transform: translateY(-3px);
}

.oha-tirada-btn.oha-tirada-activa {
    border-color: var(--oha-cyan);
    background: rgba(0, 188, 212, 0.15);
    box-shadow: 0 0 20px rgba(0, 188, 212, 0.2);
}

.oha-tirada-icono {
    font-size: 2rem;
    line-height: 1;
}

.oha-tirada-nombre {
    font-size: 0.95rem;
    font-weight: 600;
}

.oha-tirada-desc {
    font-size: 0.75rem;
    opacity: 0.6;
}

/* Boton Consultar */
.oha-btn-consultar {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    background: var(--oha-gradiante-agua);
    color: #fff;
    border: none;
    border-radius: 50px;
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--oha-transicion);
    box-shadow: var(--oha-sombra);
    font-family: inherit;
}

.oha-btn-consultar:hover {
    transform: translateY(-3px);
    box-shadow: var(--oha-sombra-hover);
}

.oha-btn-consultar:active {
    transform: translateY(0);
}

.oha-btn-icono {
    font-size: 1.2rem;
}

/* ================================================
   FASE ONDAS
   ================================================ */

.oha-pregunta-mostrada {
    text-align: center;
    color: var(--oha-dorado);
    font-style: italic;
    margin-bottom: 1rem;
    font-size: 1.05rem;
    padding: 0.8rem 1.2rem;
    background: rgba(255, 215, 0, 0.1);
    border-radius: 10px;
    border: 1px solid rgba(255, 215, 0, 0.2);
}

.oha-instruccion-ondas {
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 2rem;
    font-size: 0.95rem;
}

/* Ondas */
.oha-ondas-area {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    padding: 2rem 0;
    perspective: 1000px;
}

.oha-ondas-area.oha-ondas-ola {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.8rem;
    max-width: 700px;
    margin: 0 auto;
    padding: 1rem 0;
}

.oha-onda-contenedor {
    width: 130px;
    height: 200px;
    perspective: 1000px;
    cursor: pointer;
}

.oha-ondas-area.oha-ondas-ola .oha-onda-contenedor {
    width: 120px;
    height: 180px;
}

.oha-onda-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
}

.oha-onda-contenedor.oha-revelada .oha-onda-inner {
    transform: rotateY(180deg);
}

.oha-onda-frente,
.oha-onda-reverso {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Reverso de la onda */
.oha-onda-reverso {
    background: var(--oha-gradiante-mistico);
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.oha-onda-reverso::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 8px;
    right: 8px;
    bottom: 8px;
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 8px;
}

.oha-onda-reverso::after {
    content: '💧';
    font-size: 2.5rem;
    color: rgba(255, 215, 0, 0.3);
    position: absolute;
}

.oha-onda-reverso .oha-onda-patron {
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 10px,
        rgba(255, 255, 255, 0.03) 10px,
        rgba(255, 255, 255, 0.03) 20px
    );
}

.oha-onda-reverso .oha-onda-posicion {
    position: absolute;
    bottom: 10px;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.5);
    text-align: center;
    width: 100%;
    padding: 0 6px;
}

/* Hover onda boca abajo */
.oha-onda-contenedor:not(.oha-revelada):hover .oha-onda-inner {
    transform: translateY(-8px);
}

.oha-onda-contenedor:not(.oha-revelada):hover .oha-onda-reverso {
    box-shadow: 0 15px 35px rgba(0, 131, 143, 0.4);
    border-color: rgba(255, 215, 0, 0.4);
}

/* Frente de la onda */
.oha-onda-frente {
    background: rgba(10, 20, 40, 0.95);
    border: 2px solid rgba(0, 188, 212, 0.4);
    box-shadow: 0 8px 25px rgba(0, 188, 212, 0.2);
    transform: rotateY(180deg);
    padding: 0.8rem 0.5rem;
}

.oha-onda-frente.oha-onda-invertida {
    border-color: rgba(206, 17, 38, 0.5);
    box-shadow: 0 8px 25px rgba(206, 17, 38, 0.2);
}

.oha-onda-simbolo {
    font-size: 2.5rem;
    line-height: 1;
    margin-bottom: 0.3rem;
}

.oha-onda-frente .oha-onda-nombre {
    font-size: 0.8rem;
    color: #fff;
    font-weight: 600;
    text-align: center;
    line-height: 1.2;
    font-style: italic;
}

.oha-onda-orientacion {
    font-size: 0.65rem;
    margin-top: 0.2rem;
    font-style: italic;
}

.oha-onda-orientacion.oha-invertida-texto {
    color: #ce1126;
}

.oha-onda-orientacion.oha-derecha-texto {
    color: #22c55e;
}

/* Progreso */
.oha-progreso {
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.85rem;
    margin-top: 1rem;
}

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

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

.oha-resultado-titulo {
    font-size: 1.8rem;
    background: var(--oha-gradiante-agua);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.oha-resultado-pregunta {
    color: rgba(255, 255, 255, 0.6);
    font-style: italic;
    font-size: 0.95rem;
}

.oha-resultado-ondas {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.oha-resultado-onda {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--oha-radio);
    padding: 1.5rem;
    animation: ohaSlideIn 0.5s ease;
    animation-fill-mode: both;
}

.oha-resultado-onda:nth-child(1) { animation-delay: 0.1s; }
.oha-resultado-onda:nth-child(2) { animation-delay: 0.25s; }
.oha-resultado-onda:nth-child(3) { animation-delay: 0.4s; }
.oha-resultado-onda:nth-child(4) { animation-delay: 0.55s; }
.oha-resultado-onda:nth-child(5) { animation-delay: 0.7s; }

@keyframes ohaSlideIn {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

.oha-resultado-onda-posicion {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--oha-dorado);
    margin-bottom: 0.8rem;
    font-weight: 600;
}

.oha-resultado-onda-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.oha-resultado-onda-simbolo {
    font-size: 2.5rem;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 188, 212, 0.1);
    border-radius: 12px;
    flex-shrink: 0;
}

.oha-resultado-onda-info h3 {
    color: #fff;
    font-size: 1.2rem;
    margin-bottom: 0.2rem;
    font-style: italic;
}

.oha-resultado-onda-info .oha-orientacion-badge {
    font-size: 0.75rem;
    padding: 2px 10px;
    border-radius: 20px;
    display: inline-block;
}

.oha-orientacion-badge.oha-badge-derecha {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

.oha-orientacion-badge.oha-badge-invertida {
    background: rgba(206, 17, 38, 0.2);
    color: #ef4444;
}

.oha-resultado-onda-significado {
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.7;
    font-size: 0.95rem;
    margin-bottom: 1rem;
}

.oha-resultado-onda-consejo {
    background: rgba(255, 215, 0, 0.08);
    border-left: 3px solid var(--oha-dorado);
    padding: 0.8rem 1rem;
    border-radius: 0 8px 8px 0;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    font-style: italic;
}

.oha-resultado-onda-consejo::before {
    content: '💧 ';
}

/* Consejo final */
.oha-resultado-consejo {
    margin-top: 2rem;
    text-align: center;
    padding: 2rem;
    background: rgba(255, 215, 0, 0.08);
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: var(--oha-radio);
}

.oha-resultado-consejo h3 {
    color: var(--oha-dorado);
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.oha-resultado-consejo p {
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.7;
}

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

.oha-btn-nueva:hover {
    background: rgba(0, 188, 212, 0.15);
    border-color: var(--oha-cyan);
    transform: translateY(-2px);
}

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

.oha-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    min-height: 300px;
}

.oha-loading-ondas {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.oha-loading-onda {
    width: 50px;
    height: 75px;
    background: var(--oha-gradiante-mistico);
    border-radius: 8px;
    animation: ohaBarajar 1.2s ease-in-out infinite;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.oha-lo2 { animation-delay: 0.2s; }
.oha-lo3 { animation-delay: 0.4s; }

@keyframes ohaBarajar {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-15px) rotate(-5deg); }
    75% { transform: translateY(5px) rotate(3deg); }
}

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

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

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

.oha-app::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 50%, rgba(21, 101, 192, 0.06) 0%, transparent 50%),
                radial-gradient(circle at 70% 30%, rgba(0, 188, 212, 0.06) 0%, transparent 50%),
                radial-gradient(circle at 50% 80%, rgba(255, 215, 0, 0.04) 0%, transparent 50%);
    animation: ohaFondo 20s linear infinite;
    pointer-events: none;
    z-index: 0;
}

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

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

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

@media (max-width: 768px) {
    .oha-titulo-pregunta { font-size: 1.4rem; }
    .oha-icono-agua { font-size: 3rem; }
    .oha-onda-contenedor { width: 110px; height: 170px; }
    .oha-ondas-area.oha-ondas-ola .oha-onda-contenedor { width: 90px; height: 140px; }
    .oha-onda-simbolo { font-size: 2rem; }
    .oha-onda-frente .oha-onda-nombre { font-size: 0.7rem; }
    .oha-resultado-onda { padding: 1.2rem; }
    .oha-ondas-area { gap: 1rem; }
    .oha-ondas-area.oha-ondas-ola { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 480px) {
    .oha-pregunta-contenido { padding: 1rem 0.5rem; }
    .oha-titulo-pregunta { font-size: 1.2rem; }
    .oha-subtitulo-pregunta { font-size: 0.85rem; }
    .oha-tiradas-opciones { grid-template-columns: 1fr; gap: 0.7rem; }
    .oha-tirada-btn { flex-direction: row; padding: 0.8rem 1rem; gap: 0.6rem; }
    .oha-tirada-icono { font-size: 1.5rem; }
    .oha-onda-contenedor { width: 95px; height: 145px; }
    .oha-ondas-area { gap: 0.6rem; }
    .oha-ondas-area.oha-ondas-ola { grid-template-columns: repeat(2, 1fr); }
    .oha-ondas-area.oha-ondas-ola .oha-onda-contenedor { width: 75px; height: 115px; }
    .oha-onda-simbolo { font-size: 1.5rem; }
    .oha-onda-frente .oha-onda-nombre { font-size: 0.65rem; }
    .oha-btn-consultar { padding: 0.8rem 1.8rem; font-size: 1rem; }
    .oha-resultado-titulo { font-size: 1.4rem; }
    .oha-resultado-onda-simbolo { width: 45px; height: 45px; font-size: 1.8rem; }
    .oha-resultado-onda-info h3 { font-size: 1rem; }
    .oha-resultado-onda-header { gap: 0.7rem; }
}

@media (max-width: 360px) {
    .oha-onda-contenedor { width: 80px; height: 125px; }
    .oha-ondas-area { gap: 0.4rem; }
}

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

@media (prefers-reduced-motion: reduce) {
    .oha-app::before { animation: none; }
    .oha-icono-agua { animation: none; }
    .oha-simbolo-flotante { animation: none; display: none; }
    .oha-loading-onda { animation: none; }
    .oha-loading-texto { animation: none; opacity: 1; }
    .oha-onda-inner { transition-duration: 0.01ms; }
    .oha-resultado-onda { animation: none; opacity: 1; transform: none; }
    * { transition-duration: 0.05ms !important; animation-duration: 0.05ms !important; }
}

@media (prefers-contrast: high) {
    .oha-onda-reverso { border: 3px solid white; }
    .oha-onda-frente { border: 3px solid white; }
    .oha-tirada-btn { border: 2px solid white; }
    .oha-tirada-btn.oha-tirada-activa { border-color: var(--oha-cyan); }
    .oha-resultado-onda { border: 2px solid rgba(255, 255, 255, 0.5); }
}

/* Print */
@media print {
    .oha-app::before { display: none; }
    .oha-btn-consultar, .oha-btn-nueva { display: none; }
    .oha-resultado-onda { break-inside: avoid; }
}
