/* =================================================================
 * Page Specific Styles for UI Template (style.css)
 * ================================================================= */

/* --- 右カラム追従 (Sticky) 設定 --- */
.tool-results-sticky {
    position: -webkit-sticky;
    position: sticky;
    top: 20px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
}
.tool-results-sticky::-webkit-scrollbar { width: 6px; }
.tool-results-sticky::-webkit-scrollbar-thumb { background: rgba(150,150,150,0.3); border-radius: 4px; }

/* --- プレビューエリア --- */
.preview-container {
    border-radius: 0.5rem;
    transition: background-color 0.3s ease;
    background-image: radial-gradient(rgba(150, 150, 150, 0.2) 1px, transparent 1px);
    background-size: 20px 20px;
    min-height: 300px;
}
.preview-container.dark-mode { background-color: #121212; }
.preview-container.light-mode { background-color: #f8f9fa; border: 1px solid #dee2e6; }

/* --- グラデーションボックスとレイヤー構造 --- */
#preview-wrapper { transition: width 0.2s, height 0.2s; }
.preview-box {
    background-color: #ffffff;
    transition: border-radius 0.2s;
}

/* --- ドラッグポイント用オーバーレイ --- */
.drag-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none;
}
.drag-point {
    width: 24px; height: 24px; border: 2px solid #fff; border-radius: 50%;
    position: absolute; transform: translate(-50%, -50%);
    cursor: grab; box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3); z-index: 10;
    transition: transform 0.1s, opacity 0.2s;
    opacity: 0; pointer-events: auto;
}
.preview-container:hover .drag-point,
.preview-container.is-dragging .drag-point { opacity: 1; }
.drag-point:hover { transform: translate(-50%, -50%) scale(1.2); }
.drag-point:active { cursor: grabbing; transform: translate(-50%, -50%) scale(1.1); }

/* --- カラーリスト設定エリア --- */
.color-item {
    background: var(--bs-body-bg); border: 1px solid var(--bs-border-color);
    border-radius: 0.375rem; padding: 0.5rem 0.75rem; transition: opacity 0.2s, border-color 0.2s;
}
.dragging-item { opacity: 0.4; }
.drag-over-item { border-color: var(--bs-primary) !important; border-style: dashed; }
.drag-handle:active { cursor: grabbing !important; }

.color-picker { width: 32px; height: 32px; padding: 0; cursor: pointer; border: 1px solid var(--bs-border-color); border-radius: 4px; }
.color-slider-hue::-webkit-slider-runnable-track { background: linear-gradient(to right, #f00 0%, #ff0 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%); border-radius: 4px; }

/* --- CSS出力テキストエリア --- */
.code-output { font-family: monospace; font-size: 0.8rem; resize: none; background-color: var(--bs-tertiary-bg); white-space: pre; overflow-x: auto; }

/* --- プリセット & 履歴ボタン --- */
.preset-btn {
    width: 40px; height: 40px; border-radius: 0.25rem; border: 2px solid transparent;
    cursor: pointer; padding: 0; transition: border-color 0.2s; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.preset-btn:hover, .preset-btn.active { border-color: var(--bs-primary); }
.color-preset-btn { background-color: #fff; background-size: cover; background-position: center; }

/* 履歴用のラッパーと削除ボタン */
.history-btn-wrapper { position: relative; display: inline-block; }
.history-delete-btn {
    position: absolute; top: -6px; right: -6px; width: 18px; height: 18px;
    background: var(--bs-danger); color: white; border-radius: 50%; font-size: 10px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; border: 2px solid var(--bs-body-bg); opacity: 0; transition: opacity 0.2s;
}
.history-btn-wrapper:hover .history-delete-btn { opacity: 1; }
.history-delete-btn:hover { transform: scale(1.1); }

/* --- フローティング保存ボタン --- */
.floating-save-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    z-index: 1050;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.floating-save-btn:hover {
    transform: scale(1.05) translateY(-3px);
    box-shadow: 0 0.5rem 1rem rgba(0,0,0,0.3) !important;
}