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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f7fa;
    min-height: 100vh;
}

/* Header */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header h1 {
    font-size: 28px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.btn-logout {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid white;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-logout:hover {
    background: rgba(255, 255, 255, 0.3);
}

.btn-theme {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid white;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s;
    font-size: 18px;
}

.btn-theme:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Controls */
.controls {
    padding: 20px 40px;
}

.btn-primary {
    padding: 12px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
}

.btn-primary:hover {
    transform: translateY(-2px);
}

.btn-secondary {
    padding: 8px 16px;
    background: #e0e0e0;
    color: #333;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-secondary:hover {
    background: #d0d0d0;
}

/* Kanban Board */
.kanban-board {
    display: flex;
    gap: 20px;
    padding: 0 40px 40px;
    overflow-x: auto;
}

/* Скрытие скроллбара */
.kanban-board::-webkit-scrollbar {
    display: none;
}

.kanban-board {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.kanban-column {
    flex: 1;
    min-width: 280px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 200px);
}

.kanban-column.collapsed {
    flex: 0 0 80px;
    min-width: 80px;
}

.kanban-column.collapsed .column-header h2 {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    white-space: nowrap;
}

.column-header {
    padding: 15px;
    border-bottom: 2px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.column-header.clickable {
    cursor: pointer;
    user-select: none;
}

.column-header.clickable:hover {
    background: #f9f9f9;
}

.column-header h2 {
    font-size: 18px;
    color: #333;
}

.task-count {
    background: #667eea;
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
}

/* Цветовая кодировка колонок */
.kanban-column.overdue .column-header {
    border-bottom-color: #e74c3c;
}

.kanban-column.overdue .task-count {
    background: #e74c3c;
}

.kanban-column.today .column-header {
    border-bottom-color: #f39c12;
}

.kanban-column.today .task-count {
    background: #f39c12;
}

.kanban-column.this-week .column-header {
    border-bottom-color: #3498db;
}

.kanban-column.this-week .task-count {
    background: #3498db;
}

.kanban-column.this-month .column-header {
    border-bottom-color: #9b59b6;
}

.kanban-column.this-month .task-count {
    background: #9b59b6;
}

.kanban-column.this-year .column-header {
    border-bottom-color: #1abc9c;
}

.kanban-column.this-year .task-count {
    background: #1abc9c;
}

.kanban-column.more-than-year .column-header {
    border-bottom-color: #8e44ad;
}

.kanban-column.more-than-year .task-count {
    background: #8e44ad;
}

.kanban-column.completed .column-header {
    border-bottom-color: #27ae60;
}

.kanban-column.completed .task-count {
    background: #27ae60;
}

.tasks-container {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Скрытие скроллбара в контейнерах задач */
.tasks-container::-webkit-scrollbar {
    width: 6px;
}

.tasks-container::-webkit-scrollbar-track {
    background: transparent;
}

.tasks-container::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.tasks-container::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

/* Drag and Drop стили */
.tasks-container.drag-over {
    background: rgba(102, 126, 234, 0.1);
    border: 2px dashed #667eea;
    border-radius: 10px;
}

.task-card.drag-over-card {
    border-top: 3px solid #667eea;
    margin-top: 15px;
}

/* Task Card */
.task-card {
    background: #fafafa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    cursor: move;
    transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
}

.task-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.task-card:active {
    cursor: grabbing;
}

.task-card-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 10px;
}

.task-title {
    font-weight: 600;
    color: #333;
    font-size: 16px;
    flex: 1;
}

.task-actions {
    display: flex;
    gap: 5px;
}

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    padding: 4px;
    transition: transform 0.2s;
}

.btn-icon:hover {
    transform: scale(1.2);
}

.task-description {
    color: #666;
    font-size: 14px;
    margin-bottom: 10px;
    word-wrap: break-word;
}

.task-deadline {
    font-size: 12px;
    color: #999;
    margin-bottom: 10px;
}

.task-checklist {
    margin-bottom: 10px;
}

.checklist-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #555;
    margin-bottom: 5px;
}

.checklist-item input[type="checkbox"] {
    cursor: pointer;
}

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

.task-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e0e0e0;
}

.task-progress {
    font-size: 12px;
    color: #667eea;
    font-weight: 600;
}

.btn-complete {
    padding: 6px 12px;
    background: #27ae60;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-complete:hover {
    background: #229954;
}

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

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

.modal-content {
    background: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 10px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    animation: slideIn 0.3s;
}

/* Стилизация скроллбара в модальном окне */
.modal-content::-webkit-scrollbar {
    width: 8px;
}

.modal-content::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 10px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: #c0c0c0;
    border-radius: 10px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: #a0a0a0;
}

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

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

.close:hover {
    color: #000;
}

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

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

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

.form-group input[type="text"],
.form-group input[type="datetime-local"],
.form-group input[type="number"],
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.3s;
}

