:root {
    --bg-gradient-start: #4facfe;
    --bg-gradient-end: #00f2fe;
    --card-bg: rgba(255, 255, 255, 0.7);
    --card-border: rgba(255, 255, 255, 0.5);
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --accent-color: #f59e0b;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --font-main: 'Outfit', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-main);
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    min-height: 100vh;
    color: var(--text-primary);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 20px;
    background-attachment: fixed;
}

#app {
    width: 100%;
    max-width: 480px;
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Glassmorphism utilities */
.glass {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
}

/* Header / Points */
.header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
}

.points-badge {
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
    color: white;
    padding: 8px 16px;
    border-radius: 30px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4);
    font-size: 1.1rem;
}

.user-greeting {
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Tabs */
.view-tabs {
    display: flex;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    padding: 5px;
    margin-bottom: 10px;
}

.tab-btn {
    flex: 1;
    padding: 10px;
    border: none;
    background: transparent;
    font-family: inherit;
    font-weight: 600;
    color: white;
    cursor: pointer;
    border-radius: 15px;
    transition: all 0.3s ease;
}

.tab-btn.active {
    background: white;
    color: var(--text-primary);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* Task List */
.task-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.task-card {
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: transform 0.2s, box-shadow 0.2s;
}

.task-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
}

.task-card.completed {
    opacity: 0.7;
}

.task-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.task-icon {
    font-size: 2rem;
    color: var(--accent-color);
    background: rgba(255,255,255,0.8);
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.task-details h3 {
    font-size: 1.1rem;
    margin-bottom: 4px;
}

.task-time {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 600;
}

.check-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #cbd5e1;
    background: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: transparent;
    transition: all 0.3s ease;
}

.task-card.completed .check-btn {
    background: var(--success-color);
    border-color: var(--success-color);
    color: white;
}

/* Buttons */
.btn {
    font-family: inherit;
    font-weight: 600;
    padding: 12px 24px;
    border-radius: 15px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 1rem;
}

.btn-primary {
    background: linear-gradient(90deg, #10b981, #34d399);
    color: white;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
    width: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
}

.btn-danger {
    background: var(--danger-color);
    color: white;
    padding: 8px 12px;
}

/* Parent View Styles */
.parent-dashboard {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.add-task-form {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.form-group label {
    font-weight: 600;
    font-size: 0.9rem;
}

.form-group input, .form-group select {
    padding: 12px;
    border-radius: 10px;
    border: 1px solid var(--card-border);
    background: rgba(255,255,255,0.8);
    font-family: inherit;
    font-size: 1rem;
}

/* Modal */
.modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    opacity: 1;
    transition: opacity 0.3s;
}

.modal.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-content {
    width: 100%;
    max-width: 400px;
    padding: 30px;
    text-align: center;
    position: relative;
    transform: translateY(0);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal.hidden .modal-content {
    transform: translateY(50px);
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0,0,0,0.1);
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

#challenge-title {
    color: var(--accent-color);
    font-size: 1.8rem;
    margin-bottom: 10px;
}

#challenge-body {
    font-size: 3rem;
    font-weight: 700;
    margin: 20px 0;
    color: var(--text-primary);
}

.challenge-input {
    width: 100%;
    font-size: 2rem;
    text-align: center;
    padding: 10px;
    border: 2px solid var(--accent-color);
    border-radius: 15px;
    margin-bottom: 20px;
    font-family: inherit;
    font-weight: 700;
    color: var(--text-primary);
}

.feedback {
    margin-top: 15px;
    font-weight: 600;
    min-height: 24px;
}

.feedback.error {
    color: var(--danger-color);
    animation: shake 0.5s;
}

.feedback.success {
    color: var(--success-color);
}

/* Animations */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

@keyframes popIn {
    0% { transform: scale(0.8); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.pop-in {
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

/* Color Match Challenge Styles */
.color-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin: 20px 0;
}

.color-box {
    height: 80px;
    border-radius: 15px;
    cursor: pointer;
    border: 3px solid transparent;
    transition: transform 0.2s, border 0.2s;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.color-box:hover {
    transform: scale(1.05);
    border-color: rgba(0,0,0,0.2);
}

/* Rewards UI Styles */
.rewards-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 15px;
}

.reward-card {
    background: rgba(255, 255, 255, 0.8);
    border-radius: 20px;
    padding: 15px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.reward-icon {
    font-size: 2.5rem;
    color: var(--accent-color);
}

.reward-title {
    font-weight: 700;
    font-size: 1rem;
    line-height: 1.2;
}

.reward-cost {
    background: #fef3c7;
    color: #b45309;
    padding: 5px 10px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.9rem;
}

.reward-card .btn {
    padding: 8px 15px;
    font-size: 0.9rem;
}

/* Timer Styles */
.timer-circle {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 8px solid var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 20px auto;
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--primary-color);
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.3);
}

.timer-circle.danger {
    border-color: var(--danger-color);
    color: var(--danger-color);
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.3);
}

/* New CSS for Levels and Animations */
.task-card.pending {
    background: rgba(251, 191, 36, 0.2);
    border: 2px dashed #fbbf24;
}

@keyframes spin {
    100% { transform: rotate(360deg); }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}
