/* ================================================
   TRANSITOS PLANETARIOS - APP STYLES
   ================================================ */

.tr-app {
    --tr-ambar: #f59e0b;
    --tr-ambar-oscuro: #d97706;
    --tr-naranja: #f97316;
    --tr-luna: #8b5cf6;
    --tr-cyan: #06b6d4;
    --tr-gradiente: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    --tr-sombra: 0 10px 30px rgba(245, 158, 11, 0.15);
    --tr-radio: 16px;
    --tr-transicion: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    position: relative;
    overflow: hidden;
}

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

.tr-fase {
    animation: trFadeIn 0.6s ease;
}

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

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

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

@keyframes trBrillar {
    0%, 100% { transform: scale(1); filter: brightness(1); }
    50% { transform: scale(1.1); filter: brightness(1.3) drop-shadow(0 0 20px rgba(245, 158, 11, 0.6)); }
}

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

.tr-destello::before { content: '\2726'; }
.tr-d2::before { content: '\2756'; }
.tr-d3::before { content: '\2727'; }

.tr-d1 { animation-delay: -0.5s; top: -10px; left: 10px; }
.tr-d2 { animation-delay: -1.5s; top: -5px; right: 15px; }
.tr-d3 { animation-delay: -2.5s; bottom: 5px; left: 25px; }

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

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

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

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

.tr-campo { text-align: left; }

.tr-label {
    display: block;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.tr-select {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 12px;
    padding: 0.8rem 1rem;
    color: #fff;
    font-family: inherit;
    font-size: 0.95rem;
    transition: var(--tr-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='%23f59e0b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    cursor: pointer;
}

.tr-select:focus {
    outline: none;
    border-color: var(--tr-ambar);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15);
    background-color: rgba(255, 255, 255, 0.08);
}

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

.tr-btn-calcular {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    background: var(--tr-gradiente);
    color: #1a1a2e;
    border: none;
    border-radius: 50px;
    padding: 0.9rem 2.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--tr-transicion);
    margin-top: 1rem;
    font-family: inherit;
}

.tr-btn-calcular:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(245, 158, 11, 0.3);
}

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

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

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

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

.tr-orbita-centro {
    position: absolute;
    font-size: 1.5rem;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.tr-orbita-arc {
    position: absolute;
    top: 0; left: 0;
    width: 100px; height: 100px;
    border: 1px dashed rgba(245, 158, 11, 0.2);
    border-radius: 50%;
    animation: trArcGiro 8s linear infinite;
}

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

.tr-orbita-planeta {
    position: absolute;
    font-size: 1.2rem;
    animation: trPlanetaOrbita 6s linear infinite;
}

.tr-orbita-jup {
    top: 0; left: 50%;
    transform-origin: 0 50px;
    color: var(--tr-ambar);
    animation-duration: 6s;
}

.tr-orbita-sat {
    top: 50%; right: 0;
    transform-origin: -25px 0;
    color: var(--tr-cyan);
    animation-duration: 10s;
}

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

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

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

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

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

.tr-resultado-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(245, 158, 11, 0.2);
}

.tr-fecha-nac {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 0.3rem;
}

.tr-natal-info {
    font-size: 1.3rem;
    color: var(--tr-ambar);
    font-weight: 600;
    margin-bottom: 0.3rem;
}

.tr-natal-signo {
    color: var(--tr-ambar);
}

.tr-fecha-consulta {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.5);
}

.tr-seccion {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(245, 158, 11, 0.1);
    border-radius: var(--tr-radio);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    animation: trSlideIn 0.6s ease both;
}

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

