/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 20px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo i {
    font-size: 2rem;
    color: #667eea;
}

.logo h1 {
    font-size: 1.8rem;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-info span {
    font-weight: 500;
    color: #333;
}

/* Buttons */
.btn-primary, .btn-secondary, .btn-game {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 12px;
    font-weight: 500;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    border: 2px solid rgba(102, 126, 234, 0.2);
}

.btn-secondary:hover {
    background: rgba(102, 126, 234, 0.1);
    border-color: rgba(102, 126, 234, 0.4);
}

.btn-game {
    background: linear-gradient(135deg, #f093fb, #f5576c);
    color: white;
    width: 100%;
    justify-content: center;
}

.btn-game:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 87, 108, 0.4);
}

.btn-game:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.btn-full {
    width: 100%;
    justify-content: center;
}

/* Main Content */
.main {
    padding: 2rem 0;
}

/* Stats Panel */
.stats-panel {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
}

.stat-item i {
    color: #667eea;
    font-size: 1.2rem;
}

.progress-container {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.progress-bar {
    flex: 1;
    height: 10px;
    background: rgba(102, 126, 234, 0.2);
    border-radius: 5px;
    overflow: hidden;
}

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

.progress-text {
    font-size: 0.9rem;
    color: #666;
    white-space: nowrap;
}

/* Sections */
.todo-section, .games-section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.section-header h2 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    color: #333;
}

.section-header i {
    color: #667eea;
}

.task-stats {
    color: #666;
    font-size: 0.9rem;
}

/* Add Task Form */
.add-task-form {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.add-task-form input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 2px solid rgba(102, 126, 234, 0.2);
    border-radius: 12px;
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.9);
    transition: border-color 0.3s ease;
}

.add-task-form input:focus {
    outline: none;
    border-color: #667eea;
}

/* Tasks */
.tasks-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.task-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 12px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.task-item:hover {
    border-color: rgba(102, 126, 234, 0.3);
    transform: translateX(5px);
}

.task-item.completed {
    opacity: 0.7;
    text-decoration: line-through;
}

.task-checkbox {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid #667eea;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.task-checkbox.checked {
    background: #667eea;
    color: white;
}

.task-text {
    flex: 1;
    font-size: 1rem;
}

.task-delete {
    background: none;
    border: none;
    color: #f5576c;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: background 0.3s ease;
}

.task-delete:hover {
    background: rgba(245, 87, 108, 0.1);
}

/* Games Grid */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.game-card {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 16px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.game-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.game-card.unlocked {
    border-color: rgba(102, 126, 234, 0.3);
}

.game-card.locked {
    opacity: 0.6;
}

.game-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.game-card h3 {
    margin-bottom: 0.5rem;
    color: #333;
}

.game-card p {
    color: #666;
    margin-bottom: 1rem;
}

.unlock-level {
    font-size: 0.8rem;
    color: #f5576c;
    margin-bottom: 1rem;
    font-weight: 500;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 20px;
    max-width: 90%;
    max-height: 90%;
    overflow: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        transform: scale(0.9) translateY(-20px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #eee;
}

.modal-header h3 {
    margin: 0;
    color: #333;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
    padding: 0.5rem;
    border-radius: 8px;
    transition: background 0.3s ease;
}

.close-btn:hover {
    background: rgba(0, 0, 0, 0.1);
}

.modal-body {
    padding: 1.5rem;
}

.game-controls {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    justify-content: center;
}

/* Celebration Modal */
.modal-content.celebration {
    text-align: center;
    max-width: 400px;
}

.celebration-content {
    padding: 2rem;
}

.celebration-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.celebration-content h2 {
    color: #333;
    margin-bottom: 1rem;
}

.rewards {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin: 1.5rem 0;
}

.reward-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-radius: 12px;
    font-weight: 500;
}

/* Auth Styles */
.auth-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 1rem;
}

.auth-container {
    width: 100%;
    max-width: 400px;
}

.auth-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-header .logo h1 {
    font-size: 2rem;
}

.auth-header p {
    color: #666;
    margin-top: 0.5rem;
}

