* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

header h1 {
    font-size: 2em;
    margin-bottom: 10px;
}

.subtitle {
    opacity: 0.9;
    font-size: 1em;
}

.add-item-section {
    padding: 30px;
    background: #f8f9fa;
    border-bottom: 2px solid #e9ecef;
}

.add-item-section h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.4em;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #555;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1em;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
}

.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: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-danger {
    background: #dc3545;
    color: white;
    padding: 8px 16px;
    font-size: 0.9em;
}

.btn-danger:hover {
    background: #c82333;
}

.checklist-section {
    padding: 30px;
}

.checklist-section h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.4em;
}

.checklist-item {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 15px;
    transition: all 0.3s;
    cursor: move;
    position: relative;
}

.checklist-item:hover {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border-color: #667eea;
}

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

.checklist-item.completed {
    background: #f0f9ff;
    border-color: #4caf50;
}

.task-number {
    position: absolute;
    top: 10px;
    left: 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.9em;
}

.checklist-item.completed .task-number {
    background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
}

.item-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
    margin-left: 40px;
}

.drag-handle {
    color: #999;
    font-size: 1.2em;
    cursor: grab;
    margin-right: 5px;
}

.drag-handle:active {
    cursor: grabbing;
}

.checkbox-wrapper {
    flex-shrink: 0;
}

.checkbox-wrapper input[type="checkbox"] {
    width: 24px;
    height: 24px;
    cursor: pointer;
    accent-color: #4caf50;
}

.item-content {
    flex-grow: 1;
}

.item-title {
    font-size: 1.1em;
    color: #333;
    margin-bottom: 5px;
    word-break: break-word;
}

.item-url {
    display: inline-block;
    color: #667eea;
    text-decoration: none;
    font-size: 0.9em;
    margin-top: 5px;
}

.item-url:hover {
    text-decoration: underline;
}

.item-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.btn-edit {
    background: #17a2b8;
    color: white;
    padding: 8px 16px;
    font-size: 0.9em;
}

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

/* General Notes Section */
.general-notes-section {
    padding: 30px;
    background: #f8f9fa;
    border-top: 2px solid #e9ecef;
}

.general-notes-section h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.4em;
}

.notes-display {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 20px;
    min-height: 100px;
    margin-bottom: 15px;
}

.notes-content {
    color: #333;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
}

.notes-empty {
    color: #6c757d;
    font-style: italic;
    text-align: center;
    padding: 20px;
}

.notes-actions {
    display: flex;
    justify-content: center;
}

.note-timestamp {
    color: #6c757d;
    font-size: 0.85em;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e9ecef;
    font-style: italic;
}

.item-comment {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 12px;
    margin-top: 12px;
    border-radius: 5px;
}

.comment-header {
    font-weight: 600;
    color: #856404;
    margin-bottom: 5px;
    font-size: 0.9em;
}

.comment-text {
    color: #856404;
    font-size: 0.95em;
    line-height: 1.5;
    word-break: break-word;
}

.loading {
    text-align: center;
    color: #6c757d;
    padding: 20px;
}

.empty-state {
    text-align: center;
    color: #6c757d;
    padding: 40px;
}

.empty-state p {
    font-size: 1.1em;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background-color: white;
    margin: 10% auto;
    padding: 30px;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideDown 0.3s;
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 20px;
}

.close:hover,
.close:focus {
    color: #000;
}

.modal-content h3 {
    color: #333;
    margin-bottom: 20px;
}

#commentText {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1em;
    font-family: inherit;
    resize: vertical;
}

#commentText:focus {
    outline: none;
    border-color: #667eea;
}

.modal-actions {
    margin-top: 20px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        margin: 0;
        border-radius: 0;
    }

    header h1 {
        font-size: 1.5em;
    }

    .add-item-section,
    .checklist-section {
        padding: 20px;
    }

    .item-header {
        flex-wrap: wrap;
    }

    .item-actions {
        width: 100%;
        justify-content: flex-start;
        margin-top: 10px;
    }

    .modal-content {
        width: 95%;
        margin: 20% auto;
        padding: 20px;
    }
}
