@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;600;700&display=swap');

body {
    font-family: 'Montserrat', sans-serif;
    background: #0f0518;
    color: #ffffff;
    margin: 0;
    padding: 20px;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Анимированный фон */
.background-animation {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-image: radial-gradient(circle at 15% 50%, rgba(136, 58, 234, 0.15), transparent 25%),
                      radial-gradient(circle at 85% 30%, rgba(209, 122, 255, 0.15), transparent 25%);
    z-index: -1;
    animation: pulseBg 10s infinite alternate;
}

@keyframes pulseBg {
    0% { transform: scale(1); opacity: 0.8; }
    100% { transform: scale(1.1); opacity: 1; }
}

.container {
    max-width: 1600px; /* Было 1100px, теперь 1600px — место стало больше */
    margin: 0 auto;
    position: relative;
    z-index: 1;
    padding: 0 15px; /* Небольшой отступ по краям экрана */
}

/* Карточки и колонки */
.project-card, .kanban-column, .task-creation-box {
    background: rgba(45, 27, 78, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(209, 122, 255, 0.3);
    border-radius: 16px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

.project-card {
    padding: 25px;
    margin-bottom: 25px;
}

/* Список проектов */
.project-list {
    list-style: none;
    padding: 0;
    margin: 0 0 20px 0;
}
.project-list li {
    background: rgba(255, 255, 255, 0.05);
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.project-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.project-info {
    display: flex;
    align-items: center;
    gap: 12px;
}
.project-icon { font-size: 20px; }
.project-meta {
    font-size: 11px;
    color: #a38cb8;
    margin-top: 4px;
}
.project-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}
.empty-state { color: #a38cb8; font-style: italic; }

/* --- ФОРМЫ И ИНПУТЫ --- */
.creation-box, .task-creation-box {
    padding: 20px;
    margin-bottom: 30px;
}

.task-creation-box h3 {
    margin-top: 0;
    color: #d17aff;
    font-size: 16px;
    margin-bottom: 15px;
}

.project-form, .task-form {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: center;
}

.input-field {
    padding: 12px;
    border-radius: 8px;
    border: 1px solid rgba(209, 122, 255, 0.3);
    background: #1a0b2e;
    color: white;
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    flex: 1;
    min-width: 0;
    outline: none;
    transition: border-color 0.2s;
}
.input-field::placeholder { color: #7a5c91; }
.input-field:focus { border-color: #d17aff; }

/* Выпадающие списки */
select.input-field {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23d17aff%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 15px top 50%;
    background-size: 12px auto;
    padding-right: 35px;
}
select.input-field option {
    background: #1a0b2e;
    color: white;
}

/* Кнопки */
.btn-primary {
    padding: 12px 24px;
    background: linear-gradient(135deg, #a855f7, #d17aff);
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: transform 0.2s, box-shadow 0.2s;
    font-family: 'Montserrat', sans-serif;
    white-space: nowrap;
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 15px rgba(209, 122, 255, 0.6);
}
.btn-archive {
    background: transparent;
    border: 1px solid #a38cb8;
    color: #a38cb8;
    border-radius: 6px;
    padding: 5px 10px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-archive:hover {
    background: #a38cb8;
    color: #0f0518;
}
.btn-delete { background: transparent; border: none; color: #a38cb8; cursor: pointer; font-size: 16px; transition: color 0.2s; }
.btn-delete:hover { color: #ff4d4d; }

/* Канбан */
.kanban-board {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}
.kanban-column {
    flex: 1;
    padding: 20px;
    min-height: 400px;
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.kanban-column.backlog {
    background: rgba(45, 27, 78, 0.7);
}
.kanban-column.backlog .column-header h3 {
    color: #d17aff;
}
.column-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(209, 122, 255, 0.2);
    padding-bottom: 15px;
}
.column-header h3 { margin: 0; color: #d17aff; font-size: 16px; }
.column-icon { font-size: 20px; }

.task-list { display: flex; flex-direction: column; gap: 15px; }

.task-card {
    background: rgba(255, 255, 255, 0.05);
    padding: 15px;
    border-radius: 10px;
    border-left: 4px solid #a855f7;
    transition: all 0.3s ease;
    animation: slideIn 0.3s ease-out;
    cursor: grab;
}
.task-card:hover { background: rgba(255, 255, 255, 0.08); transform: scale(1.02); }
.task-card.completed { border-left-color: #4ade80; opacity: 0.7; }
.task-card.dragging {
    opacity: 0.5;
    transform: rotate(2deg);
    cursor: grabbing;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.task-title { font-size: 14px; font-weight: 600; margin-bottom: 8px; line-height: 1.4; }
.task-desc { font-size: 12px; color: #a38cb8; margin-bottom: 12px; font-style: italic; }
.task-assignee {
    font-size: 12px;
    color: #d17aff;
    background: rgba(209, 122, 255, 0.1);
    padding: 4px 8px;
    border-radius: 4px;
    display: inline-block;
    margin-bottom: 10px;
    font-weight: 600;
}

/* Дедлайны */
.task-deadline {
    font-size: 11px;
    color: #a38cb8;
    background: rgba(0, 0, 0, 0.3);
    padding: 4px 8px;
    border-radius: 4px;
    display: inline-block;
    margin-bottom: 10px;
    font-weight: 600;
}
.task-deadline.deadline-overdue {
    color: #ff4d4d;
    background: rgba(255, 77, 77, 0.15);
    border: 1px solid rgba(255, 77, 77, 0.3);
}

/* Прогресс-бар */
.progress-container {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 10px;
    height: 18px;
    width: 100%;
    margin: 10px 0;
    position: relative;
    overflow: hidden;
}
.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #a855f7, #d17aff);
    border-radius: 10px;
    transition: width 0.3s ease;
}
.progress-text {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    font-size: 10px;
    font-weight: bold;
    color: #fff;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
}

/* Форма обновления */
.task-details {
    background: rgba(0, 0, 0, 0.2);
    padding: 10px;
    border-radius: 8px;
    margin: 10px 0;
    font-size: 12px;
}
.task-details summary { cursor: pointer; color: #d17aff; font-weight: bold; outline: none; }
.update-form { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.update-form textarea {
    width: 100%;
    padding: 8px;
    border-radius: 4px;
    border: 1px solid rgba(209, 122, 255, 0.3);
    background: #1a0b2e;
    color: white;
    font-family: inherit;
    resize: vertical;
}
.update-form input[type="range"] { width: 100%; accent-color: #d17aff; }
.update-form output { text-align: right; font-size: 12px; color: #d17aff; font-weight: bold; }
.btn-save {
    padding: 8px;
    background: #d17aff;
    color: #1a0b2e;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
}

/* Кнопки действий в карточке */
.task-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; }
.task-actions form { margin: 0; }
.btn-move {
    background: transparent;
    border: 1px solid #d17aff;
    color: #d17aff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    padding: 6px 10px;
    transition: all 0.2s;
}
.btn-move:hover { background: #d17aff; color: #1a0b2e; }
.btn-done { border-color: #4ade80; color: #4ade80; }
.btn-done:hover { background: #4ade80; color: #0f0518; }
.btn-back { border-color: #a38cb8; color: #a38cb8; font-size: 11px; }
.btn-back:hover { background: #a38cb8; color: #0f0518; }

.badge-done {
    background: #4ade80;
    color: #0f0518;
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: bold;
    display: inline-block;
    margin-top: 5px;
}

/* Эффекты при перетаскивании */
.kanban-column.drag-over {
    background: rgba(209, 122, 255, 0.1) !important;
    border: 2px dashed #d17aff !important;
    transform: scale(1.02);
    transition: all 0.2s;
}
/* Стили для дедлайнов (цветовая индикация) */
.task-deadline {
    font-size: 11px;
    color: #a38cb8;
    background: rgba(0, 0, 0, 0.3);
    padding: 4px 8px;
    border-radius: 4px;
    display: inline-block;
    margin-bottom: 10px;
    font-weight: 600;
    transition: all 0.3s ease;
}

/* Просрочено (красный, пульсирует) */
.task-deadline.deadline-overdue {
    color: #ff4d4d;
    background: rgba(255, 77, 77, 0.15);
    border: 1px solid rgba(255, 77, 77, 0.5);
    animation: pulseRed 2s infinite;
}

/* Срочно (оранжевый, 1-2 дня) */
.task-deadline.deadline-urgent {
    color: #ffa500;
    background: rgba(255, 165, 0, 0.15);
    border: 1px solid rgba(255, 165, 0, 0.3);
}

/* Скоро (желтый, 3-5 дней) */
.task-deadline.deadline-soon {
    color: #facc15;
    background: rgba(250, 204, 21, 0.1);
    border: 1px solid rgba(250, 204, 21, 0.2);
}

@keyframes pulseRed {
    0% { box-shadow: 0 0 0 0 rgba(255, 77, 77, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(255, 77, 77, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 77, 77, 0); }
}
/* Фикс для textarea, чтобы не вылезала за края */
.update-form textarea {
    width: 100% !important;
    box-sizing: border-box; /* Учитывает отступы и границы в ширину */
    max-width: 100%;
    resize: vertical;
}
/* Стили для ссылок и комментариев в задаче */
.task-link, .task-comment {
    font-size: 11px;
    margin-bottom: 6px;
    padding: 4px 8px;
    border-radius: 4px;
    display: block;
    word-break: break-all;
}
.task-link {
    background: rgba(209, 122, 255, 0.1);
    color: #d17aff;
}
.task-link a {
    color: #d17aff;
    text-decoration: underline;
}
.task-comment {
    background: rgba(255, 255, 255, 0.05);
    color: #a38cb8;
    font-style: italic;
}
/* Стили для файлов и комментариев в задаче */
.task-file, .task-comment {
    font-size: 11px;
    margin-bottom: 6px;
    padding: 4px 8px;
    border-radius: 4px;
    display: block;
    word-break: break-all;
}
.task-file {
    background: rgba(209, 122, 255, 0.1);
    color: #d17aff;
}
.task-file a {
    color: #d17aff;
    text-decoration: underline;
}
.task-comment {
    background: rgba(255, 255, 255, 0.05);
    color: #a38cb8;
    font-style: italic;
}
/* Улучшенная форма обновления задачи */
.update-form {
    display: flex;
    flex-direction: column;
    gap: 8px; /* Уменьшили отступы между полями */
    margin-top: 10px;
}

/* Поля ввода в форме */
.update-form .input-field {
    padding: 8px 10px; /* Чуть меньше, чем в основной форме */
    font-size: 13px;
}

/* Поле для файла (чтобы не вылезало за края) */
.update-form input[type="file"] {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box; /* Важно: учитывает отступы и рамки в ширину */
    padding: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px dashed rgba(209, 122, 255, 0.5);
    color: #a38cb8;
    font-size: 12px;
    cursor: pointer;
    border-radius: 6px;
}

/* Кнопка "Обзор..." внутри поля */
.update-form input[type="file"]::file-selector-button {
    background: #d17aff;
    color: #1a0b2e;
    border: none;
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    margin-right: 10px;
    transition: background 0.2s;
}
.update-form input[type="file"]::file-selector-button:hover {
    background: #b565e6;
}

/* Кнопка "Сохранить" (делаем менее яркой) */
.btn-save {
    padding: 8px;
    background: rgba(209, 122, 255, 0.2); /* Полупрозрачный фон */
    color: #d17aff; /* Фиолетовый текст */
    border: 1px solid #d17aff;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    transition: all 0.2s;
}
.btn-save:hover {
    background: #d17aff;
    color: #1a0b2e;
}
/* Стили для колонки "На проверке" */
.kanban-column[data-status="review"] .column-header h3 {
    color: #facc15; /* Желтый цвет заголовка */
}
.review-card {
    border-left-color: #facc15; /* Желтая полоска слева */
    background: rgba(250, 204, 21, 0.05);
}

/* Кнопка "На проверку" */
.btn-review {
    border-color: #facc15;
    color: #facc15;
}
.btn-review:hover {
    background: #facc15;
    color: #0f0518;
}
/* --- ЭКРАН ВХОДА --- */
#auth-screen {
    display: none; /* Скрыт по умолчанию, JS включает */
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: #0f0518;
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.auth-card {
    background: rgba(45, 27, 78, 0.9);
    padding: 40px;
    border-radius: 20px;
    border: 1px solid #d17aff;
    text-align: center;
    width: 90%;
    max-width: 400px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.auth-title {
    color: #d17aff;
    margin-bottom: 10px;
    font-size: 28px;
}

.auth-subtitle {
    color: #a38cb8;
    margin-bottom: 30px;
}

.auth-input {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border-radius: 8px;
    border: 1px solid #d17aff;
    background: #1a0b2e;
    color: white;
    font-size: 16px;
    font-family: 'Montserrat', sans-serif;
    box-sizing: border-box;
}

.auth-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #a855f7, #d17aff);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    font-family: 'Montserrat', sans-serif;
    transition: transform 0.2s;
    box-sizing: border-box;
}
.auth-btn:hover {
    transform: scale(1.02);
}

.auth-hint {
    color: #a38cb8;
    font-size: 12px;
    margin-top: 20px;
    text-align: center;
}