/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin-bottom: 60px;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 25px;
    border-radius: 12px;
    background: white;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    transition: var(--transition);
    animation: slideUp 0.6s ease-out backwards;
}

.stat-card:nth-child(1) {
    animation-delay: 0s;
}

.stat-card:nth-child(2) {
    animation-delay: 0.1s;
}

.stat-card:nth-child(3) {
    animation-delay: 0.2s;
}

.stat-card:nth-child(4) {
    animation-delay: 0.3s;
}

.stat-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.stat-primary {
    border-left: 4px solid #ef4444;
}

.stat-success {
    border-left: 4px solid #10b981;
}

.stat-warning {
    border-left: 4px solid #f59e0b;
}

.stat-info {
    border-left: 4px solid #3b82f6;
}

.stat-icon {
    font-size: 2.5rem;
}

.stat-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.stat-label {
    color: #6b7280;
    font-size: 0.9rem;
    font-weight: 500;
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: #1f2937;
}

.stat-unit {
    color: #9ca3af;
    font-size: 0.85rem;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Progress Section */
.progress-section {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    margin-bottom: 60px;
}

.progress-section h2 {
    margin-bottom: 30px;
    color: #1f2937;
}

.progress-bar-wrapper {
    position: relative;
}

.progress-bar {
    width: 100%;
    height: 30px;
    background: #e5e7eb;
    border-radius: 15px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    transition: width 0.8s ease;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 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%);
    }
}

.progress-text {
    display: block;
    text-align: right;
    margin-top: 10px;
    font-weight: 600;
    color: #667eea;
}

/* Calendar Section */
.calendar-section {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    margin-bottom: 60px;
}

.calendar-section h2 {
    margin-bottom: 20px;
    color: #1f2937;
}

.calendar-legend {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.calendar-legend span {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
}

.day-complete,
.day-incomplete,
.day-skipped {
    width: 20px;
    height: 20px;
    border-radius: 4px;
}

.day-complete {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.day-incomplete {
    background: #e5e7eb;
}

.day-skipped {
    background: #fecaca;
}

.habit-calendar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(35px, 1fr));
    gap: 8px;
}

.calendar-day {
    aspect-ratio: 1;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.8rem;
    cursor: pointer;
    transition: var(--transition);
}

.calendar-day.completed {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.calendar-day.incomplete {
    background: #e5e7eb;
    color: #6b7280;
}

.calendar-day.skipped {
    background: #fecaca;
    color: #991b1b;
}

.calendar-day:hover {
    transform: scale(1.1);
}

/* Weekly Stats */
.weekly-section {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    margin-bottom: 60px;
}

.weekly-section h2 {
    margin-bottom: 30px;
    color: #1f2937;
}

.weekly-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 20px;
}

.weekly-stat {
    text-align: center;
    padding: 20px;
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    border-radius: 12px;
    transition: var(--transition);
}

.weekly-stat:hover {
    transform: translateY(-5px);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.day-name {
    font-weight: 600;
    margin-bottom: 10px;
    color: #6b7280;
}

.weekly-stat:hover .day-name {
    color: white;
}

.day-count {
    font-size: 2rem;
    font-weight: 800;
    color: #667eea;
}

.weekly-stat:hover .day-count {
    color: white;
}

/* Motivation Section */
.motivation-section {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    margin-bottom: 60px;
}

.motivation-section h2 {
    margin-bottom: 30px;
    color: #1f2937;
}

.motivation-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
}

.motivation-card {
    padding: 25px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px;
    transition: var(--transition);
    animation: fadeIn 0.6s ease-out;
}

.motivation-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.3);
}

.motivation-card p {
    line-height: 1.8;
    font-style: italic;
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .progress-section,
    .calendar-section,
    .weekly-section,
    .motivation-section {
        padding: 20px;
    }
}