/* ===== STATS BUTTON & PANEL ===== */

#progress_a1_c1 {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 15px;
    width: 100%;
}

#progress_a1_c1 h3 {
    font-size: 1rem;
    color: var(--wf-dark-text);
    margin: 0;
    min-width: 30px;
}

#progress_a1_c1 .progress-bar {
    flex: 1;
    margin: 0;
}

/* Stats button */
#but_stats {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff8a5c, #ff5e3a);
    box-shadow: 0 10px 25px rgba(255, 94, 58, 0.4), 0 0 0 2px rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    animation: pulse-button 2s infinite;
}

#but_stats:hover {
    transform: scale(1.15) rotate(5deg);
    box-shadow: 0 15px 35px rgba(255, 94, 58, 0.6), 0 0 0 4px rgba(255, 255, 255, 0.2);
    animation: none;
}

#but_stats:active {
    transform: scale(0.95);
}

#but_stats_div {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.stats-icon {
    font-size: 32px;
    filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.2));
    transition: transform 0.3s ease;
}

#but_stats:hover .stats-icon {
    transform: scale(1.1);
}

@keyframes pulse-button {
    0% {
        box-shadow: 0 10px 25px rgba(255, 94, 58, 0.4), 0 0 0 2px rgba(255, 255, 255, 0.1);
    }
    50% {
        box-shadow: 0 15px 35px rgba(255, 94, 58, 0.7), 0 0 0 5px rgba(255, 255, 255, 0.2);
    }
    100% {
        box-shadow: 0 10px 25px rgba(255, 94, 58, 0.4), 0 0 0 2px rgba(255, 255, 255, 0.1);
    }
}

#section_but_stats {
    position: fixed;
    bottom: 30px;
    left: 30px;
    z-index: 45;
    transition: transform 0.3s ease;
}

/* Stats overlay */
.stats-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 90;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.stats-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Stats panel */
.stats-panel {
    position: fixed;
    top: 0;
    left: -400px;
    width: 380px;
    height: 100vh;
    background: var(--wf-card-bg);
    backdrop-filter: blur(20px);
    box-shadow: 5px 0 30px var(--wf-shadow-main);
    z-index: 100;
    transition: left 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    border-right: 1px solid rgba(255, 138, 92, 0.2);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.stats-panel.active {
    left: 0;
}

#progressTxT {
    opacity: 0.5;
    margin-left: 37%;
    font-size: 15px;
}

.stats-panel-header {
    padding: 25px 20px 15px;
    border-bottom: 2px solid rgba(255, 94, 58, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(to right, rgba(255, 138, 92, 0.05), transparent);
}

.stats-panel-header h3 {
    font-size: 1.8rem;
    font-weight: 700;
    color: #ff5e3a;
    margin: 0;
    text-shadow: 0 2px 5px rgba(255, 94, 58, 0.2);
}

.stats-panel-close {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 94, 58, 0.1);
    border: none;
    font-size: 28px;
    line-height: 1;
    color: #ff5e3a;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stats-panel-close:hover {
    background: #ff5e3a;
    color: white;
    transform: rotate(90deg);
}

.stats-content {
    padding: 20px;
    flex: 1;
}

.stats-section {
    margin-bottom: 25px;
    background: var(--wf-card-bg);
    border-radius: 20px;
    padding: 18px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(255, 138, 92, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stats-section:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255, 94, 58, 0.15);
}

.stats-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 1rem;
    color: var(--wf-dark-text);
    font-weight: 500;
    letter-spacing: 0.3px;
}

.stats-value {
    font-weight: 700;
    color: #ff5e3a;
    font-size: 1.2rem;
}

/* Progress bar */
.progress-bar {
    height: 12px;
    background: var(--wf-white);
    border-radius: 30px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff8a5c, #ff5e3a);
    border-radius: 30px;
    width: 0%;
    transition: width 1s ease;
    position: relative;
    overflow: hidden;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

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

/* Pie chart */
.chart-container {
    display: flex;
    align-items: center;
    gap: 20px;
}

.pie-chart {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: conic-gradient(
        #4caf50 0% 60%,
        #ff9800 60% 85%,
        #2196f3 85% 100%
    );
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    position: relative;
    flex-shrink: 0;
}

.pie-chart::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 45px;
    height: 45px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.chart-legend {
    flex: 1;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 0.85rem;
    color: (--legend-color);;
    transition: transform 0.2s ease;
}

.legend-item:hover {
    transform: translateX(5px);
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 6px;
}

.legend-color.known {
    background: #4caf50;
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}

.legend-color.learning {
    background: #ff9800;
    box-shadow: 0 2px 8px rgba(255, 152, 0, 0.3);
}

.legend-color.new {
    background: #2196f3;
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.3);
}

/* Activity grid */
.activity-grid {
    display: flex;
    gap: 8px;
    justify-content: space-between;
}

.activity-day {
    width: 35px;
    height: 35px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    position: relative;
    cursor: pointer;
}

.activity-day::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-5px);
    background: #333;
    color: white;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.7rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    pointer-events: none;
    z-index: 10;
}

.activity-day:hover::before {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-10px);
}

.activity-day:hover {
    transform: scale(1.1);
    background: rgba(255, 94, 58, 0.3);
}

.activity-day.active {
    background: linear-gradient(135deg, #ff8a5c, #ff5e3a);
    box-shadow: 0 5px 12px rgba(255, 94, 58, 0.3);
}

.activity-day.active:hover {
    transform: scale(1.15);
    box-shadow: 0 8px 18px rgba(255, 94, 58, 0.4);
}

/* Stats grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.stat-card {
    background: linear-gradient(135deg, var(--wf-card-bg), var(--wf-card-bg));
    border-radius: 18px;
    padding: 15px 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(255, 138, 92, 0.1);
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: (-3px) scale(1.02);
    box-shadow: 0 10px 25px rgba(255, 94, 58, 0.15);
    border-color: #ff8a5c;
}

.stat-icon {
    width: 45px;
    height: 45px;
    background: rgba(255, 138, 92, 0.1);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    transition: all 0.3s ease;
}

.stat-card:hover .stat-icon {
    background: #ff5e3a;
    transform: scale(1.2);
}

.stat-card:hover .stat-icon {
    color: white;
}

.stat-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 0.75rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.stat-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--wf-dark-text);
    line-height: 1.2;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .stats-panel {
        width: 100%;
        left: -100%;
    }
    
    #section_but_stats {
        bottom: 20px;
        left: 20px;
    }
    
    #but_stats {
        width: 60px;
        height: 60px;
    }
    
    .stats-icon {
        font-size: 28px;
    }
    
    .activity-day {
        width: 30px;
        height: 30px;
    }
}

@media (max-width: 480px) {
    .chart-container {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .stats-grid {
        gap: 8px;
    }
    
    .stat-card {
        padding: 12px 10px;
    }
    
    .stat-number {
        font-size: 1.2rem;
    }
}