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

body {
    font-family: 'Inter', sans-serif;
    background-color: #0d1117;
    color: #e6edf3;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow-x: hidden;
}

.container {
    display: flex;
    flex-direction: row;
    width: 100%;
    max-width: 1200px;
    height: 90vh;
    background-color: #161b22;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border: 1px solid #30363d;
    overflow: hidden;
}

.left-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px;
    border-right: 1px solid #30363d;
    position: relative;
}

.right-panel {
    flex: 1;
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 25px;
    overflow-y: auto;
}

.panel-title {
    text-align: center;
    font-weight: 500;
    margin-bottom: 10px;
    color: #c9d1d9;
    font-size: 1.2rem;
}

/* Canvas 3D */
#canvas-container {
    flex: 1;
    width: 100%;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    cursor: grab;
}

#canvas-container:active {
    cursor: grabbing;
}

/* Controls */
.controls {
    margin-top: 20px;
    background: #0d1117;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #30363d;
}

.control-group {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.control-group:last-child {
    margin-bottom: 0;
}

.control-group label {
    font-family: monospace;
    font-size: 0.9rem;
    width: 140px;
}

input[type=range] {
    flex: 1;
    accent-color: #58a6ff;
}

/* Typography & Colors */
h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
    text-align: center;
}

.green-text { color: #3fb950; }
.yellow-text { color: #d29922; }
.cyan-text { color: #58a6ff; }
.p0-color { color: #7ee787; }
.p1-color { color: #ff7b72; }
.grey-text { color: #8b949e; }
.p0-bg { background-color: #7ee787; }
.p1-bg { background-color: #ff7b72; }

/* Comparison Boxes */
.comparison-boxes {
    display: flex;
    gap: 20px;
}

.box {
    flex: 1;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid #30363d;
    background: #0d1117;
}

.classic-box { border-color: #ff7b72; }
.classic-box h3 { color: #ff7b72; }
.quantum-box { border-color: #58a6ff; }
.quantum-box h3 { color: #58a6ff; }

.box p {
    font-size: 0.8rem;
    color: #8b949e;
    margin-bottom: 10px;
}

.bit-value {
    font-size: 1.5rem;
    font-weight: bold;
    font-family: monospace;
}

.qubit-value {
    font-size: 1.2rem;
    font-weight: bold;
    font-family: monospace;
}

/* Sections */
.section {
    text-align: center;
}

.small-text {
    font-size: 0.85rem;
    line-height: 1.4;
}

/* Probabilities Layout */
.prob-layout {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 30px;
    margin-top: 15px;
}

.prob-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.prob-label {
    font-family: monospace;
    font-weight: bold;
}

.bar-container {
    width: 60px;
    height: 80px;
    border: 1px solid #30363d;
    background: #0d1117;
    position: relative;
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    align-items: flex-end;
}

.bar {
    width: 100%;
    transition: height 0.3s ease;
}

.prob-val {
    font-family: monospace;
    font-size: 0.9rem;
}

.collapse-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-left: 20px;
}

.collapse-btn {
    background: transparent;
    color: #d29922;
    border: 1px solid #d29922;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

.collapse-btn:hover {
    background: rgba(210, 153, 34, 0.1);
}

.collapse-btn:active {
    transform: scale(0.95);
}

.collapse-result {
    font-size: 1.8rem;
    font-family: monospace;
    font-weight: bold;
    color: #e6edf3;
    width: 60px;
    height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 1px solid #d29922;
    border-radius: 8px;
    background: #0d1117;
}

/* Math Grid */
.state-math-section {
    background: #0d1117;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #30363d;
}

.main-eq {
    font-size: 1.2rem;
    font-weight: bold;
    margin: 10px 0;
    color: #e6edf3;
}

.math-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    font-family: monospace;
    text-align: left;
    max-width: 400px;
    margin: 0 auto;
    font-size: 0.9rem;
    color: #c9d1d9;
}

.mt-2 { margin-top: 15px; }

/* Responsive */
@media (max-width: 900px) {
    .container {
        flex-direction: column;
        height: auto;
    }
    .left-panel {
        border-right: none;
        border-bottom: 1px solid #30363d;
        height: 500px;
    }
}
