.todo-container {
    max-width: 800px;
    margin: 20px auto;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.todo-container h2 {
    margin-bottom: 20px;
    color: #333;
    text-align: center;
}

.todo-form {
    margin-bottom: 30px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 6px;
}

.todo-input,
.todo-textarea {
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s;
	box-sizing: border-box;
}

.todo-input:focus,
.todo-textarea:focus {
    outline: none;
    border-color: #007cba;
}

.todo-textarea {
    min-height: 80px;
    resize: vertical;
}

.todo-deadline-group {
    margin-bottom: 15px;
    padding: 10px;
    background: #f0f0f0;
    border-radius: 4px;
}

.todo-deadline-label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    cursor: pointer;
	color: #000;
}

.todo-deadline-input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
	box-sizing: border-box;
}

.todo-deadline-input:disabled {
    background: #e9e9e9;
    cursor: not-allowed;
    opacity: 0.6;
}

.todo-button {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.todo-button-primary {
    background: #007cba;
    color: white;
}

.todo-button-primary:hover {
    background: #005a87;
}

.todo-button-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.todo-filters {
    margin-bottom: 15px;
    text-align: center;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    justify-content: center;
}

.todo-filter {
    padding: 8px;
    margin: 0 2px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 13px;
}

.todo-filter:hover {
    background: #f0f0f0;
}

.todo-filter.active {
    background: #007cba;
    color: white;
    border-color: #007cba;
}

.todo-sort {
    margin-bottom: 20px;
    text-align: right;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

.todo-sort label {
    font-size: 13px;
    color: #666;
}

.todo-sort-select {
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    background: white;
    cursor: pointer;
}

.todo-sort-select:hover {
    border-color: #007cba;
}

.todo-list {
    min-height: 200px;
}

.todo-loading {
    text-align: center;
    padding: 40px;
    color: #999;
}

.todo-item {
    display: flex;
	flex-wrap: wrap;
    align-items: flex-start;
    padding: 15px;
    margin-bottom: 10px;
    background: #f9f9f9;
    border-left: 3px solid #007cba;
    border-radius: 0 4px 4px 0;
    transition: all 0.3s;
    animation: slideIn 0.3s ease;
}

.todo-item.overdue {
    border-left-color: #dc3545;
    background: #fff5f5;
}

.todo-item.expiring {
    border-left-color: #ffc107;
    background: #fff9e6;
}

.todo-item.completed {
    border-left-color: #28a745;
    background: #f0f0f0;
    opacity: 0.8;
}

.todo-item.completed .todo-item-title {
    text-decoration: line-through;
    color: #999;
}

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

.todo-item-header {
	display: flex;
	width: 100%;
	justify-content: space-between;
}

.todo-item-checkbox {
    margin-right: 15px;
    margin-top: 3px;
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.todo-item-toggle {
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    padding: 0 6px;
    color: #666;
    transition: transform 0.2s;
	float: right;
}

.todo-item-toggle.expanded {
}

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

.todo-item-title {
    font-weight: bold;
    margin-bottom: 5px;
    color: #333;
    text-align: left;
	width: inherit;
}

.todo-item-description {
    font-size: 13px;
    color: #666;
    margin-bottom: 8px;
	text-align: left;
}

.todo-item-deadline {
    display: inline-block;
    padding: 3px 8px;
    background: #e9ecef;
    border-radius: 3px;
    font-size: 11px;
    color: #495057;
    margin-right: 8px;
}

.todo-item-deadline.overdue {
    background: #dc3545;
    color: white;
}

.todo-item-deadline.expiring {
    background: #ffc107;
    color: #333;
}

.todo-item-date {
    display: inline-block;
    font-size: 11px;
    color: #999;
}

.todo-item-meta {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.todo-item-actions {
    display: flex;
    gap: 10px;
    margin-left: 15px;
	flex-direction: column;
}

.todo-item-edit,
.todo-item-delete {
    padding: 5px 10px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    background: transparent;
}

.todo-item-edit {
    color: #ffc107;
}

.todo-item-edit:hover {
    background: #ffc107;
    color: white;
}

.todo-item-delete {
    color: #dc3545;
}

.todo-item-delete:hover {
    background: #dc3545;
    color: white;
}

.todo-edit-form {
    width: 100%;
}

.todo-edit-input,
.todo-edit-textarea,
.todo-edit-deadline {
    width: 100%;
    padding: 8px;
    margin-bottom: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.todo-edit-deadline {
    margin-bottom: 15px;
}

.todo-edit-actions {
    display: flex;
    gap: 10px;
}

.todo-save-btn,
.todo-cancel-btn {
    padding: 8px 15px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    transition: background-color 0.3s;
    font-size: 14px;
}

.todo-save-btn {
    background: #28a745;
    color: white;
}

.todo-save-btn:hover {
    background: #218838;
}

.todo-cancel-btn {
    background: #6c757d;
    color: white;
}

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

.todo-empty {
    text-align: center;
    padding: 40px;
    color: #999;
    font-style: italic;
}

.todo-error {
    color: #721c24;
    background: #f8d7da;
    padding: 15px;
    border-radius: 4px;
    text-align: center;
    border: 1px solid #f5c6cb;
}

.todo-debug {
    margin-top: 20px;
    padding: 10px;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    color: #721c24;
    font-family: monospace;
    font-size: 12px;
    white-space: pre-wrap;
}

/* Адаптивность для мобильных */
@media (max-width: 600px) {
    .todo-container {
        padding: 10px;
    }
    
    .todo-filters {
        
    }
    
    .todo-filter {
        width: max-content;
        margin: 2px 0;
    }
    
    .todo-sort {
        flex-direction: column;
        align-items: stretch;
    }
    
    .todo-item {
        flex-direction: column;
    }
    
    .todo-item-actions {
        margin-left: 0;
        margin-top: 10px;
        justify-content: center;
		flex-direction: row;
		width: 100%;
    }
    
    .todo-item-meta {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ========== СТИЛИ ДЛЯ ПОДЗАДАЧ ========== */

/* Индикатор наличия подзадач */
.todo-item.has-subtasks {
    border-left-color: #17a2b8;
}

.todo-item-subtask-indicator {
    display: inline-block;
    margin-left: 8px;
    font-size: 14px;
    color: #17a2b8;
    cursor: help;
    animation: subtle-pulse 2s infinite;
}

@keyframes subtle-pulse {
    0% {
        opacity: 0.7;
    }
    50% {
        opacity: 1;
        transform: scale(1.1);
    }
    100% {
        opacity: 0.7;
    }
}

/* Кнопка показа/скрытия подзадач */
.todo-item-subtask-toggle {
    background: transparent;
    border: none;
    font-size: 16px;
    cursor: pointer;
    padding: 5px 8px;
    color: #17a2b8;
    transition: all 0.2s;
    border-radius: 4px;
}

.todo-item-subtask-toggle:hover {
    background: #e9ecef;
    transform: scale(1.1);
}

.todo-item-subtask-toggle:active {
    transform: scale(0.95);
}

/* Контейнер подзадач */
.todo-subtasks-container {
    margin-top: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 0 solid #17a2b8;
    animation: slideDown 0.3s ease;
}

.todo-subtasks-list {
    margin-bottom: 15px;
}

/* Элемент подзадачи */
.todo-subtask-item {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    margin-bottom: 6px;
    background: white;
    border-radius: 4px;
    border: 1px solid #e9ecef;
    transition: all 0.2s;
    animation: fadeIn 0.3s ease;
}

.todo-subtask-item:hover {
    background: #f1f3f5;
    border-color: #17a2b8;
    transform: translateX(2px);
}

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

/* Чекбокс подзадачи */
.todo-subtask-checkbox {
    margin-right: 12px;
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #17a2b8;
}

.todo-subtask-checkbox:checked {
    background-color: #17a2b8;
}

/* Заголовок подзадачи */
.todo-subtask-title {
    flex: 1;
    font-size: 14px;
    color: #495057;
    transition: all 0.2s;
    word-break: break-word;
}

.todo-subtask-title.completed {
    text-decoration: line-through;
    color: #adb5bd;
    font-style: italic;
}

/* Кнопка удаления подзадачи */
.todo-subtask-delete {
    background: transparent;
    border: none;
    font-size: 18px;
    color: #dc3545;
    cursor: pointer;
    padding: 0 8px;
    opacity: 0.5;
    transition: all 0.2s;
    border-radius: 4px;
}

.todo-subtask-delete:hover {
    opacity: 1;
    transform: scale(1.2);
    background: #dc3545;
    color: white;
}

.todo-subtask-delete:active {
    transform: scale(0.95);
}

/* Форма добавления подзадачи */
.todo-subtask-form {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed #dee2e6;
}

.todo-subtask-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    transition: all 0.3s;
}

.todo-subtask-input:focus {
    outline: none;
    border-color: #17a2b8;
    box-shadow: 0 0 0 3px rgba(23, 162, 184, 0.1);
}

.todo-subtask-add {
    background: #17a2b8;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 8px 15px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s;
    min-width: 40px;
}

.todo-subtask-add:hover {
    background: #138496;
    transform: scale(1.05);
}

.todo-subtask-add:active {
    transform: scale(0.95);
}

/* Пустое состояние подзадач */
.todo-subtasks-list .todo-empty {
    padding: 20px;
    text-align: center;
    color: #999;
    font-style: italic;
    background: white;
    border-radius: 4px;
    border: 1px dashed #dee2e6;
}

/* Загрузка подзадач */
.todo-subtasks-list .todo-loading {
    padding: 20px;
    text-align: center;
    color: #999;
    background: white;
    border-radius: 4px;
}

/* Адаптивность для мобильных устройств */
@media (max-width: 600px) {
    .todo-subtasks-container {
        padding: 12px;
        margin-top: 12px;
    }
    
    .todo-subtask-item {
        flex-wrap: wrap;
        padding: 10px;
    }
    
    .todo-subtask-checkbox {
        margin-right: 10px;
        width: 20px;
        height: 20px;
    }
    
    .todo-subtask-title {
        font-size: 13px;
        width: calc(100% - 60px);
    }
    
    .todo-subtask-delete {
        padding: 0 6px;
        font-size: 20px;
    }
    
    .todo-subtask-form {
        flex-direction: column;
        gap: 8px;
    }
    
    .todo-subtask-input {
        width: 100%;
        padding: 10px;
        font-size: 14px;
    }
    
    .todo-subtask-add {
        width: 100%;
        padding: 10px;
    }
    
    .todo-item-subtask-toggle {
        padding: 8px 10px;
        font-size: 18px;
    }
}

/* Очень маленькие экраны */
@media (max-width: 380px) {
    .todo-subtask-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .todo-subtask-checkbox {
        margin-right: 0;
    }
    
    .todo-subtask-title {
        width: 100%;
        margin: 5px 0;
    }
    
    .todo-subtask-delete {
        align-self: flex-end;
    }
}

/* Темная тема (опционально) */
@media (prefers-color-scheme: dark) {
    .todo-subtasks-container {
        background: #2d2d2d;
        border-left-color: #17a2b8;
    }
    
    .todo-subtask-item {
        background: #3d3d3d;
        border-color: #4d4d4d;
    }
    
    .todo-subtask-item:hover {
        background: #4d4d4d;
    }
    
    .todo-subtask-title {
        color: #e0e0e0;
    }
    
    .todo-subtask-title.completed {
        color: #808080;
    }
    
    .todo-subtask-input {
        background: #3d3d3d;
        border-color: #4d4d4d;
        color: #e0e0e0;
    }
    
    .todo-subtask-input:focus {
        border-color: #17a2b8;
    }
    
    .todo-subtasks-list .todo-empty,
    .todo-subtasks-list .todo-loading {
        background: none;
        color: #000;
    }
}
.todo-item-checkbox-placeholder {
    display: inline-block;
    width: 20px;
    height: 20px;
    margin-right: 10px;
    color: #999;
    font-size: 16px;
    cursor: not-allowed;
    opacity: 0.5;
    text-align: center;
    line-height: 20px;
}

.todo-item-checkbox-placeholder:hover {
    opacity: 0.8;
}
/* Стили для кастомного предупреждения */
.todo-custom-alert {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.todo-custom-alert.visible {
    opacity: 1;
}

.todo-alert-content {
    background: white;
    border-radius: 12px;
    padding: 24px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.todo-custom-alert.visible .todo-alert-content {
    transform: scale(1);
}

.todo-alert-header {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 12px;
    color: #f59e0b;
}

.todo-alert-message {
    margin-bottom: 20px;
    color: #4a5568;
    line-height: 1.5;
}

.todo-alert-buttons {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.todo-alert-confirm {
    background: #f59e0b;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.2s;
}

.todo-alert-confirm:hover {
    background: #d97706;
}

.todo-alert-cancel {
    background: #e2e8f0;
    color: #4a5568;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.2s;
}

.todo-alert-cancel:hover {
    background: #cbd5e0;
}

/* Стили для toast-уведомлений */
.todo-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: white;
    padding: 12px 24px;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 9999;
    max-width: 300px;
}

.todo-toast.visible {
    transform: translateY(0);
    opacity: 1;
}

.todo-toast-success {
    border-left: 4px solid #10b981;
}

.todo-toast-error {
    border-left: 4px solid #ef4444;
}

.todo-toast-info {
    border-left: 4px solid #3b82f6;
}

/* Стили для прогресса подзадач */
.todo-subtasks-progress {
    font-size: 12px;
    color: #6b7280;
    margin-top: 4px;
    padding: 2px 0;
}
.todo-subtask-item.deleting {
    transition: all 0.25s ease;
    opacity: 0.4;
    transform: translateX(20px);
}

.todo-subtask-item.deleting .todo-subtask-delete {
    opacity: 0.3;
    pointer-events: none;
}
