/* ====== Общие стили ====== */
body {
    font-family: Arial, sans-serif;
    background: #f4f4f9;
    margin: 0;
    padding: 0;
    display: flex;
    min-height: 100vh;
}

/* Стили для contenteditable элементов в настройках */
[contenteditable="true"] {
    outline: none;
    word-wrap: break-word;
    white-space: pre-wrap;
}

[contenteditable="true"]:focus {
    border-color: #007BFF !important;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

[contenteditable="true"]:empty:before {
    content: attr(placeholder);
    color: #999;
    pointer-events: none;
}

/* ====== Индикатор загрузки ====== */
.loading-spinner {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
    font-size: 18px;
    color: #666;
    flex-direction: column;
    gap: 15px;
}

.loading-spinner::before {
    content: '';
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ====== Toast уведомления ====== */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 10000;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    max-width: 400px;
    font-size: 14px;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast-success {
    background: #27ae60;
    color: white;
}

.toast-error {
    background: #e74c3c;
    color: white;
}

.toast-warning {
    background: #f39c12;
    color: white;
}

.toast-info {
    background: #3498db;
    color: white;
}

/* ====== Плавные переходы секций ====== */
.content-section {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ====== Активная кнопка меню ====== */
#menuButtons button.active {
    background: #3498db;
    color: white;
    font-weight: bold;
}

/* ====== Сайдбар (меню слева) ====== */
#sidebar {
    width: 260px;
    background: #2c3e50;
    color: white;
    padding: 20px;
    display: none; /* По умолчанию скрыт, показывается только после авторизации */
    flex-direction: column;
    min-height: 100vh;
    box-shadow: 2px 0 10px rgba(0,0,0,0.2);
    position: fixed;
    left: 0;
    top: 0;
}

#sidebar h2 {
    font-size: 20px;
    margin-bottom: 20px;
    text-align: center;
    font-weight: bold;
}

/* Блок авторизации в меню */
#authSection {
    text-align: center;
    margin-bottom: 20px;
    font-weight: bold;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
}

#authSection button {
    width: 100%;
    padding: 12px;
    margin-top: 10px;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: 0.3s;
}

#authSection button:hover {
    background: #c0392b;
}

/* Кнопки меню */
#sidebar button {
    width: 100%;
    padding: 12px;
    margin: 5px 0;
    background: #34495e;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: 0.3s;
}

#sidebar button:hover {
    background: #1abc9c;
}

/* Скрывать меню, если не авторизован */
#menuSection {
    display: none;
}

/* ====== Основной контент ====== */
#mainContent {
    margin-left: 280px;
    width: calc(100% - 280px);
    padding: 30px;
    text-align: center;
}

/* ====== Раздел задач ====== */
#taskSection {
    width: 100%;
  
    margin: auto;
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.1);
    padding: 20px;
}

/* ====== Форма (ширина 100%) ====== */
form {
 
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

input, select {
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 16px;
    flex: 1;
    min-width: 200px;
}

/* Исключаем чекбоксы и радио из flex: 1 */
input[type="checkbox"],
input[type="radio"] {
    flex: none !important;
    min-width: auto !important;
    width: auto !important;
}

/* ====== Таблица (на весь экран) ====== */
table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
}

th, td {
    padding: 15px;
    border-bottom: 1px solid #ddd;
    text-align: left;
}

th {
    background: #2c3e50;
    color: white;
}

td {
    font-size: 14px;
}

/* Чередование цветов строк */
tr:nth-child(even) {
    background-color: #f9f9f9;
}

/* ====== Модальное окно редактирования ====== */
#overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

#editModal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
    z-index: 1000;
    width: 400px;
    max-width: 90%;
}

#editModal h3 {
    margin-top: 0;
    color: #2c3e50;
}

