/**
 * 席順・座席配置ジェネレーター - 専用スタイル
 */

/* レイアウト選択 */
.sa-option-group {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.sa-option-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text);
    white-space: nowrap;
    flex-shrink: 0;
}

.sa-layout-selector {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    flex: 1;
}

.sa-layout-option {
    cursor: pointer;
}

.sa-layout-option input[type="radio"] {
    display: none;
}

.sa-layout-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px 14px;
    border: 2px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-white);
    transition: all 0.2s ease;
    min-width: 72px;
}

.sa-layout-option input[type="radio"]:checked + .sa-layout-card {
    border-color: var(--color-primary);
    background: rgba(61, 90, 128, 0.06);
}

.sa-layout-card:hover {
    border-color: var(--color-primary);
}

.sa-layout-icon {
    font-size: 20px;
    color: var(--color-primary);
    line-height: 1;
}

.sa-layout-name {
    font-size: 12px;
    color: var(--color-text-secondary);
    white-space: nowrap;
}

.sa-layout-option input[type="radio"]:checked + .sa-layout-card .sa-layout-name {
    color: var(--color-primary);
    font-weight: 500;
}

/* 島型・教室型オプション */
.sa-island-selector {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sa-island-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    color: var(--color-text);
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.15s ease;
}

.sa-island-btn:hover {
    background: var(--color-border);
}

.sa-island-count {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 700;
    color: var(--color-primary-dark);
    min-width: 24px;
    text-align: center;
}

.sa-island-info {
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 500;
    color: var(--color-text-secondary);
}

/* グループ設定パネル */
.sa-group-panel {
    padding: 16px 20px;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-bg);
}

.sa-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.sa-group-hint {
    font-size: 12px;
    color: var(--color-text-muted);
}

.sa-group-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 240px;
    overflow-y: auto;
}

.sa-group-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: 6px;
}

.sa-group-color {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    flex-shrink: 0;
    cursor: pointer;
    border: 2px solid rgba(0, 0, 0, 0.1);
}

.sa-group-name {
    flex: 1;
    font-size: 14px;
    color: var(--color-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sa-group-select {
    padding: 4px 8px;
    font-size: 13px;
    color: var(--color-text);
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 4px;
    cursor: pointer;
}

/* 結果表示エリア */
.sa-result-area {
    padding: 20px;
    border-bottom: 1px solid var(--color-border);
}

.sa-result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.sa-canvas-wrapper {
    display: flex;
    justify-content: center;
    padding: 10px 0;
    /* overflow は不要: JSがコンテナ幅に合わせてスケールするため */
}

.sa-canvas-wrapper canvas {
    border-radius: var(--radius);
    /* max-width/height:auto は使わない。
       JSが直接 style.width / style.height を設定し、
       コンテナ幅に収まるサイズで描画するため。
       CSSで上書きすると二重縮小で文字が潰れる。 */
}

/* レスポンシブ対応 */
@media (max-width: 600px) {
    .sa-layout-selector {
        gap: 6px;
    }

    .sa-layout-card {
        padding: 8px 10px;
        min-width: 60px;
    }

    .sa-layout-icon {
        font-size: 16px;
    }

    .sa-layout-name {
        font-size: 11px;
    }

    .sa-option-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .sa-group-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .sa-canvas-wrapper {
        padding: 4px 0;
    }
}
