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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f5f5;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 30px;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.logo-link {
    display: block;
    transition: opacity 0.2s;
}

.logo-link:hover {
    opacity: 0.8;
}

.logo-link img {
    height: 50px;
    width: auto;
}

h1 {
    color: #333;
    margin: 0;
    font-size: 28px;
}

.subtitle {
    color: #666;
    margin-bottom: 30px;
    font-size: 14px;
}

.layout {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 30px;
}

.controls {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.tabs-and-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.control-group {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.control-group h3 {
    margin-bottom: 15px;
    color: #444;
    font-size: 16px;
    border-bottom: 2px solid #007bff;
    padding-bottom: 8px;
}

.tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
}

.tab {
    padding: 10px 20px;
    background: #f0f0f0;
    border: none;
    border-radius: 6px 6px 0 0;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #666;
    transition: all 0.2s;
}

.tab:hover {
    background: #e0e0e0;
}

.tab.active {
    background: #007bff;
    color: white;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.param {
    margin-bottom: 20px;
}

.param:last-child {
    margin-bottom: 0;
}

.param-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.param label {
    font-weight: 600;
    color: #555;
    font-size: 13px;
}

.param-value {
    display: flex;
    align-items: center;
    gap: 8px;
}

.value-display {
    background: white;
    border: 1px solid #ddd;
    padding: 4px 10px;
    border-radius: 4px;
    min-width: 80px;
    text-align: center;
    font-size: 13px;
    font-weight: 500;
    color: #007bff;
    cursor: text;
    outline: none;
}

.value-display:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0,123,255,0.1);
}

.unit {
    font-size: 12px;
    color: #888;
    font-weight: normal;
}

input[type="range"] {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #ddd;
    outline: none;
    -webkit-appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #007bff;
    cursor: pointer;
    transition: all 0.2s;
}

input[type="range"]::-webkit-slider-thumb:hover {
    background: #0056b3;
    transform: scale(1.1);
}

input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #007bff;
    cursor: pointer;
    border: none;
}

input[type="number"] {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    margin-top: 5px;
}

input[type="number"]:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0,123,255,0.1);
}

.chart-container {
    background: white;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    height: 600px;
    min-height: 300px;
}

canvas {
    max-height: 100%;
}

.info-box {
    background: #e7f3ff;
    border-left: 4px solid #007bff;
    padding: 15px;
    border-radius: 4px;
    font-size: 13px;
    color: #333;
}

.info-box strong {
    display: block;
    margin-bottom: 8px;
    color: #007bff;
}

.info-item {
    display: flex;
    justify-content: space-between;
    margin: 5px 0;
    align-items: center;
}

.show-modes-btn {
    padding: 4px 12px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.2s;
}

.show-modes-btn:hover {
    background: #0056b3;
}

.show-modes-btn.active {
    background: #dc3545;
}

.computing {
    opacity: 0.6;
    pointer-events: none;
}

.phase-sliders-row {
    display: flex;
    gap: 15px;
    justify-content: flex-start;
    flex-wrap: wrap;
    margin-top: 10px;
}

.phase-slider-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.phase-slider-item label {
    font-weight: 600;
    font-size: 12px;
    color: #555;
}

.phase-slider-item input[type="range"] {
    writing-mode: bt-lr;
    -webkit-appearance: slider-vertical;
    width: 8px;
    height: 90px;
    padding: 0;
}

.phase-slider-item .value-display {
    min-width: 50px;
    font-size: 11px;
    padding: 3px 6px;
}

@media (max-width: 1024px) {
    .layout {
        grid-template-columns: 1fr;
    }
}