/* ====== Медиа-запросы для мобильных ====== */
@media (max-width: 768px) {
    body {
        flex-direction: column;
    }

    #sidebar {
        width: 100%;
        height: auto;
        position: relative;
        box-shadow: none;
        text-align: center;
    }

    #mainContent {
        margin-left: 0;
        width: 100%;
    }

    form {
        flex-direction: column;
    }

    input, select {
        width: 100%;
    }

    table {
        font-size: 12px;
    }

    th, td {
        padding: 10px;
    }

    button {
        font-size: 14px;
        padding: 10px;
    }
}


/* 📌 Блок архива */
.year-container {
    margin-bottom: 10px;
}

.year-title {
    font-size: 18px;
    color: #2c3e50;
    font-weight: bold;
    cursor: pointer;
    padding: 5px;
    background: #e0e0e0;
    border-radius: 5px;
    transition: background 0.3s;
}

.year-title:hover {
    background: #3498db;
    color: white;
}

/* 📌 Скрытые месяцы */
.hidden {
    display: none;
}

.months-list {
    list-style: none;
    padding-left: 10px;
    margin-top: 5px;
}

.months-list li {
    margin-bottom: 5px;
}

.months-list li a {
    text-decoration: none;
    color: #2c3e50;
    font-size: 16px;
    padding: 5px 10px;
    border-radius: 5px;
    display: inline-block;
    transition: all 0.3s;
}

.months-list li a:hover {
    background: #3498db;
    color: white;
}

/* 📌 Заголовок таблицы архива */
#selectedMonth {
    font-size: 20px;
    color: #2c3e50;
    margin-bottom: 10px;
    text-align: center;
}

.year-container {
    margin-bottom: 10px;
}

.year-title {
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    padding: 5px;
    background: #2c3e50;
    color: white;
    border-radius: 5px;
    text-align: center;
}

.months-list {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    padding: 10px;
}

.months-list.hidden {
    display: none;
}

.month-tag {
    background: #1abc9c;
    color: white;
    padding: 5px 10px;
    border-radius: 15px;
    cursor: pointer;
    text-decoration: none;
    transition: 0.3s;
    display: inline-block;
}

.month-tag:hover {
    background: #16a085;
}





// КНОПКИ ДЛЯ АРХИВА 
/* ✅ Контейнер кнопок */
.button-container {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

/* ✅ Кнопка "Назад" */
.btn-back {
    background-color: #6c757d;
    color: white;
    border: none;
    padding: 10px 18px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    border-radius: 5px;
    transition: 0.3s;
}

.btn-back:hover {
    background-color: #5a6268;
}

/* ✅ Кнопка "Скачать отчет" */
.btn-excel {
    background-color: #28a745;
    color: white;
    border: none;
    padding: 12px 20px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    border-radius: 5px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: 0.3s;
    margin-left: 20px;
}

.btn-excel:hover {
    background-color: #218838;
}
.button-container {display: flex; margin:10px;}


// ГРАФИК 
#statisticsSection {
    width: 100%;  /* Устанавливаем ширину контейнера на 100% */
    max-width: 100%; /* Убираем ограничения на максимальную ширину */
    margin-top: 20px; /* Отступ сверху */
    padding: 20px; /* Отступ внутри */
}

#taskChart {
    width: 100% !important; /* Устанавливаем ширину канваса на 100% */
    height: 400px; /* Высота графика, можно настроить по желанию */
}





#taskSection {
    display: none; /* Изначально скрыто */
}

#statisticsSection {
    display: none; /* Изначально скрыто */
}

#statisticsSection.active {
    display: block; /* Когда активируется, показывается */
}

#taskSection.active {
    display: block; /* Когда активируется, показывается */
}







/* Кнопка Очистить логи */
.btn-danger {
    background-color: #dc3545;
     
    color: white;
    border: none;
    padding: 10px 18px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    border-radius: 5px;
    transition: 0.3s;
    margin-left: 20px ;
}



/* Кнопка Сохранить в TXT */
.btn-save {
    background-color: #28a745;
   
    color: white;
    border: none;
    padding: 10px 18px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    border-radius: 5px;
    transition: 0.3s;
    margin-left: 20px ;
}






