:root {
    --bg-color: #ffffff;
    --text-primary: #292929;
    --text-secondary: #757575;
    --accent-color: #1a8917;
    --accent-hover: #156d12;
    --border-color: #e6e6e6;
    --danger: #d93025;
    --success: #1a8917;
    --priority-color: #ffc017;
    --font-serif: 'Playfair Display', serif;
    --font-sans: 'Inter', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-sans);
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 4rem;
    overflow-y: auto;
}

/* Main Container */
.app-container {
    width: 70%;
    max-width: 800px;
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.app-title {
    font-family: var(--font-serif);
    font-size: 3.5rem;
    font-weight: 900;
    letter-spacing: -0.03em;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    text-align: center;
}

.counter-display {
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 400;
    font-family: var(--font-sans);
    margin-bottom: 2rem;
    text-align: center;
}

/* Input Group */
.input-group {
    display: flex;
    gap: 1rem;
    background: transparent;
    padding: 0;
    border: none;
    border-bottom: 1px solid var(--border-color);
    border-radius: 0;
    margin-bottom: 2rem;
    align-items: center;
}

input[type="text"] {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    padding: 0.5rem 0;
    font-size: 1.25rem;
    font-family: var(--font-serif);
}

input[type="text"]::placeholder {
    color: var(--text-secondary);
    font-family: var(--font-sans);
    font-weight: 300;
}

.add-btn {
    background: transparent;
    color: var(--text-secondary);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
}

.add-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--accent-color);
}

/* Task Lists */
.task-lists-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    overflow-y: visible;
    flex: 1;
}

/* Task Group */
.task-group {
    display: flex;
    flex-direction: column;
    gap: 0;
    transition: all 0.2s ease;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
    margin-bottom: 0.5rem;
}

.task-group.completed {
    opacity: 0.5;
}

/* Task Item */
.task-item {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0.5rem 0;
    display: flex;
    align-items: flex-start;
    /* Align to top for multiline */
    gap: 1rem;
    transition: all 0.2s ease;
    position: relative;
}

.task-item.subtask {
    margin-left: 2rem;
    border-left: 2px solid var(--border-color);
    padding-left: 1rem;
}

.task-item.priority {
    padding-left: 0;
}

.priority-separator {
    height: 2px;
    background-color: var(--priority-color);
    margin: 1rem auto;
    width: 33%;
    border-radius: 2px;
}

.checkbox {
    appearance: none;
    width: 18px;
    height: 18px;
    border: 1px solid var(--text-secondary);
    border-radius: 50%;
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
    flex-shrink: 0;
    margin-top: 0.3rem;
    /* Align with first line of text */
}

.checkbox:checked {
    background: var(--accent-color);
    border-color: var(--accent-color);
}

.checkbox:checked::after {
    content: '';
    position: absolute;
    width: 10px;
    height: 5px;
    border-left: 2px solid white;
    border-bottom: 2px solid white;
    top: 45%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-45deg);
}

.task-content {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1.1rem;
    font-family: var(--font-serif);
    outline: none;
    min-width: 0;
    resize: none;
    /* Disable manual resize */
    overflow: hidden;
    /* Hide scrollbar */
    line-height: 1.5;
    padding: 0;
}

.task-group.completed .task-content {
    text-decoration: line-through;
    color: var(--text-secondary);
}

/* Actions */
.actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    opacity: 0;
    transition: opacity 0.2s;
    margin-top: 0.1rem;
    /* Align with text */
}

.task-item:hover .actions {
    opacity: 1;
}

.action-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0.25rem;
    transition: all 0.2s;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.action-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-primary);
}

.priority-btn.active {
    color: var(--priority-color);
}

.subtask-btn:hover {
    color: var(--accent-color);
}

.delete-btn:hover {
    color: var(--danger);
}

.drag-handle {
    cursor: grab;
    color: var(--text-secondary);
    padding: 0.25rem;
    font-size: 1rem;
    opacity: 0;
    transition: opacity 0.2s;
    margin-top: 0.2rem;
    /* Align with text */
}

.task-item:hover .drag-handle {
    opacity: 1;
}

/* Footer */
.app-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.85rem;
    color: var(--text-secondary);
    padding-top: 0.5rem;
}

.clear-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.85rem;
    transition: color 0.2s;
}

.clear-btn:hover {
    color: var(--text-primary);
    text-decoration: underline;
}

/* Dragging Visuals */
.task-group.dragging {
    opacity: 0.4;
}

.drop-line {
    height: 4rem;
    background: transparent;
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    margin: 0.5rem 0;
    opacity: 0.5;
}

/* Mobile Layout */
@media (max-width: 768px) {
    .app-container {
        width: 90%;
        gap: 1rem;
    }

    .app-title {
        font-size: 2.5rem;
        margin-bottom: 0;
    }

    .counter-display {
        margin-bottom: 1rem;
    }

    .task-content,
    input[type="text"] {
        font-size: 1rem;
    }

    /* Always show controls on mobile */
    .actions,
    .drag-handle {
        opacity: 1;
    }
}

/* Authentication & Views */
.hidden {
    display: none !important;
}

.login-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: var(--bg-color);
    z-index: 1000;
}

.login-card {
    text-align: center;
    padding: 2rem;
    max-width: 400px;
    width: 90%;
}

.login-subtitle {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

.google-btn {
    background: #ffffff;
    color: #3c4043;
    border: 1px solid #dadce0;
    border-radius: 4px;
    padding: 0.75rem 1.5rem;
    font-family: 'Google Sans', 'Roboto', sans-serif;
    font-weight: 500;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    transition: background-color 0.2s, box-shadow 0.2s;
}

.google-btn:hover {
    background-color: #f7f8f8;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.header-top {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    width: 100%;
}

.logout-btn {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
    color: var(--text-secondary);
}

.logout-btn:hover {
    color: var(--danger);
}