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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    min-height: 100vh;
    color: #fff;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

h1 {
    text-align: center;
    margin-bottom: 5px;
    font-size: 2.2rem;
    color: #00d4ff;
    text-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
}

.subtitle {
    text-align: center;
    color: #b8b8d1;
    margin-bottom: 25px;
    font-style: italic;
}

h2 {
    color: #00d4ff;
    margin-bottom: 15px;
}

h3 {
    color: #00d4ff;
    margin-bottom: 8px;
    font-size: 1rem;
}

h4 {
    color: #00ff88;
    margin-bottom: 10px;
}

.main-content {
    display: flex;
    gap: 25px;
    margin-bottom: 30px;
    flex-wrap: wrap;
    justify-content: center;
}

.simulation-area {
    background: #0f0f23;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

#simCanvas {
    display: block;
    background: linear-gradient(180deg, #2a2a4a 0%, #1a1a3e 100%);
    border-radius: 10px;
}

.sim-info {
    margin-top: 15px;
    padding: 10px;
    background: #1a1a3e;
    border-radius: 8px;
    font-size: 0.95rem;
}

.sim-info div {
    margin-bottom: 5px;
    color: #b8b8d1;
}

.sim-info span {
    color: #00ff88;
    font-weight: bold;
}

.controls-area {
    background: #0f0f23;
    border-radius: 15px;
    padding: 20px;
    min-width: 320px;
    max-width: 380px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.phase-indicator {
    background: #1a1a3e;
    padding: 10px 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
}

.phase-text {
    color: #00d4ff;
    font-weight: bold;
}

.control-section {
    background: #1a1a3e;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
}

.info-text {
    color: #888;
    font-size: 0.85rem;
    margin-bottom: 10px;
    font-style: italic;
}

.control-group {
    margin-bottom: 15px;
}

.control-group label {
    display: block;
    margin-bottom: 5px;
    color: #b8b8d1;
    font-size: 0.9rem;
}

.control-group input[type="range"] {
    width: 70%;
    vertical-align: middle;
}

.control-group span {
    color: #00d4ff;
    font-weight: bold;
    margin-left: 10px;
}

.button-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.btn {
    padding: 10px 16px;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(135deg, #00d4ff 0%, #0099cc 100%);
    color: #000;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 212, 255, 0.4);
}

.btn-secondary {
    background: #2a2a4a;
    color: #fff;
}

.btn-secondary:hover:not(:disabled) {
    background: #3a3a5a;
}

.btn-success {
    background: linear-gradient(135deg, #00ff88 0%, #00cc6a 100%);
    color: #000;
}

.btn-success:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 255, 136, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, #ff4444 0%, #cc0000 100%);
    color: #fff;
}

.btn-danger:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 68, 68, 0.4);
}

.measurement-display {
    margin-top: 10px;
    padding: 10px;
    background: #0f0f23;
    border-radius: 6px;
    font-size: 0.95rem;
    color: #b8b8d1;
    line-height: 1.6;
}

.measurement-display span:nth-child(even) {
    color: #00ff88;
    font-weight: bold;
}

.data-section {
    background: #0f0f23;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

#dataTable {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 15px;
}

#dataTable th,
#dataTable td {
    padding: 12px 20px;
    text-align: center;
    border-bottom: 1px solid #2a2a4a;
}

#dataTable th {
    background: #1a1a3e;
    color: #00d4ff;
    font-weight: 600;
}

#dataTable tbody tr:hover {
    background: #1a1a3e;
}

#dataTable td {
    color: #b8b8d1;
}

.table-buttons {
    display: flex;
    gap: 10px;
}

.btn-remove {
    padding: 5px 12px;
    border: none;
    border-radius: 5px;
    background: #ff4444;
    color: #fff;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-remove:hover {
    background: #cc0000;
}

.analysis-section {
    background: #0f0f23;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.analysis-content {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
}

.plot-container {
    background: #1a1a3e;
    border-radius: 10px;
    padding: 15px;
}

#plotCanvas {
    display: block;
    background: #0d0d1a;
    border-radius: 8px;
}

.results-container {
    flex: 1;
    min-width: 280px;
    background: #1a1a3e;
    border-radius: 10px;
    padding: 20px;
}

.results-container h3 {
    margin-bottom: 15px;
}

.results-container p {
    margin-bottom: 8px;
    color: #b8b8d1;
}

.results-container span {
    color: #00ff88;
}

.calculation-box {
    margin-top: 20px;
    padding: 15px;
    background: #0f0f23;
    border-radius: 8px;
    border: 1px solid #00d4ff;
}

.calculation-box p {
    margin-bottom: 6px;
}

.error-result {
    margin-top: 10px;
    font-size: 1.1rem;
}

.error-result span {
    color: #ff6b6b;
}

@media (max-width: 900px) {
    .main-content {
        flex-direction: column;
        align-items: center;
    }

    .controls-area {
        max-width: 100%;
        min-width: auto;
    }

    .analysis-content {
        flex-direction: column;
    }
}
