/* Mika Chat Widget Styles */

.mika-chat-widget {
    position: fixed;
    bottom: var(--mika-margin, 50px);
    right: var(--mika-margin, 50px);
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Schwebender Button */
.mika-chat-button {
    width: var(--mika-button-size, 90px);
    height: var(--mika-button-size, 90px);
    border-radius: 50%;
    background-color: #2196F3; /* Fallback, wird durch inline-style oder .animated überschrieben */
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 10000;
    overflow: hidden;
}

/* Animierter Button mit Gradient */
.mika-chat-button.animated {
    background: radial-gradient(circle at center, var(--mika-color1, #FF0080) 0%, var(--mika-color2, #93278F) 50%, var(--mika-color1, #FF0080) 100%) !important;
    background-size: 200% 200% !important;
    animation: mika-breathing-pulse 6s ease-in-out infinite;
    background-color: transparent !important; /* Überschreibe background-color */
}

.mika-chat-button.animated::before {
    content: '';
    position: absolute;
    top: -6px;
    left: -6px;
    right: -6px;
    bottom: -6px;
    background: radial-gradient(circle at center, var(--mika-color1, #FF0080) 0%, var(--mika-color2, #93278F) 60%, transparent 100%);
    background-size: 200% 200%;
    animation: mika-breathing-pulse 6s ease-in-out infinite 1s;
    border-radius: 50%;
    z-index: -1;
    opacity: 0.5;
    pointer-events: none;
}

.mika-chat-button.animated::after {
    content: '';
    position: absolute;
    top: -12px;
    left: -12px;
    right: -12px;
    bottom: -12px;
    background: radial-gradient(circle at center, var(--mika-color1, #FF0080) 0%, var(--mika-color2, #93278F) 40%, transparent 80%);
    background-size: 200% 200%;
    animation: mika-breathing-pulse 6s ease-in-out infinite 2s;
    border-radius: 50%;
    z-index: -2;
    opacity: 0.2;
    pointer-events: none;
}

@keyframes mika-breathing-pulse {
    0% {
        background-position: 50% 50%;
        transform: scale(1);
    }
    20% {
        background-position: 40% 40%;
        transform: scale(1.03);
    }
    40% {
        background-position: 60% 60%;
        transform: scale(1.08);
    }
    60% {
        background-position: 40% 60%;
        transform: scale(1.05);
    }
    80% {
        background-position: 60% 40%;
        transform: scale(1.02);
    }
    100% {
        background-position: 50% 50%;
        transform: scale(1);
    }
}

.mika-chat-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.mika-chat-button:active {
    transform: scale(0.95);
}

/* Chat Container */
.mika-chat-container {
    position: fixed;
    bottom: 0;
    right: 0;
    /* width, height und border-radius werden über inline styles gesetzt */
    background: white;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 9998;
    border: 1px solid #e0e0e0;
}

.mika-chat-container.active {
    display: flex;
}



/* Chat Header */
.mika-chat-header {
    background: #f8f9fa;
    padding: 16px 20px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.mika-chat-title {
    font-weight: 600;
    font-size: 16px;
    color: #333;
    margin: 0;
}

.mika-chat-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    color: #666;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mika-chat-close:hover {
    background: #e0e0e0;
    color: #333;
}

/* iFrame Container */
.mika-chat-iframe-container {
    flex: 1;
    overflow: hidden;
    position: relative;
}

.mika-chat-iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: white;
}

/* Responsive Design */
@media (max-width: 768px) {
    .mika-chat-widget {
        bottom: calc(var(--mika-margin, 30px) * 0.7);
        right: calc(var(--mika-margin, 30px) * 0.7);
    }
    
    .mika-chat-button {
        width: calc(var(--mika-button-size, 75px) * 0.9);
        height: calc(var(--mika-button-size, 75px) * 0.9);
    }
    
    .mika-dot {
        width: 6px;
        height: 6px;
    }
    
    .mika-chat-container {
        width: 100% !important;
        height: 100vh !important;
        border-radius: 0 !important;
        right: 0;
        bottom: 0;
        top: 0;
        left: 0;
    }
    
    .mika-chat-header {
        padding: 12px 16px;
    }
    
    .mika-chat-title {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .mika-chat-widget {
        bottom: calc(var(--mika-margin, 30px) * 0.5);
        right: calc(var(--mika-margin, 30px) * 0.5);
    }
    
    .mika-chat-button {
        width: calc(var(--mika-button-size, 75px) * 0.8);
        height: calc(var(--mika-button-size, 75px) * 0.8);
    }
    
    .mika-chat-button svg {
        width: 20px;
        height: 20px;
    }
    
    .mika-dot {
        width: 6px;
        height: 6px;
    }
    
    .mika-chat-container {
        width: 100% !important;
        height: 100vh !important;
        border-radius: 0 !important;
        right: 0;
        bottom: 0;
        top: 0;
        left: 0;
    }
}

/* Animation für das Öffnen/Schließen */
.mika-chat-container {
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.mika-chat-container.active {
    transform: translateY(0);
}

/* Hover-Effekt für den Button */
.mika-chat-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.mika-chat-button:hover::before {
    opacity: 1;
}

/* Typing Dots Animation */
.mika-typing-dots {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 100%;
    height: 100%;
    position: relative;
    z-index: 1;
    pointer-events: none;
}

.mika-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: white;
    opacity: 0;
    animation: mika-dot-appear 8s ease-in-out infinite;
    box-shadow: 0 0 4px rgba(255, 255, 255, 0.5);
}

.mika-dot:nth-child(1) {
    animation-delay: 0s;
}

.mika-dot:nth-child(2) {
    animation-delay: 1.2s;
}

.mika-dot:nth-child(3) {
    animation-delay: 2.4s;
}

@keyframes mika-dot-appear {
    0% {
        opacity: 0;
        transform: scale(0.2);
    }
    10% {
        opacity: 0.3;
        transform: scale(0.6);
    }
    20% {
        opacity: 1;
        transform: scale(1.2);
    }
    30% {
        opacity: 1;
        transform: scale(1);
    }
    70% {
        opacity: 1;
        transform: scale(1);
    }
    80% {
        opacity: 0.7;
        transform: scale(0.9);
    }
    90% {
        opacity: 0.3;
        transform: scale(0.6);
    }
    100% {
        opacity: 0;
        transform: scale(0.2);
    }
}

/* Focus States für Accessibility */
.mika-chat-button:focus,
.mika-chat-close:focus {
    outline: 2px solid #2196F3;
    outline-offset: 2px;
}

/* Loading State */
.mika-chat-iframe-container.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #2196F3;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .mika-chat-container {
        background: #1a1a1a;
        border-color: #333;
    }
    
    .mika-chat-header {
        background: #2a2a2a;
        border-color: #333;
    }
    
    .mika-chat-title {
        color: #fff;
    }
    
    .mika-chat-close {
        color: #ccc;
    }
    
    .mika-chat-close:hover {
        background: #333;
        color: #fff;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .mika-chat-button.animated {
        animation: none;
    }
    
    .mika-chat-button.animated::before,
    .mika-chat-button.animated::after {
        animation: none;
    }
    
    .mika-dot {
        animation: none;
        opacity: 1;
        transform: scale(1);
    }
    
    .mika-chat-container {
        transition: none;
    }
    
    .mika-chat-button:hover {
        transform: none;
    }
    
    .mika-chat-button:active {
        transform: none;
    }
} 