* {
  box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    margin: 20px;
}
textarea, input[type="text"] {
    width: 100%;
    margin-bottom: 10px;
}
button {
    width: 100%;
    padding: 10px;
}

.content_html {
    border: 2px solid #363;
    padding: 10px;
    border-radius: 8px;
}
.content_text {
    border: 2px solid #336;
    padding: 10px;
    border-radius: 8px;
    white-space: pre-wrap; /* Preserve whitespace and line breaks */
}

.task-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1em;
    font-size: 1em;
}

.task-table th, .task-table td {
    border: 1px solid #ccc;
    padding: 0.5em 1em;
    text-align: left;
}

.task-table th {
    background-color: #f5f5f5;
    font-weight: bold;
}

.task-table tr[data-state] {
    transition: background 0.2s;
}

.task-table tr[data-state]:hover {
    background-color: #e9f7ff;
}

/* Priority styles */
.priority-low {
    color: #4CAF50; /* green */
    font-weight: bold;
}
.priority-medium {
    color: #2196F3; /* blue */
    font-weight: bold;
}
.priority-high {
    color: #FF9800; /* orange */
    font-weight: bold;
}
.priority-urgent {
    color: #F44336; /* red */
    font-weight: bold;
}

/* State styles */
.state-open {
    color: #009688; /* teal */
}
.state-in_progress {
    color: #3F51B5; /* indigo */
}
.state-paused {
    color: #FFC107; /* amber */
}
.state-waiting {
    color: #9E9E9E; /* grey */
}
.state-validating {
    color: #00BCD4; /* cyan */
}
.state-completed {
    color: #8BC34A; /* light green */
}
.state-cancelled {
    color: #E91E63; /* pink */
}
.item-row {
    display: flex;
    align-items: center;
    gap: 12px;
}
.item-row input[type="checkbox"] {
    margin: 0;
}
.item-row input[type="text"] {
    flex: 1 1 auto;
    margin-bottom: 0;
    min-width: 0;
}
.item-row .spinner {
    margin-left: 0;
}
.item-row a {
    white-space: nowrap;
}

.trash-icon {
    display: inline-block;
    width: 18px;
    height: 18px;
    position: relative;
    vertical-align: middle;
    cursor: pointer;
}
.trash-icon::before {
    content: "";
    display: block;
    position: absolute;
    left: 4px;
    top: 6px;
    width: 10px;
    height: 8px;
    border: 2px solid #888;
    border-radius: 0 0 2px 2px;
    background: #fff;
}
.trash-icon::after {
    content: "";
    display: block;
    position: absolute;
    left: 7px;
    top: 3px;
    width: 4px;
    height: 2px;
    background: #888;
    border-radius: 1px;
}
.trash-icon .lid {
    position: absolute;
    left: 5px;
    top: 2px;
    width: 8px;
    height: 2px;
    background: #888;
    border-radius: 1px;
}

.spinner {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid #ccc;
    border-top: 2px solid #333;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    vertical-align: middle;
    margin-left: 8px;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Button-style links */
.btn-link {
    display: inline-block;
    padding: 8px 16px;
    margin: 4px;
    text-decoration: none;
    border-radius: 8px;
    border: 2px solid #007bff;
    background-color: #007bff;
    color: white;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-link:hover {
    background-color: #0056b3;
    border-color: #0056b3;
    color: white;
    text-decoration: none;
}

.btn-link:active {
    transform: translateY(1px);
}

/* Variant styles for different button types */
.btn-link.btn-secondary {
    background-color: #6c757d;
    border-color: #6c757d;
}

.btn-link.btn-secondary:hover {
    background-color: #545b62;
    border-color: #545b62;
}

.btn-link.btn-warning {
    background-color: #ffc107;
    border-color: #ffc107;
    color: #212529;
}

.btn-link.btn-warning:hover {
    background-color: #e0a800;
    border-color: #e0a800;
    color: #212529;
}

.btn-link.btn-danger {
    background-color: #dc3545;
    border-color: #dc3545;
}

.btn-link.btn-danger:hover {
    background-color: #c82333;
    border-color: #c82333;
}

/* Action buttons container */
.action-buttons {
    margin: 15px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

/* ToDo specific styles */
.todo-context {
    color: #2E8B57; /* SeaGreen */
    font-weight: bold;
}
.todo-project {
    color: #1E90FF; /* DodgerBlue */
    font-weight: bold;
}
.todo-group {
    color: #8A2BE2; /* BlueViolet */
    font-weight: bold;
}
.todo-link {
    color: #007bff;
    text-decoration: underline;
}