/**
 * Vitality Gym Boxing Reflex - Coach Animation Styles
 * 101.html alapú design rendszer
 * Sötét gradient háttér, arany kiemelések
 */

/* === COACH CONTAINER === */
.coach-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-top: 50px;
    margin-bottom: 32px;
    margin-left: auto;
    margin-right: auto;
    max-width: 600px;
}

/* === COACH KÉP === */
.coach-image {
    width: 300px;
    height: 300px;
    border-radius: 50%;
    overflow: hidden;
    position: relative;
    /* Arany keret mint a 101.html-ben */
    border: 4px solid var(--vg-gold, #FFD700);
    box-shadow: 0 8px 24px rgba(255, 215, 0, 0.3),
                0 4px 12px rgba(0, 0, 0, 0.4);
    /* Sötét gradient háttér */
    background: linear-gradient(145deg, #2c313a, #1a1e25);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Logo a kör középpontjában */
.coach-image::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    height: 80%;
    background-image: url('/logoapp.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 1;
}

.coach-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: relative;
    z-index: 1;
}

/* === COACH KÉP PULZÁLÓ ANIMÁCIÓ - BESZÉD-SZERŰ DINAMIKUS PULZÁLÁS === */
/* Gyors, változatos ritmus ami imitálja a beszédet (mint egy hangsáv vizualizáció) */
/* 1.25s ciklus, változó ismétlésszámmal (hang hossza alapján) */
.coach-image.pulse-animation {
    animation: speechPulse 1.25s cubic-bezier(0.4, 0.0, 0.2, 1);
    animation-iteration-count: var(--pulse-iterations, 3);
    animation-fill-mode: forwards;
}

@keyframes speechPulse {
    0% {
        transform: scale(1);
        filter: brightness(1);
        box-shadow: 0 8px 24px rgba(255, 215, 0, 0.3),
                    0 4px 12px rgba(0, 0, 0, 0.4);
    }
    8% {
        transform: scale(1.06);
        filter: brightness(1.05);
        box-shadow: 0 10px 28px rgba(255, 215, 0, 0.4),
                    0 5px 14px rgba(0, 0, 0, 0.45);
    }
    18% {
        transform: scale(1.02);
        filter: brightness(1.02);
        box-shadow: 0 8px 24px rgba(255, 215, 0, 0.32),
                    0 4px 12px rgba(0, 0, 0, 0.42);
    }
    25% {
        transform: scale(1.11);
        filter: brightness(1.08);
        box-shadow: 0 14px 34px rgba(255, 215, 0, 0.55),
                    0 7px 17px rgba(0, 0, 0, 0.52);
    }
    35% {
        transform: scale(1.04);
        filter: brightness(1.03);
        box-shadow: 0 9px 26px rgba(255, 215, 0, 0.35),
                    0 4px 13px rgba(0, 0, 0, 0.43);
    }
    48% {
        transform: scale(1.14);
        filter: brightness(1.1);
        box-shadow: 0 16px 38px rgba(255, 215, 0, 0.6),
                    0 8px 19px rgba(0, 0, 0, 0.55);
    }
    58% {
        transform: scale(1.03);
        filter: brightness(1.02);
        box-shadow: 0 8px 25px rgba(255, 215, 0, 0.33),
                    0 4px 12px rgba(0, 0, 0, 0.42);
    }
    68% {
        transform: scale(1.09);
        filter: brightness(1.06);
        box-shadow: 0 12px 30px rgba(255, 215, 0, 0.48),
                    0 6px 15px rgba(0, 0, 0, 0.48);
    }
    78% {
        transform: scale(1.05);
        filter: brightness(1.04);
        box-shadow: 0 10px 27px rgba(255, 215, 0, 0.38),
                    0 5px 13px rgba(0, 0, 0, 0.44);
    }
    88% {
        transform: scale(1.12);
        filter: brightness(1.09);
        box-shadow: 0 14px 36px rgba(255, 215, 0, 0.58),
                    0 7px 18px rgba(0, 0, 0, 0.53);
    }
    95% {
        transform: scale(1.02);
        filter: brightness(1.01);
        box-shadow: 0 8px 24px rgba(255, 215, 0, 0.31),
                    0 4px 12px rgba(0, 0, 0, 0.41);
    }
    100% {
        transform: scale(1);
        filter: brightness(1);
        box-shadow: 0 8px 24px rgba(255, 215, 0, 0.3),
                    0 4px 12px rgba(0, 0, 0, 0.4);
    }
}

/* === SZÖVEGBUBORÉK (101.html panel stílusban) === */
.speech-bubble {
    position: relative;
    /* Sötét gradient háttér mint a 101.html paneljei */
    background: linear-gradient(145deg, #2c313a, #1a1e25);
    border: 1px solid rgba(0, 0, 0, 0.3);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4),
                inset 0 0 4px rgba(0, 0, 0, 0.3);
    color: var(--vg-white, #f8f9fa);
    padding: 20px 24px;
    border-radius: 16px;
    margin-top: 32px;
    max-width: 500px;
    opacity: 0;
}

/* Buborék csúcsa (felfelé mutató háromszög) */
.speech-bubble::before {
    content: '';
    position: absolute;
    top: -16px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 16px solid transparent;
    border-right: 16px solid transparent;
    border-bottom: 16px solid #2c313a;
}

.speech-bubble p {
    margin: 0;
    font-size: 1.4rem;
    line-height: 1.6;
    font-weight: 500;
    color: var(--vg-white, #f8f9fa);
}

/* === SZÖVEGBUBORÉK FADE-IN ANIMÁCIÓ === */
.speech-bubble.fade-in-bubble {
    animation: bubbleFadeIn 0.6s ease-out forwards;
}

@keyframes bubbleFadeIn {
    0% {
        opacity: 0;
        transform: translateY(-10px) scale(0.95);
    }
    60% {
        opacity: 1;
        transform: translateY(0) scale(1.02);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* === KOMBINÁLT ANIMÁCIÓ === */
/* Coach megjelenik és szövegbuborék követi */
.coach-intro {
    animation: coachIntro 1s ease-out;
}

@keyframes coachIntro {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.9);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* === COACH + BUBORÉK LAYOUT VARIÁCIÓK === */

/* Bal oldali coach */
.coach-layout-left {
    flex-direction: row;
    align-items: flex-start;
    text-align: left;
}

.coach-layout-left .speech-bubble {
    margin-top: 0;
    margin-left: 24px;
}

.coach-layout-left .speech-bubble::before {
    top: 50%;
    left: -16px;
    transform: translateY(-50%) rotate(-90deg);
}

/* Jobb oldali coach */
.coach-layout-right {
    flex-direction: row-reverse;
    align-items: flex-start;
    text-align: right;
}

.coach-layout-right .speech-bubble {
    margin-top: 0;
    margin-right: 24px;
}

.coach-layout-right .speech-bubble::before {
    top: 50%;
    right: -16px;
    left: auto;
    transform: translateY(-50%) rotate(90deg);
}

/* === ARANY TÉMÁJÚ BUBORÉK (101.html gold alapján) === */
.speech-bubble.bubble-gold {
    background: linear-gradient(145deg, #FFDF8D, #FFD700);
    color: var(--vg-bg-grey, #202734);
    border: 2px solid var(--vg-dark-gold, #B8860B);
    box-shadow: 0 4px 16px rgba(255, 215, 0, 0.4),
                inset 0 0 4px rgba(255, 255, 255, 0.2);
}

.speech-bubble.bubble-gold::before {
    border-bottom-color: #FFDF8D;
}

.speech-bubble.bubble-gold p {
    color: var(--vg-bg-grey, #202734);
}

/* === KÉK TÉMÁJÚ BUBORÉK === */
.speech-bubble.bubble-blue {
    background: linear-gradient(145deg, #2086ff, #0065d1);
    color: var(--vg-white, #f8f9fa);
    border: 1px solid rgba(0, 0, 0, 0.3);
}

.speech-bubble.bubble-blue::before {
    border-bottom-color: #2086ff;
}

/* === TYPING ANIMÁCIÓ === */
.typing-indicator {
    display: inline-flex;
    gap: 4px;
    align-items: center;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background-color: var(--vg-grey, #6c757d);
    border-radius: 50%;
    animation: typingDot 1.4s infinite;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingDot {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.4;
    }
    30% {
        transform: translateY(-8px);
        opacity: 1;
    }
}

/* === COACH AVATAR VARIÁCIÓK === */

/* Kis méret (mobil) */
.coach-image-sm {
    width: 200px;
    height: 200px;
}

.coach-image-sm::before {
    width: 80%;
    height: 80%;
}

/* Nagy méret (desktop) */
.coach-image-lg {
    width: 400px;
    height: 400px;
}

.coach-image-lg::before {
    width: 80%;
    height: 80%;
}

/* === SIKER/HIBA ANIMÁCIÓK (101.html alapján) === */

/* Siker fény hatás - arany */
.coach-success {
    animation: successGlow 1s ease-out;
}

@keyframes successGlow {
    0%, 100% {
        box-shadow: 0 8px 24px rgba(255, 215, 0, 0.3),
                    0 4px 12px rgba(0, 0, 0, 0.4);
    }
    50% {
        box-shadow: 0 0 40px rgba(255, 215, 0, 0.8),
                    0 0 60px rgba(255, 215, 0, 0.4);
    }
}

/* Hiba rázkódás */
.coach-error {
    animation: errorShake 0.5s ease-out;
}

@keyframes errorShake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-8px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(8px);
    }
}

/* === RESZPONZÍV DESIGN === */

/* Tablet */
@media (max-width: 768px) {
    .coach-image {
        width: 250px;
        height: 250px;
    }

    .coach-image::before {
        width: 80%;
        height: 80%;
    }

    .speech-bubble {
        max-width: 400px;
        padding: 16px 20px;
        font-size: 1rem;
    }

    /* Tablet esetén mindig középre rendezett */
    .coach-layout-left,
    .coach-layout-right {
        flex-direction: column;
        align-items: center;
    }

    .coach-layout-left .speech-bubble,
    .coach-layout-right .speech-bubble {
        margin: 24px 0 0 0;
    }

    .coach-layout-left .speech-bubble::before,
    .coach-layout-right .speech-bubble::before {
        top: -16px;
        left: 50%;
        right: auto;
        transform: translateX(-50%) rotate(0deg);
    }
}

/* Mobile */
@media (max-width: 480px) {
    .coach-container {
        margin-top: 50px;
        margin-bottom: 24px;
        margin-left: auto;
        margin-right: auto;
    }

    .coach-image {
        width: 200px;
        height: 200px;
        border-width: 3px;
    }

    .coach-image::before {
        width: 80%;
        height: 80%;
    }

    .speech-bubble {
        max-width: 100%;
        padding: 14px 18px;
        font-size: 0.875rem;
        margin-top: 24px;
    }

    .speech-bubble::before {
        border-left-width: 12px;
        border-right-width: 12px;
        border-bottom-width: 12px;
        top: -12px;
    }

    .speech-bubble p {
        font-size: 1rem;
    }
}

/* === CUSTOM OSZTÁLYOK === */

/* Szövegbuborék elrejtése (csak coach) */
.hide-bubble .speech-bubble {
    display: none;
}

/* Coach elrejtése (csak buborék) */
.hide-coach .coach-image {
    display: none;
}

/* Középre igazítás */
.coach-center {
    text-align: center;
}

/* === ARANY FÉNY EFFEKT (101.html alapján) === */
.glow-gold {
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.6),
                0 0 40px rgba(255, 215, 0, 0.4),
                0 0 60px rgba(255, 215, 0, 0.2);
}

/* Folyamatos pulzáló arany fény */
.glow-pulse {
    animation: glowPulse 2s ease-in-out infinite;
}

@keyframes glowPulse {
    0%, 100% {
        box-shadow: 0 8px 24px rgba(255, 215, 0, 0.3),
                    0 4px 12px rgba(0, 0, 0, 0.4);
    }
    50% {
        box-shadow: 0 0 30px rgba(255, 215, 0, 0.8),
                    0 0 50px rgba(255, 215, 0, 0.5);
    }
}

/* === KÉK FÉNY EFFEKT === */
.glow-blue {
    box-shadow: 0 0 20px rgba(0, 123, 255, 0.6),
                0 0 40px rgba(0, 123, 255, 0.4),
                0 0 60px rgba(0, 123, 255, 0.2);
}

/* === PIROS FÉNY EFFEKT === */
.glow-red {
    box-shadow: 0 0 20px rgba(220, 53, 69, 0.6),
                0 0 40px rgba(220, 53, 69, 0.4),
                0 0 60px rgba(220, 53, 69, 0.2);
}
