@charset "UTF-8";

@import url('wide.css') screen and (min-width: 769px);
@import url('mobile.css') screen and (max-width: 768px);

/* カテゴリ色付け機能 */
.category-tag {
    display: inline-block;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: bold;
    color: #333;
    border-radius: 4px;
    text-decoration: none;
    margin-right: 6px;
    border: 1px solid rgba(0,0,0,0.1);
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    transition: all 0.2s ease;
}

.category-tag:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* カテゴリ別色設定 - パステル調で全て異なる色 */
.cat_cell.category-sougou { background-color: #d2f5d2 !important; }  /* 緑 */
.cat_cell.category-zatsudan { background-color: #e1e1e1 !important; }  /* グレー */
.cat_cell.category-anime { background-color: #ffcacb !important; }  /* ピンク */
.cat_cell.category-ss { background-color: #f0d7ff !important; }  /* 紫 */
.cat_cell.category-game { background-color: #d4e4fc !important; }  /* 水色 */
.cat_cell.category-pokego { background-color: #c8ffff !important; }  /* シアン */
.cat_cell.category-card { background-color: #fff4d4 !important; }  /* クリーム */
.cat_cell.category-pkpk { background-color: #ffd9df !important; }  /* 桃色 */
.cat_cell.category-pokemas { background-color: #e6ffe6 !important; }  /* ライトグリーン */
.cat_cell.category-sleep { background-color: #e6e6ff !important; }  /* ラベンダー */
.cat_cell.category-illustration { background-color: #ffdcb9 !important; }  /* オレンジ */
.cat_cell.category-project { background-color: #f0f0f0 !important; }  /* ライトグレー */
.cat_cell.category-sonota { background-color: #fffacd !important; }  /* レモン */

/* スレッド一覧でのタグ色 */
.category-tag.category-sougou,
.category-tag-inline.category-sougou,
.category-tag-square.category-sougou { background-color: #d2f5d2; }

.category-tag.category-zatsudan,
.category-tag-inline.category-zatsudan,
.category-tag-square.category-zatsudan { background-color: #e1e1e1; }

.category-tag.category-anime,
.category-tag-inline.category-anime,
.category-tag-square.category-anime { background-color: #ffcacb; }

.category-tag.category-ss,
.category-tag-inline.category-ss,
.category-tag-square.category-ss { background-color: #f0d7ff; }

.category-tag.category-game,
.category-tag-inline.category-game,
.category-tag-square.category-game { background-color: #d4e4fc; }

.category-tag.category-pokego,
.category-tag-inline.category-pokego,
.category-tag-square.category-pokego { background-color: #c8ffff; }

.category-tag.category-card,
.category-tag-inline.category-card,
.category-tag-square.category-card { background-color: #fff4d4; }

.category-tag.category-pkpk,
.category-tag-inline.category-pkpk,
.category-tag-square.category-pkpk { background-color: #ffd9df; }

.category-tag.category-pokemas,
.category-tag-inline.category-pokemas,
.category-tag-square.category-pokemas { background-color: #e6ffe6; }

.category-tag.category-sleep,
.category-tag-inline.category-sleep,
.category-tag-square.category-sleep { background-color: #e6e6ff; }

.category-tag.category-illustration,
.category-tag-inline.category-illustration,
.category-tag-square.category-illustration { background-color: #ffdcb9; }

.category-tag.category-project,
.category-tag-inline.category-project,
.category-tag-square.category-project { background-color: #f0f0f0; }

.category-tag.category-sonota,
.category-tag-inline.category-sonota,
.category-tag-square.category-sonota { background-color: #fffacd; }

/* スレッド一覧でのインラインカテゴリ表示 */
.category-tag-inline {
    display: inline-block;
    padding: 3px 8px;
    font-size: 11px;
    font-weight: bold;
    color: #333;
    margin-right: 8px;
    text-decoration: none;
    vertical-align: middle;
    min-width: 45px;
    text-align: center;
    border-radius: 3px;
    border: 1px solid rgba(0,0,0,0.1);
    white-space: nowrap;
}

/* スレッドページでの四角いカテゴリ表示 */
.category-tag-square {
    display: inline-block;
    padding: 5px 10px;
    font-size: 12px;
    font-weight: bold;
    color: #333;
    text-decoration: none;
    border: 1px solid rgba(0,0,0,0.1);
    text-align: center;
    min-width: 55px;
    border-radius: 3px;
    white-space: nowrap;
}

/* カテゴリメニューでの色付け */
.cat_cell.category-colored a {
    color: #333 !important;
    text-decoration: none;
    font-weight: bold;
}

.cat_cell.category-colored {
    border: 1px solid rgba(0,0,0,0.1);
}

.cat_cell.category-colored:hover {
    opacity: 0.9;
}

/* YouTube埋め込み表示スタイル */
.youtube-embed-container {
    margin: 15px auto;
    padding: 12px;
    background: #f8f9fa;
    border: 2px solid #e1e8ed;
    border-radius: 15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    max-width: 584px; /* iframe幅560px + padding 24px */
    position: relative;
    transition: box-shadow 0.3s ease;
}

.youtube-embed-container:hover {
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}


.youtube-embed-container iframe {
    width: 100%;
    max-width: 560px;
    height: 315px;
    border-radius: 8px;
    display: block;
    margin: 0 auto;
}

/* モバイル対応 */
@media screen and (max-width: 768px) {
    .youtube-embed-container {
        max-width: 100%;
        margin: 12px auto;
        padding: 10px;
    }
    
    .youtube-embed-container iframe {
        height: 250px;
    }
    
}

/* さらに小さい画面対応 */
@media screen and (max-width: 480px) {
    .youtube-embed-container iframe {
        height: 200px;
    }
}

/* レス参照プレビュー機能 */
.reply-link {
    color: #0066cc;
    text-decoration: none;
    cursor: pointer;
    padding: 1px 2px;
    border-radius: 3px;
    transition: background-color 0.2s ease;
}

.reply-link:hover {
    background-color: #e6f2ff;
    text-decoration: underline;
}

.reply-preview {
    position: absolute;
    background: #ffffff;
    border: 2px solid #d1d8e0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    max-width: 300px;
    min-width: 250px;
    z-index: 1000;
    font-size: 14px;
    line-height: 1.4;
}

.preview-header {
    background: #f8f9fa;
    padding: 8px 12px;
    border-bottom: 1px solid #e9ecef;
    border-radius: 6px 6px 0 0;
    font-size: 12px;
}

.preview-header strong {
    color: #0066cc;
    margin-right: 8px;
}

.preview-name {
    font-weight: bold;
    color: #333;
    margin-right: 8px;
}

.preview-date {
    color: #666;
    font-size: 11px;
}

.preview-content {
    padding: 10px 12px;
    max-height: 150px;
    overflow-y: auto;
    word-wrap: break-word;
}

.preview-content img {
    max-width: 100% !important;
    height: auto !important;
}

.preview-images {
    padding: 5px 12px 10px;
    border-top: 1px solid #e9ecef;
    text-align: center;
}

.preview-images img {
    border-radius: 4px;
    border: 1px solid #ddd;
}

.preview-error {
    padding: 10px 12px;
    color: #dc3545;
    font-style: italic;
}

.preview-actions {
    padding: 8px 12px;
    border-top: 1px solid #e9ecef;
    background: #f8f9fa;
    font-size: 12px;
    text-align: right;
    border-radius: 0 0 6px 6px;
}

.preview-actions a {
    color: #0066cc;
    text-decoration: none;
    margin: 0 2px;
}

.preview-actions a:hover {
    text-decoration: underline;
}

/* モバイル対応 */
@media screen and (max-width: 768px) {
    .reply-preview {
        max-width: 280px;
        min-width: 200px;
        font-size: 13px;
    }
    
    .preview-header {
        padding: 6px 10px;
        font-size: 11px;
    }
    
    .preview-content {
        padding: 8px 10px;
        max-height: 120px;
    }
    
    .preview-images {
        padding: 4px 10px 8px;
    }
    
    .preview-actions {
        padding: 6px 10px;
        font-size: 11px;
    }
}


/* スレッドリストでのカテゴリ表示 */
.thread-category {
    display: inline-block;
    margin-right: 8px;
    vertical-align: middle;
}

/* 作成フォームでのプレビュー */
.category-preview {
    margin-left: 10px;
    display: inline-block;
    vertical-align: middle;
}

/* スレッドロック機能 */
.thread-lock-status {
    font-size: 16px;
    margin-right: 8px;
}

.thread-locked-notice {
    background: #fff3cd;
    border: 2px solid #ffeaa7;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    text-align: center;
}

.thread-locked-notice h3 {
    color: #856404;
    margin-bottom: 10px;
}

.thread-locked-notice p {
    color: #6c5700;
    margin: 8px 0;
}

.lock-reason {
    background: #f8f9fa;
    border-left: 4px solid #ffc107;
    padding: 5px 10px;
    margin-top: 8px;
    font-size: 12px;
}

.admin-controls {
    margin-top: 15px;
}

.admin-button {
    background: #dc3545;
    color: white;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    text-decoration: none;
    font-size: 14px;
    transition: background-color 0.2s ease;
}

.admin-button:hover {
    background: #c82333;
    color: white;
}

/* ロック管理ページ */
.thread-info {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
    margin: 20px 0;
}

.thread-info h3 {
    color: #495057;
    margin-bottom: 10px;
}

.thread-info .locked {
    color: #dc3545;
    font-weight: bold;
}

.thread-info .unlocked {
    color: #28a745;
    font-weight: bold;
}

.lock-form {
    margin: 20px 0;
}

.lock-form table {
    width: 100%;
    max-width: 600px;
}

.lock-form th {
    background: #f8f9fa;
    padding: 10px;
    text-align: right;
    vertical-align: top;
    width: 150px;
}

.lock-form td {
    padding: 10px;
}

.lock-form input[type="text"],
.lock-form input[type="password"],
.lock-form textarea {
    width: 100%;
    max-width: 300px;
    padding: 5px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.lock-form textarea {
    resize: vertical;
    font-family: inherit;
}

.submit-button {
    background: #007bff;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    margin-right: 10px;
}

.submit-button:hover {
    background: #0056b3;
}

.cancel-button {
    background: #6c757d;
    color: white;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 4px;
    font-size: 16px;
}

.cancel-button:hover {
    background: #5a6268;
    color: white;
}

.success-message {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
    padding: 15px;
    border-radius: 4px;
    margin: 20px 0;
}

.error-message {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 15px;
    border-radius: 4px;
    margin: 20px 0;
}

.navigation {
    margin: 30px 0;
    text-align: center;
}

.navigation a {
    color: #007bff;
    text-decoration: none;
    margin: 0 10px;
}

.navigation a:hover {
    text-decoration: underline;
}

/* モバイル対応 */
@media screen and (max-width: 768px) {
    .thread-locked-notice {
        padding: 15px;
        margin: 15px 0;
    }
    
    .lock-form table {
        display: block;
    }
    
    .lock-form tr {
        display: block;
        margin-bottom: 15px;
    }
    
    .lock-form th,
    .lock-form td {
        display: block;
        width: 100%;
        text-align: left;
        padding: 5px 0;
    }
    
    .lock-form th {
        font-weight: bold;
        margin-bottom: 5px;
    }
    
    .submit-button,
    .cancel-button {
        display: block;
        width: 100%;
        margin: 5px 0;
        text-align: center;
    }
}

/* Twitter埋め込み用スタイル */
.twitter-embed-container {
    margin: 15px 0;
    max-width: 100%;
    overflow: hidden;
}

.twitter-embed-container blockquote {
    margin: 0;
    padding: 0;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .twitter-embed-container {
        margin: 10px 0;
    }
}

/* 画像ギャラリー用スタイル */
.image-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 10px 0;
}

.thumbnail-container {
    flex: 0 0 auto;
}

.thumbnail {
    width: 150px;
    height: 150px;
    object-fit: cover;
    border: 2px solid #ddd;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.thumbnail:hover {
    border-color: #007bff;
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* 画像ビューワー用スタイル */
.image-viewer {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.9);
    cursor: pointer;
}

.viewer-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 90%;
    max-height: 90%;
}

.viewer-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
    cursor: grab;
}

.viewer-image:active {
    cursor: grabbing;
}

.viewer-image.zoomed {
    cursor: move;
}

.viewer-close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    user-select: none;
}

.viewer-close:hover {
    color: #ccc;
}

.zoom-controls {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 15px;
    z-index: 1001;
    background-color: rgba(0,0,0,0.8);
    padding: 15px 20px;
    border-radius: 25px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.zoom-btn {
    width: 45px;
    height: 45px;
    background-color: rgba(255,255,255,0.2);
    color: white;
    border: 2px solid rgba(255,255,255,0.4);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: bold;
    transition: all 0.2s ease;
    user-select: none;
}

.zoom-btn:hover {
    background-color: rgba(255,255,255,0.3);
    border-color: rgba(255,255,255,0.7);
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.zoom-btn:active {
    transform: translateY(0);
    background-color: rgba(255,255,255,0.4);
}

.zoom-info {
    position: absolute;
    top: 20px;
    left: 20px;
    color: white;
    font-size: 16px;
    font-weight: bold;
    background-color: rgba(0,0,0,0.7);
    padding: 10px 15px;
    border-radius: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    min-width: 60px;
    text-align: center;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .thumbnail {
        width: 100px;
        height: 100px;
    }

    .image-gallery {
        gap: 5px;
    }
}

/* レス数リンク（最新レスへのジャンプ） */
.res a {
    color: #007bff;
    text-decoration: none;
    display: inline-block;
    padding: 2px 4px;
    border-radius: 3px;
    transition: all 0.2s ease;
}

.res a:hover {
    color: #0056b3;
    background-color: #e7f3ff;
    text-decoration: underline;
}

/* 編集ページ・作成ページの送信ボタン */
.btn_submit {
    background: transparent;
    padding: 0;
    margin-top: 20px;
}

.btn_submit input[type="submit"] {
    font-size: 16px;
    padding: 12px 35px;
    font-weight: bold;
    background: linear-gradient(to bottom, #4169e1, #3658c8);
    color: #ffffff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: background 0.2s ease;
}

.btn_submit input[type="submit"]:hover {
    background: linear-gradient(to bottom, #5179f1, #4668d8);
}

@media screen and (max-width: 768px) {
    .btn_submit input[type="submit"] {
        width: 100%;
        padding: 10px 20px;
        font-size: 15px;
    }
}

/* 新規スレッドボタンの表示制御 */
/* デスクトップ表示 */
@media screen and (min-width: 769px) {
    .create-button-pc {
        display: inline-block;
    }
    .create-button-mobile {
        display: none;
    }
}

/* モバイル表示 */
@media screen and (max-width: 768px) {
    .create-button-pc {
        display: none;
    }
    .create-button-mobile {
        display: inline-block;
    }
}

/* ロック中タグ（カテゴリタグのデザインを継承） */
.lock-tag {
    display: inline-block;
    padding: 5px 10px;
    font-size: 12px;
    font-weight: bold;
    color: #cc0000;
    background-color: #ffcccc;
    text-decoration: none;
    border: 1px solid #ff9999;
    text-align: center;
    min-width: 55px;
    border-radius: 3px;
    white-space: nowrap;
    margin-left: 8px;
}