/* TrashTrucks Progress System Styles */

/* ==================== ACHIEVEMENT POPUP ==================== */

.achievement-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    z-index: 2000;
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.achievement-popup.show {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

.achievement-popup-content {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    border-radius: 30px;
    padding: 30px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    text-align: center;
    min-width: 300px;
    border: 5px solid white;
    animation: achievementPulse 2s ease-in-out infinite;
}

@keyframes achievementPulse {
    0%, 100% { box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4); }
    50% { box-shadow: 0 20px 80px rgba(255, 215, 0, 0.6); }
}

.achievement-icon {
    font-size: 80px;
    margin-bottom: 15px;
    animation: achievementBounce 1s ease-in-out infinite;
}

@keyframes achievementBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.achievement-title {
    font-size: 32px;
    font-weight: bold;
    color: white;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.3);
    margin-bottom: 10px;
}

.achievement-description {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 15px;
}

.achievement-reward {
    font-size: 24px;
    font-weight: bold;
    color: white;
    background: rgba(0, 0, 0, 0.2);
    padding: 10px 20px;
    border-radius: 20px;
    margin-top: 10px;
}

/* ==================== TRUCK UNLOCK POPUP ==================== */

.truck-unlock-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0) rotate(-10deg);
    z-index: 2000;
    opacity: 0;
    transition: all 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.truck-unlock-popup.show {
    transform: translate(-50%, -50%) scale(1) rotate(0deg);
    opacity: 1;
}

.truck-unlock-content {
    background: linear-gradient(135deg, #4CAF50 0%, #66BB6A 100%);
    border-radius: 30px;
    padding: 40px;
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.5);
    text-align: center;
    min-width: 320px;
    border: 6px solid white;
}

.truck-unlock-title {
    font-size: 28px;
    font-weight: bold;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    margin-bottom: 20px;
}

.truck-unlock-icon {
    font-size: 100px;
    margin: 20px 0;
    animation: truckDrive 2s ease-in-out infinite;
}

@keyframes truckDrive {
    0%, 100% { transform: translateX(-10px); }
    50% { transform: translateX(10px); }
}

