/* =================================================================
 * Page Specific Styles for Custom Border Generator (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 {
    background-color: #f8f9fa;
    background-image: 
        linear-gradient(45deg, rgba(0, 0, 0, 0.03) 25%, transparent 25%, transparent 75%, rgba(0, 0, 0, 0.03) 75%, rgba(0, 0, 0, 0.03)), 
        linear-gradient(45deg, rgba(0, 0, 0, 0.03) 25%, transparent 25%, transparent 75%, rgba(0, 0, 0, 0.03) 75%, rgba(0, 0, 0, 0.03));
    background-size: 20px 20px;
    background-position: 0 0, 10px 10px;
    border-radius: 8px;
    transition: background-color 0.3s ease, background-image 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    min-height: 450px;
}

#preview-container.preview-bg-dark {
    background-color: #111827 !important;
    background-image: none !important;
}

#preview-container.preview-bg-light {
    background-color: #f8fafc !important;
    background-image: none !important;
}

#preview-box {
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.25rem;
    text-align: center;
    transition: all 0.2s ease;
    background-color: var(--bs-body-bg);
    min-width: 100px;
    min-height: 50px;
}

/* --- 出力エリア --- */
.code-output { 
    font-family: 'Fira Code', 'Cascadia Code', 'Courier New', monospace; 
    font-size: 0.9rem; 
    resize: none; 
    background-color: var(--bs-tertiary-bg); 
    color: var(--bs-emphasis-color);
    white-space: pre; 
    overflow-x: auto; 
    border-color: var(--bs-border-color-translucent);
    line-height: 1.5;
}

/* --- 履歴＆プリセットボタン --- */
.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; }

.preset-btn {
    width: 44px; height: 44px; border-radius: 0.375rem; border: 2px solid transparent;
    cursor: pointer; padding: 0; transition: all 0.2s; box-shadow: var(--bs-box-shadow-sm);
    display: flex; align-items: center; justify-content: center;
    background-color: var(--bs-body-bg);
}
.preset-btn:hover { 
    border-color: var(--bs-primary); 
    transform: translateY(-2px);
}
.preset-btn-inner {
    width: 24px; height: 24px;
}

/* --- フローティング保存ボタン --- */
.floating-save-btn {
    position: fixed !important;
    bottom: 30px !important;
    right: 30px !important;
    width: 60px !important;
    height: 60px !important;
    z-index: 1050;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50% !important;
    padding: 0 !important;
    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;
}

/* --- フォームパーツの視認性向上 --- */
.form-label { font-size: 0.95rem; margin-bottom: 0.5rem; }
.form-range::-webkit-slider-thumb { width: 1.25rem; height: 1.25rem; background: var(--bs-primary); border: 2px solid var(--bs-body-bg); }
.form-range::-webkit-slider-runnable-track { background-color: var(--bs-border-color-translucent); height: 8px; border-radius: 4px; }
.form-control-color { cursor: pointer; height: 38px; border-radius: 0.375rem; }
.badge.bg-secondary-subtle { font-size: 0.85rem !important; font-weight: 600; padding: 0.4em 0.75em; border: 1px solid var(--bs-border-color-translucent); }