/**
 * Основные стили приложения анализа устойчивости систем корабля
 * Файл: styles.css
 * Назначение: Базовые стили layout и компонентов
 */

/* Сброс стилей и базовые настройки */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Arial', sans-serif;
}

/* Основные стили body */
body {
    padding: 20px;
    min-height: 100vh;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Контейнер приложения */
.container {
    max-width: 900px;
    margin: 0 auto;
    border-radius: 10px;
    padding: 20px;
    transition: all 0.3s ease;
}

/* Заголовок */
.header {
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom-width: 1px;
    border-bottom-style: solid;
}

.header h1 {
    font-size: 24px;
    margin-bottom: 5px;
}

/* Переключатель темы */
.theme-switcher {
    text-align: center;
    margin-bottom: 15px;
}

.theme-switcher button {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

/* Счетчик тестов */
.test-counter {
    text-align: center;
    margin: 10px 0;
    font-weight: bold;
}

/* Панель управления */
.control-panel {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.panel-section {
    padding: 15px;
    border-radius: 8px;
    border-width: 1px;
    border-style: solid;
}

h3 {
    margin-bottom: 10px;
    font-size: 16px;
}

/* Элементы управления */
select, input[type="range"], input[type="number"] {
    width: 100%;
    padding: 5px;
    border-radius: 4px;
    margin-bottom: 5px;
    transition: all 0.3s ease;
}

/* Панель параметров */
.parameters {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

.param-item {
    display: flex;
    flex-direction: column;
}

.param-item label {
    margin-bottom: 5px;
    font-size: 14px;
}

.param-item input {
    padding: 8px;
    font-size: 14px;
}

.param-name {
    font-size: 12px;
    margin-top: 3px;
    opacity: 0.8;
}

/* Кнопки управления тестами */
.test-controls {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

button {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    color: white;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.3s ease;
}

#startTest {
    background: #00aa44;
}

#startTest:hover {
    background: #00cc55;
}

#resetTest {
    background: #cc6600;
}

#resetTest:hover {
    background: #ff8800;
}

#finishAnalysis {
    background: #0066cc;
    display: none;
}

#finishAnalysis:hover {
    background: #0088ff;
}

/* Блок результатов */
.results {
    padding: 15px;
    border-radius: 8px;
    border-width: 1px;
    border-style: solid;
    margin-bottom: 15px;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.status-light {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.stable {
    background: #00ff44;
    box-shadow: 0 0 8px #00ff44;
}

.unstable {
    background: #ff4444;
    box-shadow: 0 0 8px #ff4444;
}

.kpe-value {
    font-size: 16px;
    font-weight: bold;
}

.stable-text { color: #00ff44; }
.unstable-text { color: #ff4444; }

/* История тестов */
.test-history {
    margin-top: 20px;
}

.history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.history-table th, .history-table td {
    border-width: 1px;
    border-style: solid;
    padding: 8px;
    text-align: center;
}

.history-table th {
    font-weight: bold;
}

/* Страница результатов */
.results-page {
    display: none;
}

.conclusion {
    padding: 20px;
    border-radius: 8px;
    border-width: 1px;
    border-style: solid;
    margin-bottom: 20px;
}

.conclusion h2 {
    margin-bottom: 15px;
    text-align: center;
}

.optimal-params {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin: 15px 0;
}

.param-card {
    padding: 15px;
    border-radius: 6px;
    border-width: 1px;
    border-style: solid;
}

.param-card h4 {
    margin-bottom: 10px;
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    .control-panel {
        grid-template-columns: 1fr;
    }

    .parameters {
        grid-template-columns: 1fr;
    }

    .test-controls {
        flex-direction: column;
        align-items: center;
    }

    .test-controls button {
        width: 100%;
        max-width: 200px;
    }

    .history-table {
        font-size: 10px;
    }

    .optimal-params {
        grid-template-columns: 1fr;
    }
}