/* ============================================ */
/* EVITA ANIMATIONS – Chat Sim & Orbit Avatar   */
/* Prefix: ecsim- (Chat), eorbit- (Orbit)       */
/* ============================================ */

/* ============================================ */
/* KONZEPT 02: LIVE CHAT SIMULATION              */
/* ============================================ */
.evita-chat-sim {
    width: 300px;
    max-width: 100%;
    background: var(--card-bg, #0f0f0f);
    border: 1px solid var(--border-color, #222);
    border-radius: 2px;
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.4s ease, box-shadow 0.4s ease;
    position: relative;
}

.evita-chat-sim:hover {
    border-color: var(--accent-color, #c4a35a);
    box-shadow: 0 0 30px rgba(196,163,90,0.08);
}

/* ── Header ── */
.ecsim-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color, #222);
    background: rgba(255,255,255,0.01);
}

.ecsim-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 2px solid var(--accent-color, #c4a35a);
    object-fit: cover;
    flex-shrink: 0;
    box-shadow: 0 0 10px rgba(196,163,90,0.2);
    transition: box-shadow 0.4s ease;
}

.evita-chat-sim:hover .ecsim-avatar {
    box-shadow: 0 0 18px rgba(196,163,90,0.4);
}

.ecsim-avatar-fallback {
    display: none;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-color, #c4a35a), #8a7340);
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    border: 2px solid var(--accent-color, #c4a35a);
    flex-shrink: 0;
}

.ecsim-meta {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.ecsim-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-color, #e4e4e4);
    line-height: 1.2;
}

.ecsim-status {
    font-size: 10px;
    color: #4ade80;
    display: flex;
    align-items: center;
    gap: 5px;
    line-height: 1.2;
}

.ecsim-status-dot {
    width: 6px;
    height: 6px;
    background: #4ade80;
    border-radius: 50%;
    animation: ecsimPulse 2.5s ease-in-out infinite;
    flex-shrink: 0;
}

/* ── Chat Body ── */
.ecsim-body {
    padding: 14px 16px;
    min-height: 155px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 13px;
    line-height: 1.55;
    overflow: hidden;
}

/* ── Bubbles ── */
.ecsim-bubble {
    max-width: 88%;
    padding: 8px 12px;
    border-radius: 2px;
    opacity: 0;
    transform: translateY(6px);
}

.ecsim-bubble.is-visible {
    animation: ecsimBubbleIn 0.35s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.ecsim-bubble.evita {
    background: rgba(196,163,90,0.08);
    border-left: 2px solid var(--accent-color, #c4a35a);
    color: var(--text-color, #e4e4e4);
    align-self: flex-start;
}

.ecsim-bubble.user {
    background: rgba(255,255,255,0.04);
    border-right: 2px solid var(--text-color-subtle, #555);
    color: var(--text-color-muted, #949494);
    align-self: flex-end;
    text-align: right;
}

/* ── Typing Indicator ── */
.ecsim-typing {
    display: flex;
    gap: 4px;
    padding: 10px 12px;
    align-self: flex-start;
    opacity: 0;
    transform: translateY(4px);
}

.ecsim-typing.is-visible {
    animation: ecsimBubbleIn 0.25s ease forwards;
}

.ecsim-typing span {
    width: 5px;
    height: 5px;
    background: var(--accent-color, #c4a35a);
    border-radius: 50%;
    animation: ecsimDot 1.4s ease-in-out infinite;
}
.ecsim-typing span:nth-child(2) { animation-delay: 0.15s; }
.ecsim-typing span:nth-child(3) { animation-delay: 0.3s; }

/* ── Footer ── */
.ecsim-footer {
    padding: 10px 16px;
    border-top: 1px solid var(--border-color, #222);
    display: flex;
    align-items: center;
    gap: 8px;
}

.ecsim-input-fake {
    flex: 1;
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--border-color, #222);
    border-radius: 2px;
    padding: 7px 11px;
    font-size: 11px;
    color: var(--text-color-subtle, #555);
    font-family: 'DM Sans', sans-serif;
    transition: border-color 0.3s;
}

.evita-chat-sim:hover .ecsim-input-fake {
    border-color: rgba(196,163,90,0.3);
}

.ecsim-send-fake {
    width: 30px;
    height: 30px;
    background: var(--accent-color, #c4a35a);
    border: none;
    border-radius: 2px;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
    flex-shrink: 0;
}

.ecsim-send-fake:hover {
    background: #d39a00;
}

/* ── CTA Overlay ── */
.ecsim-cta-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(10,10,10,0.85);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    z-index: 2;
}

.evita-chat-sim:hover .ecsim-cta-overlay {
    opacity: 1;
}

.ecsim-cta-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent-color, #c4a35a);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ecsim-cta-label svg {
    width: 16px;
    height: 16px;
    animation: ecsimArrowPulse 1.5s ease-in-out infinite;
}

/* ── Chat Sim Keyframes ── */
@keyframes ecsimBubbleIn {
    to { opacity: 1; transform: translateY(0); }
}

@keyframes ecsimDot {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.35; }
    30% { transform: translateY(-5px); opacity: 1; }
}

@keyframes ecsimPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.35; }
}

@keyframes ecsimArrowPulse {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(3px); }
}

@keyframes ecsimFadeOut {
    to { opacity: 0; transform: translateY(-4px); }
}

/* ── Accessibility: Focus ── */
.evita-chat-sim:focus-visible {
    outline: 2px solid var(--accent-color, #c4a35a);
    outline-offset: 3px;
}

/* ── Fix: summary-image braucht Breite auf Mobile ── */
.summary-image:has(.evita-chat-sim) {
    width: 100%;
    display: block;
}

@media (min-width: 992px) {
    .summary-image:has(.evita-chat-sim) {
        display: flex;
        justify-content: flex-end;
    }
}


/* ============================================ */
/* KONZEPT 03: ORBIT AVATAR                      */
/* ============================================ */

/* ── Intro Zwei-Spalten Layout ── */
.evita-intro-split {
    display: flex;
    align-items: center;
    gap: 3rem;
    margin: 2rem 0;
}

.evita-intro-text {
    flex: 1 1 60%;
    min-width: 0;
}

.evita-intro-text p {
    margin: 0;
}

.evita-intro-orbit {
    flex: 0 0 300px;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* ── Orbit Container ── */
.eorbit-container {
    width: 300px;
    height: 300px;
    position: relative;
    cursor: pointer;
}

/* ── Zentraler Avatar ── */
.eorbit-core {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90px;
    height: 90px;
    border-radius: 50%;
    z-index: 3;
    animation: eorbitCorePulse 3.5s ease-in-out infinite;
    /* Glow hinter dem Bild */
    box-shadow: 0 0 25px rgba(196,163,90,0.25);
}

.eorbit-core-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--accent-color, #c4a35a);
    display: block;
}

/* ── Orbit-Ringe ── */
.eorbit-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    border: 1px solid;
    border-radius: 50%;
}

.eorbit-ring-1 {
    width: 150px;
    height: 150px;
    margin: -75px 0 0 -75px;
    border-color: rgba(196,163,90,0.22);
    animation: eorbitSpin 14s linear infinite;
}

.eorbit-ring-2 {
    width: 210px;
    height: 210px;
    margin: -105px 0 0 -105px;
    border-color: rgba(196,163,90,0.13);
    animation: eorbitSpin 22s linear infinite reverse;
}

.eorbit-ring-3 {
    width: 280px;
    height: 280px;
    margin: -140px 0 0 -140px;
    border-color: rgba(196,163,90,0.07);
    animation: eorbitSpin 32s linear infinite;
}

/* ── Knoten auf den Ringen ── */
.eorbit-node {
    position: absolute;
    width: 8px;
    height: 8px;
    background: var(--accent-color, #c4a35a);
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(196,163,90,0.4);
    top: -4px;
    left: calc(50% - 4px);
}

.eorbit-ring-2 .eorbit-node {
    top: auto;
    bottom: -4px;
}

.eorbit-ring-3 .eorbit-node {
    top: 50%;
    left: -4px;
    margin-top: -4px;
}

/* ── Feature-Labels ── */
.eorbit-label {
    position: absolute;
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.1em;
    color: var(--text-color-muted, #949494);
    white-space: nowrap;
    text-transform: uppercase;
    opacity: 0;
    transition: opacity 0.5s ease, transform 0.5s ease;
    transform: translateY(3px);
    pointer-events: none;
}

.eorbit-container:hover .eorbit-label {
    opacity: 1;
    transform: translateY(0);
}

/* Label-Positionen */
.eorbit-label[data-feature="rag"]     { top: 6%;  right: 10%; }
.eorbit-label[data-feature="memory"]  { bottom: 10%; left: 6%; }
.eorbit-label[data-feature="email"]   { top: 50%; right: -4px; transform: translateY(-50%); }
.eorbit-label[data-feature="gemini"]  { top: 6%;  left: 15%; }
.eorbit-label[data-feature="tools"]   { bottom: 6%; right: 12%; }
.eorbit-label[data-feature="news"]    { bottom: 30%; left: 2%; }

.eorbit-container:hover .eorbit-label[data-feature="email"] {
    transform: translateY(-50%);
}

/* ── CTA unter dem Orbit ── */
.eorbit-cta {
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.68rem;
    color: var(--accent-color, #c4a35a);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    white-space: nowrap;
    opacity: 0;
    animation: eorbitFadeInUp 1s 1.5s forwards;
}

/* ── Hover: Beschleunigung + Glow ── */
.eorbit-container:hover .eorbit-core {
    animation: eorbitCorePulseHover 1.5s ease-in-out infinite;
    box-shadow: 0 0 40px rgba(196,163,90,0.4);
}

.eorbit-container:hover .eorbit-ring-1 { animation-duration: 6s; }
.eorbit-container:hover .eorbit-ring-2 { animation-duration: 10s; }
.eorbit-container:hover .eorbit-ring-3 { animation-duration: 15s; }

.eorbit-container:hover .eorbit-node {
    box-shadow: 0 0 14px rgba(196,163,90,0.6);
}

/* ── Orbit Keyframes ── */
@keyframes eorbitSpin {
    to { transform: rotate(360deg); }
}

@keyframes eorbitCorePulse {
    0%, 100% { transform: translate(-50%,-50%) scale(1);    box-shadow: 0 0 25px rgba(196,163,90,0.2); }
    50%      { transform: translate(-50%,-50%) scale(1.06);  box-shadow: 0 0 35px rgba(196,163,90,0.35); }
}

@keyframes eorbitCorePulseHover {
    0%, 100% { transform: translate(-50%,-50%) scale(1.04); }
    50%      { transform: translate(-50%,-50%) scale(1.12); }
}

@keyframes eorbitFadeInUp {
    from { opacity: 0; transform: translateX(-50%) translateY(8px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ── Focus ── */
.eorbit-container:focus-visible {
    outline: 2px solid var(--accent-color, #c4a35a);
    outline-offset: 4px;
    border-radius: 50%;
}


/* ============================================ */
/* LIGHT MODE                                    */
/* ============================================ */
body.light-mode .evita-chat-sim {
    background: var(--surface-light, #f7f9fb);
    border-color: #e0e0e0;
}

body.light-mode .evita-chat-sim:hover {
    border-color: var(--accent-color, #c4a35a);
    box-shadow: 0 0 25px rgba(196,163,90,0.1);
}

body.light-mode .ecsim-header {
    border-bottom-color: #e0e0e0;
}

body.light-mode .ecsim-bubble.evita {
    background: rgba(196,163,90,0.1);
    color: #333;
}

body.light-mode .ecsim-bubble.user {
    background: rgba(0,0,0,0.04);
    color: #666;
}

body.light-mode .ecsim-footer {
    border-top-color: #e0e0e0;
}

body.light-mode .ecsim-input-fake {
    border-color: #e0e0e0;
    color: #999;
    background: rgba(0,0,0,0.02);
}

body.light-mode .ecsim-cta-overlay {
    background: rgba(255,255,255,0.88);
}

body.light-mode .eorbit-ring-1 { border-color: rgba(196,163,90,0.3); }
body.light-mode .eorbit-ring-2 { border-color: rgba(196,163,90,0.18); }
body.light-mode .eorbit-ring-3 { border-color: rgba(196,163,90,0.1); }

body.light-mode .eorbit-label {
    color: #777;
}


/* ── Evita-VS: Mobile Label Override ── */
@media (max-width: 991px) {
    .evita-vs td:first-child::before {
        content: "Chatbot: " !important;
        color: #ff6b6b !important;
    }

    .evita-vs td:last-child::before {
        content: "Evita: " !important;
        color: #51cf66 !important;
    }
}


/* ============================================ */
/* RESPONSIVE                                    */
/* ============================================ */
@media (max-width: 991px) {
    .evita-intro-split {
        flex-direction: column;
        gap: 2rem;
        text-align: center;
    }

    .evita-intro-orbit {
        flex: 0 0 auto;
        order: -1; /* Orbit oben auf Mobile */
    }

    .eorbit-container {
        width: 250px;
        height: 250px;
    }

    .eorbit-core {
        width: 75px;
        height: 75px;
    }

    .eorbit-ring-1 { width: 125px; height: 125px; margin: -62.5px 0 0 -62.5px; }
    .eorbit-ring-2 { width: 175px; height: 175px; margin: -87.5px 0 0 -87.5px; }
    .eorbit-ring-3 { width: 235px; height: 235px; margin: -117.5px 0 0 -117.5px; }

    /* Labels bei Hover trotzdem sichtbar — auf Touch immer zeigen */
    .eorbit-label {
        opacity: 0.7;
        transform: translateY(0);
        font-size: 8px;
    }
    .eorbit-label[data-feature="email"] {
        transform: translateY(-50%);
    }
}

@media (max-width: 480px) {
    .evita-chat-sim {
        width: 100%;
    }

    .eorbit-container {
        width: 220px;
        height: 220px;
    }

    .eorbit-core {
        width: 65px;
        height: 65px;
    }

    .eorbit-ring-1 { width: 110px; height: 110px; margin: -55px 0 0 -55px; }
    .eorbit-ring-2 { width: 155px; height: 155px; margin: -77.5px 0 0 -77.5px; }
    .eorbit-ring-3 { width: 205px; height: 205px; margin: -102.5px 0 0 -102.5px; }
}
