/* ==========================================================================
   GX ARANHA — SISTEMA DE APRESENTAÇÃO E TREINAMENTO INTERATIVO (MÊS 1)
   Módulo Isolado de Onboarding & Guias Visuais Dinâmicos
   ========================================================================== */

/* CONTAINER GLOBAL DE TREINAMENTO */
.training-layer {
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.35s;
}

.training-layer.active {
    opacity: 1;
    visibility: visible;
    pointer-events: none;
}

/* OVERLAY ESCURECIDO LIMPO (SEM BLUR, LEVEMENTE ESCURO) */
.training-backdrop {
    position: absolute;
    inset: 0;
    background: transparent;
    pointer-events: none;
    transition: all 0.3s ease;
}

/* CAIXA DE DESTAQUE / RETÍCULO PULSANTE AO REDOR DO ALVO COM RECORTE NÍTIDO */
.training-spotlight-box {
    position: absolute;
    border-radius: 12px;
    border: 2px solid #ff3333;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.48),
                0 0 20px rgba(255, 51, 51, 0.6),
                inset 0 0 10px rgba(255, 51, 51, 0.15);
    pointer-events: none;
    transition: left 0.15s ease-out, top 0.15s ease-out, width 0.15s ease-out, height 0.15s ease-out;
    z-index: 10000;
    animation: spotlightPulse 2.2s infinite ease-in-out;
}

@keyframes spotlightPulse {
    0%, 100% {
        border-color: #ff3333;
        box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.48),
                    0 0 18px rgba(255, 51, 51, 0.5),
                    inset 0 0 8px rgba(255, 51, 51, 0.15);
    }
    50% {
        border-color: #ff6666;
        box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.48),
                    0 0 28px rgba(255, 51, 51, 0.8),
                    inset 0 0 16px rgba(255, 51, 51, 0.3);
    }
}

/* CANTOS TECNOLÓGICOS / RETÍCULOS CYBER NO SPOTLIGHT */
.training-spotlight-box::before,
.training-spotlight-box::after {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    border-color: #ffd700;
    border-style: solid;
    pointer-events: none;
}
.training-spotlight-box::before {
    top: -4px;
    left: -4px;
    border-width: 3px 0 0 3px;
    border-radius: 4px 0 0 0;
}
.training-spotlight-box::after {
    bottom: -4px;
    right: -4px;
    border-width: 0 3px 3px 0;
    border-radius: 0 0 4px 0;
}

/* ELEMENTO TEMPORARIAMENTE ELEVADO PARA CLIQUE INTERATIVO */
.training-target-elevated {
    position: relative !important;
    z-index: 10001 !important;
    pointer-events: auto !important;
    cursor: pointer !important;
}

/* ==========================================================================
   SETA ANIMADA DIRECIONAL TECNOLÓGICA (SPIDER TECH POINTER)
   ========================================================================== */
.training-arrow-wrap {
    position: absolute;
    z-index: 10002;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.training-arrow-svg {
    width: 54px;
    height: 54px;
    filter: drop-shadow(0 0 12px rgba(255, 51, 51, 0.9)) drop-shadow(0 0 25px rgba(255, 215, 0, 0.6));
}

/* Animações direcionais de Bounce / Pointer */
.training-arrow-wrap.arrow-down {
    animation: arrowBounceDown 1.4s infinite cubic-bezier(0.45, 0, 0.55, 1);
}
.training-arrow-wrap.arrow-up {
    animation: arrowBounceUp 1.4s infinite cubic-bezier(0.45, 0, 0.55, 1);
}
.training-arrow-wrap.arrow-left {
    animation: arrowBounceLeft 1.4s infinite cubic-bezier(0.45, 0, 0.55, 1);
}
.training-arrow-wrap.arrow-right {
    animation: arrowBounceRight 1.4s infinite cubic-bezier(0.45, 0, 0.55, 1);
}

@keyframes arrowBounceDown {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-14px) scale(1.1); }
}

@keyframes arrowBounceUp {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(14px) scale(1.1); }
}

@keyframes arrowBounceLeft {
    0%, 100% { transform: translateX(0) scale(1); }
    50% { transform: translateX(14px) scale(1.1); }
}

@keyframes arrowBounceRight {
    0%, 100% { transform: translateX(0) scale(1); }
    50% { transform: translateX(-14px) scale(1.1); }
}

/* ==========================================================================
   CARD DE DIÁLOGO / INSTRUÇÃO DIDÁTICA DO TREINADOR
   ========================================================================== */
.training-card-wrap {
    position: absolute;
    z-index: 10003;
    width: 440px;
    max-width: calc(100vw - 32px);
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: auto;
}

.training-card {
    background: #111118;
    border: 1px solid rgba(255, 51, 51, 0.45);
    border-radius: 16px;
    padding: 22px 24px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.9),
                0 0 30px rgba(255, 51, 51, 0.25),
                inset 0 1px 0 rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
    animation: cardEntrance 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes cardEntrance {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.training-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #ff3333, #ffd700, #22c55e);
}

/* HEADER DO CARD */
.training-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.training-card-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 51, 51, 0.15);
    border: 1px solid rgba(255, 51, 51, 0.35);
    padding: 4px 10px;
    border-radius: 20px;
}

.training-badge-icon {
    width: 16px;
    height: 16px;
    object-fit: contain;
    animation: spiderSpin 8s infinite linear;
}

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

