* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
}

.header {
    text-align: center;
    color: white;
    margin-bottom: 40px;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.header-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.back-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.3s;
}

.back-button:hover {
    background: rgba(255, 255, 255, 0.3);
}

.card {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.create-form {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
}

.input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.input:focus {
    outline: none;
    border-color: #667eea;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #6b7280;
    color: white;
    padding: 8px 16px;
    font-size: 14px;
}

.btn-secondary:hover {
    background: #4b5563;
}

.btn-success {
    background: #10b981;
    color: white;
}

.btn-success:hover {
    background: #059669;
}

.btn-danger {
    background: #ef4444;
    color: white;
    padding: 8px 16px;
    font-size: 14px;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-danger:hover,
.item:hover .btn-danger {
    background: white;
    color: #ef4444;
    border: 2px solid #ef4444;
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
}

.checklist-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border: 2px solid #f3f4f6;
    border-radius: 8px;
    margin-bottom: 12px;
    transition: all 0.3s;
    cursor: pointer;
}

.checklist-item:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.1);
}

.checklist-info {
    flex: 1;
}

.checklist-name {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 4px;
}

.checklist-date {
    font-size: 14px;
    color: #6b7280;
}

.checklist-actions {
    display: flex;
    gap: 8px;
}

.checklist-layout {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 20px;
    min-height: 500px;
}

.category-nav {
    border: 2px solid #f3f4f6;
    border-radius: 8px;
    padding: 16px;
    background: #f9fafb;
    position: sticky;
    top: 20px;
    height: fit-content;
    max-height: calc(100vh - 300px);
    overflow-y: auto;
}

.category-nav-title {
    font-size: 14px;
    font-weight: 700;
    color: #6b7280;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.category-nav-item {
    padding: 10px 12px;
    margin-bottom: 4px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
    color: #374151;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.category-nav-item:hover {
    background: #e5e7eb;
}

.category-nav-item.active {
    background: #667eea;
    color: white;
    font-weight: 600;
}

.category-nav-delete {
    background: none;
    border: none;
    color: #ef4444;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
    line-height: 1;
}

.category-nav-delete:hover {
    background: #fee2e2;
    color: #dc2626;
}

.category-nav-item.active .category-nav-delete {
    color: white;
}

.category-nav-item.active .category-nav-delete:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.btn-delete-x {
    background: none;
    border: none;
    color: #ef4444;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
    line-height: 1;
}

.btn-delete-x:hover {
    background: #fee2e2;
    color: #dc2626;
}

.categories-content {
    border: 2px solid #f3f4f6;
    border-radius: 8px;
    padding: 20px;
}

.category {
    margin-bottom: 40px;
    scroll-margin-top: 20px;
}

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 20px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid #667eea;
}

.category-title {
    flex: 1;
}

.category-actions {
    display: flex;
    gap: 8px;
}

.item {
    display: flex;
    align-items: center;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 8px;
    transition: background 0.2s;
    cursor: pointer;
}

.item:hover {
    background: #f9fafb;
}

.item.checked {
    opacity: 0.6;
}

.checkbox {
    width: 24px;
    height: 24px;
    border: 2px solid #d1d5db;
    border-radius: 6px;
    margin-right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
}

.item.checked .checkbox {
    background: #667eea;
    border-color: #667eea;
}

.checkbox::after {
    content: '✓';
    color: white;
    font-size: 16px;
    font-weight: bold;
    display: none;
}

.item.checked .checkbox::after {
    display: block;
}

.item-text {
    flex: 1;
    font-size: 16px;
    color: #374151;
}

.item.checked .item-text {
    text-decoration: line-through;
}

.checked-indicator {
    color: #10b981;
    font-size: 20px;
    font-weight: bold;
    margin-right: 8px;
}

.item-actions {
    display: flex;
    gap: 8px;
    opacity: 1;
    transition: opacity 0.2s;
}

.item:hover .item-actions {
    opacity: 1;
}

.drag-handle {
    cursor: move;
    color: #9ca3af;
    margin-right: 8px;
    font-size: 18px;
}

.drag-handle-small {
    cursor: move;
    color: #9ca3af;
    margin-right: 8px;
    font-size: 14px;
}

.progress-bar {
    background: #e5e7eb;
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 20px;
}

.progress-fill {
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    height: 100%;
    transition: width 0.3s;
}

.progress-text {
    text-align: center;
    color: #6b7280;
    font-size: 14px;
    margin-bottom: 10px;
}

.add-section {
    margin-top: 20px;
    padding: 16px;
    background: #f9fafb;
    border-radius: 8px;
}

.add-form {
    display: flex;
    gap: 8px;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
}

.empty-state-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #6b7280;
}

.error {
    background: #fee2e2;
    color: #991b1b;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.edit-mode-banner {
    background: #fef3c7;
    color: #92400e;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
    font-weight: 600;
}

.editable-input {
    flex: 1;
    padding: 8px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 16px;
    background: white;
}

.editable-input:focus {
    outline: none;
    border-color: #667eea;
}

.category-title-input {
    font-size: 20px;
    font-weight: 700;
    padding: 8px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    flex: 1;
}

.category-title-input:focus {
    outline: none;
    border-color: #667eea;
}

.dragging {
    opacity: 0.5;
}

.drag-over {
    border-top: 3px solid #667eea;
}

@media (max-width: 768px) {
    .checklist-layout {
        grid-template-columns: 1fr;
    }

    .category-nav {
        position: static;
        max-height: none;
    }
}

.summary-view {
    padding: 20px;
}

.summary-category {
    margin-bottom: 30px;
    padding: 16px;
    background: #f9fafb;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.summary-category-title {
    font-size: 18px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 12px;
}

.summary-items {
    list-style: none;
    padding: 0;
    margin: 0;
}

.summary-item {
    display: flex;
    align-items: center;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 8px;
    transition: background 0.2s, opacity 0.5s ease-out, transform 0.5s ease-out;
    cursor: pointer;
}

.summary-item:hover {
    background: #f3f4f6;
}

.summary-item.checked {
    opacity: 0;
    transform: translateX(-20px);
}

.summary-item .checkbox {
    width: 24px;
    height: 24px;
    border: 2px solid #d1d5db;
    border-radius: 6px;
    margin-right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.summary-item.checked .checkbox {
    background: #667eea;
    border-color: #667eea;
}

.summary-item .checkbox::after {
    content: '✓';
    color: white;
    font-size: 16px;
    font-weight: bold;
    display: none;
    animation: checkmark-pop 0.3s ease;
}

.summary-item.checked .checkbox::after {
    display: block;
}

@keyframes checkmark-pop {
    0% {
        transform: scale(0);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

.summary-item-text {
    flex: 1;
    font-size: 16px;
    color: #374151;
    transition: text-decoration 0.3s ease;
}

.summary-item.checked .summary-item-text {
    text-decoration: line-through;
}


/* Multi-select item styling */
.item-selected {
    background: #e0e7ff !important;
    border: 2px solid #667eea;
}

/* Icon button styling */
.btn-icon {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: #f3f4f6;
}

.btn-icon-delete {
    font-size: 24px;
    font-weight: bold;
    color: #ef4444;
    padding: 0px 6px;
}

.btn-icon-delete:hover {
    background: #fee2e2;
    color: #dc2626;
}

/* Category actions layout */
.category-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}
