/* Устанавливаем общие настройки шрифта */
html, body {
    font-family: 'Helvetica Neue', sans-serif;
    font-size: 14px;
    margin: 0;
    padding: 0;
  }
  
  /* === Основные стили === */
  
  body {
    background: linear-gradient(to right, #0f172a, #0e2034, #0e1d30);
    color: #333;
    overflow-y: auto;
  }
  
/* Шапка */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed;
    top: 0;
    width: 100%;
    height: 75px;
    padding: 0 20px;
    background: linear-gradient(to right, #0f172a, #0e2034, #0e1d30);
    box-sizing: border-box;
    border-bottom: 0px solid rgb(229, 231, 235);
    z-index: 9999;
    color-scheme: dark;
    cursor: pointer;
}

.nav__list {
    display: flex;
    gap: 20px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav__item {
    display: block;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
}

.button {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    padding: 0 15px;
    font-weight: 600;
    font-size: 14px;
    line-height: 24px;
    text-align: left;
    color: rgb(255, 255, 255);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(229, 231, 235, 0.5);
    border-radius: 5px;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    cursor: pointer;
    transition: background 0.3s ease, color 0.3s ease;
}

  
/* Основной контейнер */
.main-container {
    display: flex;
    flex-wrap: nowrap; /* Блоки располагаются в одну строку */
    gap: 20px;
    padding: 100px 20px 20px;
    justify-content: center;
    align-items: flex-start;
}

/* Для экранов шириной меньше 768px */
@media screen and (max-width: 768px) {
    .main-container {
        flex-direction: column; /* Блоки располагаются вертикально */
        align-items: stretch; /* Растягиваем блоки по ширине */
    }

    .settings {
        width: 100%; /* Растягиваем блок настроек на всю ширину */
    }

    .chart-container {
        width: 100%; /* Растягиваем блок графика на всю ширину */
    }
}

  
  .settings {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    width: 350px;
    box-sizing: border-box;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    flex-shrink: 0; /* Чтобы блок настроек не сжимался */
  }
  
  .settings h2, .settings h3 {
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
  }
  
  .form-group {
    margin-bottom: 15px;
    
  }
  
  label {
    color: #666;
  }
  
  input[type="text"],
  input[type="number"],
  input[type="color"] {
    width: 100%;
    max-width: 100%;
    min-width: 300px;
    padding: 8px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-sizing: border-box;
}

input.editable-input {
    width: auto; /* Перезапись глобального правила */
    max-width: 80px;
    min-width: 50px;
}
  .switch-group {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
  }
  
  /* Цвет кнопок управления линиями будет выставляться динамически в JS,
     когда линия активна/неактивна. */
  .switch-button {
    flex: 1;
    padding: 10px;
    background: #f4f4f4; 
    border: 1px solid #ccc;
    border-radius: 5px;
    cursor: pointer;
    text-align: center;
    transition: background 0.3s ease, transform 0.2s ease;
    color: #333; /* Тёмный текст по умолчанию */
  }
  
  .switch-button.active {
    /* Можно дополнительно подсветить активную кнопку */
    outline: 2px solid #fff;
    transform: scale(1.03);
  }
  
  /* Блок графика и таблицы */
  .chart-container {
    flex: 1;
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    
    display: flex;
    flex-direction: column;
    gap: 20px;
  }
  
  /* Обёртка под канвас и таблицу — чтоб занимали одинаковую ширину */
  .chart-table-wrapper {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
  }
  
  /* Обёртка под канвас — чтоб он резиново растягивался */
  #chartWrapper {
    width: 100%;
    aspect-ratio: 16 / 9;
    margin: 0 auto;
  }
  
  #myChart {
    width: 100%;
    height: 100%;
  }
  table {
    width: 100%;
    border-collapse: collapse;
  }
  
  td {
    padding: 5px; /* Отступы внутри ячейки */
    text-align: center;
    min-width: 50px; /* Минимальная ширина ячейки */
    position: relative; /* Для корректного размещения инпута */
  }
  
  input[type="number"] {
    width: 100%; /* Ширина инпута подгоняется под ячейку */
    box-sizing: border-box; /* Учитываются внутренние отступы */
    font-family: 'Helvetica Neue', sans-serif;
    font-size: 14px;
    text-align: center; /* Выравнивание текста в инпуте */
    padding: 5px;
    border: 1px solid #ccc;
    border-radius: 4px;
  }
  
  
  th, td {
    font-family: inherit;
    font-size: inherit;
    padding: 10px;
    text-align: center;
    border: 1px solid #ccc;
  }
  
  th {
    background: #f4f4f4;
    font-weight: bold;
  }
  
  td button {
    padding: 5px 10px;
    font-size: inherit;
    background: #f87171;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s ease;
  }
  
  td button:hover {
    background: #ef4444;
  }
  
  .download-button {
    margin-top: 20px;
    font-size: 14px;
    background: #08b371; /* цвет для кнопки "Скачать" */
    border: 1px solid rgba(0, 0, 0, 0.2);
  }
  
  .download-button:hover {
    background: #06a167;
  }
  
  textarea {
    width: 100%;
    max-width: 100%;
    min-width: 300px;
    padding: 8px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-sizing: border-box;
    resize: none; /* Запрет изменения размеров */
}
/* Кнопка добавления точки */
.add-point-button {
    background-color: #06aa45;
    color: #fff;
    border: none;
    border-radius: 5px;
    padding: 10px 20px;
    font-size: 14px;
    height: 80px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease;
    width: 100%; /* Кнопка занимает всю ширину блока */
    box-sizing: border-box; /* Учитывает отступы и границы */
    margin-top: 20px; /* Отступ сверху */
}

.add-point-button:hover {
    background-color: #1e90ff;
    transform: scale(1.05);
}

/* Кнопка скачивания графика */
.download-button {
    background-color:#1e90ff;
    color: #fff;
    border: none;
    border-radius: 5px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease;
    width: 100%; /* Кнопка занимает всю ширину блока */
    box-sizing: border-box; /* Учитывает отступы и границы */
    margin-top: 20px; /* Отступ сверху */
}

.download-button:hover {
    background-color: #45a049;
    transform: scale(1.05);
}


.editable-input {
    width: auto; /* Ширина подгоняется под содержимое */
    max-width: 80px; /* Ограничение максимальной ширины */
    min-width: 50px; /* Минимальная ширина */
    box-sizing: border-box; /* Учитываем отступы */
    font-family: 'Helvetica Neue', sans-serif;
    font-size: 14px;
    text-align: center;
    padding: 5px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.delete-button {
    background-color: #f87171; /* Красный цвет */
    color: #fff;
    border: none;
    border-radius: 5px;
    padding: 5px 10px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.delete-button:hover {
    background-color: #ef4444;
}

