/* RESET & BASE STYLES */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 1rem;
}

/* Demo Container - Centers card */
.demo-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

/* TODO CARD STYLES */
.todo-card {
    background: white;
    border-radius: 1.5rem;
    padding: 1.5rem;
    width: 100%;
    max-width: 500px;
    box-shadow: 0 20px 35px -10px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Hover effect for desktop */
.todo-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 25px 40px -12px rgba(0, 0, 0, 0.25);
}

/* CARD HEADER - Title + Status */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.title-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
}

/* Checkbox Styling */
.complete-toggle {
    width: 1.25rem;
    height: 1.25rem;
    cursor: pointer;
    accent-color: #10b981;
    flex-shrink: 0;
}

/* Focus style for keyboard navigation */
.complete-toggle:focus-visible {
    outline: 3px solid #10b981;
    outline-offset: 2px;
}

/* Todo Title */
.todo-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1f2937;
    transition: text-decoration 0.2s ease, color 0.2s ease;
    word-break: break-word;
}

/* Completed state (via JS) */
.todo-title.completed {
    text-decoration: line-through;
    color: #9ca3af;
}

/* Status Badge */
.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 2rem;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
}

.status-pending {
    background: #fef3c7;
    color: #d97706;
}

.status-inprogress {
    background: #dbeafe;
    color: #2563eb;
}

.status-done {
    background: #d1fae5;
    color: #059669;
}

/* DESCRIPTION */
.todo-description {
    color: #4b5563;
    line-height: 1.5;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

/* META ROW - Priority & Due Date */
.meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

/* Priority Badge */
.priority-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 2rem;
    font-size: 0.8rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.priority-high {
    background: #fee2e2;
    color: #dc2626;
}

.priority-medium {
    background: #fef3c7;
    color: #d97706;
}

.priority-low {
    background: #e0f2fe;
    color: #0284c7;
}

/* Due Date */
.due-date {
    color: #6b7280;
    font-size: 0.8rem;
    font-weight: 500;
}

/* TIME REMAINING */
.time-remaining-wrapper {
    background: #f3f4f6;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
}

.time-label {
    font-size: 1.1rem;
}

.time-remaining {
    color: #374151;
    font-weight: 500;
}

.time-remaining.overdue {
    color: #dc2626;
    font-weight: 600;
}

.time-remaining.due-now {
    color: #ea580c;
    font-weight: 600;
}

/* TAGS SECTION */
.tags-section {
    margin-bottom: 1.25rem;
}

.tags-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: block;
    margin-bottom: 0.5rem;
}

.tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    list-style: none;
}

.tag {
    padding: 0.35rem 0.85rem;
    border-radius: 2rem;
    font-size: 0.75rem;
    font-weight: 500;
    background: #f3f4f6;
    color: #374151;
    transition: all 0.2s ease;
}

.tag-work {
    background: #e0e7ff;
    color: #4338ca;
}

.tag-urgent {
    background: #ffe4e6;
    color: #e11d48;
}

/* Focus style for tags (keyboard accessible) */
.tag:focus-visible {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* ACTION BUTTONS */
.action-buttons {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    border-top: 1px solid #e5e7eb;
    padding-top: 1rem;
    margin-top: 0.25rem;
}

.edit-btn, .delete-btn {
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.edit-btn {
    background: #f3f4f6;
    color: #374151;
}

.edit-btn:hover {
    background: #e5e7eb;
}

.delete-btn {
    background: #fee2e2;
    color: #dc2626;
}

.delete-btn:hover {
    background: #fecaca;
}

/* Button Focus Styles (WCAG AA compliant) */
.edit-btn:focus-visible,
.delete-btn:focus-visible {
    outline: 3px solid #667eea;
    outline-offset: 2px;
    transform: scale(1.02);
}

/* ========== RESPONSIVE DESIGN ========== */
/* Mobile (320px - 640px) */
@media (max-width: 640px) {
    .demo-container {
        padding: 0;
    }
    
    .todo-card {
        padding: 1rem;
        border-radius: 1rem;
    }
    
    .card-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .title-wrapper {
        width: 100%;
    }
    
    .status-badge {
        align-self: flex-start;
    }
    
    .todo-title {
        font-size: 1.1rem;
    }
    
    .meta-row {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .edit-btn, .delete-btn {
        width: 100%;
        justify-content: center;
    }
    
    .tags-list {
        gap: 0.4rem;
    }
}

/* Tablet (641px - 1024px) */
@media (min-width: 641px) and (max-width: 1024px) {
    .todo-card {
        max-width: 480px;
        padding: 1.25rem;
    }
}

/* Desktop (1025px - 1200px) */
@media (min-width: 1025px) {
    .todo-card {
        max-width: 500px;
    }
}

/* Ensure no horizontal overflow */
img, svg, .tag, button {
    max-width: 100%;
}

/* High contrast focus for all interactive elements */
*:focus-visible {
    outline: 3px solid #667eea;
    outline-offset: 2px;
}