/* layout.css */

/* 基本設定 */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

.content {
    flex: 1;
    overflow: hidden;
}

.column {
    overflow-y: auto;
    height: 100%;
    display: flex;
    flex-direction: column;
}

#split {
    display: flex;
    height: 100%;
    flex-wrap: wrap; /* モバイル対応のため追加 */
}

#diagram-preview-container {
    flex-grow: 1;
    overflow: auto; /* スクロールバーのために追加 */
    padding: 1px;  /* 既存のpaddingを追加 */
}

#editor-column {
    flex-grow: 1;
}

/* ガター（分割バー）のスタイル */
.gutter {
    background-color: #eee;
    background-repeat: no-repeat;
    background-position: 50%;
}

.gutter.gutter-horizontal {
    cursor: col-resize;
    background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAeCAYAAADkftS9AAAAIklEQVQoU2M4c+bMfxAGAgYYmwGrIIiDjrELjpo5aiZeMwF+yNnOs5KSvgAAAABJRU5ErkJggg==');
}

.gutter.gutter-vertical {
    cursor: row-resize;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1em' height='1em' viewBox='0 0 16 16'%3E%3Cpath fill='%23919191' d='M2 8a1 1 0 1 1 0 2a1 1 0 0 1 0-2m0-3a1 1 0 1 1 0 2a1 1 0 0 1 0-2m3 3a1 1 0 1 1 0 2a1 1 0 0 1 0-2m0-3a1 1 0 1 1 0 2a1 1 0 0 1 0-2m3 3a1 1 0 1 1 0 2a1 1 0 0 1 0-2m0-3a1 1 0 1 1 0 2a1 1 0 0 1 0-2m3 3a1 1 0 1 1 0 2a1 1 0 0 1 0-2m0-3a1 1 0 1 1 0 2a1 1 0 0 1 0-2m3 3a1 1 0 1 1 0 2a1 1 0 0 1 0-2m0-3a1 1 0 1 1 0 2a1 1 0 0 1 0-2'/%3E%3C/svg%3E");
}

/* 画像のスタイル */
.card-img-top {
    height: 100px;
    object-fit: cover;
    object-position: top;
    transition: height 0.5s ease;
}

.expanded-img {
    height: auto;
    transition: height 0.5s ease;
}

/* コラプスコンテンツのスタイル */
.collapse-content {
    overflow: hidden;
}

.toggle-icon {
    transition: transform 0.5s ease-out;
}

.rotate-180 {
    transform: rotate(180deg);
}

/* タブのスタイル */
.nav-tabs .nav-item .nav-link {
    position: relative;
    padding-right: 30px;
}

.nav-tabs .nav-item .close-tab {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.8rem;
    opacity: 0.5;
    transition: opacity 0.2s;
    cursor: pointer;
    z-index: 10;
}

.nav-tabs .nav-item .close-tab:hover {
    opacity: 1;
}

.tab-content {
    flex: 1;
    overflow-y: auto;
    padding: 10px 5px 20px 5px;
    overflow: hidden; /* これは意図的に残しましたか？必要なければ削除してください */
}

/* カードのスタイル */
.card {
    position: relative;
}

.card .close-card {
    position: absolute;
    right: 8px;
    top: 8px;
    font-size: 1rem;
    opacity: 0.5;
    transition: opacity 0.2s;
    cursor: pointer;
    z-index: 10;
}

.card:hover .close-card {
    opacity: 1;
}

/* パレットカードのスタイル */
#paletteCards .col {
    padding: 0;
}

#palette-column {
    overflow-y: scroll;
    padding: 3px; /* 既存のpaddingを移動 */
}

.no-image {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #ccc;
    height: 180px;
    color: #666;
    font-size: 1.2rem;
}

/* スクロールバーを非表示にするクラス */
.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.no-scrollbar::-webkit-scrollbar {
    display: none;
}

/* オフキャンバスのスタイル */
.offcanvas, .offcanvas-lg, .offcanvas-md, .offcanvas-sm, .offcanvas-xl, .offcanvas-xxl {
    --bs-offcanvas-zindex: 1055;
}

.offcanvas-start {
    width: 80%;
    transition: transform 0.3s linear;
}

/* モーダルのヘッダーアイコンのマージン調整 */
.modal-header #statusIcon { 
    margin-right: .25rem !important; 
    margin-left: .25rem !important; 
}

/* モーダル画像のスタイル */
#diagramModal .modal-body img#modalImage {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

/* #diagramModal.modal .modal-dialog.modal-fullscreen {
    margin-top: 4rem !important;
} */
/* #diagramModal .modal-dialog{
    margin-top: 4rem !important;
} */

#diagramModal .modal {
    --bs-modal-zindex: 1045;
}
/* レスポンシブデザイン */
@media (max-width: 992px) {
    #palette-column {
        display: none;
    }
}

@media (max-width: 576px) {
    #switch-column {
        transform: rotate(270deg);
        transition: transform 0.5s ease;
    }
    .offcanvas-backdrop.show {
        opacity: 0.5;
    }

    #split {
        flex-direction: column;
    }
    #diagram-preview-container {
        order: 1;
        flex: 1 1 auto;
        width: 100%;
    }
    #editor-column {
        order: 2;
        flex: 2 1 auto;
        width: 100%;
    }
    .gutter.gutter-horizontal {
        display: none;
    }
    .gutter.gutter-vertical {
        display: block;
        order: 2;
        cursor: row-resize;
    }
}

/* 追加のスタイル (必要に応じて) */

/* パレットカードのトグルアイコン */
.card-footer i.toggle-palette-card {
    font-size: 1.2rem;
    color: #000;
    cursor: pointer;
    opacity: 0.5;
    transition: transform 0.5s ease-out;
}

/* タブコンテンツ内のテキストエリア */
.tab-pane textarea.form-control {
    resize: none; /* ユーザーによるリサイズを禁止 */
    font-family: 'Courier New', Courier, monospace; /* コードフォントの指定 */
}


/* パレットのスクロール */
#palette-column {
    height: 100%;
    box-sizing: border-box;
}

/* フォーカスリング */
.focus-ring:focus {
    outline: 2px solid #007bff80;
    outline-offset: 1px;
}

/* ツールチップのカスタマイズ (必要に応じて) */
.tooltip-inner {
    background-color: #333;
    color: #fff;
    border-radius: 4px;
    padding: 5px 10px;
    font-size: 0.875rem;
}

/* タブを一列に表示し、折り返しを防ぐ */
.nav-tabs {
    display: flex;
    flex-wrap: nowrap;
    border-bottom: var(--bs-nav-tabs-border-width) solid none;
    overflow: hidden;
}

/* タブ項目を均等に配置する */
.nav-tabs .nav-item {
    flex: 1 1 0;
    min-width: 0; /* コンテンツサイズ以下に縮小可能にする */
    border-bottom: var(--bs-nav-tabs-border-width) solid var(--bs-nav-tabs-border-color);
}

/* タブリンクのスタイルを調整 */
.nav-tabs .nav-link {
    display: block;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    position: relative; /* 閉じるボタンの位置調整のため */
}

/* タブ内の閉じるボタンの位置を調整 */
.nav-tabs .nav-link .close-tab {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.8rem;
    opacity: 0.5;
    transition: opacity 0.2s;
    cursor: pointer;
    z-index: 10;
}

/* タブリンクにホバーしたときの閉じるボタンの透明度を調整 */
.nav-tabs .nav-link:hover .close-tab {
    opacity: 1;
}
