/* KI-Team Chatbots - Apple Style Design */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.ki-team-container {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', sans-serif;
    background: #f8f9fa;
    color: #1d1d1f;
    margin: 0;
    padding: 20px;
    max-width: 1400px;
    margin: 0 auto;
}

.ki-team-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 25px;
    margin-bottom: 40px;
}

/* Responsive Grid */
@media (max-width: 1024px) {
    .ki-team-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .ki-team-grid {
        grid-template-columns: 1fr;
    }
    
    /* Mobile Chat-Höhe und Breite anpassen */
    .ki-team-chat-container {
        height: var(--ki-team-mobile-chat-height, 70vh) !important;
        width: var(--ki-team-mobile-chat-width, 95%) !important;
    }
    
    /* Mobile Button-Animationen aktivieren */
    .ki-team-chat-btn {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%) !important;
        background-size: 200% 200% !important;
        animation: gradientShift 3s ease infinite !important;
        -webkit-animation: gradientShift 3s ease infinite !important;
        -moz-animation: gradientShift 3s ease infinite !important;
        -o-animation: gradientShift 3s ease infinite !important;
    }
    
    /* Mobile Chat-Header Animationen */
    .ki-team-chat-header {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%) !important;
        background-size: 200% 200% !important;
        animation: gradientShift 3s ease infinite !important;
        -webkit-animation: gradientShift 3s ease infinite !important;
        -moz-animation: gradientShift 3s ease infinite !important;
        -o-animation: gradientShift 3s ease infinite !important;
    }
    
    .ki-team-chat-header::before {
        content: '' !important;
        position: absolute !important;
        top: 0 !important;
        left: -100% !important;
        width: 100% !important;
        height: 100% !important;
        background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent) !important;
        animation: shimmer 2s infinite !important;
        -webkit-animation: shimmer 2s infinite !important;
        -moz-animation: shimmer 2s infinite !important;
        -o-animation: shimmer 2s infinite !important;
    }
    
    /* Mobile Send-Button Animationen */
    .ki-team-send-btn {
        background: linear-gradient(135deg, #667eea, #764ba2) !important;
        background-size: 200% 200% !important;
        animation: gradientShift 3s ease infinite !important;
        -webkit-animation: gradientShift 3s ease infinite !important;
        -moz-animation: gradientShift 3s ease infinite !important;
        -o-animation: gradientShift 3s ease infinite !important;
    }
    
    /* Mobile Animationen erzwingen */
    * {
        -webkit-animation-fill-mode: both !important;
        -moz-animation-fill-mode: both !important;
        -o-animation-fill-mode: both !important;
        animation-fill-mode: both !important;
    }
    
    /* iOS-spezifische Optimierungen */
    .ki-team-chat-btn,
    .ki-team-chat-header,
    .ki-team-send-btn {
        -webkit-transform: translateZ(0) !important;
        -moz-transform: translateZ(0) !important;
        -o-transform: translateZ(0) !important;
        transform: translateZ(0) !important;
        -webkit-backface-visibility: hidden !important;
        -moz-backface-visibility: hidden !important;
        -o-backface-visibility: hidden !important;
        backface-visibility: hidden !important;
        -webkit-perspective: 1000 !important;
        -moz-perspective: 1000 !important;
        -o-perspective: 1000 !important;
        perspective: 1000 !important;
    }
    
    /* Force hardware acceleration on mobile */
    .ki-team-chat-btn::before,
    .ki-team-chat-header::before {
        -webkit-transform: translateZ(0) !important;
        -moz-transform: translateZ(0) !important;
        -o-transform: translateZ(0) !important;
        transform: translateZ(0) !important;
    }
}


.ki-team-member {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 32px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.ki-team-member::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
}

.ki-team-member:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.12);
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.9);
}

.ki-team-member.hidden {
    display: none;
}

.ki-team-member.disabled {
    opacity: 0.5;
    pointer-events: none;
    filter: grayscale(100%);
}

.ki-team-avatar {
    width: 88px;
    height: 88px;
    border-radius: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.ki-team-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 20px;
}

.ki-team-member h3 {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: #1d1d1f;
}

.ki-team-member p {
    color: #6e6e73;
    line-height: 1.6;
    margin-bottom: 25px;
    font-size: 0.95rem;
}

.ki-team-chat-btn {
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 20px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    z-index: 1;
}


.ki-team-chat-btn:hover {
    transform: translateY(-3px) scale(1.08);
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.4);
    animation-duration: 1s;
}

