/* ===== COMIC BUBBLE SYSTEM ===== */

.comic-bubble-container {
    position: fixed;
    z-index: 100000; /* MASSIV ERHÖHT - über allen Karten und UI-Elementen */
    pointer-events: none; /* Verhindert Interferenz mit anderen Elementen */
    opacity: 0;
    visibility: hidden;
    transition: all 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    transform: scale(0.3) rotate(-5deg) translateZ(0);
    /* GPU-Beschleunigung für Comic Bubbles */
    will-change: transform, opacity;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* Prioritäts-Bubble (Welcome) - höchster z-index */
.comic-bubble-container.priority-bubble {
    z-index: 100001; /* ABSOLUT HÖCHSTE PRIORITÄT für Priority Bubbles */
}

.comic-bubble-container.welcome-bubble {
    animation: welcomePulse 2s ease-in-out infinite;
}

.comic-bubble-container.show {
    opacity: 1;
    visibility: visible;
    transform: scale(1) rotate(0deg) translateZ(0);
    pointer-events: all;
}

.comic-bubble-container.hide {
    opacity: 0;
    visibility: hidden;
    transform: scale(0.8) translateY(20px) translateZ(0);
    transition: all 0.5s ease-in-out;
}

/* Comic Bubble Design */
.comic-bubble {
    position: relative;
    background: linear-gradient(135deg, #ffe6f0 0%, #fff0f8 50%, #ffd4e8 100%);
    border: 2px solid #2c3e50;
    border-radius: 25px;
    padding: 20px 25px;
    max-width: 350px;
    min-width: 200px;
    font-family: 'Kalam', 'Comic Sans MS', cursive, sans-serif;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    animation: bobble 6s ease-in-out infinite;
}

/* Close Button für Bubbles - relativ zur Bubble (bewegt sich mit Animationen) */
.comic-bubble-close {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    background: #e74c3c;
    color: white;
    border: 2px solid #c0392b;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    line-height: 1;
    transition: all 0.2s ease;
    pointer-events: all;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.comic-bubble-close:hover {
    background: #c0392b;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.comic-bubble-close:active {
    transform: scale(0.95);
}

/* Voting System für Bubbles - rechts unten, etwas größer (bewegt sich mit Animationen) */
.comic-bubble-voting {
    position: absolute;
    bottom: -18px;
    left: 15px;
    display: flex;
    gap: 6px;
    background: rgba(255, 255, 255, 0.9);
    padding: 4px 8px;
    border-radius: 14px;
    border: 1px solid #ddd;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    pointer-events: all;
}

.comic-bubble-vote-btn {
    background: none;
    border: none;
    font-size: 14px;
    cursor: pointer;
    padding: 3px 5px;
    border-radius: 50%;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 2px;
    min-width: 24px;
    height: 24px;
    justify-content: center;
}

.comic-bubble-vote-btn:hover {
    background: rgba(0, 0, 0, 0.08);
    transform: scale(1.15);
}

.comic-bubble-vote-btn.voted {
    background: rgba(52, 152, 219, 0.25);
    transform: scale(1.1);
}

.comic-bubble-vote-btn.thumbs-up:hover {
    background: rgba(46, 204, 113, 0.2);
}

.comic-bubble-vote-btn.thumbs-down:hover {
    background: rgba(231, 76, 60, 0.2);
}

.vote-count {
    font-size: 12px;
    font-weight: bold;
    color: #666;
}

/* Position: Standard Positionierungen verwenden */

/* Mobile Anpassung für standard positions */
@media (max-width: 768px) {
    .comic-bubble-bottom-right {
        right: 10px;
        bottom: 80px;
    }
    
    .comic-bubble-bottom-right .comic-bubble {
        max-width: 280px;
        font-size: 13px;
        padding: 15px 18px;
    }
}

/* Bild-Support für Comic-Blasen */
.comic-bubble-image {
    width: 40px;
    height: 40px;
    float: left;
    margin-right: 15px;
    margin-top: -5px;
    border-radius: 50%;
    border: 2px solid #2c3e50;
    object-fit: cover;
    animation: pulse 2s ease-in-out infinite alternate;
}

@keyframes pulse {
    from { transform: scale(1); }
    to { transform: scale(1.05); }
}

/* Bobble Animation */
@keyframes bobble {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    25% { transform: translateY(-8px) rotate(1deg); }
    50% { transform: translateY(-4px) rotate(0deg); }
    75% { transform: translateY(-12px) rotate(-1deg); }
}

/* Comic Bubble Text */
.comic-bubble-text {
    color: #2c3e50;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.5;
    text-align: center;
    margin: 0;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.8);
    position: relative;
    z-index: 2;
    font-family: 'Kalam', 'Comic Sans MS', cursive, sans-serif;
}

/* Tail-Elemente entfernt - Blasen ohne Dreiecke */

/* Close Button */
.comic-bubble-close {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    background: #e74c3c;
    border: 2px solid #2c3e50;
    border-radius: 50%;
    color: white;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 3;
    pointer-events: all;
}

.comic-bubble-close:hover {
    background: #c0392b;
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* Category Badge */
.comic-bubble-category {
    position: absolute;
    top: -12px;
    left: 20px;
    background: #3498db;
    color: white;
    font-size: 10px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 12px;
    border: 2px solid #2c3e50;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 3;
    font-family: 'Kalam', 'Comic Sans MS', cursive, sans-serif;
}

.comic-bubble-category.motivational { background: #e67e22; }
.comic-bubble-category.funny { background: #f39c12; }
.comic-bubble-category.wisdom { background: #9b59b6; }
.comic-bubble-category.technical { background: #2ecc71; }
.comic-bubble-category.lifestyle { background: #e74c3c; }

/* Mobile Anpassungen */
@media (max-width: 768px) {
    .comic-bubble {
        max-width: 280px;
        padding: 15px 18px;
        border-radius: 20px;
        font-family: 'Kalam', 'Comic Sans MS', cursive, sans-serif;
    }
    
    .comic-bubble-text {
        font-size: 14px;
        font-family: 'Kalam', 'Comic Sans MS', cursive, sans-serif;
    }
    
    /* Mobile: Bubbles nur an linken und rechten Positionen */
    .comic-bubble-top-left,
    .comic-bubble-bottom-left {
        left: 15px; /* Näher zum Rand für bessere Darstellung */
        max-width: 280px;
    }
    
    .comic-bubble-top-right,
    .comic-bubble-bottom-right {
        right: 15px; /* Näher zum Rand für bessere Darstellung */
        max-width: 280px;
    }
    
    /* Center-Position auf mobile ausblenden/deaktivieren */
    .comic-bubble-center {
        display: none !important;
    }
    
    /* Mobile-spezifische Anpassungen ohne Tails */
}

/* Positionierungs-Hilfesklassen */
.comic-bubble-top-left {
    top: 110px;
    left: 50px;
}

.comic-bubble-top-right {
    top: 110px;
    right: 50px;
}

.comic-bubble-bottom-left {
    bottom: 100px;
    left: 50px;
}

.comic-bubble-bottom-right {
    bottom: 100px;
    right: 50px;
    z-index: 2050; /* Über dem Biker-Bild (z-index: 1000) */
}

/* Spezielle Styling für Welcome-Bubbles in bottom-right Position */
.comic-bubble-bottom-right.welcome-bubble .comic-bubble {
    border: 3px solid #fff;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.4);
    animation: welcome-bounce 3s ease-in-out infinite;
}

/* Welcome-Bounce Animation */
@keyframes welcome-bounce {
    0%, 100% { transform: translateY(0px) scale(1); }
    25% { transform: translateY(-12px) scale(1.02); }
    50% { transform: translateY(-6px) scale(1.01); }
    75% { transform: translateY(-18px) scale(1.03); }
}

.comic-bubble-center {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.3) rotate(-5deg);
}

.comic-bubble-center.show {
    transform: translate(-50%, -50%) scale(1) rotate(0deg);
}

/* Mobile-spezifische Center-Left und Center-Right Positionen */
.comic-bubble-center-left {
    top: 50%;
    left: 30px;
    transform: translateY(-50%) scale(0.3) rotate(-5deg);
}

.comic-bubble-center-left.show {
    transform: translateY(-50%) scale(1) rotate(0deg);
}

.comic-bubble-center-right {
    top: 50%;
    right: 30px;
    transform: translateY(-50%) scale(0.3) rotate(-5deg);
}

.comic-bubble-center-right.show {
    transform: translateY(-50%) scale(1) rotate(0deg);
}

/* Special Effects für Entrance */
.comic-bubble-container.entrance-bounce {
    animation: entranceBounce 1.2s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

@keyframes entranceBounce {
    0% {
        opacity: 0;
        transform: scale(0) rotate(180deg);
    }
    60% {
        opacity: 0.8;
        transform: scale(1.1) rotate(-10deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

/* Glow Effect für besondere Sprüche */
.comic-bubble.special-glow {
    box-shadow: 
        0 8px 25px rgba(0, 0, 0, 0.3),
        0 0 30px rgba(52, 152, 219, 0.6),
        inset 0 2px 5px rgba(255, 255, 255, 0.8);
    animation: specialGlow 3s ease-in-out infinite alternate;
}

@keyframes specialGlow {
    0% { box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3), 0 0 20px rgba(52, 152, 219, 0.4), inset 0 2px 5px rgba(255, 255, 255, 0.8); }
    100% { box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3), 0 0 40px rgba(52, 152, 219, 0.8), inset 0 2px 5px rgba(255, 255, 255, 0.8); }
}

/* Themes für verschiedene Seiten */

.page-profile .comic-bubble {
    background: linear-gradient(135deg, #fff0e6 0%, #fff8f0 50%, #ffe8d4 100%);
}

/* Welcome Bubble Animation */
@keyframes welcomePulse {
    0%, 100% { 
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
        transform: scale(1);
    }
    50% { 
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
        transform: scale(1.02);
    }
}