/* ============================================================
   TaskWarden Todo System Styles
   ============================================================ */

/* ── Todo Card ──────────────────────────────────────────────── */

.todo-card {
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    border-left: 4px solid #dee2e6 !important;
}

.todo-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.1) !important;
}

.todo-card.status-pending   { border-left-color: #6c757d !important; }
.todo-card.status-active    { border-left-color: #0d6efd !important; }
.todo-card.status-inprogress { border-left-color: #0dcaf0 !important; }
.todo-card.status-completed { border-left-color: #198754 !important; }
.todo-card.status-skipped   { border-left-color: #ffc107 !important; }
.todo-card.status-blocked   { border-left-color: #dc3545 !important; }

.todo-card .todo-title {
    font-weight: 600;
    color: #212529;
    text-decoration: none;
}

.todo-card .todo-title:hover {
    color: #0466C8;
}

.todo-card.completed .todo-title {
    text-decoration: line-through;
    color: #6c757d;
}

/* ── Completion Checkbox ────────────────────────────────────── */

.todo-check-circle {
    width: 24px;
    height: 24px;
    min-width: 24px;
    border-radius: 50%;
    border: 2px solid #dee2e6;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    background: transparent;
    padding: 0;
    color: transparent;
}

.todo-check-circle:hover {
    border-color: #198754;
    background: #e8f5e9;
    color: #198754;
}

.todo-check-circle.checked {
    border-color: #198754;
    background: #198754;
    color: white;
}

/* ── Priority Indicators ────────────────────────────────────── */

.priority-urgent {
    color: #dc3545;
}

.priority-important {
    color: #ffc107;
}

/* ── Due Date Badges ────────────────────────────────────────── */

.due-overdue {
    color: #dc3545;
    font-weight: 600;
}

.due-today {
    color: #fd7e14;
    font-weight: 600;
}

.due-upcoming {
    color: #6c757d;
}

/* ── View Tabs ──────────────────────────────────────────────── */

.view-tabs .btn {
    border-radius: 0;
    border: 1px solid #dee2e6;
    background: white;
    color: #6c757d;
}

.view-tabs .btn:first-child {
    border-radius: 0.375rem 0 0 0.375rem;
}

.view-tabs .btn:last-child {
    border-radius: 0 0.375rem 0.375rem 0;
}

.view-tabs .btn.active {
    background: #0466C8;
    border-color: #0466C8;
    color: white;
}

/* ── Kanban Board ───────────────────────────────────────────── */

.kanban-board {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: 1rem;
    min-height: 400px;
}

.kanban-column {
    flex: 1;
    min-width: 260px;
    max-width: 340px;
    background: #f8f9fa;
    border-radius: 0.5rem;
    padding: 0.75rem;
}

.kanban-column-header {
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.5rem;
    margin-bottom: 0.75rem;
    border-radius: 0.375rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.kanban-column .kanban-item {
    background: white;
    border-radius: 0.375rem;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    cursor: grab;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.kanban-column .kanban-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.kanban-column .kanban-item.dragging {
    opacity: 0.5;
    transform: rotate(2deg);
}

.kanban-column.drag-over {
    background: #e3f2fd;
    border: 2px dashed #0d6efd;
}

/* ── Calendar View ──────────────────────────────────────────── */

.calendar-grid {
    width: 100%;
    border-collapse: collapse;
}

.calendar-grid th {
    text-align: center;
    padding: 0.5rem;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    color: #6c757d;
    background: #f8f9fa;
}

.calendar-grid td {
    border: 1px solid #e9ecef;
    padding: 0.25rem;
    height: 80px;
    vertical-align: top;
    width: 14.28%;
    cursor: pointer;
    transition: background 0.15s ease;
}

.calendar-grid td:hover {
    background: #f0f7ff;
}

.calendar-grid td.today {
    background: #e3f2fd;
}

.calendar-grid td.other-month {
    background: #fafafa;
    color: #ccc;
}

.calendar-grid td.selected {
    background: #e8f5e9;
    border-color: #198754;
}

.calendar-grid .day-number {
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 2px;
}

.calendar-grid .day-dots {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
}

.calendar-grid .todo-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.todo-dot.dot-pending   { background: #6c757d; }
.todo-dot.dot-active    { background: #0d6efd; }
.todo-dot.dot-inprogress { background: #0dcaf0; }
.todo-dot.dot-completed { background: #198754; }
.todo-dot.dot-skipped   { background: #ffc107; }
.todo-dot.dot-blocked   { background: #dc3545; }

/* ── Eisenhower Matrix ──────────────────────────────────────── */

.eisenhower-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    gap: 1rem;
    min-height: 500px;
}

.eisenhower-quadrant {
    border-radius: 0.5rem;
    overflow: hidden;
}

.eisenhower-quadrant .quadrant-header {
    padding: 0.75rem 1rem;
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: white;
}

.eisenhower-quadrant .quadrant-body {
    padding: 0.75rem;
    min-height: 200px;
    background: white;
    border: 1px solid #e9ecef;
    border-top: 0;
    border-radius: 0 0 0.5rem 0.5rem;
}

.quadrant-do-first .quadrant-header    { background: #dc3545; }
.quadrant-schedule .quadrant-header    { background: #0d6efd; }
.quadrant-delegate .quadrant-header    { background: #fd7e14; }
.quadrant-eliminate .quadrant-header   { background: #6c757d; }

.quadrant-do-first .quadrant-body  { border-color: #dc354533; }
.quadrant-schedule .quadrant-body  { border-color: #0d6efd33; }
.quadrant-delegate .quadrant-body  { border-color: #fd7e1433; }
.quadrant-eliminate .quadrant-body { border-color: #6c757d33; }

/* ── My Day ─────────────────────────────────────────────────── */

.myday-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
}

.myday-header h2 {
    margin: 0;
    font-weight: 700;
}

.myday-header .date-display {
    opacity: 0.9;
    font-size: 1.1rem;
}

.myday-section {
    margin-bottom: 1.5rem;
}

.myday-section-header {
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6c757d;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e9ecef;
}

/* ── Tag Pills ──────────────────────────────────────────────── */

.todo-tag {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 50rem;
    font-size: 0.75rem;
    font-weight: 500;
    border: 1px solid;
}

/* ── Category Badge ─────────────────────────────────────────── */

.category-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.15rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 500;
    background: #f0f0f0;
}

/* ── Filter Bar ─────────────────────────────────────────────── */

.filter-bar {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
}

.filter-bar .form-select,
.filter-bar .form-control {
    font-size: 0.85rem;
}

/* ── Template Cards ─────────────────────────────────────────── */

.template-card {
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.template-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.1) !important;
}

.template-card.featured {
    border-left: 4px solid #ffc107 !important;
}

/* Star Rating Display */
.star-rating {
    color: #ffc107;
    font-size: 0.9rem;
}

.star-rating .bi-star {
    color: #dee2e6;
}

/* Star Rating Input */
.star-rating-input {
    display: inline-flex;
    flex-direction: row-reverse;
    gap: 0.1rem;
}

.star-rating-input input[type="radio"] {
    display: none;
}

.star-rating-input label {
    cursor: pointer;
    font-size: 1.5rem;
    color: #dee2e6;
    transition: color 0.15s ease;
}

.star-rating-input label:hover,
.star-rating-input label:hover ~ label,
.star-rating-input input:checked ~ label {
    color: #ffc107;
}

/* ── Named Period Card ──────────────────────────────────────── */

.period-card {
    transition: transform 0.15s ease;
}

.period-card:hover {
    transform: translateY(-1px);
}

.period-color-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

/* ── Notification List ──────────────────────────────────────── */

.notification-item {
    transition: background 0.15s ease;
}

.notification-item.unread {
    background: #f0f7ff;
    border-left: 3px solid #0d6efd;
}

.notification-item .unread-dot {
    width: 8px;
    height: 8px;
    min-width: 8px;
    background: #0d6efd;
    border-radius: 50%;
}

/* ── Rule Builder ───────────────────────────────────────────── */

.rule-builder {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 0.5rem;
    padding: 1rem;
}

.rule-condition-row {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 0.375rem;
    padding: 0.5rem;
    margin-bottom: 0.5rem;
}

/* ── Template Item Form ─────────────────────────────────────── */

.template-item-row {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 0.375rem;
    padding: 1rem;
    margin-bottom: 0.75rem;
    position: relative;
}

.template-item-row .drag-handle {
    cursor: grab;
    color: #adb5bd;
}

.template-item-row .drag-handle:hover {
    color: #495057;
}

.template-item-row .remove-item-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
}

/* ── Dependency Chain ───────────────────────────────────────── */

.dependency-item {
    display: flex;
    align-items: center;
    padding: 0.5rem;
    gap: 0.5rem;
}

.dependency-arrow {
    color: #0d6efd;
    font-size: 1.2rem;
}

/* ── Status Indicator Animations ────────────────────────────── */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.todo-card {
    animation: fadeInUp 0.3s ease;
}

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

.todo-card.just-completed {
    animation: pulse 0.3s ease;
}

/* ── Responsive ─────────────────────────────────────────────── */

@media (max-width: 768px) {
    .eisenhower-grid {
        grid-template-columns: 1fr;
    }

    .kanban-board {
        flex-direction: column;
    }

    .kanban-column {
        min-width: unset;
        max-width: unset;
    }

    .calendar-grid td {
        height: 60px;
        font-size: 0.75rem;
    }

    .myday-header {
        padding: 1.5rem;
    }

    .filter-bar {
        flex-direction: column;
    }
}

@media (max-width: 576px) {
    .view-tabs .btn span {
        display: none;
    }

    .calendar-grid td {
        height: 50px;
    }
}
