/**
 * Todo List CSS
 * Clean, simple implementation using float/block layout
 */

/* ====================
   CONTAINER
   ==================== */

.todo-editor-container {
    max-width: 800px;
    margin: 0 auto;
}

.todo-list-items {
    min-height: 100px;
}

/* ====================
   SECTION HEADERS
   ==================== */

.todo-section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
    margin-bottom: 12px;
    padding: 8px 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-color);
}

.todo-section-header:first-child {
    margin-top: 0;
}

.todo-section-header i {
    font-size: 16px;
}

/* Section header icon colors */
.todo-section-header i.fa-exclamation-circle {
    color: #ef4444;
}

.todo-section-header i.fa-calendar-day {
    color: #3b82f6;
}

.todo-section-header i.fa-calendar {
    color: #8b5cf6;
}

.todo-section-header i.fa-check-circle {
    color: #10b981;
}

.todo-section-title {
    flex: 1;
}

.todo-section-count {
    padding: 2px 8px;
    background: var(--border-color);
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
}

/* ====================
   TODO ITEM
   ==================== */

.todo-item {
    position: relative;
    margin-bottom: 10px;
    padding: 12px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-left-width: 4px;
    border-radius: 6px;
    overflow: hidden;
    transition: all 0.2s ease;
}

.todo-item.checked {
    opacity: 0.5;
    background: transparent;
}

/* Section-specific styling */
.todo-item.section-overdue {
    background: transparent;
    border-left-color: #ef4444 !important;
}

.todo-item.section-today {
    background: transparent;
    border-left-color: #3b82f6 !important;
}

.todo-item.section-completed {
    border-left-color: #10b981 !important;
}

/* Priority border colors (only for non-overdue, non-today tasks) */
.todo-item.section-upcoming.priority-low { border-left-color: #3b82f6; }
.todo-item.section-upcoming.priority-medium { border-left-color: #f59e0b; }
.todo-item.section-upcoming.priority-high { border-left-color: #ef4444; }

/* ====================
   LAYOUT
   ==================== */

.todo-checkbox {
    float: left;
    width: 20px;
    height: 20px;
    margin: 0 12px 0 0;
    cursor: pointer;
    accent-color: var(--accent-color);
}

.todo-delete-btn {
    float: right;
    padding: 4px 8px;
    background: transparent;
    border: none;
    border-radius: 4px;
    color: #dc3545;
    font-size: 14px;
    cursor: pointer;
}

.todo-delete-btn:hover {
    background: rgba(220, 53, 69, 0.1);
}

.todo-content {
    overflow: hidden;
}

/* ====================
   TEXT INPUT
   ==================== */

.todo-text {
    display: block;
    width: 100%;
    margin-bottom: 8px;
    padding: 0 0 4px 0;
    border: none;
    background: var(--content-bg);
    font-size: 15px;
    line-height: 1.5;
    color: var(--text-primary);
    outline: none;
    box-shadow: none;
}

.todo-text::placeholder {
    color: var(--text-secondary);
    opacity: 0.5;
}

.todo-text.checked {
    text-decoration: line-through;
    color: var(--text-secondary);
}

/* ====================
   META FIELDS
   ==================== */

.todo-meta {
    font-size: 0; /* Remove inline-block spacing */
}

.todo-meta label {
    display: inline-block;
    margin-right: 12px;
    margin-bottom: 4px;
    font-size: 13px;
    color: var(--text-secondary);
    vertical-align: middle;
}

.todo-meta label:last-child {
    margin-right: 0;
}

.todo-meta i {
    display: inline-block;
    width: 14px;
    margin-right: 4px;
    font-size: 12px;
    opacity: 0.7;
    vertical-align: middle;
}

.todo-meta input,
.todo-meta select {
    display: inline-block;
    padding: 3px 6px;
    border: 1px solid var(--border-color);
    border-radius: 3px;
    background: var(--content-bg);
    font-size: 13px;
    color: var(--text-primary);
    outline: none;
    vertical-align: middle;
}

.todo-meta input:focus,
.todo-meta select:focus {
    border-color: var(--accent-color);
}

.todo-meta input:disabled,
.todo-meta select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: var(--content-bg);
}

.todo-datetime { width: 200px; }
.todo-priority { width: 100px; cursor: pointer; }

/* ====================
   ADD FORM
   ==================== */

.todo-list-add {
    margin-bottom: 16px;
}

.todo-add-form {
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--content-bg);
    transition: all 0.2s ease;
}

.todo-add-form:focus-within {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(var(--accent-rgb, 54, 123, 245), 0.1);
}

.todo-add-text {
    display: block;
    width: 100%;
    padding: 8px 0;
    margin-bottom: 10px;
    border: none;
    background: transparent;
    font-size: 15px;
    line-height: 1.5;
    color: var(--text-primary);
    outline: none;
}

.todo-add-text::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

.todo-add-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.todo-add-meta label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: var(--text-secondary);
}

.todo-add-meta i {
    font-size: 13px;
    opacity: 0.7;
}

.todo-add-meta input,
.todo-add-meta select {
    padding: 4px 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--content-bg);
    font-size: 13px;
    color: var(--text-primary);
    outline: none;
    transition: all 0.2s ease;
}

.todo-add-meta input:focus,
.todo-add-meta select:focus {
    border-color: var(--accent-color);
}

.todo-add-datetime { width: 200px; }
.todo-add-priority { width: 100px; cursor: pointer; }