.truck-unlock-name {
    font-size: 32px;
    font-weight: bold;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

/* ==================== PROGRESS DASHBOARD ==================== */

.progress-dashboard {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 700px;
    max-height: 85vh;
    background: white;
    border-radius: 30px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    z-index: 1500;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.dashboard-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dashboard-header h2 {
    font-size: 32px;
    color: white;
    margin: 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.close-dashboard {
    background: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease;
}

.close-dashboard:hover {
    transform: scale(1.1);
}

.close-dashboard:active {
    transform: scale(0.95);
}

/* ==================== DASHBOARD STATS ==================== */

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    padding: 20px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

.stat-card {
    background: white;
    border-radius: 20px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-icon {
    font-size: 48px;
    margin-bottom: 10px;
}

.stat-value {
    font-size: 36px;
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 14px;
    color: #666;
    font-weight: 600;
}

/* ==================== DASHBOARD TABS ==================== */

.dashboard-sections {
    display: flex;
    background: #f0f0f0;
    padding: 0;
    border-bottom: 3px solid #ddd;
}

.dashboard-tab {
    flex: 1;
    padding: 20px;
    font-size: 18px;
    font-weight: bold;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 4px solid transparent;
}

.dashboard-tab:hover {
    background: rgba(102, 126, 234, 0.1);
}

.dashboard-tab.active {
    background: white;
    border-bottom-color: #667eea;
    color: #667eea;
}

/* ==================== DASHBOARD CONTENT ==================== */

.dashboard-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: white;
}

/* Scrollbar styling for dashboard */
.dashboard-content::-webkit-scrollbar {
    width: 10px;
}

.dashboard-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.dashboard-content::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 10px;
}

.dashboard-content::-webkit-scrollbar-thumb:hover {
    background: #764ba2;
}

/* ==================== ACHIEVEMENTS GRID ==================== */

.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.achievement-card {
    background: white;
    border-radius: 20px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.achievement-card.earned {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    transform: scale(1.02);
}

.achievement-card.earned .achievement-icon {
    animation: achievementSparkle 2s ease-in-out infinite;
}

@keyframes achievementSparkle {
    0%, 100% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.1) rotate(5deg); }
}

.achievement-card.locked {
    opacity: 0.6;
    filter: grayscale(0.5);
}

.achievement-card.locked:hover {
    opacity: 0.8;
    transform: translateY(-3px);
}

.achievement-card .achievement-icon {
    font-size: 60px;
    margin-bottom: 15px;
}

.achievement-name {
    font-size: 18px;
    font-weight: bold;
    color: #333;
    margin-bottom: 8px;
}

.achievement-card.earned .achievement-name {
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.achievement-desc {
    font-size: 14px;
    color: #666;
    margin-bottom: 12px;
}

.achievement-card.earned .achievement-desc {
    color: rgba(255, 255, 255, 0.95);
}

.achievement-progress {
    margin-top: 10px;
}

.progress-bar {
    width: 100%;
    height: 10px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    transition: width 0.5s ease;
}

/* ==================== TRUCKS GRID ==================== */

.trucks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
}

/* Dashboard truck collection cards - scoped to prevent conflicts with game truck cards */
.trucks-grid .truck-card {
    background: white;
    border-radius: 20px;
    padding: 25px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.trucks-grid .truck-card.unlocked {
    background: linear-gradient(135deg, #4CAF50 0%, #66BB6A 100%);
}

.trucks-grid .truck-card.unlocked .truck-icon {
    animation: truckWiggle 3s ease-in-out infinite;
}

@keyframes truckWiggle {
    0%, 100% { transform: rotate(-2deg); }
    50% { transform: rotate(2deg); }
}

.trucks-grid .truck-card.locked {
    opacity: 0.5;
    filter: grayscale(1);
}

.trucks-grid .truck-card.locked:hover {
    opacity: 0.7;
    transform: translateY(-3px);
}

.truck-icon {
    font-size: 80px;
    margin-bottom: 15px;
}

.truck-name {
    font-size: 20px;
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
}

.trucks-grid .truck-card.unlocked .truck-name {
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

.truck-requirement {
    font-size: 16px;
    color: #666;
    background: rgba(0, 0, 0, 0.05);
    padding: 8px 16px;
    border-radius: 15px;
    display: inline-block;
}

/* ==================== STICKER BOOK ==================== */

.sticker-book {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 15px;
}

.sticker-slot {
    background: white;
    border-radius: 15px;
    padding: 15px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.sticker-slot:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.sticker-display {
    font-size: 48px;
    margin-bottom: 10px;
}

.sticker-count {
    font-size: 14px;
    font-weight: bold;
    color: #666;
    background: rgba(102, 126, 234, 0.1);
    padding: 5px 10px;
    border-radius: 10px;
}

/* ==================== RESPONSIVE DESIGN ==================== */

@media (max-width: 768px) {
    .dashboard-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .stat-icon {
        font-size: 40px;
    }

    .stat-value {
        font-size: 28px;
    }

    .stat-label {
        font-size: 12px;
    }

    .dashboard-tab {
        font-size: 14px;
        padding: 15px 10px;
    }

    .achievements-grid,
    .trucks-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 15px;
    }

    .achievement-card,
    .trucks-grid .truck-card {
        padding: 15px;
    }

    .achievement-icon,
    .truck-icon {
        font-size: 50px;
    }

    .sticker-book {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        gap: 10px;
    }

    .sticker-display {
        font-size: 36px;
    }
}

@media (max-width: 480px) {
    .progress-dashboard {
        width: 95%;
        max-height: 90vh;
    }

    .dashboard-header h2 {
        font-size: 24px;
    }

    .close-dashboard {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }

    .achievement-popup-content,
    .truck-unlock-content {
        min-width: 250px;
        padding: 20px;
    }

    .achievement-icon {
        font-size: 60px;
    }

    .achievement-title {
        font-size: 24px;
    }

    .truck-unlock-icon {
        font-size: 80px;
    }

    .truck-unlock-name {
        font-size: 24px;
    }
}

/* ==================== ANIMATIONS ==================== */

@keyframes slideInFromTop {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideOutToTop {
    from {
        transform: translateY(0);
        opacity: 1;
    }
    to {
        transform: translateY(-100%);
        opacity: 0;
    }
}

/* Star collection animation */
.star-collect {
    animation: starCollect 1s ease-out;
}

@keyframes starCollect {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.5);
        opacity: 0.8;
    }
    100% {
        transform: scale(0.3) translateY(-100px);
        opacity: 0;
    }
}

/* Progress bar fill animation */
.progress-fill-animate {
    animation: progressFill 1s ease-out;
}

@keyframes progressFill {
    from {
        width: 0%;
    }
}

/* Confetti effect for major achievements */
.confetti {
    position: fixed;
    width: 10px;
    height: 10px;
    background: #f0f;
    position: absolute;
    animation: confetti-fall 3s linear;
    z-index: 3000;
}

@keyframes confetti-fall {
    to {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}

/* ==================== ACCESSIBILITY ==================== */

@media (prefers-reduced-motion: reduce) {
    .achievement-popup,
    .truck-unlock-popup,
    .achievement-icon,
    .truck-icon,
    .stat-card,
    .achievement-card,
    .trucks-grid .truck-card,
    .sticker-slot {
        animation: none !important;
        transition: none !important;
    }
}

/* Focus styles for keyboard navigation */
.dashboard-tab:focus,
.close-dashboard:focus,
.achievement-card:focus,
.trucks-grid .truck-card:focus,
.sticker-slot:focus {
    outline: 3px solid #667eea;
    outline-offset: 2px;
}
