/* 統合情報サイト カスタムスタイル */

html, body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: block;
    visibility: visible;
    opacity: 1;
}

body {
    font-family: 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', Meiryo, sans-serif;
}

/* ローディングアニメーション */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: #3b82f6;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* モーダルアニメーション */
.modal-enter {
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* テーブルスタイル */
.document-table {
    width: 100%;
    border-collapse: collapse;
}

.document-table th,
.document-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.document-table th {
    background-color: #f9fafb;
    font-weight: 600;
    color: #374151;
}

.document-table tr:hover {
    background-color: #f9fafb;
}

/* ボタンスタイル */
.btn {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 600;
    transition: all 0.2s;
    cursor: pointer;
    border: none;
}

.btn-primary {
    background-color: #3b82f6;
    color: white;
}

.btn-primary:hover {
    background-color: #2563eb;
}

.btn-secondary {
    background-color: #6b7280;
    color: white;
}

.btn-secondary:hover {
    background-color: #4b5563;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    .document-table {
        font-size: 0.875rem;
    }
    
    .document-table th,
    .document-table td {
        padding: 8px;
    }
}

/* 編集モーダル: 背面ページへのスクロール伝播を抑止 */
#editModal {
    overscroll-behavior: none;
}

#editModal > div.max-w-6xl {
    overscroll-behavior: contain;
}

/* 資料編集モーダル: リアルタイムプレビュー時の2ペイン表示 */
/* 親を flex 列にし、プレビュー行に残り高さを与えないとペインに overflow が生まれずホイールが背面へ抜ける */
#editModalBody.live-preview-mode {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

#editModalBody.live-preview-mode #markdownHelperBar {
    position: static;
    flex-shrink: 0;
    z-index: auto;
}

#editPreviewLayout.live-preview-mode {
    display: flex;
    flex: 1 1 auto;
    gap: 12px;
    min-height: 0;
    overflow: hidden;
}

#editPreviewLayout.live-preview-mode #editArea,
#editPreviewLayout.live-preview-mode #previewArea {
    flex: 1 1 50%;
    min-width: 0;
    min-height: 0;
    margin: 0;
}

#editPreviewLayout.live-preview-mode #editArea {
    display: flex;
    overflow: hidden;
}

#editPreviewLayout.live-preview-mode #editContent {
    flex: 1 1 auto;
    min-height: 0 !important;
    height: 100% !important;
    max-height: 100%;
    overflow-y: auto;
    overscroll-behavior: contain;
    touch-action: pan-y;
    resize: none;
}

#editPreviewLayout.live-preview-mode #previewArea {
    display: block !important;
    min-height: 0 !important;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
}

#editPreviewLayout.live-preview-mode #previewContent {
    min-height: min-content;
}

.doc-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.doc-action-btn {
    min-width: 120px;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.doc-action-btn[disabled] {
    opacity: 0.45;
    cursor: not-allowed;
}

/* 画面の長辺方向に 50:50 配置（横長=左右、縦長=上下） */
@media (orientation: portrait) {
    #editPreviewLayout.live-preview-mode {
        flex-direction: column;
    }
}

@media (orientation: landscape) {
    #editPreviewLayout.live-preview-mode {
        flex-direction: row;
    }
}