.tr-seccion-titulo {
    color: var(--tr-ambar);
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.tr-titulo-resumen { color: var(--tr-ambar); }

/* Resumen */
.tr-resumen-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.tr-resumen-item {
    text-align: center;
    background: rgba(245, 158, 11, 0.06);
    border-radius: 12px;
    padding: 1rem;
    border: 1px solid rgba(245, 158, 11, 0.1);
}

.tr-resumen-num {
    font-size: 2rem;
    font-weight: 800;
    color: var(--tr-ambar);
}

.tr-resumen-label {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
    margin-top: 0.3rem;
}

/* Transito card */
.tr-transito-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.tr-transito-planeta {
    font-size: 1.2rem;
    font-weight: 700;
    color: #fff;
}

.tr-tipo-badge {
    font-size: 0.75rem;
    padding: 3px 10px;
    border-radius: 12px;
    font-weight: 600;
}

.tr-tipo-rapido { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.tr-tipo-medio { background: rgba(139, 92, 246, 0.15); color: #8b5cf6; }
.tr-tipo-lento { background: rgba(6, 182, 212, 0.15); color: #06b6d4; }

.tr-transito-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.8rem;
    flex-wrap: wrap;
}

.tr-meta-pos {
    font-size: 0.9rem;
    color: var(--tr-ambar);
    font-weight: 600;
}

.tr-meta-vel {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
}

.tr-meta-sep {
    color: rgba(255, 255, 255, 0.3);
}

.tr-transito-aspecto {
    margin-bottom: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.tr-aspecto-badge {
    font-size: 0.85rem;
    padding: 4px 14px;
    border-radius: 20px;
    font-weight: 500;
}

.tr-aspecto-armonico {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.tr-aspecto-tenso {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.tr-aspecto-neutro {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.tr-orbe-info {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.4);
}

.tr-transito-area {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 0.8rem;
    background: rgba(245, 158, 11, 0.06);
    border-radius: 8px;
    padding: 0.5rem 0.8rem;
}

.tr-transito-desc {
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.7;
    font-size: 0.95rem;
}

/* New consultation button */
.tr-btn-nueva {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border: 2px solid rgba(245, 158, 11, 0.3);
    border-radius: 50px;
    padding: 0.9rem 2rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--tr-transicion);
    font-family: inherit;
}

.tr-btn-nueva:hover {
    background: rgba(245, 158, 11, 0.15);
    border-color: var(--tr-ambar);
    transform: translateY(-2px);
}

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

.tr-app::before {
    content: '';
    position: absolute;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: radial-gradient(circle at 30% 40%, rgba(245, 158, 11, 0.06) 0%, transparent 50%),
                radial-gradient(circle at 70% 30%, rgba(6, 182, 212, 0.04) 0%, transparent 50%),
                radial-gradient(circle at 50% 80%, rgba(139, 92, 246, 0.03) 0%, transparent 50%);
    animation: trFondo 25s linear infinite;
    pointer-events: none;
    z-index: 0;
}

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

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

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

@media (max-width: 768px) {
    .tr-titulo-form { font-size: 1.6rem; }
    .tr-icono-oraculo { font-size: 3rem; }
    .tr-form-campos { grid-template-columns: 1fr 1fr 1fr; gap: 0.8rem; }
    .tr-resumen-grid { grid-template-columns: repeat(3, 1fr); gap: 0.6rem; }
}

@media (max-width: 480px) {
    .tr-form-contenido { padding: 1.5rem 0.5rem; }
    .tr-titulo-form { font-size: 1.4rem; }
    .tr-subtitulo-form { font-size: 0.85rem; }
    .tr-form-campos { grid-template-columns: 1fr; }
    .tr-resultado-contenido { padding: 1.5rem 0.5rem; }
    .tr-seccion { padding: 1.2rem; }
    .tr-btn-nueva { padding: 0.8rem 1.5rem; font-size: 0.9rem; }
    .tr-btn-calcular { padding: 0.8rem 1.8rem; font-size: 0.9rem; }
    .tr-resumen-grid { grid-template-columns: 1fr; }
    .tr-resumen-num { font-size: 1.5rem; }
}

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

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

@media (prefers-contrast: high) {
    .tr-seccion { border: 2px solid rgba(255, 255, 255, 0.4); }
    .tr-select { border: 2px solid rgba(255, 255, 255, 0.4); }
}

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