/* SCIAN LEO CPM - Cellular Potts Model Simulator Styles */

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

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: #1a1a2e;
    color: #e0e0e0;
    min-height: 100vh;
}

header {
    background: #16213e;
    padding: 1rem 2rem;
    border-bottom: 2px solid #0f3460;
}

header h1 { color: #e94560; font-size: 1.5rem; }
.subtitle { color: #888; font-size: 0.85rem; margin-top: 0.25rem; }

.main-layout {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    height: calc(100vh - 80px);
}

.canvas-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #16213e;
    border-radius: 8px;
    overflow: hidden;
}

#simCanvas {
    flex: 1;
    width: 100%;
    background: #0a0a1a;
}

.canvas-info {
    display: flex;
    gap: 2rem;
    padding: 0.5rem 1rem;
    background: #0f3460;
    font-size: 0.8rem;
    color: #aaa;
}

.controls-panel {
    width: 320px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.control-section {
    background: #16213e;
    border-radius: 8px;
    padding: 1rem;
}

.control-section h3 {
    color: #e94560;
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
    border-bottom: 1px solid #0f3460;
    padding-bottom: 0.4rem;
}

.control-section label {
    display: block;
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
    color: #ccc;
}

.control-section label span {
    color: #4ecca3;
    font-weight: bold;
    float: right;
}

input[type="range"] {
    width: 100%;
    margin-top: 0.25rem;
    accent-color: #e94560;
}

input[type="checkbox"] {
    accent-color: #e94560;
    margin-right: 0.5rem;
}

.button-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s;
}

.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-primary { background: #0f3460; color: #fff; }
.btn-primary:hover:not(:disabled) { background: #1a4a80; }
.btn-success { background: #1b9e5a; color: #fff; }
.btn-success:hover:not(:disabled) { background: #22c76e; }
.btn-danger { background: #e94560; color: #fff; }
.btn-danger:hover:not(:disabled) { background: #ff5777; }
.btn-secondary { background: #333; color: #fff; }
.btn-secondary:hover:not(:disabled) { background: #555; }

.about-text { font-size: 0.75rem; color: #888; line-height: 1.4; margin-bottom: 0.5rem; }
.about-text a { color: #4ecca3; }

/* Header row with help button */
.header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-help {
    background: #0f3460;
    color: #e94560;
    border: 2px solid #e94560;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.btn-help:hover { background: #e94560; color: #fff; }

/* Help icon next to section headers */
.help-icon {
    display: inline-block;
    width: 18px;
    height: 18px;
    background: #0f3460;
    color: #e94560;
    border: 1px solid #e94560;
    border-radius: 50%;
    font-size: 0.7rem;
    font-weight: bold;
    text-align: center;
    line-height: 18px;
    cursor: pointer;
    margin-left: 0.5rem;
    vertical-align: middle;
    transition: all 0.2s;
}
.help-icon:hover { background: #e94560; color: #fff; }

/* Expandable help text under section headers */
.help-text {
    background: #0f3460;
    border-radius: 4px;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.75rem;
    font-size: 0.75rem;
    color: #aaa;
    line-height: 1.4;
}

/* Help Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: #16213e;
    border: 1px solid #0f3460;
    border-radius: 12px;
    padding: 2rem;
    max-width: 560px;
    max-height: 80vh;
    overflow-y: auto;
    color: #e0e0e0;
    position: relative;
}

.modal-content h2 {
    color: #e94560;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.modal-content h3 {
    color: #4ecca3;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.modal-content p, .modal-content li {
    font-size: 0.85rem;
    line-height: 1.5;
    color: #ccc;
    margin-bottom: 0.4rem;
}

.modal-content ol {
    padding-left: 1.5rem;
    margin-bottom: 0.75rem;
}

.modal-close {
    position: absolute;
    top: 0.75rem;
    right: 1rem;
    font-size: 1.5rem;
    color: #888;
    cursor: pointer;
    transition: color 0.2s;
}
.modal-close:hover { color: #e94560; }
