/* ===================================
   SIDEBAR NOTIFICATION BADGES
   ================================= */

/**
 * Badge-System für Sidebars
 * - Zeigt Anzahl neuer/ungelesener Inhalte
 * - Position: Top-Right des Sidebar-Buttons
 * - Colors: Red (wichtig), Blue (info), Green (success)
 */

.sidebar-btn-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: #ef4444;
    color: white;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
    z-index: 10;
    pointer-events: none;
    animation: badge-appear 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes badge-appear {
    from {
        transform: scale(0);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Badge-Varianten */
.sidebar-btn-badge.badge-info {
    background: #3b82f6;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
}

.sidebar-btn-badge.badge-success {
    background: #10b981;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4);
}

.sidebar-btn-badge.badge-warning {
    background: #f59e0b;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4);
}

/* Pulse-Animation für neue Badges */
.sidebar-btn-badge.badge-pulse {
    animation: badge-appear 0.3s ease, badge-pulse 2s ease-in-out infinite;
}

@keyframes badge-pulse {
    0%, 100% {
        box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
    }
    50% {
        box-shadow: 0 2px 16px rgba(239, 68, 68, 0.8),
                    0 0 0 4px rgba(239, 68, 68, 0.2);
    }
}

/* Hover-Effect */
.sidebar-btn:hover .sidebar-btn-badge {
    transform: scale(1.1);
    transition: transform 0.2s ease;
}

/* Hide wenn Wert 0 */
.sidebar-btn-badge[data-count="0"] {
    display: none;
}

/* Recently Used Dot */
.sidebar-recently-used-dot {
    position: absolute;
    bottom: 4px;
    left: 4px;
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
    z-index: 10;
    pointer-events: none;
    animation: dot-glow 2s ease-in-out infinite;
}

@keyframes dot-glow {
    0%, 100% {
        opacity: 0.6;
        box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
    }
    50% {
        opacity: 1;
        box-shadow: 0 0 16px rgba(16, 185, 129, 1);
    }
}

/* Favorite Star */
.sidebar-favorite-star {
    position: absolute;
    top: 2px;
    left: 2px;
    font-size: 14px;
    color: #fbbf24;
    text-shadow: 0 0 8px rgba(251, 191, 36, 0.8);
    z-index: 10;
    pointer-events: none;
    animation: star-twinkle 3s ease-in-out infinite;
}

@keyframes star-twinkle {
    0%, 100% {
        opacity: 0.8;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.15);
    }
}

/* Keyboard Shortcut Hint */
.sidebar-shortcut-hint {
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    padding: 2px 6px;
    background: rgba(0, 0, 0, 0.8);
    color: rgba(255, 255, 255, 0.9);
    font-size: 9px;
    font-weight: 600;
    border-radius: 4px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 11;
}

.sidebar-btn:hover .sidebar-shortcut-hint {
    opacity: 1;
}

/* Theme-Aware Colors (Dark Mode) */
body.dark-mode .sidebar-shortcut-hint {
    background: rgba(255, 255, 255, 0.9);
    color: rgba(0, 0, 0, 0.8);
}

/* Responsive: Kleinere Badges auf mobilen Geräten */
@media (max-width: 768px) {
    .sidebar-btn-badge {
        min-width: 16px;
        height: 16px;
        font-size: 9px;
        top: -2px;
        right: -2px;
    }

    .sidebar-shortcut-hint {
        display: none; /* Keine Shortcuts auf Mobile */
    }
}