.auth-form h2 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: #333;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #333;
}

.form-group input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid rgba(102, 126, 234, 0.2);
    border-radius: 12px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
}

.form-group small {
    color: #666;
    font-size: 0.8rem;
}

.auth-switch {
    text-align: center;
    margin-top: 1rem;
    color: #666;
}

.auth-switch a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
}

.auth-switch a:hover {
    text-decoration: underline;
}

.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
}

/* Profile Styles */
.profile-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.profile-header {
    text-align: center;
    margin-bottom: 2rem;
}

.profile-avatar-large {
    font-size: 5rem;
    color: #667eea;
    margin-bottom: 1rem;
}

.profile-header h1 {
    color: #333;
    margin-bottom: 0.5rem;
}

.profile-subtitle {
    color: #666;
    font-size: 1.1rem;
}

.profile-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 16px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

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

.stat-icon {
    font-size: 2rem;
    color: #667eea;
    margin-bottom: 1rem;
}

.stat-info h3 {
    font-size: 2rem;
    color: #333;
    margin-bottom: 0.5rem;
}

.stat-info p {
    color: #666;
}

.achievements-section {
    margin-bottom: 2rem;
}

.achievements-section h2 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    color: #333;
}

.achievements-section i {
    color: #667eea;
}

.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.achievement-card {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
    position: relative;
    transition: all 0.3s ease;
}

.achievement-card.unlocked {
    border: 2px solid #4ade80;
    box-shadow: 0 4px 20px rgba(74, 222, 128, 0.2);
}

.achievement-card.locked {
    opacity: 0.5;
    border: 2px solid #ccc;
}

.achievement-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.achievement-card.unlocked .achievement-icon {
    color: #4ade80;
}

.achievement-card.locked .achievement-icon {
    color: #ccc;
}

.achievement-card h3 {
    margin-bottom: 0.5rem;
    color: #333;
}

.achievement-card p {
    color: #666;
    font-size: 0.9rem;
}

.achievement-badge {
    background: #4ade80;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-size: 0.8rem;
    margin-top: 0.5rem;
    display: inline-block;
}

.achievement-lock {
    color: #ccc;
    margin-top: 0.5rem;
}

.profile-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Game Canvas */
.game-canvas {
    border: 2px solid #667eea;
    border-radius: 12px;
    display: block;
    margin: 0 auto;
    background: #f8fafc;
}

.game-info {
    text-align: center;
    margin: 1rem 0;
    font-size: 1.1rem;
    font-weight: 500;
}

.game-score {
    color: #667eea;
}

/* Responsive Design */
@media (max-width: 768px) {
    .stats-panel {
        flex-direction: column;
        gap: 1rem;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .add-task-form {
        flex-direction: column;
    }

    .games-grid {
        grid-template-columns: 1fr;
    }

    .game-controls {
        flex-direction: column;
    }

    .profile-stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }

    .achievements-grid {
        grid-template-columns: 1fr;
    }

    .profile-actions {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }

    .header .container {
        padding: 0.75rem 15px;
    }

    .logo h1 {
        font-size: 1.5rem;
    }

    .nav {
        flex-direction: column;
        gap: 0.5rem;
    }

    .user-info {
        flex-direction: column;
        gap: 0.5rem;
    }

    .todo-section, .games-section, .profile-container {
        padding: 1.5rem;
    }

    .modal-content {
        max-width: 95%;
        margin: 1rem;
    }

    .auth-card {
        padding: 1.5rem;
    }
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.slide-up {
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.bounce {
    animation: bounce 0.6s ease;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

/* Confetti Styles */
.confetti {
    position: fixed;
    width: 10px;
    height: 10px;
    background: #667eea;
    pointer-events: none;
    z-index: 10000;
}

.confetti:nth-child(odd) {
    background: #f093fb;
}

.confetti:nth-child(3n) {
    background: #4ade80;
}

.confetti:nth-child(4n) {
    background: #fbbf24;
}

.confetti:nth-child(5n) {
    background: #f87171;
}
