/* ==========================================================================
   assets/css/style.css
   Welcart Design Editor 用スタイル (WordPress用スコープ版)
   ========================================================================== */

/* エディタ専用のフォント読み込み */
@import url('https://fonts.googleapis.com/css2?family=DotGothic16&family=Hina+Mincho&family=Kaisei+Opti&family=Klee+One&family=M+PLUS+1p&family=Noto+Sans+JP:wght@400;700&family=Noto+Serif+JP:wght@400;700&family=Potta+One&family=Reggae+One&family=Sawarabi+Mincho&family=Shippori+Mincho&family=Yuji+Boku&family=Yuji+Mai&family=Yuji+Syuku&family=Zen+Kaku+Gothic+New&family=Zen+Kurenaido&family=Zen+Maru+Gothic&display=swap');

/* ▼▼▼ 全て #designEditorModal で囲ってスコープ化します ▼▼▼ */

#designEditorModal {
    display: none;
    position: fixed;
    z-index: 10000; /* WPのadmin barより上に */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.9);
    overflow: hidden;
    font-family: "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", "Hiragino Sans", sans-serif;
    color: #333;
    line-height: 1.6;
    font-size: 16px;
    box-sizing: border-box;
}

#designEditorModal * {
    box-sizing: border-box;
}

/* --- コンテナ・レイアウト --- */
#designEditorModal .editor-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: #e0e0e0;
}

/* --- ヘッダー --- */
#designEditorModal .editor-header {
    background: #333;
    color: #fff;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 50px;
    flex-shrink: 0;
}

/* --- ボディ --- */
#designEditorModal .editor-body {
    display: flex;
    flex: 1;
    overflow: hidden;
    position: relative;
}

/* --- 左サイドバー（ツール） --- */
#designEditorModal .editor-toolbar {
    width: 250px;
    background: #f5f5f5;
    border-right: 1px solid #ccc;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding: 10px;
    flex-shrink: 0;
}

#designEditorModal .tool-section {
    margin-bottom: 20px;
    border-bottom: 1px solid #ddd;
    padding-bottom: 15px;
}
#designEditorModal .tool-section h4 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 0.9rem;
    color: #0073aa;
    padding: 0;
    background: none;
    border: none;
}

#designEditorModal .wde-input-field {
    width: 100%;
    padding: 5px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 0.85rem;
}

#designEditorModal .editor-btn {
    display: block;
    width: 100%;
    margin-bottom: 5px;
    padding: 8px;
    background: #fff;
    border: 1px solid #ccc;
    cursor: pointer;
    text-align: left;
    font-size: 0.9rem;
    color: #333;
}
#designEditorModal .editor-btn:hover {
    background: #eee;
}

/* --- キャンバスエリア --- */
#designEditorModal .editor-canvas-area {
    flex: 1;
    background: #999;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: auto;
    position: relative;
}
#designEditorModal .canvas-wrapper {
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
    background: #fff; /* 背景白確保 */
}

/* --- 右サイドバー（パネル） --- */
#designEditorModal .editor-panels {
    width: 280px;
    background: #fff;
    border-left: 1px solid #ccc;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    flex-shrink: 0;
}

#designEditorModal .panel-block {
    padding: 10px;
    border-bottom: 1px solid #eee;
}
#designEditorModal .panel-title {
    font-weight: bold;
    background: #eee;
    padding: 5px 10px;
    margin: -10px -10px 10px -10px;
    font-size: 0.85rem;
}

/* --- プロパティ入力 --- */
#designEditorModal .prop-row {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
}
#designEditorModal .prop-label {
    width: 80px;
    font-size: 0.8rem;
    color: #666;
}
#designEditorModal .prop-input {
    flex: 1;
    padding: 4px;
    font-size: 0.9rem;
    border: 1px solid #ccc;
}
#designEditorModal .prop-color {
    width: 100%;
    height: 30px;
    padding: 0;
    border: none;
}

/* --- レイヤーリスト --- */
#designEditorModal #layer-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
#designEditorModal #layer-list li {
    padding: 5px 10px;
    border-bottom: 1px solid #eee;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
#designEditorModal #layer-list li.active {
    background: #e6f7ff;
    border-left: 3px solid #0073aa;
}
#designEditorModal #layer-list li:hover {
    background: #f9f9f9;
}

/* --- ズームコントロール --- */
#designEditorModal .zoom-controls {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background: rgba(255,255,255,0.8);
    padding: 5px;
    border-radius: 4px;
    display: flex;
    gap: 5px;
}
#designEditorModal .zoom-controls button {
    cursor: pointer;
}

/* --- レスポンシブ対応 (SP/Tab) --- */
@media screen and (max-width: 900px) {
    #designEditorModal .editor-container {
        height: 100dvh;
    }
    #designEditorModal .editor-body {
        flex-direction: column;
    }
    #designEditorModal .editor-canvas-area {
        order: 1;
        width: 100%;
        height: 45%;
        border-bottom: 1px solid #ccc;
    }
    #designEditorModal .editor-panels {
        order: 2;
        width: 100%;
        height: 30%;
        border-left: none;
        border-bottom: 1px solid #ccc;
    }
    #designEditorModal .editor-toolbar {
        order: 3;
        width: 100%;
        height: 25%;
        border-right: none;
        display: flex;
        flex-direction: row;
        overflow-x: auto;
        white-space: nowrap;
        align-items: flex-start;
        padding: 5px;
    }
    #designEditorModal .editor-toolbar .tool-section {
        min-width: 160px;
        margin-right: 10px;
        margin-bottom: 0;
        border-bottom: none;
        border-right: 1px solid #ddd;
        padding-right: 10px;
    }
    #designEditorModal .editor-header {
        height: auto;
        flex-direction: column;
        padding: 10px 5px;
        gap: 10px;
    }
}