/* Counting Widgets - Hauptstyles */
.counting-widget {
    text-align: center;
    padding: 20px;
    margin: 10px 0;
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    /* Wichtig: Stelle sicher, dass jedes Widget einen eigenen Stacking Context hat */
    z-index: 1;
}

/* Stelle sicher, dass alle Widgets korrekt angezeigt werden */
.counting-widget:nth-child(odd) {
    z-index: 2;
}

.counting-widget:nth-child(even) {
    z-index: 3;
}

/* Modern Style */
.counting-widget.style-modern {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.counting-widget.style-modern:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.2);
}

/* Classic Style */
.counting-widget.style-classic {
    background: #f8f9fa;
    border: 2px solid #dee2e6;
    color: #495057;
}

.counting-widget.style-classic:hover {
    border-color: #007bff;
    background: #e9ecef;
}

/* Minimal Style */
.counting-widget.style-minimal {
    background: transparent;
    border: 1px solid #e0e0e0;
    color: #333;
}

.counting-widget.style-minimal:hover {
    border-color: #333;
    background: #fafafa;
}

/* Bold Style */
.counting-widget.style-bold {
    background: #343a40;
    color: white;
    border: 3px solid #007bff;
}

.counting-widget.style-bold:hover {
    background: #007bff;
    border-color: #0056b3;
}

/* Elegant Style */
.counting-widget.style-elegant {
    background: linear-gradient(45deg, #f8f9fa, #e9ecef);
    color: #495057;
    border: 1px solid #dee2e6;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.counting-widget.style-elegant:hover {
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    transform: scale(1.02);
}

/* Counter Number Styles */
.counter-number {
    font-size: 3rem;
    font-weight: bold;
    margin: 10px 0;
    line-height: 1.2;
}

.counter-prefix,
.counter-suffix {
    font-size: 1.5rem;
    opacity: 0.8;
    margin: 0 5px;
}

.counter-value {
    display: inline-block;
    min-width: 60px;
}

/* Counter Title */
.counter-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0 0 15px 0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Counter Description */
.counter-description {
    font-size: 0.9rem;
    opacity: 0.8;
    margin-top: 10px;
    line-height: 1.4;
}

/* Icon Counter Styles */
.icon-counter-widget {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.icon-counter-widget.icon-position-top,
.icon-counter-widget.icon-position-bottom {
    flex-direction: column;
}

.icon-counter-widget.icon-position-left,
.icon-counter-widget.icon-position-right {
    flex-direction: row;
}

.counter-icon {
    margin: 10px;
    font-size: 2.5rem;
    opacity: 0.8;
}

.icon-counter-widget.icon-position-top .counter-icon {
    order: -1;
}

.icon-counter-widget.icon-position-bottom .counter-icon {
    order: 1;
}

.icon-counter-widget.icon-position-left .counter-icon {
    order: -1;
    margin-right: 20px;
}

.icon-counter-widget.icon-position-right .counter-icon {
    order: 1;
    margin-left: 20px;
}

.counter-content {
    flex: 1;
    min-width: 0;
}

/* Animation Classes */
.counting-widget.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.counting-widget.animate-on-scroll.animated {
    opacity: 1;
    transform: translateY(0);
}

.counting-widget.fade-in-on-scroll {
    opacity: 0;
    transition: opacity 0.8s ease;
}

.counting-widget.fade-in-on-scroll.animated {
    opacity: 1;
}

.counting-widget.slide-up-on-scroll {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.5s ease;
}

.counting-widget.slide-up-on-scroll.animated {
    opacity: 1;
    transform: translateY(0);
}

/* Hover Effects */
.counting-widget.hover {
    transform: scale(1.05);
}

.counting-widget.style-modern.hover {
    transform: translateY(-8px) scale(1.02);
}

.counting-widget.style-elegant.hover {
    transform: scale(1.03);
}

/* Responsive Design */
@media (max-width: 768px) {
    .counting-widget {
        padding: 15px;
        margin: 8px 0;
    }
    
    .counter-number {
        font-size: 2.5rem;
    }
    
    .counter-title {
        font-size: 1rem;
    }
    
    .counter-icon {
        font-size: 2rem;
    }
    
    .icon-counter-widget.icon-position-left .counter-icon,
    .icon-counter-widget.icon-position-right .counter-icon {
        margin: 10px;
    }
}

@media (max-width: 480px) {
    .counting-widget {
        padding: 12px;
        margin: 5px 0;
    }
    
    .counter-number {
        font-size: 2rem;
    }
    
    .counter-prefix,
    .counter-suffix {
        font-size: 1.2rem;
    }
    
    .counter-title {
        font-size: 0.9rem;
    }
    
    .counter-description {
        font-size: 0.8rem;
    }
    
    .counter-icon {
        font-size: 1.8rem;
    }
    
    .icon-counter-widget {
        flex-direction: column !important;
    }
    
    .icon-counter-widget .counter-icon {
        order: -1 !important;
        margin: 5px !important;
    }
}

/* Loading Animation */
.counting-widget.loading .counter-value {
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* Success Animation */
.counting-widget.success .counter-value {
    animation: success-bounce 0.6s ease;
}

@keyframes success-bounce {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* Interactive Counter */
.counting-widget.interactive {
    cursor: pointer;
    user-select: none;
}

.counting-widget.interactive:active {
    transform: scale(0.98);
}

/* Progress Bar Style (für Progress Counter Widget) */
.counter-progress {
    width: 100%;
    height: 8px;
    background: rgba(255,255,255,0.2);
    border-radius: 4px;
    margin: 15px 0;
    overflow: hidden;
}

.counter-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #28a745, #20c997);
    border-radius: 4px;
    transition: width 2s ease;
    width: 0%;
}

/* Statistics Grid */
.statistics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.statistics-grid .counting-widget {
    margin: 0;
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .counting-widget.style-classic {
        background: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .counting-widget.style-minimal {
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .counting-widget.style-elegant {
        background: linear-gradient(45deg, #2d3748, #4a5568);
        border-color: #4a5568;
        color: #e2e8f0;
    }
}

/* Print Styles */
@media print {
    .counting-widget {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    .counting-widget:hover {
        transform: none;
    }
}

/* Accessibility */
.counting-widget:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

.counting-widget.interactive:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .counting-widget {
        border: 2px solid currentColor;
    }
    
    .counting-widget.style-modern {
        background: #000;
        color: #fff;
    }
    
    .counting-widget.style-classic {
        background: #fff;
        color: #000;
        border-color: #000;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .counting-widget {
        transition: none;
    }
    
    .counting-widget:hover {
        transform: none;
    }
    
    .counter-progress-bar {
        transition: none;
    }
    
    .counting-widget.animate-on-scroll,
    .counting-widget.fade-in-on-scroll,
    .counting-widget.slide-up-on-scroll {
        opacity: 1;
        transform: none;
    }
}
