/* habits.css - Paper Checklist Style */

.habits-container {
    padding-bottom: 2rem;
}

.habits-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.add-btn {
    background: transparent;
    border: 1px dashed rgba(255, 255, 255, 0.3);
    color: var(--text-secondary);
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}

.add-btn:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    background: rgba(255, 255, 255, 0.05);
}

.habits-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    /* Space between groups */
}

/* Category Headers (The "Box" style) */
.habit-category-header {
    padding: 0.6rem 2.5rem;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: #0c4a6e;
    /* Dark blue text */
    background: #e0f2fe;
    /* High-contrast light blue block */
    margin: 1.5rem 0 0.5rem 0;
    width: fit-content;
    display: block;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Priority based block tints */
.habit-category-header.urgent {
    background: #fee2e2;
    color: #991b1b;
}

.habit-category-header.medium {
    background: #e0f2fe;
    color: #0c4a6e;
}

.habit-category-header.low {
    background: #f1f5f9;
    color: #334155;
}

.habit-checklist {
    border: none;
    background: transparent;
}

/* Checklist Item */
.habit-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: background 0.1s;
}

.habit-item:last-child {
    border-bottom: none;
}

.habit-item:hover {
    background: rgba(255, 255, 255, 0.02);
}

/* Square Checkbox */
.checkbox-square {
    width: 20px;
    height: 20px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 2px;
    background: transparent;
    margin-right: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #000;
    /* Checkmark color */
    font-size: 0.85rem;
    padding: 0;
    flex-shrink: 0;
    transition: all 0.2s;
}

.checkbox-square:hover {
    border-color: white;
}

.checkbox-square.checked {
    background: transparent;
    /* Keep transparent or fill? Image had checkmark */
    background: #fff;
    color: #000;
    border-color: #fff;
}

/* Content */
.habit-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.habit-name {
    font-size: 0.95rem;
    color: var(--text-primary);
    font-weight: 500;
}

/* Completed State */
.habit-item.done .habit-name {
    text-decoration: line-through;
    opacity: 0.5;
}

/* Delete Button */
.delete-icon {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0;
    padding: 0 0.5rem;
    transition: opacity 0.2s;
}

.habit-item:hover .delete-icon {
    opacity: 0.6;
}

.delete-icon:hover {
    opacity: 1;
    color: #ef4444;
}

/* Modal Styles Reuse */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: 0.3s;
}

.modal-overlay.open {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: #1e293b;
    padding: 2rem;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
}

.form-input {
    width: 100%;
    padding: 0.8rem;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: white;
}

.save-btn {
    background: var(--accent-primary);
    border: none;
    padding: 0.5rem 1.5rem;
    color: white;
    border-radius: 6px;
    cursor: pointer;
}

/* --- Responsive Habits --- */
@media (max-width: 768px) {
    .habits-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        margin-bottom: 1.5rem;
    }

    .habits-header h2 {
        font-size: 1.5rem;
    }

    .habit-item {
        padding: 0.75rem 0.5rem;
    }

    .habit-name {
        font-size: 0.9rem;
    }

    .checkbox-square {
        margin-right: 0.75rem;
    }
}