@charset "UTF-8";

/* ベース設定 */
body {
    background-color: #f0f2f5;
    height: 100vh;
    overflow: hidden; /* PCではスクロール禁止（アプリライクな操作感） */
}

/* レイアウト構成 */
.editor-container {
    display: flex;
    height: calc(100vh - 56px); /* ナビバーの高さを引く */
    width: 100%;
}

/* 左サイドバー */
.sidebar {
    width: 280px;
    background: white;
    border-right: 1px solid #ddd;
    display: flex;
    flex-direction: column;
    z-index: 10;
    flex-shrink: 0;
}

.sidebar-content {
    padding: 15px;
    overflow-y: auto;
    flex: 1;
}

/* メインエリア（キャンバス表示部） */
.main-area {
    flex: 1;
    background: #555;
    position: relative;
    overflow: auto;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
}

.canvas-container-wrapper {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    background: white;
}

/* 右サイドバー（プロパティ設定） */
.properties-panel {
    width: 320px;
    background: white;
    border-left: 1px solid #ddd;
    padding: 15px;
    overflow-y: auto;
    z-index: 10;
    flex-shrink: 0;
}

/* ツールボタン */
.tool-btn {
    text-align: left;
    margin-bottom: 6px;
    font-size: 0.9rem;
}

/* セクションタイトル */
.section-title {
    font-size: 0.8rem;
    font-weight: bold;
    color: #6c757d;
    margin-top: 20px;
    margin-bottom: 8px;
    border-bottom: 1px solid #eee;
    padding-bottom: 4px;
}

.section-title:first-child {
    margin-top: 0;
}

/* ズームコントロール */
.zoom-controls {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    padding: 8px 16px;
    border-radius: 30px;
    color: white;
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: 100;
}

/* カラーパレット */
.color-preset-container {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 8px;
}

.color-swatch {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    border: 1px solid #ddd;
    cursor: pointer;
    transition: transform 0.1s;
}

.color-swatch:hover {
    transform: scale(1.2);
    border-color: #999;
}

/* SNSアイコンボタングループ */
.sns-btn-group {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.sns-btn {
    flex: 1;
    min-width: 40px;
    text-align: center;
}

/* --- レスポンシブ対応（スマホ・タブレット 991px以下） --- */
@media (max-width: 991px) {
    body {
        overflow: auto; /* スマホでは縦スクロールを許可 */
        height: auto;
    }

    .editor-container {
        flex-direction: column; /* 縦並びに変更 */
        height: auto;
    }

    /* 1. キャンバスエリア（最上部） */
    .main-area {
        order: 1;
        height: 50vh; /* 画面半分をキャンバスに */
        min-height: 350px;
        width: 100%;
        padding: 10px;
        
        /* ★追加: 縦並びにして、キャンバスとボタンが重ならないようにする */
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    /* 2. プロパティ設定（キャンバスのすぐ下） */
    .properties-panel {
        order: 2;
        width: 100%;
        height: auto;
        border-left: none;
        border-top: 1px solid #ddd;
        padding-bottom: 30px;
    }

    /* 3. ツールパレット（一番下） */
    .sidebar {
        order: 3;
        width: 100%;
        height: auto;
        border-right: none;
        border-top: 1px solid #ddd;
        border-bottom: 1px solid #ddd;
    }
    
    .sidebar-content {
        padding-bottom: 50px;
    }

    /* ズームコントロールの配置修正 */
    .zoom-controls {
        /* ★変更: 絶対配置をやめて、キャンバスの下に表示 */
        position: static;
        transform: none;
        left: auto;
        bottom: auto;
        margin-top: 10px;
        
        padding: 4px 12px;
        font-size: 0.8rem;
    }
}