:root {
    --primary-color: #1f2044;
    --primary-light: #2a2d5c;
    --primary-dark: #161732;
    --accent-color: #4a90e2;
    --text-light: #ffffff;
    --text-dark: #333333;
    --background-light: #f5f6fa;
    --success-color: #4caf50;
    --warning-color: #ff9800;
    --danger-color: #f44336;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--background-light);
    color: var(--text-dark);
    line-height: 1.6;
}

.container {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    position: fixed;
    top: 0;
    left: 0;
}

/* Language Switcher */
.language-switcher {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
}

.lang-button {
    padding: 8px 16px;
    font-size: 0.9rem;
    font-weight: 600;
    background-color: var(--accent-color);
    color: var(--text-light);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    min-width: 50px;
}

.lang-button:hover {
    background-color: #357abd;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

.lang-button:active {
    transform: translateY(0);
}

/* Адаптивность для переключателя языка */
@media (max-width: 768px) {
    .language-switcher {
        top: 10px;
        right: 10px;
    }
    
    .lang-button {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
}

/* Стили для экранов */
.screen {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease-in-out;
    position: absolute;
    top: 0;
    left: 0;
}

.screen.hidden {
    display: none;
    opacity: 0;
}

/* Стили для экрана приветствия */
.welcome-content {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 2rem;
    background-color: var(--primary-color);
    color: var(--text-light);
}

.welcome-content h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.welcome-content p {
    font-size: 1.2rem;
    color: #ccc;
    margin-bottom: 2rem;
}

/* Стили для экрана мониторинга */
.monitoring-content {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    padding: 0.5rem;
    background-color: white;
    overflow: hidden;
}

.close-button {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--primary-color);
    cursor: pointer;
    z-index: 1000;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.3s;
}

.close-button:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

/* Панель управления */
.controls-panel {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 0.75rem;
    background-color: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    align-items: center;
    flex-shrink: 0;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.control-group label {
    font-size: 0.9rem;
    color: #666;
}

.control-group input[type="number"] {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    width: 100px;
}

.control-group input[type="range"] {
    width: 150px;
}

.control-button {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    background-color: var(--accent-color);
    color: var(--text-light);
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.control-button:hover {
    background-color: #357abd;
}

.control-button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* Контейнер графиков */
.charts-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    flex: 1;
    min-height: 0;
    margin-bottom: 0.5rem;
    overflow: hidden;
}

@media (max-width: 768px) {
    .charts-container {
        grid-template-columns: 1fr;
    }
}

.chart-container {
    background: white;
    border-radius: 8px;
    padding: 0.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.chart-container h3 {
    margin-bottom: 0.5rem;
    font-size: 1rem;
    color: var(--text-dark);
}

.chart-container canvas {
    flex: 1;
    min-height: 0;
    max-height: 100%;
}

/* Информационная панель */
.data-info {
    display: flex;
    gap: 2rem;
    padding: 0.75rem;
    background-color: #f8f9fa;
    border-radius: 8px;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.info-label {
    font-size: 0.85rem;
    color: #666;
}

.info-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
}

/* Стили для кнопок */
.primary-button {
    padding: 12px 24px;
    font-size: 1.1rem;
    background-color: var(--accent-color);
    color: var(--text-light);
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.primary-button:hover {
    background-color: #357abd;
}

.button-container {
    display: flex;
    gap: 10px;
    margin-top: 1rem;
}

/* Стили для статуса */
.status-text {
    margin-top: 1rem;
    font-size: 14px;
    color: var(--text-light);
    padding: 0.5rem;
    border-radius: 4px;
    background-color: rgba(255, 255, 255, 0.1);
}

.status-text.hidden {
    display: none;
}

/* Стили для полей ввода */
.device-input-container {
    margin: 20px 0;
    text-align: center;
    width: 100%;
}

.device-input-container label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-light);
    font-size: 1rem;
}

.device-input {
    padding: 10px;
    font-size: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 5px;
    width: 100%;
    max-width: 400px;
    box-sizing: border-box;
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--text-light);
    transition: border-color 0.3s;
}

.device-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.device-input:focus {
    outline: none;
    border-color: var(--accent-color);
    background-color: rgba(255, 255, 255, 0.2);
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    .welcome-content h1 {
        font-size: 2rem;
    }
    
    .welcome-content p {
        font-size: 1rem;
    }
    
    .charts-container {
        grid-template-columns: 1fr;
    }
    
    .controls-panel {
        flex-direction: column;
        align-items: stretch;
    }
    
    .control-group {
        width: 100%;
    }
    
    .control-group input[type="number"],
    .control-group input[type="range"] {
        width: 100%;
    }
    
    .data-info {
        flex-direction: column;
        gap: 1rem;
    }
}