/* Einheitlicher cooler Button für alle Bots */
.ki-team-chat-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    background-size: 200% 200%;
    animation: gradientShift 3s ease infinite;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.ki-team-chat-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.6s;
}

.ki-team-chat-btn:hover::after {
    left: 100%;
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Cooler Puls-Effekt */
.ki-team-chat-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.ki-team-chat-btn:hover::before {
    width: 300px;
    height: 300px;
}

/* Chat Modal */
.ki-team-chat-modal {
    display: none;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(0, 0, 0, 0.5) !important;
    z-index: 2147483647 !important;
    backdrop-filter: blur(5px);
}

/* Zusätzliche Regeln für maximale Priorität */
.ki-team-chat-modal * {
    z-index: 2147483647 !important;
}

.ki-team-chat-container {
    z-index: 2147483647 !important;
}

.ki-team-chat-header {
    z-index: 2147483647 !important;
}

.ki-team-chat-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: var(--ki-team-chat-width, 90%);
    max-width: 600px;
    height: var(--ki-team-chat-height, 80vh);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(40px);
    border-radius: 24px;
    box-shadow: 0 32px 80px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.ki-team-chat-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    background-size: 200% 200%;
    animation: gradientShift 3s ease infinite;
    backdrop-filter: blur(20px);
    color: white;
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.ki-team-chat-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Mobile-spezifische Animationen mit Vendor-Prefixes */
@-webkit-keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@-moz-keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@-o-keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@-webkit-keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

@-moz-keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

@-o-keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

.ki-team-chat-member-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.ki-team-chat-avatar {
    width: 56px;
    height: 56px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
}

.ki-team-chat-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 14px;
}

.ki-team-chat-avatar i {
    color: white;
}

.ki-team-chat-member-info h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 2px;
}

.ki-team-chat-member-info p {
    font-size: 0.9rem;
    opacity: 0.8;
}

.ki-team-close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.ki-team-close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.ki-team-chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #f8fafc;
}

.ki-team-message {
    margin-bottom: 15px;
    display: flex;
}

.ki-team-bot-message {
    justify-content: flex-start;
}

.ki-team-user-message {
    justify-content: flex-end;
}

.ki-team-message-content {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 0.95rem;
    line-height: 1.4;
}

.ki-team-bot-message .ki-team-message-content {
    background: white;
    color: #2d3748;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-bottom-left-radius: 4px;
    line-height: 1.2em;
    word-wrap: break-word;
    text-align: left;
    padding: 16px;
    user-select: text;
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
}

.ki-team-bot-message .ki-team-message-content p {
    margin: 0 0 12px 0;
    padding: 0;
    line-height: 1.2em;
    text-align: left;
}

.ki-team-bot-message .ki-team-message-content p:last-child {
    margin-bottom: 0;
}

.ki-team-user-message .ki-team-message-content {
    background: rgba(0, 0, 0, 0.8);
    color: white;
    border-bottom-right-radius: 4px;
    line-height: 1.2em;
    text-align: left;
}

.ki-team-user-message .ki-team-message-content p {
    margin: 0;
    padding: 0;
    line-height: 1.2em;
    text-align: left;
}

.ki-team-chat-input-container {
    padding: 20px;
    background: white;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 10px;
}

#ki-team-chat-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 25px;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.3s ease;
}

#ki-team-chat-input:focus {
    border-color: #007AFF;
}

.ki-team-send-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.ki-team-send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.ki-team-send-btn i {
    color: white !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    font-size: 1.2rem;
}

/* Loading Animation */
.ki-team-typing-indicator {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 12px 16px;
    background: white;
    border-radius: 18px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    max-width: 70px;
}

.ki-team-typing-dot {
    width: 8px;
    height: 8px;
    background: #007AFF;
    border-radius: 50%;
    animation: ki-team-typing 1.4s infinite ease-in-out;
}

.ki-team-typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.ki-team-typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes ki-team-typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.5;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* Admin Styles */
.ki-team-bots-config {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.ki-team-bot-config {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
}

.ki-team-bot-config h3 {
    margin-top: 0;
    color: #1d1d1f;
}

.ki-team-image-upload {
    margin: 10px 0;
}

.ki-team-avatar-preview {
    border-radius: 20px;
    border: 2px solid #e2e8f0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .ki-team-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .ki-team-chat-container {
        width: 95%;
        height: 90%;
    }
    
    .ki-team-message-content {
        max-width: 85%;
    }
    
    .ki-team-bots-config {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .ki-team-container {
        padding: 15px;
    }
    
    .ki-team-member {
        padding: 20px;
    }
    
    .ki-team-avatar {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
}
