/* ================================================
   HTML/CSS Live Editor - 画像URL機能追加CSS
   Version: 2.1.0
   main.css に追記する内容
================================================ */

/* ── ヘッダー：画像リスト読込ボタン ── */
.btn-imglist {
    background: #8e44ad !important;
    color: white;
    border: none;
    padding: 0.4rem 0.85rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background 0.3s;
    white-space: nowrap;
}
.btn-imglist:hover { background: #7d3c98 !important; }

/* ── 右サイドバー：画像URL欄 ── */
.img-url-label {
    font-size: 0.8rem;
    color: #555;
    white-space: nowrap;
    font-weight: 500;
}
.img-url-input {
    flex: 1;
    padding: 0.3rem 0.5rem;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 0.78rem;
    min-width: 0;
    outline: none;
}
.img-url-input:focus { border-color: #8e44ad; box-shadow: 0 0 0 2px rgba(142,68,173,0.15); }
.img-url-apply-btn {
    background: #8e44ad;
    color: white;
    border: none;
    padding: 0.3rem 0.6rem;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.78rem;
    white-space: nowrap;
    transition: background 0.2s;
}
.img-url-apply-btn:hover { background: #7d3c98; }

/* ── 画像リスト管理モーダル ── */
.imglist-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
}
.imglist-modal {
    background: #fff;
    border-radius: 10px;
    width: 640px;
    max-width: 95vw;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}
.imglist-modal__head {
    background: #2c3e50;
    color: white;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}
.imglist-modal__title { font-size: 0.95rem; font-weight: 600; }
.imglist-modal__close {
    background: none;
    border: none;
    color: white;
    font-size: 1.3rem;
    cursor: pointer;
    line-height: 1;
    padding: 0 4px;
    opacity: 0.8;
}
.imglist-modal__close:hover { opacity: 1; }

.imglist-import-row {
    display: flex;
    gap: 10px;
    padding: 14px;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
}
.imglist-paste-area {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 10px;
    font-family: 'Courier New', monospace;
    font-size: 11.5px;
    resize: none;
    height: 80px;
    outline: none;
}
.imglist-paste-area:focus { border-color: #8e44ad; }
.imglist-import-btns {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-shrink: 0;
}
.imglist-csv-label {
    background: #ecf0f1;
    color: #2c3e50;
    border: 1px solid #ddd;
    padding: 7px 14px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    text-align: center;
    transition: background 0.2s;
}
.imglist-csv-label:hover { background: #dfe6e9; }

.imglist-section-title {
    padding: 8px 14px 4px;
    font-size: 12px;
    font-weight: 600;
    color: #555;
    flex-shrink: 0;
}
.imglist-list {
    flex: 1;
    overflow-y: auto;
    padding: 0 14px 10px;
}
.imglist-list::-webkit-scrollbar { width: 5px; }
.imglist-list::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }

.imglist-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border: 1px solid #eee;
    border-radius: 5px;
    margin-bottom: 5px;
    background: #fafafa;
}
.imglist-item input[type=checkbox] { accent-color: #8e44ad; cursor: pointer; flex-shrink: 0; }
.imglist-item-thumb {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
    background: #ecf0f1;
    flex-shrink: 0;
}
.imglist-item-url {
    flex: 1;
    font-size: 11px;
    color: #333;
    font-family: 'Courier New', monospace;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}
.imglist-item-url input {
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 3px;
    padding: 3px 6px;
    font-size: 11px;
    font-family: 'Courier New', monospace;
    outline: none;
}
.imglist-item-url input:focus { border-color: #8e44ad; }
.imglist-empty {
    text-align: center;
    color: #aaa;
    font-size: 12px;
    padding: 24px 0;
}

.imglist-modal__foot {
    padding: 10px 14px;
    border-top: 1px solid #eee;
    display: flex;
    gap: 8px;
    flex-shrink: 0;
    justify-content: flex-start;
}

/* ── imglistボタン（共通） ── */
.imglist-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 14px;
    border-radius: 5px;
    font-size: 12px;
    cursor: pointer;
    border: none;
    transition: all 0.15s;
    white-space: nowrap;
    font-family: inherit;
}
.imglist-btn--primary { background: #8e44ad; color: #fff; }
.imglist-btn--primary:hover { background: #7d3c98; }
.imglist-btn--outline { background: transparent; color: #555; border: 1px solid #ddd; }
.imglist-btn--outline:hover { background: #f5f5f5; }
.imglist-btn--danger { background: transparent; color: #c0392b; border: 1px solid #e0a0a0; }
.imglist-btn--danger:hover { background: #fdf3f3; }

/* ── プレビュー内画像クリックポップアップ ── */
.img-click-popup {
    position: fixed;
    z-index: 10002;
    background: #fff;
    border-radius: 8px;
    width: 480px;
    max-width: 95vw;
    box-shadow: 0 6px 24px rgba(0,0,0,0.18);
    border: 1px solid #ddd;
    overflow: hidden;
}
.img-click-popup__head {
    background: #2c3e50;
    color: white;
    padding: 0.6rem 0.9rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: move;
}
.img-click-popup__close {
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0.8;
    padding: 0 3px;
}
.img-click-popup__close:hover { opacity: 1; }
.img-click-popup__body {
    display: flex;
    gap: 10px;
    padding: 12px;
}
.img-click-popup__preview-wrap {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: center;
}
.img-click-popup__preview {
    width: 100px;
    height: 80px;
    object-fit: cover;
    border-radius: 5px;
    border: 1px solid #eee;
    background: #f5f5f5;
}
.img-click-popup__upload-chk {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: #555;
    cursor: pointer;
    white-space: nowrap;
}
.img-click-popup__upload-chk input { accent-color: #8e44ad; cursor: pointer; }
.img-click-popup__fields { flex: 1; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.img-click-popup__field-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11.5px;
    color: #555;
}
.img-click-popup__field-row span { white-space: nowrap; font-weight: 500; }
.img-click-popup__url-input {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 5px 8px;
    font-size: 11px;
    font-family: 'Courier New', monospace;
    outline: none;
    min-width: 0;
}
.img-click-popup__url-input:focus { border-color: #8e44ad; }
.img-click-popup__list-wrap { flex: 1; min-height: 0; }
.img-click-popup__list-label { font-size: 11px; color: #888; margin-bottom: 4px; }
.img-click-popup__list {
    max-height: 120px;
    overflow-y: auto;
    border: 1px solid #eee;
    border-radius: 4px;
    background: #fafafa;
}
.img-click-popup__list::-webkit-scrollbar { width: 4px; }
.img-click-popup__list::-webkit-scrollbar-thumb { background: #ccc; border-radius: 2px; }
.img-popup-list-item {
    padding: 5px 8px;
    font-size: 11px;
    font-family: 'Courier New', monospace;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: background 0.15s;
}
.img-popup-list-item:hover { background: #f0e8f8; color: #8e44ad; }
.img-popup-list-item:last-child { border-bottom: none; }
.img-click-popup__btns { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
