/* Mika Chat Widget Styles */

.mika-chat-widget {
    position: fixed;
    bottom: var(--mika-margin, 30px);
    right: var(--mika-margin, 30px);
    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, 75px);
    height: var(--mika-button-size, 75px);
    border-radius: 50%;
    background-color: #FF0080; /* Fallback for non-animated */
    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; /* For animation layers */
}

/* Atmende Animation */
.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%);
    background-size: 200% 200%;
    animation: mika-breathing-pulse 6s ease-in-out infinite;
}

.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;
}

.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;
}

@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);
    }
}

/* Typing Dots Animation */
.mika-typing-dots {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 100%;
    height: 100%;
}

.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);
    }
}

.mika-chat-button:hover {
    transform: scale(1.05);
    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;
    background: white;
    border-radius: 12px 12px 0 0;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    z-index: 9998;
    display: none;
    overflow: hidden;
    border: 1px solid #e0e0e0;
}

.mika-chat-container.open {
    display: block;
    animation: mika-slide-in 0.3s ease-out;
}

/* Button verstecken wenn Chat geöffnet ist */
.mika-chat-widget.chat-open .mika-chat-button {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.8);
    transition: all 0.3s ease;
}

@keyframes mika-slide-in {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

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

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

.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;
}

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

/* iFrame Container */
.mika-chat-iframe-container {
    width: 100%;
    height: calc(100% - 60px); /* Subtract header height */
    overflow: hidden;
}

.mika-chat-iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* 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 #FF0080;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* 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-chat-container {
        bottom: 0;
        right: 0;
        width: 100vw !important;
        height: 100vh !important;
        max-width: none;
        max-height: none;
        border-radius: 0 !important;
    }
    
    .mika-dot {
        width: 6px;
        height: 6px;
    }
}

@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-container {
        bottom: 0;
        right: 0;
        width: 100vw !important;
        height: 100vh !important;
        border-radius: 0 !important;
    }
    
    .mika-chat-header {
        padding: 12px 16px;
    }
    
    .mika-chat-title {
        font-size: 14px;
    }
    
    .mika-dot {
        width: 5px;
        height: 5px;
    }
}

/* Accessibility */
.mika-chat-button:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

.mika-chat-close:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .mika-chat-button {
        border: 2px solid #000;
    }
    
    .mika-chat-container {
        border: 2px solid #000;
    }
    
    .mika-chat-header {
        background: #000;
        color: #fff;
    }
    
    .mika-chat-title {
        color: #fff;
    }
    
    .mika-chat-close {
        color: #fff;
    }
    
    .mika-chat-close:hover {
        background: #333;
    }
}

/* 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.open {
        animation: none;
    }
    
    .mika-chat-button:hover {
        transform: none;
    }
    
    .mika-chat-button:active {
        transform: none;
    }
    
    .mika-chat-close:active {
        transform: none;
    }
}

/* Scroll Lock für Mobile */
body.chat-open {
    overflow: hidden;
} 