/* ============================================================
   Retrogrades アプリ固有スタイル
   共通スタイルは common/styles_common.css で定義
   Bootstrap 5 は initializer-common.js が動的ロード
   ============================================================ */

body { background: var(--rl-surface); }

.page-wrapper {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 24px);
}
.page-wrapper > .container-xl:not(#ad-container-top-1):not(#ad-container-footer-1) { flex: 1; }
@media (max-width: 575px) {
    .page-wrapper { min-height: calc(100vh - 40px); }
}

/* ========================================
   メインレイアウト（display:contents パターン）
   PC:      左列(S→P) + 右列(R)
   モバイル: S→R→P
======================================== */
.rg-main-layout {
    display: flex;
    flex-direction: column;
    gap: .5rem;
}
.rg-left-col,
.rg-right-col { display: contents; }
.rg-item-r { order: 2; }
.rg-item-s { order: 1; }
.rg-item-p { order: 3; }

@media (min-width: 992px) {
    .rg-main-layout { flex-direction: row; align-items: flex-start; }
    .rg-left-col {
        display: flex; flex-direction: column; gap: .5rem;
        flex: 0 0 33.333%; max-width: 33.333%;
    }
    .rg-right-col {
        display: flex; flex-direction: column; gap: .5rem;
        flex: 1; min-width: 0;
    }
    .rg-item-r, .rg-item-s, .rg-item-p { order: 0; }
}
@media (min-width: 1200px) {
    .rg-left-col { flex: 0 0 25%; max-width: 25%; }
}

/* ========================================
   設定パネル内のサブラベル
======================================== */
.rg-sublabel {
    font-size: .75rem;
    color: var(--rl-text-sub);
    margin-bottom: .3rem;
}

/* スマホでも設定パネルは常時表示（折りたたみなし） */

/* 設定セクション内のサブ項目（視点/周期/表示設定等）を1段インデント */
.rg-item-p .search-section > *:not(.section-label) {
    padding-left: .75rem;
}

/* ========================================
   メインキャンバス（軌道シミュレーション）
======================================== */

/* モバイルでキャンバスと再生コントロールの順序を入れ替えるために flex 化 */
.result-panel > .p-2 {
    display: flex;
    flex-direction: column;
}
@media (max-width: 991px) {
    .rg-canvas-wrap     { order: 2; }
    .rg-replay-controls { order: 1; }
    .rg-strip-wrap      { order: 3; }
    .rg-note            { order: 4; }
}

.rg-canvas-wrap {
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
}
.rg-canvas-wrap canvas {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 8px;
}

/* ========================================
   シークバー（リプレイ）
======================================== */
.rg-replay-controls {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-top: .4rem;
    padding: .3rem .5rem;
    background: #f5f5f5;
    border-radius: 6px;
    font-size: .75rem;
    color: var(--rl-text-sub);
}
.rg-replay-controls .form-range,
.rg-replay-controls .flex-1 { flex: 1; }
.rg-time-display {
    min-width: 3.5rem;
    text-align: right;
    font-family: monospace;
    font-size: .8rem;
    font-weight: 700;
    color: #333;
}

/* ========================================
   天球展開図（ストリップキャンバス）
======================================== */
.rg-strip-wrap {
    margin-top: .5rem;
    padding-top: .5rem;
    border-top: 1px solid var(--rl-border);
}
.rg-strip-wrap canvas {
    display: block;
    width: 100%;
    height: auto;
}

/* ========================================
   注釈テキスト
======================================== */
.rg-note {
    margin-top: .4rem;
    font-size: .75rem;
    color: var(--rl-text-sub);
    line-height: 1.5;
}

/* ========================================
   ボタン状態: 回転開始（実行中はグレー）/ 一時停止（再生中は青）
======================================== */
#startBtn:disabled {
    background: #9e9e9e !important;
    border-color: #9e9e9e !important;
    color: #fff !important;
    cursor: not-allowed;
    opacity: .7;
}
#stopBtn:not(:disabled) {
    background: #0d6efd !important;
    border-color: #0d6efd !important;
    color: #fff !important;
}
#stopBtn:not(:disabled):hover {
    background: #0b5ed7 !important;
    border-color: #0a58ca !important;
}
