/* =========================
   БАЗОВЫЕ СТИЛИ
========================= */
body { 
    font-family: sans-serif; 
    margin: 0;
    padding: 0;
    background: #f9f9f9;
    color: #333;
}

/* Центровка блоков */
.center {
    text-align: center;
    margin-top: 40px;
}

/* Заголовки */
h2 {
    margin: 20px 0;
}
h3 {
    margin: 10px 0 5px 0;
}
h4 {
    margin: 0;
}

/* =========================
   ХЕДЕР
========================= */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background-color: #fff;
    border-bottom: 1px solid #ccc;
    box-sizing: border-box;
}

.status-block h4 {
    margin: 0;
    font-weight: normal;
}

.status-ready { color: #007F00; font-weight: bold; }
.status-busy  { color: #c0ce00; font-weight: bold; }
.status-fail  { color: #AF0000; font-weight: bold; }

.user-block {
    text-align: right;
    font-size: 14px;
}

/* =========================
   ФОРМЫ И ИНПУТЫ
========================= */
/* Вход в систему */
.login-form input {
    width: 200px;   /* совпадает с кнопкой */
}

/* Все инпуты в модалках */
.modal-content input {
    width: 100%;      /* занимает почти всю форму */
    max-width: 640px;
    box-sizing: border-box;
}

input, select { 
    margin: 5px 0;
    padding: 10px;
    width: 100%;
    max-width: 300px;
    box-sizing: border-box;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
}

/* Чекбокс — выравнивание */
input[type="checkbox"] {
    width: auto;
    margin-right: 8px;
}

/* =========================
   ВВОД ТЕКСТА
========================= */
.form-group {
    display: flex;
    flex-direction: column;
    margin-top: 5px;
    margin-bottom: 0px;
}

.fixed-textarea {
    width: 100%;
    height: 110px; /* фиксированная высота */
    padding: 5px;
    font-size: 14px;
    resize: none;             /* запрет ручного изменения размера */
    border: 1px solid #ccc;
    border-radius: 6px;
    box-sizing: border-box;
    line-height: 1.4;
    overflow-y: auto;         /* скролл внутри */
    background: #fafafa;
}

.fixed-textarea:focus {
    border-color: #007BFF;
    outline: none;
    background: #fff;
}

.form-group label {
    margin-top: 0px;
    margin-bottom: 5px;
    font-size: 14px;
    color: #444;
    text-align: left;
}

/* =========================
   КНОПКИ
========================= */
button { 
    padding: 10px;
    margin-top: 10px;
    width: 200px;
    font-size: 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    background-color: #2F89E5;
    color: white;
    transition: background-color 0.2s;
}

button:hover:not(:disabled) {
    background-color: #2F89D1;
}

button:disabled {
    background-color: #898989;
    opacity: 0.5;
    cursor: default;
}

/* Вертикальное расположение кнопок */
.actions {
    margin-top: 20px;
    text-align: center; /* для центрирования */
}

.actions button {
    display: block;     /* каждая кнопка в новой строке */
    margin: 10px auto;  /* центрируем по горизонтали */
    width: 200px;       /* одинаковая ширина */
}

/* =========================
   ОШИБКИ
========================= */
.error {
    color: red; 
    margin-top: 10px; 
    font-size: 14px;
    text-align: center;  
}

/* =========================
   МОДАЛЬНЫЕ ОКНА
========================= */
.modal {
    display: none; 
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background-color: #fff;
    padding: 20px;
    border-radius: 6px;
    max-height: 640px;
    width: 80%;
    max-width: 640px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
}

/* Списки задач */
.modal-content select {
    width: 100%;          
    max-width: 640px;     
    margin: 0 auto 10px;  
    height: 200px;         
    overflow-y: auto;     
    box-sizing: border-box;
    display: block;       
}

/* Универсальные кнопки в модалках */
.modal-content button {
    width: 140px;
    height: 40px;
    font-size: 14px;
}

/* Центрирование кнопки закрытия */
.modal-close {
    display: flex;
    justify-content: center;
    margin-top: 10px;
}

/* Группы кнопок в модалке */
.modal-actions {
    display: flex;
    justify-content: flex-start;
    gap: 10px;
}

/* Вертикальное расположение кнопок в модальной форме */
.modal-buttons.center-buttons {
    display: flex;
    flex-direction: column;   /* ставим вертикально */
    align-items: center;      /* центр по горизонтали */
    gap: 10px;                /* расстояние между кнопками */
    margin-top: 15px;
}

/* Кнопки внутри контейнера */
.modal-buttons.center-buttons button {
    width: 200px;   /* одинаковая ширина */
    height: 40px;
    font-size: 16px;
}

.modal-buttons-tasks {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
}

.left-buttons button,
.right-buttons button {
    margin-right: 5px;
}

/* =========================
   DROPZONE ДЛЯ ФАЙЛОВ
========================= */
/* --- Дроп-зона для файла --- */
.file-drop-zone {
    border: 2px dashed #888;
    padding: 20px;
    max-height: 80px;
    text-align: center;
    border-radius: 6px;
    background: #fafafa;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;  /* плавный переход при hover/drag */
}

/* Визуальное выделение при наведении мыши */
.file-drop-zone:hover {
    border-color: #2F89E5;
    background-color: #f0f8ff;
}

/* Визуальное выделение при drag & drop */
.file-drop-zone.drag-over {
    border-color: #007bff;
    background-color: #e9f5ff;
    box-shadow: 0 0 10px rgba(0, 123, 255, 0.5);
    transform: scale(1.02);
}

/* Визуальное выделение по id */
#create-new-task-btn {
    background-color: #28a745; /* зелёный оттенок */
    color: white;
    font-size: 16px;           
    width: 250px;              /* можно подстроить под дизайн */
    height: 50px;              /* чуть выше */
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s;
}

#create-new-task-btn:hover {
    background-color: #218838; /* темнее при наведении */
}

#refresh-tasks-btn {
    background-color: #28a745; /* зелёный оттенок */
}

#refresh-tasks-btn:hover {
    background-color: #218838; /* темнее при наведении */
}

#select-file-btn {
    margin-top: 0px;       /* поднимаем кнопку */
    border-radius: 4px;
    border: none;
    background-color: #2F89E5;
    color: white;
    cursor: pointer;
    transition: background-color 0.2s;
}

#select-file-btn:hover {
    background-color: #2F7AD1;
}

#new-task-modal input {
    max-width: 300px;   
}

#new-task-modal select {
    max-width: 300px;
    width: 100%;
    display: inline-block; /* чтобы не центрировался */
    margin: 0 0 10px 0;    /* нижний отступ, остальное не сдвигает */
    box-sizing: border-box;
}

/* =========================
   АДАПТИВНОСТЬ
========================= */
@media (max-width: 500px) {
    input, button {
        width: 90%;
    }
    header {
        display: block;
        text-align: center;
        padding: 10px;
    }
    .user-block {
        text-align: center;
        margin-top: 10px;
    }
    .status-block {
        margin-bottom: 10px;
    }
    .modal-content {
        width: 95%;
        max-width: none;
        height: 90%;
    }
}
