/* Photon Path styles — wide layout, controls on right */

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

body {
    background: var(--bg-warm, #f5f5f5);
    color: var(--text-primary, #2d2d2d);
    font-family: 'EB Garamond', Georgia, serif;
    min-height: 100vh;
}

.content {
    max-width: 1400px;
    margin: 0 auto;
    padding: calc(var(--header-height, 64px) + 1.5rem) 1rem 3rem;
}

.intro h1 {
    font-family: 'EB Garamond', Georgia, serif;
    font-size: 2rem;
    font-weight: 400;
    margin-bottom: 0.3rem;
}

.intro p {
    font-size: 1.05rem;
    line-height: 1.6;
    color: var(--text-muted, #6b6b6b);
    margin-bottom: 1rem;
}

/* ─── App layout: canvas left, controls right ─────────────────────────────── */
.app-layout {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.canvas-area {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.canvas-wrapper {
    position: relative;
    width: 100%;
    background: #0a0a2e;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.25);
}

#main-canvas {
    width: 100%;
    height: auto;
    display: block;
}

/* Accumulation image canvas */
.accum-wrapper {
    position: relative;
    width: 100%;
    background: #111;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
    display: none;
}

.accum-wrapper.visible {
    display: block;
}

.accum-label {
    position: absolute;
    top: 0.4rem;
    left: 0.6rem;
    font-family: var(--font-sans, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
    font-size: 0.7rem;
    color: rgba(255,255,255,0.5);
    pointer-events: none;
    z-index: 1;
}

#accum-canvas {
    width: 100%;
    height: 40px;
    display: block;
}

/* ─── Right column: controls ──────────────────────────────────────────────── */
.controls-column {
    flex: 0 0 280px;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.controls-panel {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    font-family: var(--font-sans, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
    font-size: 0.82rem;
}

.controls-body {
    padding: 0.75rem 0.9rem;
}

.control-group {
    margin-bottom: 0.6rem;
}

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

.control-group label {
    display: block;
    margin-bottom: 0.2rem;
    color: var(--text-primary, #2d2d2d);
    font-size: 0.82rem;
}

.control-group label span {
    font-weight: 600;
}

.control-divider {
    border: none;
    border-top: 1px solid #eee;
    margin: 0.6rem 0;
}

/* Range sliders */
input[type="range"] {
    width: 100%;
    height: 4px;
    border-radius: 2px;
    background: linear-gradient(to right, #ccc, #888);
    outline: none;
    -webkit-appearance: none;
    cursor: pointer;
    accent-color: #2196F3;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: white;
    border: 2px solid #2196F3;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    transition: border-color 0.15s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
    border-color: #1565C0;
}

input[type="range"]::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: white;
    border: 2px solid #2196F3;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* Toggle button group */
.toggle-group {
    display: flex;
    gap: 0;
    margin-top: 0.2rem;
}

.toggle-btn {
    flex: 1;
    padding: 0.3rem 0.4rem;
    border: 1px solid #ccc;
    background: #fff;
    cursor: pointer;
    font-size: 0.76rem;
    font-family: inherit;
    color: var(--text-muted, #6b6b6b);
    transition: all 0.15s ease;
    white-space: nowrap;
}

.toggle-btn:first-child {
    border-radius: 4px 0 0 4px;
}

.toggle-btn:last-child {
    border-radius: 0 4px 4px 0;
}

.toggle-btn:not(:first-child) {
    border-left: none;
}

.toggle-btn.active {
    background: var(--text-primary, #2d2d2d);
    color: #fff;
    border-color: var(--text-primary, #2d2d2d);
}

/* Action buttons */
.button-row {
    display: flex;
    gap: 0.4rem;
    margin-top: 0.25rem;
}

.action-btn {
    flex: 1;
    padding: 0.4rem 0.6rem;
    border: 1px solid #ccc;
    border-radius: 5px;
    background: #fff;
    font-family: inherit;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.15s ease;
    color: var(--text-primary, #2d2d2d);
}

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

.action-btn.primary {
    background: #2196F3;
    color: #fff;
    border-color: #2196F3;
}

.action-btn.primary:hover:not(:disabled) {
    background: #1976D2;
    border-color: #1976D2;
}

.action-btn:hover:not(:disabled):not(.primary) {
    background: #f0f0f0;
}

/* Stats panel */
.stats-panel {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 0.6rem 0.9rem;
    font-family: var(--font-sans, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
    font-size: 0.78rem;
}

.stats-panel .stat-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.15rem;
    color: var(--text-muted, #6b6b6b);
}

.stats-panel .stat-row .stat-val {
    font-weight: 600;
    color: var(--text-primary, #2d2d2d);
}

/* Phase function plot */
.phase-panel {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 0.75rem;
    font-family: var(--font-sans, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
}

.phase-title {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted, #6b6b6b);
    text-align: center;
    margin-bottom: 0.3rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

#phase-canvas {
    width: 100%;
    height: 200px;
    display: block;
    border-radius: 4px;
}

/* About section */
.about-section {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}

.about-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 1rem;
    background: none;
    border: none;
    font-family: var(--font-sans, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
    font-size: 0.8rem;
    color: var(--text-muted, #6b6b6b);
    text-align: left;
    cursor: pointer;
    transition: color 0.15s ease;
}

.about-toggle:hover {
    color: var(--text-primary, #2d2d2d);
}

.about-toggle.open {
    border-bottom: 1px solid #e0e0e0;
}

.about-label { font-weight: 500; }

.about-arrow {
    font-size: 0.7rem;
}

.about-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    padding: 0 1rem;
}

.about-content.open {
    max-height: 1200px;
    padding: 0.75rem 1rem 1rem;
}

.about-content p {
    font-size: 0.85rem;
    line-height: 1.6;
    margin-bottom: 0.75rem;
    color: var(--text-primary, #2d2d2d);
}

.about-content p:last-child { margin-bottom: 0; }

.about-content strong { font-weight: 600; }

/* Mobile: stack vertically */
@media (max-width: 768px) {
    .app-layout {
        flex-direction: column;
    }

    .canvas-area {
        width: 100%;
    }

    .controls-column {
        flex: none;
        width: 100%;
    }
}
