:root {
    --primary: #4f46e5;
    --success: #22c55e;
    --danger: #ef4444;
    --bg: #f8fafc;
    --card: #ffffff;
}

body {
    font-family: 'Segoe UI', sans-serif;
    background-color: var(--bg);
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Stats Bar */
.stats-bar {
    width: 100%;
    padding: 1rem;
    background: var(--card);
    display: flex;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.xp-container {
    width: 300px;
    height: 12px;
    background: #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
}

.xp-progress {
    height: 100%;
    background: var(--success);
    width: 0%;
    transition: width 0.4s ease;
}

/* Task Card */
.task-wrapper { margin-top: 2rem; width: 90%; max-width: 500px; position: fixed;top: 85px;}

.task-card {
    background: var(--card);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

ul { list-style: none; padding: 0; }

li {
    background: #f1f5f9;
    margin: 10px 0;
    padding: 12px;
    border-radius: 8px;
    display: flex;
    align-items: center;
}

/* Modal Styling */
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    justify-content: center; align-items: center;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
}

.danger-btn { background: var(--danger); color: white; border: none; padding: 10px; cursor: pointer; border-radius: 5px; }

/* Light Mode Variables (Default) */
:root {
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-color: #1e293b;
    --header-bg: #ffffff;
    --input-bg: #ffffff;
    --li-bg: #f1f5f9;
}

/* Dark Mode Variables */
body.dark-mode {
    --bg-color: #0f172a;
    --card-bg: #1e293b;
    --text-color: #f1f5f9;
    --header-bg: #1e293b;
    --input-bg: #334155;
    --li-bg: #334155;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: background 0.3s, color 0.3s;
}

.stats-bar, .task-card, .modal-content {
    background-color: var(--header-bg);
}

li {
    background-color: var(--li-bg);
}

input {
    background-color: var(--input-bg);
    color: var(--text-color);
    border: 1px solid #033b00;
}

.logout-btn {
    background-color: var(--primary); /* Use that indigo/blue color */
    color: white;
    border: none;
    padding: 10px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: opacity 0.2s;
}

.logout-btn:hover {
    opacity: 0.9;
}

.danger-btn {
    background-color: var(--danger); /* Red color */
    color: white;
    border: none;
    padding: 10px;
    border-radius: 5px;
    cursor: pointer;
}

/* Mobile Optimizations */
@media (max-width: 600px) {
    .stats-bar {
        flex-direction: column; /* Stack stats vertically */
        gap: 10px;
        padding: 15px;
    }

    .xp-container {
        width: 90%; /* Make the bar almost full width on mobile */
        height: 15px; /* Slightly thicker for better visibility */
    }

    .task-wrapper {
        width: 95%; /* Use more of the screen width */
        margin-top: 1rem;
    }

    .task-card {
        padding: 1.2rem;
    }

    /* Make buttons and inputs larger for "fat fingers" */
    input[type="text"], 
    .login-btn, 
    button {
        padding: 15px;
        font-size: 16px; /* Prevents iOS from zooming in on inputs */
    }

    li {
        padding: 15px;
        font-size: 1.1rem;
    }

    /* Adjust the Settings Modal for small screens */
    .modal-content {
        width: 85%;
        padding: 1.5rem;
    }
}

li label {
    display: flex;
    align-items: center;
    width: 100%;
    cursor: pointer;
    gap: 15px;
}

/* Make the checkbox bigger on mobile */
input[type="checkbox"] {
    width: 22px;
    height: 22px;
    cursor: pointer;
}