.todo-add-submit {
    margin-left: auto;
    padding: 6px 16px;
    border: 1px solid var(--accent-color);
    border-radius: 4px;
    background: var(--accent-color);
    color: white;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.todo-add-submit:hover {
    background: var(--accent-hover, #2563eb);
    transform: translateY(-1px);
}

.todo-add-submit:active {
    transform: translateY(0);
}

/* ====================
   DIVIDER
   ==================== */

.todo-list-divider {
    height: 1px;
    margin: 16px 0;
    background: var(--border-color);
    opacity: 0.2;
}

/* ====================
   EMPTY STATE
   ==================== */

.todo-empty {
    padding: 60px 20px;
    text-align: center;
    color: var(--text-secondary);
}

.todo-empty i {
    display: block;
    margin-bottom: 12px;
    font-size: 40px;
    opacity: 0.4;
}

.todo-empty p {
    margin: 4px 0;
    font-size: 15px;
    opacity: 0.7;
}

/* ====================
   DARK MODE
   ==================== */

body.dark .todo-section-header {
    color: rgba(255, 255, 255, 0.9);
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

body.dark .todo-section-count {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
}

body.dark .todo-item {
    background: transparent;
    border-color: rgba(255, 255, 255, 0.1);
}

body.dark .todo-item.checked {
    background: transparent;
}

body.dark .todo-item.section-overdue {
    background: transparent;
    border-left-color: #ef4444 !important;
}

body.dark .todo-item.section-today {
    background: transparent;
    border-left-color: #3b82f6 !important;
}

body.dark .todo-item.section-completed {
    border-left-color: #10b981 !important;
}

body.dark .todo-item.section-upcoming.priority-low { border-left-color: #3b82f6; }
body.dark .todo-item.section-upcoming.priority-medium { border-left-color: #f59e0b; }
body.dark .todo-item.section-upcoming.priority-high { border-left-color: #ef4444; }

body.dark .todo-text {
    color: rgba(255, 255, 255, 0.9) !important;
    background: #171717 !important;
    border: none !important;
}

body.dark .todo-text:focus,
body.dark .todo-text:hover,
body.dark .todo-text:active {
    background: #171717 !important;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
}

body.dark .todo-text::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

body.dark .todo-text.checked {
    color: rgba(255, 255, 255, 0.4);
}

body.dark .todo-meta label {
    color: rgba(255, 255, 255, 0.5);
}

body.dark .todo-meta input,
body.dark .todo-meta select {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
}

body.dark .todo-meta input:focus,
body.dark .todo-meta input:hover,
body.dark .todo-meta input:active,
body.dark .todo-meta select:focus,
body.dark .todo-meta select:hover,
body.dark .todo-meta select:active {
    background: rgba(255, 255, 255, 0.03) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

body.dark .todo-meta input:focus,
body.dark .todo-meta select:focus {
    border-color: var(--accent-color) !important;
}

body.dark .todo-meta input:disabled,
body.dark .todo-meta select:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

body.dark .todo-add-form {
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.02);
}

body.dark .todo-add-form:focus-within {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(var(--accent-rgb, 54, 123, 245), 0.15);
}

body.dark .todo-add-text {
    color: rgba(255, 255, 255, 0.9) !important;
    background: transparent !important;
    border: none !important;
}

body.dark .todo-add-text:focus,
body.dark .todo-add-text:hover,
body.dark .todo-add-text:active {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
}

body.dark .todo-add-text::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

body.dark .todo-add-meta label {
    color: rgba(255, 255, 255, 0.5);
}

body.dark .todo-add-meta input,
body.dark .todo-add-meta select {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
}

body.dark .todo-add-meta input:focus,
body.dark .todo-add-meta input:hover,
body.dark .todo-add-meta input:active,
body.dark .todo-add-meta select:focus,
body.dark .todo-add-meta select:hover,
body.dark .todo-add-meta select:active {
    background: rgba(255, 255, 255, 0.05) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

body.dark .todo-add-meta input:focus,
body.dark .todo-add-meta select:focus {
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: var(--accent-color) !important;
}

body.dark .todo-list-divider {
    background: rgba(255, 255, 255, 0.05);
}

body.dark .todo-empty {
    color: rgba(255, 255, 255, 0.4);
}

/* ====================
   MOBILE
   ==================== */

@media (max-width: 768px) {
    .todo-item {
        padding: 10px;
    }

    .todo-checkbox {
        margin-right: 10px;
    }

    .todo-meta label {
        margin-right: 8px;
        font-size: 12px;
    }

    .todo-meta i {
        font-size: 11px;
        width: 12px;
    }

    .todo-meta input,
    .todo-meta select {
        padding: 2px 4px;
        font-size: 12px;
    }

    .todo-datetime { width: 160px; }
    .todo-priority { width: 80px; }

    /* Add form mobile styles */
    .todo-add-form {
        padding: 10px;
    }

    .todo-add-text {
        font-size: 14px;
    }

    .todo-add-meta {
        gap: 6px;
    }

    .todo-add-meta label {
        font-size: 12px;
    }

    .todo-add-meta i {
        font-size: 11px;
    }

    .todo-add-meta input,
    .todo-add-meta select {
        padding: 3px 6px;
        font-size: 12px;
    }

    .todo-add-datetime { width: 160px; }
    .todo-add-priority { width: 80px; }

    .todo-add-submit {
        padding: 5px 12px;
        font-size: 13px;
    }
}