.form-group input[type="number"] {
    height: 42px;
}

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

#checklistContainer {
    margin-bottom: 10px;
}

.checklist-edit-item {
    display: flex;
    gap: 10px;
    margin-bottom: 8px;
    align-items: center;
    padding: 8px;
    background: #f9f9f9;
    border-radius: 5px;
    cursor: move;
    transition: background 0.2s;
}

.checklist-edit-item:hover {
    background: #f0f0f0;
}

.checklist-edit-item.dragging {
    opacity: 0.5;
}

.drag-handle {
    cursor: grab;
    font-size: 18px;
    color: #999;
    user-select: none;
}

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

.checklist-completed-checkbox {
    cursor: pointer;
    width: 18px;
    height: 18px;
}

.checklist-edit-item input.checklist-input {
    flex: 1;
    padding: 8px;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    font-size: 14px;
}

.btn-remove {
    padding: 6px 12px;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.btn-remove:hover {
    background: #c0392b;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.btn-cancel {
    padding: 12px 24px;
    background: #e0e0e0;
    color: #333;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
}

.btn-cancel:hover {
    background: #d0d0d0;
}

/* Dark Theme */
body.dark-theme {
    background: #1e1e1e;
    color: #e0e0e0;
}

body.dark-theme .header {
    background: linear-gradient(135deg, #2d2d2d 0%, #1a1a1a 100%);
}

body.dark-theme .btn-logout,
body.dark-theme .btn-theme {
    background: rgba(80, 80, 80, 0.3);
    border-color: #606060;
}

body.dark-theme .btn-logout:hover,
body.dark-theme .btn-theme:hover {
    background: rgba(80, 80, 80, 0.5);
}

body.dark-theme .btn-primary {
    background: linear-gradient(135deg, #404040 0%, #2d2d2d 100%);
}

body.dark-theme .kanban-column {
    background: #2d2d2d;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

body.dark-theme .column-header {
    border-bottom-color: #404040;
}

body.dark-theme .column-header.clickable:hover {
    background: #3a3a3a;
}

body.dark-theme .column-header h2 {
    color: #e0e0e0;
}

body.dark-theme .task-card {
    background: #3a3a3a;
    border-color: #505050;
}

body.dark-theme .task-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
}

body.dark-theme .task-title {
    color: #f0f0f0;
}

body.dark-theme .task-description {
    color: #b8b8b8;
}

body.dark-theme .task-deadline {
    color: #909090;
}

body.dark-theme .checklist-item {
    color: #d0d0d0;
}

body.dark-theme .checklist-item.completed {
    color: #808080;
}

body.dark-theme .tasks-container.drag-over {
    background: rgba(80, 80, 80, 0.3);
    border-color: #909090;
}

body.dark-theme .task-card.drag-over-card {
    border-top-color: #909090;
}

body.dark-theme .task-progress {
    color: #b8b8b8;
}

body.dark-theme .modal-content {
    background: #2d2d2d;
    color: #e0e0e0;
}

body.dark-theme .modal-content h2 {
    color: #f0f0f0;
}

body.dark-theme .form-group label {
    color: #e8e8e8;
}

body.dark-theme .form-group input[type="text"],
body.dark-theme .form-group input[type="datetime-local"],
body.dark-theme .form-group input[type="number"],
body.dark-theme .form-group textarea {
    background: #3a3a3a;
    border-color: #505050;
    color: #e0e0e0;
    color-scheme: dark;
}

body.dark-theme .form-group input:focus,
body.dark-theme .form-group textarea:focus {
    border-color: #909090;
}

body.dark-theme .checklist-edit-item {
    background: #3a3a3a;
}

body.dark-theme .checklist-edit-item:hover {
    background: #454545;
}

body.dark-theme .checklist-edit-item input.checklist-input {
    background: #2d2d2d;
    border-color: #505050;
    color: #e0e0e0;
}

body.dark-theme .drag-handle {
    color: #808080;
}

body.dark-theme .btn-cancel {
    background: #404040;
    color: #e0e0e0;
}

body.dark-theme .btn-cancel:hover {
    background: #505050;
}

body.dark-theme .btn-secondary {
    background: #404040;
    color: #e0e0e0;
}

body.dark-theme .btn-secondary:hover {
    background: #505050;
}

body.dark-theme .close {
    color: #c0c0c0;
}

body.dark-theme .close:hover {
    color: #ffffff;
}

/* Стилизация скроллбара в модальном окне для темной темы */
body.dark-theme .modal-content::-webkit-scrollbar-track {
    background: #2d2d2d;
}

body.dark-theme .modal-content::-webkit-scrollbar-thumb {
    background: #505050;
}

body.dark-theme .modal-content::-webkit-scrollbar-thumb:hover {
    background: #606060;
}
