/* ================================================
   XP-SYSTEM KOMPONENTEN
   Wiederverwendbare CSS-Komponenten für Features
   ================================================ */

/* ===== GRUNDLEGENDE FEATURE-CONTAINER ===== */
.feature-container {
    position: relative;
    transition: all 0.3s ease;
}

.feature-container.locked {
    opacity: 1; /* Keep full opacity, transparency comes from overlay */
    pointer-events: none;
    user-select: none;
}

.feature-container.locked-visual {
    opacity: 1;
    pointer-events: auto;
    user-select: auto;
}

.feature-container.unlocked {
    opacity: 1;
    pointer-events: auto;
}

/* ===== SCHLOSS-OVERLAY FÜR GESPERRTE FEATURES ===== */
.feature-lock-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent !important; /* No dark overlay */
    border-radius: inherit;
    display: contents; /* render nothing as container */
    z-index: 10;
    backdrop-filter: none !important; /* No blur */
    transition: none;
}

.feature-lock-overlay:hover {
    background: transparent !important;
    backdrop-filter: none !important;
}

/* Lock-Icon bleibt immer sichtbar */
.feature-lock-overlay .lock-icon {
    opacity: 1; /* Lock icon always visible */
}

/* XP-Text immer sichtbar */
.feature-lock-overlay .xp-requirement-text {
    opacity: 1; /* Always visible */
    transition: opacity 0.3s ease;
}

.feature-lock-overlay:hover .xp-requirement-text {
    opacity: 1; /* Stay visible on hover */
}

/* Schloss-Icon - positioniert wie unlock indicator */
.lock-icon {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, #dc3545, #c82333);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.4);
    animation: lockPulse 2s ease-in-out infinite;
    font-size: 12px;
    color: white;
}

/* Entferne die alte Lock-Icon Animation und Größe */
.feature-lock-overlay .lock-icon {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, #dc3545, #c82333);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.4);
    animation: lockPulse 2s ease-in-out infinite;
    font-size: 12px;
    color: white;
    margin-bottom: 0;
    text-shadow: none;
}

@keyframes lockPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* XP-Anforderung Text - zentriert im Overlay */
.xp-requirement-text {
    position: absolute;
    left: 50%;
    bottom: 10px;
    transform: translateX(-50%);
    color: white;
    font-weight: bold;
    font-size: 0.9rem;
    text-align: center;
    background: rgba(220, 53, 69, 0.95); /* Red pill */
    padding: 0.3rem 0.6rem;
    border-radius: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3); /* Stronger shadow for better visibility */
    white-space: nowrap;
    border: 1px solid rgba(255, 255, 255, 0.2); /* Subtle border for definition */
}

/* Aktuelle XP Anzeige */
.current-xp-text {
    color: #ffc107;
    font-size: 0.8rem;
    text-align: center;
    background: rgba(0, 0, 0, 0.4);
    padding: 0.2rem 0.5rem;
    border-radius: 10px;
}

/* ===== GRÜNE CHECKBOX FÜR FREIGESCHALTETE FEATURES ===== */
.feature-unlocked-indicator {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, #28a745, #20c997);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.4);
    animation: checkmarkAppear 0.5s ease-out;
}

.feature-unlocked-indicator::before {
    content: '✓';
    color: white;
    font-weight: bold;
    font-size: 14px;
    line-height: 1;
}

