@charset "UTF-8";

/* ============================================================
   7. スマートフォン対応 (480px以下)
   ============================================================ */

/* デフォルトではモバイル用パーツは非表示 */
.mobile-header, .mobile-overlay {
    display: none;
}

@media (max-width: 480px) {
    /* --- モバイルヘッダー --- */
    .mobile-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        height: 40px; /* スマホ用ヘッダーの高さ */
        background-color: #007acc; /* IDEっぽい青、またはお好みで */
        color: white;
        padding: 0 10px;
        box-sizing: border-box;
        z-index: 2000; /* 最前面 */
    }

    .mobile-app-name {
        font-size: 14px;
        font-weight: bold;
    }

    .mobile-btn {
        background: transparent;
        border: 1px solid rgba(255,255,255,0.3);
        color: white;
        border-radius: 4px;
        padding: 4px 10px;
        cursor: pointer;
        font-size: 12px;
        display: flex;
        align-items: center;
        gap: 5px;
    }
    .mobile-btn:active {
        background-color: rgba(0,0,0,0.2);
    }

    /* --- レイアウト調整 --- */
    /* 全体の高さ調整: モバイルヘッダー(40px) + 既存ヘッダー(50px) 分を引く */
    .ide-container {
        height: calc(100vh - 90px) !important; 
        position: relative; /* 子要素の絶対配置の基準 */
    }

    /* 既存ヘッダーは残すが、文字サイズ等を少し調整してもよい */
    .ide-header .main-title { font-size: 14px; }
    .ide-header .sub-title { display: none; } /* スペース節約のためサブタイトルは隠す例 */

    /* リサイズバーは非表示 */
    .ide-resizer {
        display: none !important;
    }

    /* --- サイドバー共通設定 (フロート化) --- */
    .ide-sidebar, .ide-right-sidebar {
        position: absolute;
        top: 0;
        bottom: 0;
        z-index: 1000; /* オーバーレイより上 */
        width: 75% !important; /* 画面の3/4 */
        transition: transform 0.3s ease; /* スライドアニメーション */
        box-shadow: 0 0 10px rgba(0,0,0,0.5);
        height: 100% !important;
    }

    /* 左サイドバー: デフォルトは画面外(左)へ隠す */
    .ide-sidebar {
        left: 0;
        transform: translateX(-100%);
        border-right: none;
    }
    
    /* 右サイドバー: デフォルトは画面外(右)へ隠す */
    .ide-right-sidebar {
        right: 0;
        transform: translateX(100%);
        border-left: none;
    }

    /* クラス付与時の表示状態 */
    .ide-container.show-left .ide-sidebar {
        transform: translateX(0);
    }
    .ide-container.show-right .ide-right-sidebar {
        transform: translateX(0);
    }

    /* --- オーバーレイ (暗くする幕) --- */
    .mobile-overlay {
        display: block;
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.6); /* コンテンツを暗く */
        z-index: 900; /* サイドバー(1000)の下、コンテンツの上 */
        opacity: 0;
        pointer-events: none; /* 非表示時はクリック透過 */
        transition: opacity 0.3s ease;
    }

    /* どちらかのサイドバーが開いているときはオーバーレイを表示 */
    .ide-container.show-left .mobile-overlay,
    .ide-container.show-right .mobile-overlay {
        opacity: 1;
        pointer-events: auto; /* クリックを検知させる */
    }
}