/* assets/css/harmony.css – Icosmo Harmony page */

/* Section titles inside panels match the page section titles */
.icosmo-harmony-page h2 {
    font-size: 1.2em;
    border-bottom: 1px solid #4f4f4f;
    padding-bottom: 5px;
    margin: 20px 0 15px;
    text-align: center;
    color: #f0f0f0;
}

.icosmo-harmony-page .title-container h2 {
    margin: -8px 0 0 3px !important;
    padding: 0 !important;
}

/* Controls (header centre) */
.harmony-control-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9em;
    color: #ccc;
}

/* Selects and buttons come from the shared Icosmo interface styles (icosmo-ui.css) */
.harmony-control-row select {
    width: auto;
}

/* Selects: no vertical padding, so the text sits centred in the compact height with every font */
.icosmo-harmony-page select {
    padding-top: 0;
    padding-bottom: 0;
    line-height: normal;
}

.harmony-custom textarea {
    background-color: var(--ic-input-bg, #111111);
    color: var(--ic-input-text, #cccccc);
    border: 1px solid var(--ic-input-border, #777777);
    border-radius: 3px;
    padding: 4px 6px;
    font-size: var(--font-size-input-text);
}

.harmony-checkbox {
    cursor: pointer;
}

.harmony-info {
    font-size: 0.75em;
    color: #999;
}

/* Legend (header right) */
.harmony-legend {
    display: grid;
    grid-template-columns: max-content max-content 1fr;
    gap: 4px 10px;
    align-items: center;
    font-size: 0.8em;
}

.harmony-legend-item {
    display: contents;
}

.harmony-legend-line {
    display: inline-block;
    width: 28px;
    height: 4px;
    border-radius: 2px;
}

.harmony-legend-name {
    color: #e0e0e0;
    white-space: nowrap;
}

.harmony-legend-principle {
    color: #999;
}

/* Custom values */
.harmony-custom {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 600px;
    margin: 0 auto 20px;
    font-size: 0.85em;
    color: #ccc;
}

.harmony-custom textarea {
    font-family: 'Courier New', Courier, monospace;
    width: 100%;
    box-sizing: border-box;
}

.harmony-custom button {
    align-self: flex-start;
}

/* Wheel and detail */
.harmony-main {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.harmony-panel {
    flex: 1 1 50%;
    min-width: 0;
}

.harmony-wheel {
    display: block;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

.harmony-wheel-key {
    font-size: 13px;
    font-weight: bold;
    text-anchor: middle;
    dominant-baseline: central;
    pointer-events: none;
}

.harmony-wheel-symbol {
    font-family: "Segoe UI Symbol", "Apple Symbols", sans-serif;
    font-size: 12px;
    font-weight: bold;
    text-anchor: middle;
    dominant-baseline: central;
    pointer-events: none;
}

.harmony-wheel-centre {
    fill: #999;
    font-size: 13px;
    text-anchor: middle;
    dominant-baseline: central;
}

.harmony-wheel-pair,
.harmony-wheel-node {
    cursor: pointer;
}

.harmony-detail-title {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    font-size: 1.05em;
    margin-bottom: 10px;
}

.harmony-member-pick {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.harmony-member-pick select {
    max-width: 260px;
}

.harmony-detail-body {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.harmony-lissajous {
    width: 240px;
    height: 240px;
    flex-shrink: 0;
    background-color: #222;
    border: 1px solid #4f4f4f;
    border-radius: 4px;
}

.harmony-no-figure {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 0.85em;
}

.harmony-detail-body .icosmo-details-list {
    margin: 0;
    font-size: 0.85em;
}

.harmony-detail-body .icosmo-details-list dd {
    display: block;
}

.harmony-entry {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.harmony-entry .symbol {
    font-size: 1.1em;
}

.harmony-muted {
    color: #999;
}

.harmony-hint {
    color: #999;
    font-size: 0.85em;
    text-align: center;
}

#harmony-play-info {
    margin-left: 10px;
    font-size: 0.8em;
}

#harmony-play {
    margin-top: 12px;
}

/* Ranked table */
.harmony-table tbody tr {
    cursor: pointer;
}

.harmony-table tr.harmony-selected td {
    background-color: var(--ic-table-hover, #5a5a5a) !important;
}

/* Non-harmonic pairs (optional rows at the end of the table) */
.harmony-table tr.harmony-nonharmonic td {
    color: var(--ic-muted, #bdbdbd);
    font-style: italic;
}

.harmony-custom-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85em;
}

.harmony-level-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 5px;
    vertical-align: middle;
}

/* Lambdoma grid */
.harmony-grid {
    display: grid;
    gap: 2px;
    max-width: 1100px;
    margin: 0 auto;
}

.harmony-grid-8 {
    max-width: 640px;
    font-size: 1.3em;
}

.harmony-grid-switch {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 12px;
}

.icosmo-harmony-page .harmony-grid-switch button.harmony-active {
    background-color: #e0e0e0;
    color: #222;
}

.harmony-grid-head {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75em;
    color: #999;
}

.harmony-grid-cell {
    position: relative;
    aspect-ratio: 1 / 1;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7em;
}

.harmony-grid-empty {
    background: none;
}

.harmony-grid-reducible {
    background-color: #2f2f2f;
    color: #555;
}

.harmony-grid-ratio {
    background-color: #383838;
    color: #ddd;
    border: 1px solid transparent;
}

.harmony-grid-out {
    opacity: 0.4;
}

.harmony-grid-dot {
    position: absolute;
    border-radius: 50%;
    opacity: 0.45;
}

.harmony-grid-label {
    position: relative;
}

.harmony-grid-active {
    border-width: 2px;
    border-style: solid;
    cursor: pointer;
}

.harmony-grid-selected {
    box-shadow: 0 0 0 2px #ffffff;
}

.harmony-grid-count {
    position: absolute;
    top: 1px;
    right: 3px;
    font-size: 0.85em;
    font-weight: bold;
    color: #fff;
}

/* Responsive */
@media (max-width: 900px) {
    .harmony-main {
        flex-direction: column;
    }
    .harmony-panel {
        width: 100%;
    }
}

@media (max-width: 600px) {
    .harmony-detail-body {
        flex-direction: column;
        align-items: center;
    }
    .harmony-grid-cell {
        font-size: 0.5em;
    }
}