@keyframes checkmarkAppear {
    0% {
        opacity: 0;
        transform: scale(0) rotate(180deg);
    }
    50% {
        transform: scale(1.2) rotate(360deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotate(360deg);
    }
}

/* ===== CORNER LOCK (Kleine Ecke) ===== */
/* Wenn das XP-System global deaktiviert ist, alle XP-Indikatoren verstecken */
.xp-system-disabled .feature-unlocked-indicator,
.xp-system-disabled .feature-locked-overlay,
.xp-system-disabled .feature-lock-corner,
.xp-system-disabled .lock-icon,
.xp-system-disabled .lock-icon-small,
.xp-system-disabled .lock-icon-corner,
.xp-system-disabled .xp-requirement,
.xp-system-disabled .xp-requirement-text,
.xp-system-disabled .xp-requirement-inline,
.xp-system-disabled .xp-requirement-badge,
.xp-system-disabled [data-xp-lock="1"] {
    display: none !important;
}
.feature-lock-corner {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 20px;
    height: 20px;
    background: #dc3545;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.feature-lock-corner::before {
    content: '🔒';
    font-size: 10px;
    line-height: 1;
}

/* ===== INLINE LOCK (Innerhalb des Elements) ===== */
.feature-lock-inline {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: rgba(220, 53, 69, 0.1);
    border: 1px solid rgba(220, 53, 69, 0.3);
    border-radius: 8px;
    margin: 0.5rem 0;
}

.feature-lock-inline .lock-icon {
    font-size: 1.2rem;
    margin: 0;
    animation: none;
}

.feature-lock-inline .lock-text {
    flex: 1;
    color: #dc3545;
    font-weight: 500;
}

/* ===== XP-BADGE KOMPONENTE ===== */
.xp-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: linear-gradient(135deg, #ffc107, #fd7e14);
    color: #333;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(255, 193, 7, 0.3);
}

.xp-badge::before {
    content: '⭐';
    font-size: 0.9rem;
}

/* XP-Badge Varianten */
.xp-badge.required {
    background: linear-gradient(135deg, #dc3545, #c82333);
    color: white;
}

.xp-badge.available {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
}

.xp-badge.warning {
    background: linear-gradient(135deg, #ffc107, #fd7e14);
    color: #333;
}

/* ===== PROGRESS BAR FÜR XP ===== */
.xp-progress {
    width: 100%;
    height: 6px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
    overflow: hidden;
    margin: 0.5rem 0;
}

.xp-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #28a745, #20c997);
    border-radius: 3px;
    transition: width 0.8s ease;
    position: relative;
}

.xp-progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        rgba(255,255,255,0.2) 0%,
        rgba(255,255,255,0.4) 50%,
        rgba(255,255,255,0.2) 100%
    );
    animation: shimmer 2s ease-in-out infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ===== FEATURE-CARD INTEGRATION ===== */
.feature-card {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.feature-card.locked {
    background: rgba(248, 249, 250, 0.8);
    border: 2px dashed rgba(220, 53, 69, 0.3);
}

.feature-card.unlocked {
    background: rgba(248, 255, 248, 0.9);
    border: 2px solid rgba(40, 167, 69, 0.3);
}

.feature-card.unlocked::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #28a745, #20c997);
}

/* ===== TOOLTIP FÜR ZUSÄTZLICHE INFORMATIONEN ===== */
.xp-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 0.5rem 0.8rem;
    border-radius: 6px;
    font-size: 0.8rem;
    white-space: nowrap;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    margin-bottom: 5px;
}

.xp-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.9);
}

.feature-container:hover .xp-tooltip {
    opacity: 1;
}

/* ===== RESPONSIVE ANPASSUNGEN ===== */
@media (max-width: 768px) {
    .lock-icon {
        font-size: 1.5rem;
    }
    
    .xp-requirement-text {
        font-size: 0.8rem;
        padding: 0.2rem 0.4rem;
    }
    
    .feature-unlocked-indicator {
        width: 20px;
        height: 20px;
        top: 5px;
        right: 5px;
    }
    
    .feature-unlocked-indicator::before {
        font-size: 12px;
    }
}

/* ===== UTILITY CLASSES ===== */
.text-xp-required { color: #dc3545; }
.text-xp-available { color: #28a745; }
.text-xp-warning { color: #ffc107; }

.bg-xp-required { background-color: rgba(220, 53, 69, 0.1); }
.bg-xp-available { background-color: rgba(40, 167, 69, 0.1); }
.bg-xp-warning { background-color: rgba(255, 193, 7, 0.1); }

/* ===== HOVER EFFEKTE ===== */
.feature-container.unlocked:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.2);
}

.feature-container.locked:hover .feature-lock-overlay {
    background: rgba(220, 53, 69, 0.1); /* Light red tint on hover */
}

/* ===== ANIMATIONS ===== */
@keyframes featureUnlock {
    0% {
        opacity: 0.6;
        transform: scale(0.95);
        filter: grayscale(100%);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        opacity: 1;
        transform: scale(1);
        filter: grayscale(0%);
    }
}

.feature-container.just-unlocked {
    animation: featureUnlock 0.8s ease-out;
}

/* ===== DARK MODE SUPPORT ===== */
@media (prefers-color-scheme: dark) {
    .feature-lock-overlay {
        background: rgba(0, 0, 0, 0.4);
    }
    
    .xp-requirement-text {
        background: rgba(220, 53, 69, 0.5);
    }
    
    .current-xp-text {
        background: rgba(255, 193, 7, 0.5);
        color: #333;
    }
    
    .feature-card.locked {
        background: rgba(33, 37, 41, 0.8);
        border-color: rgba(220, 53, 69, 0.4);
    }
    
    .feature-card.unlocked {
        background: rgba(25, 50, 25, 0.8);
        border-color: rgba(40, 167, 69, 0.4);
    }
}