.training-badge-text {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1px;
    color: #ff6666;
    text-transform: uppercase;
}

.training-step-indicator {
    font-size: 11px;
    font-weight: 700;
    color: #ffd700;
    background: rgba(255, 215, 0, 0.12);
    border: 1px solid rgba(255, 215, 0, 0.25);
    padding: 3px 9px;
    border-radius: 12px;
}

.training-btn-close {
    background: transparent;
    border: none;
    color: #888;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s;
    margin-left: 6px;
}
.training-btn-close:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

/* CONTEÚDO DO CARD */
.training-card-body h3 {
    font-size: 18px;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 8px;
    line-height: 1.25;
    letter-spacing: 0.3px;
}

.training-card-body p {
    font-size: 13.5px;
    line-height: 1.55;
    color: #d1d5db;
    margin-bottom: 16px;
}

.training-card-body p strong {
    color: #ffd700;
    font-weight: 700;
}

.training-action-hint {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(34, 197, 94, 0.12);
    border: 1px dashed rgba(34, 197, 94, 0.4);
    padding: 10px 14px;
    border-radius: 10px;
    margin-bottom: 16px;
    color: #4ade80;
    font-size: 12.5px;
    font-weight: 600;
    animation: hintPulse 2s infinite ease-in-out;
}

@keyframes hintPulse {
    0%, 100% { background: rgba(34, 197, 94, 0.12); border-color: rgba(34, 197, 94, 0.4); }
    50% { background: rgba(34, 197, 94, 0.22); border-color: rgba(34, 197, 94, 0.7); }
}

.training-action-hint svg {
    flex-shrink: 0;
}

/* PROGRESS BAR */
.training-progress-track {
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    margin-bottom: 16px;
    overflow: hidden;
}

.training-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff3333, #ffd700);
    border-radius: 2px;
    transition: width 0.3s ease;
}

/* FOOTER DO CARD */
.training-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.training-btn-skip {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #9ca3af;
    font-size: 12px;
    font-weight: 600;
    padding: 8px 14px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}
.training-btn-skip:hover {
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.05);
}

.training-actions-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.training-btn-prev {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #e5e7eb;
    font-size: 12px;
    font-weight: 600;
    padding: 8px 14px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}
.training-btn-prev:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}
.training-btn-prev:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.training-btn-next {
    background: linear-gradient(135deg, #ff3333, #dc2626);
    border: 1px solid #ff6666;
    color: #ffffff;
    font-size: 12.5px;
    font-weight: 700;
    padding: 8px 18px;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 4px 12px rgba(255, 51, 51, 0.4);
    transition: all 0.2s;
}
.training-btn-next:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(255, 51, 51, 0.6);
    filter: brightness(1.1);
}

/* ==========================================================================
   COMPONENTE DE TOGGLE MODERNO (LOBBY & SALA DE ESPERA)
   ========================================================================== */
.training-toggle-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 51, 51, 0.25);
    border-radius: 12px;
    padding: 12px 14px;
    margin-top: 12px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    transition: all 0.25s ease;
    cursor: pointer;
}

.training-toggle-card:hover {
    background: rgba(255, 51, 51, 0.08);
    border-color: rgba(255, 51, 51, 0.5);
    box-shadow: 0 4px 15px rgba(255, 51, 51, 0.15);
}

.training-toggle-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.training-toggle-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(255, 51, 51, 0.15);
    border: 1px solid rgba(255, 51, 51, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ff6666;
    flex-shrink: 0;
}

.training-toggle-texts {
    display: flex;
    flex-direction: column;
}

.training-toggle-title {
    font-size: 12.5px;
    font-weight: 700;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 6px;
}

.training-toggle-tag {
    font-size: 9px;
    font-weight: 800;
    color: #22c55e;
    background: rgba(34, 197, 94, 0.15);
    border: 1px solid rgba(34, 197, 94, 0.3);
    padding: 1px 5px;
    border-radius: 4px;
}

.training-toggle-sub {
    font-size: 11px;
    color: #9ca3af;
    line-height: 1.3;
}

/* SWITCH SLIDER TECH */
.tech-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.tech-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.tech-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: #2b2b36;
    border: 1px solid #4b5563;
    transition: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    border-radius: 24px;
}

.tech-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: #9ca3af;
    transition: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

.tech-switch input:checked + .tech-slider {
    background-color: #22c55e;
    border-color: #4ade80;
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.5);
}

.tech-switch input:checked + .tech-slider:before {
    transform: translateX(20px);
    background-color: #ffffff;
}

/* BOTÃO DE AJUDA / REABRIR TREINAMENTO NO HUD */
.hud-btn-training {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 8px;
    height: 28px;
    gap: 4px;
    font-size: 11px;
    font-weight: 700;
    transition: all 0.2s ease;
}

.hud-btn-training:hover {
    background: rgba(255, 51, 51, 0.2);
    border-color: #ff3333;
    color: #ff6666;
    box-shadow: 0 0 10px rgba(255, 51, 51, 0.4);
}

/* RESPONSIVIDADE DO MODAL DE TREINAMENTO */
@media (max-width: 600px) {
    .training-card-wrap {
        width: calc(100vw - 20px);
        left: 10px !important;
        right: 10px !important;
        margin: 0 auto;
    }
    .training-card {
        padding: 16px 18px;
    }
    .training-card-body h3 {
        font-size: 16px;
    }
    .training-card-body p {
        font-size: 12.5px;
    }
}
