/* リセットとベーススタイル */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans JP', sans-serif;
    background-color: #f5f5f5;
    line-height: 1.6;
    color: #333;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
}



/* ヘッダー全体 */
.header {
  background: linear-gradient(135deg, #3b82f6, #8b5cf6); /* 青〜紫 */
  color: #fff;
  padding: 18px 0 20px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.site-logo:hover {
  transform: scale(1.05);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-image {
    width: 50px;
    height: 50px;
    object-fit: contain;
    border-radius: 8px;
    background-color: rgba(255, 255, 255, 0.1);
    padding: 5px;
}

.logo {
    font-size: 28px;
    font-weight: 700;
    margin: 0;
}

.tagline {
    font-size: 14px;
    opacity: 0.9;
}

.new-thread-btn {
    background-color: #ff6b6b;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.new-thread-btn:hover {
    background-color: #ff5252;
    transform: translateY(-2px);
}

/* カテゴリナビゲーション */
.category-nav {
    background-color: white;
    padding: 15px 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    overflow-x: auto;
}

.category-nav .container {
    display: flex;
    gap: 10px;
    min-width: fit-content;
}

.category-btn {
    padding: 8px 16px;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    font-size: 14px;
}

.category-btn:hover {
    background-color: #e9ecef;
}

.category-btn.active {
    background-color: #667eea;
    color: white;
    border-color: #667eea;
}

/* メインコンテンツ */
.main {
    padding: 30px 0;
}

/* メインコンテンツ */
.main {
    padding: 30px 0;
}

/* インライン広告のスタイル（コメント用とスレッド間用） */
.inline-ad-container {
    margin: 20px 0;
    padding: 15px;
    text-align: center;
    border-top: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
    background-color: #f9fafb;
    border-radius: 8px;
}

.inline-ad-container .adsbygoogle {
    display: block !important;
    margin: 0 auto !important;
}



.loading {
    text-align: center;
    padding: 50px 20px;
    color: #666;
}

/* スレッド一覧 */
.thread-item {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
    position: relative;
}

.thread-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

.thread-item.category-大学受験 { border-left-color: #ff6b6b; }
.thread-item.category-高校受験 { border-left-color: #4ecdc4; }
.thread-item.category-中学受験 { border-left-color: #45b7d1; }
.thread-item.category-資格試験 { border-left-color: #96ceb4; }
.thread-item.category-公務員試験 { border-left-color: #ffeaa7; }
.thread-item.category-就職試験 { border-left-color: #dda0dd; }
.thread-item.category-その他 { border-left-color: #a8a8a8; }

.thread-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
    color: #2c3e50;
}

.thread-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 13px;
    color: #666;
    margin-bottom: 10px;
}

.category {
    background-color: #667eea;
    color: white;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 12px;
}

.thread-preview {
    color: #666;
    font-size: 14px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 10px;
}

.thread-stats {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 13px;
    color: #888;
}

.thread-stats .likes-count {
    display: flex;
    align-items: center;
    gap: 4px;
}

.thread-stats .comments-count {
    display: flex;
    align-items: center;
    gap: 4px;
}

.thread-stats .latest-comment-time {
    font-size: 11px;
    color: #aaa;
    margin-left: 8px;
}

.favorite-btn {
    background: none;
    border: none;
    color: #ccc;
    cursor: pointer;
    font-size: 16px;
    padding: 5px;
    border-radius: 50%;
    transition: all 0.3s ease;
    margin-left: auto;
}

.favorite-btn:hover {
    color: #ffd700;
    transform: scale(1.1);
}

/* フッタースタイル */
.footer {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    margin-top: 60px;
    padding: 50px 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-section {
    background: rgba(255, 255, 255, 0.1);
    padding: 25px;
    border-radius: 15px;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.footer-section h3 {
    color: #fff;
    margin-bottom: 20px;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer-section h3 i {
    color: #ffd700;
}

/* 使い方セクション */
.usage-guide h4 {
    color: #fff;
    font-size: 14px;
    margin: 15px 0 8px;
    font-weight: 600;
}

.usage-guide p {
    font-size: 13px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 12px;
}

/* 管理人の想いセクション */
.admin-message {
    background: linear-gradient(135deg, rgba(255, 182, 193, 0.2) 0%, rgba(255, 160, 122, 0.2) 100%);
    border: 2px solid rgba(255, 192, 203, 0.3);
}

.admin-content p {
    font-size: 13px;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 15px;
}

.admin-content .greeting {
    font-weight: 600;
    color: #fff;
    margin-bottom: 18px;
}

.admin-content .closing {
    font-weight: 500;
    color: #fff;
    margin-top: 20px;
}

.admin-content .signature {
    text-align: right;
    font-style: italic;
    color: #ffd700;
    font-weight: 600;
    margin-top: 15px;
    margin-bottom: 0;
}

/* お問い合わせセクション */
.contact-intro {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 20px;
    line-height: 1.6;
}

.contact-form-inner .form-group {
    margin-bottom: 15px;
}

.contact-form-inner label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 5px;
}

.contact-form-inner input,
.contact-form-inner select,
.contact-form-inner textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 12px;
    backdrop-filter: blur(5px);
}

/* select要素のoption要素のスタイル修正 */
.contact-form-inner select {
    background: rgba(255, 255, 255, 0.9);
    color: #333;
}

.contact-form-inner select option {
    background: #fff;
    color: #333;
    padding: 8px;
}

.contact-form-inner input::placeholder,
.contact-form-inner textarea::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.contact-form-inner input:focus,
.contact-form-inner select:focus,
.contact-form-inner textarea:focus {
    outline: none;
    border-color: #ffd700;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

.contact-submit-btn {
    background: linear-gradient(135deg, #ffd700, #ffed4a);
    color: #333;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
}

.contact-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 215, 0, 0.3);
}

/* フッター下部 */
.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.footer-bottom p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 12px;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .footer-content {
        grid-template-columns: 1fr;
        gap: 25px;
    }
    
    .footer-section {
        padding: 20px;
    }
    
    .usage-guide h4 {
        font-size: 13px;
    }
    
    .usage-guide p,
    .admin-content p,
    .contact-intro {
        font-size: 12px;
    }
}

.favorite-btn.favorited {
    color: #ffd700;
}

.favorite-btn.favorited:hover {
    color: #ffed4e;
}

/* 右上配置のお気に入りボタン */
.favorite-btn-top {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #e0e0e0;
    color: #ccc;
    cursor: pointer;
    font-size: 18px;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.3s ease;
    z-index: 10;
    backdrop-filter: blur(4px);
}

.favorite-btn-top:hover {
    color: #ffd700;
    background: rgba(255, 255, 255, 1);
    border-color: #ffd700;
    transform: scale(1.1);
}

.favorite-btn-top.favorited {
    color: #ffd700;
    background: rgba(255, 215, 0, 0.1);
    border-color: #ffd700;
}

.favorite-btn-top.favorited:hover {
    color: #ffed4e;
    background: rgba(255, 237, 78, 0.2);
}

/* 画像アップロード */
.image-upload-wrapper {
    margin-top: 10px;
}

.image-upload-area {
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: #fafafa;
}

.image-upload-area:hover,
.image-upload-area.drag-active {
    border-color: #667eea;
    background-color: #f0f4ff;
}

.image-upload-area i {
    font-size: 24px;
    color: #888;
    margin-bottom: 10px;
}

.image-upload-area p {
    margin: 10px 0 5px 0;
    color: #666;
    font-size: 14px;
}

.image-upload-area small {
    color: #888;
    font-size: 12px;
}

.image-upload-area-small {
    border: 1px dashed #ddd;
    border-radius: 6px;
    padding: 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: #fafafa;
    font-size: 12px;
    color: #666;
    margin-bottom: 10px;
}

.image-upload-area-small:hover,
.image-upload-area-small.drag-active {
    border-color: #667eea;
    background-color: #f0f4ff;
}

.image-upload-area-small i {
    margin-right: 5px;
    color: #888;
}

.image-preview-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

.image-preview-item {
    position: relative;
    width: 100px;
    height: 100px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid #e0e0e0;
}

.image-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-preview-remove {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(255, 0, 0, 0.8);
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-preview-remove:hover {
    background: rgba(255, 0, 0, 1);
}

/* 画像ギャラリー表示 */
.thread-images, .comment-images-display {
    margin: 15px 0;
}

.image-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.gallery-image {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid #e0e0e0;
}

.gallery-image:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* 画像モーダル */
.image-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 10000;
    cursor: pointer;
}

.image-modal img {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 90vw;
    max-height: 90vh;
    border-radius: 8px;
}

.image-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    color: white;
    font-size: 30px;
    cursor: pointer;
    z-index: 10001;
}

/* 「さらに表示」表示 */
.more-images {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    font-size: 14px;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.more-images:hover {
    background: rgba(0, 0, 0, 0.8);
}

/* スレッド詳細の画像表示 */
.thread-images-display {
    margin: 20px 0;
}

.thread-images-display .image-gallery {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.thread-images-display .gallery-image {
    height: 200px;
}

/* コメント画像表示 */
.comment-images-display .image-gallery {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

.comment-images-display .gallery-image {
    height: 120px;
}

/* 「さらに表示」表示 */
.more-images {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    font-size: 14px;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.more-images:hover {
    background: rgba(0, 0, 0, 0.8);
}

/* スレッド詳細の画像表示 */
.thread-images-display {
    margin: 20px 0;
}

.thread-images-display .image-gallery {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.thread-images-display .gallery-image {
    height: 200px;
}

/* コメント画像表示 */
.comment-images-display .image-gallery {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

.comment-images-display .gallery-image {
    height: 120px;
}

/* モーダル */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.modal-overlay.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background-color: white;
    border-radius: 12px;
    padding: 30px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideIn 0.3s ease;
    position: relative;
}

@keyframes slideIn {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.thread-detail {
    max-width: 800px;
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
}

.close-btn:hover {
    color: #333;
}

.thread-header h2 {
    color: #2c3e50;
    margin-bottom: 15px;
    padding-right: 40px;
}

.thread-content {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    line-height: 1.7;
}

.thread-actions {
    margin: 20px 0;
}

.like-btn {
    background-color: #ff6b6b;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.like-btn:hover {
    background-color: #ff5252;
}

.like-btn.liked {
    background-color: #e74c3c;
}

/* フォーム */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #2c3e50;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 25px;
}

.form-actions button {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.form-actions button[type="button"] {
    background-color: #6c757d;
    color: white;
}

.form-actions button[type="submit"] {
    background-color: #667eea;
    color: white;
}

.form-actions button:hover {
    opacity: 0.9;
}

/* コメントセクション */
.comments-section {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.comments-section h3 {
    color: #2c3e50;
    margin-bottom: 20px;
}

.reply-form {
    margin-bottom: 30px;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
}

.reply-form textarea {
    margin-bottom: 15px;
}

.reply-form button {
    background-color: #667eea;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}

.comment-item {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    border-left: 3px solid #667eea;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 13px;
    color: #666;
}

.comment-number {
    font-weight: 600;
    color: #667eea;
}

.comment-content {
    line-height: 1.6;
    margin-bottom: 10px;
}

.comment-actions {
    display: flex;
    justify-content: flex-end;
}

.comment-like-btn {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    font-size: 12px;
    padding: 5px 10px;
    border-radius: 15px;
    transition: all 0.3s ease;
}

.comment-like-btn:hover {
    background-color: #e9ecef;
}

.comment-like-btn.liked {
    color: #ff6b6b;
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
    .header .container {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .logo-container {
        flex-direction: column;
        gap: 10px;
    }
    
    .logo-image {
        width: 40px;
        height: 40px;
    }
    
    .category-nav {
        padding: 10px 0;
    }
    
    .category-nav .container {
        padding: 0 10px;
    }
    
    .modal-content {
        padding: 20px;
        margin: 10px;
    }
    
    .thread-meta {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions button {
        width: 100%;
    }
}

/* 空の状態 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.empty-state i {
    font-size: 48px;
    color: #ccc;
    margin-bottom: 20px;
}

.empty-state h3 {
    margin-bottom: 10px;
    color: #888;
}

/* 検索セクション */
.search-section {
    background-color: white;
    padding: 20px 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    border-top: 1px solid #eee;
}

.search-bar {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background-color: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 25px;
    padding: 0 20px;
    transition: all 0.3s ease;
}

.search-input-wrapper:focus-within {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.search-icon {
    color: #666;
    margin-right: 10px;
}

.search-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 12px 0;
    font-size: 16px;
    outline: none;
}

.search-clear-btn {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: all 0.3s ease;
    display: none;
}

.search-clear-btn:hover {
    background-color: #e9ecef;
    color: #666;
}

.search-clear-btn.visible {
    display: block;
}

.search-filters {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    flex-wrap: wrap;
}

.search-main-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.search-filter-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-left: auto;
}

.search-type-select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background-color: white;
    cursor: pointer;
}

.search-btn {
    background-color: #667eea;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-btn:hover {
    background-color: #5a67d8;
    transform: translateY(-1px);
}

.search-btn i {
    font-size: 13px;
}

/* フィルターグループのスタイル */
.filter-group {
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.filter-group label {
    font-size: 14px;
    font-weight: 500;
    color: #555;
    margin: 0;
}

.filter-select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background-color: white;
    cursor: pointer;
    font-size: 14px;
    min-width: 100px;
}

.advanced-search-btn {
    background-color: #6c757d;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.advanced-search-btn:hover {
    background-color: #5a6268;
}

.advanced-search-btn.active {
    background-color: #667eea;
}

/* 詳細検索パネル（使用停止 - フィルターは検索バーに統合） */
.advanced-search-panel {
    display: none;
}

.advanced-search-panel.active {
    display: none;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.search-options {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.search-option {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.search-option label {
    font-weight: 500;
    color: #495057;
    font-size: 14px;
}

.search-option select {
    padding: 6px 10px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    background-color: white;
}

/* ハッシュタグ関連 */
.hashtag-input-wrapper {
    position: relative;
}

.hashtag-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: white;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 6px 6px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 10;
    display: none;
}

.hashtag-suggestion {
    padding: 10px 15px;
    cursor: pointer;
    border-bottom: 1px solid #f1f3f4;
    transition: background-color 0.2s ease;
}

.hashtag-suggestion:hover {
    background-color: #f8f9fa;
}

.hashtag-suggestion:last-child {
    border-bottom: none;
}

.hashtag-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.hashtag-tag {
    display: inline-flex;
    align-items: center;
    background-color: #667eea;
    color: white;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 12px;
    gap: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.hashtag-tag:hover {
    background-color: #5a6fd8;
}

.hashtag-tag .remove-tag {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 0;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
}

.hashtag-tag .remove-tag:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.form-help {
    color: #6c757d;
    font-size: 12px;
    margin-top: 5px;
}

/* サブカテゴリセクション */
.subcategory-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.subcategory-section h3 {
    color: #495057;
    font-size: 16px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.subcategory-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.subcategory-item {
    background-color: #f8f9fa;
    color: #495057;
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
    text-decoration: none;
}

.subcategory-item:hover {
    background-color: #667eea;
    color: white;
    border-color: #667eea;
    transform: translateY(-2px);
}

.subcategory-item.active {
    background-color: #667eea;
    color: white;
    border-color: #667eea;
}

.subcategory-item .count {
    opacity: 0.7;
    margin-left: 5px;
}

/* 検索結果情報 */
.search-results-info {
    background-color: #e7f3ff;
    padding: 10px 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid #b3d9ff;
}

.results-count {
    color: #0066cc;
    font-weight: 500;
}

.clear-search-btn {
    background-color: #6c757d;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.clear-search-btn:hover {
    background-color: #5a6268;
}

/* スレッドアイテムにハッシュタグ表示 */
.thread-hashtags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.thread-hashtag {
    background-color: #e9ecef;
    color: #495057;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.thread-hashtag:hover {
    background-color: #667eea;
    color: white;
}

/* スレッドサブカテゴリ表示 */
.thread-subcategory {
    background-color: #28a745;
    color: white;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 12px;
}

/* 匿名/記名選択スタイル */
.author-type-selection {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.radio-option {
    display: flex;
    align-items: center;
    cursor: pointer;
    gap: 8px;
}

.radio-option input[type="radio"] {
    width: auto;
    margin: 0;
}

.radio-label {
    font-size: 14px;
    color: #495057;
    font-weight: 500;
}

.custom-name-input {
    margin-top: 10px;
    animation: slideDown 0.3s ease;
}

.custom-name-input input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

/* 返信フォーム用の小さいスタイル */
.reply-author-selection {
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 10px 0;
    flex-wrap: wrap;
}

.radio-option-small {
    display: flex;
    align-items: center;
    cursor: pointer;
    gap: 5px;
}

.radio-option-small input[type="radio"] {
    width: auto;
    margin: 0;
}

.radio-label-small {
    font-size: 12px;
    color: #495057;
    font-weight: 500;
}

.reply-custom-name {
    margin-left: 10px;
    animation: slideDown 0.3s ease;
}

.reply-custom-name input {
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 12px;
    width: 120px;
}

/* 匿名表示スタイル */
.anonymous-author {
    color: #6c757d;
    font-style: italic;
}

.named-author {
    color: #495057;
    font-weight: 500;
}

/* ページヘッダー */
.page-header {
    text-align: center;
    padding: 40px 0;
    border-bottom: 1px solid #e9ecef;
    margin-bottom: 30px;
}

.page-header h2 {
    color: #495057;
    font-size: 28px;
    margin-bottom: 10px;
}

.page-description {
    color: #6c757d;
    font-size: 16px;
}

/* ヘッダーナビゲーション */
.header-nav {
    display: flex;
    gap: 10px;
    align-items: center;
}

.nav-btn {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.nav-btn:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

.nav-btn.active {
    background-color: rgba(255, 255, 255, 0.4);
}

/* ロゴクリック可能 */
.logo-container {
    cursor: pointer;
}

/* 空の状態のボタン */
.create-thread-btn, .browse-threads-btn {
    background-color: #667eea;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    margin-top: 20px;
    transition: all 0.3s ease;
}

.create-thread-btn:hover, .browse-threads-btn:hover {
    background-color: #5a6fd8;
    transform: translateY(-2px);
}

/* 検索ハイライト */
.search-highlight {
    background-color: #fff3cd;
    padding: 1px 3px;
    border-radius: 3px;
    font-weight: 500;
}

/* アニメーション */
.fade-in {
    animation: fadeInUp 0.5s ease forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .search-filters {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .search-options {
        flex-direction: column;
        gap: 15px;
    }
    
    .hashtag-list {
        justify-content: center;
    }
    
    .search-results-info {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
}

/* エラー状態表示 */
.error-state {
    text-align: center;
    padding: 60px 20px;
    background-color: #fff5f5;
    border-radius: 8px;
    border: 1px solid #fed7d7;
    margin: 20px 0;
}

.error-state i {
    font-size: 48px;
    color: #e53e3e;
    margin-bottom: 20px;
}

.error-state h3 {
    color: #e53e3e;
    margin-bottom: 15px;
}

.error-state p {
    color: #666;
    margin-bottom: 20px;
    font-size: 14px;
}

.retry-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.retry-btn:hover {
    background: #5a67d8;
    transform: translateY(-2px);
}

/* --- ロゴアイコン（青ヘッダー用・白背景） --- */
.site-logo {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 50%;             /* 丸くする */
  background-color: #fff;          /* 白背景でアイコンを囲む */
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  overflow: hidden;
}

.site-logo img {
  width: 36px !important;          /* アイコン自体は小さめに - 初期表示時も固定 */
  height: 36px !important;
  object-fit: contain;
  max-width: 36px;                 /* 巨大表示を防ぐ */
  max-height: 36px;
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 10px;                        /* ロゴとテキストの間隔 */
}

.logo {
  font-size: 24px;
  font-weight: 700;
  color: #fff;
  margin: 0;
}

/* === Modal (default hidden) === */
.modal-overlay {
  display: none;                 /* ← デフォルト非表示 */
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal-overlay.active {
  display: flex;                 /* ← 表示したいときだけ active を付与 */
}

.modal-content, .modal {
  background: #fff;
  border-radius: 12px;
  width: min(720px, 92vw);
  max-height: 85vh;
  overflow: auto;
  padding: 32px;
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
  position: relative;
}

/* === Beautiful Modal Form Styling === */
.modal h3 {
  font-size: 24px;
  font-weight: 600;
  color: #333;
  margin: 0 0 24px 0;
  text-align: center;
  padding-bottom: 16px;
  border-bottom: 2px solid #f0f0f0;
}

.modal form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.modal label {
  font-size: 14px;
  font-weight: 500;
  color: #555;
  margin-bottom: 6px;
  display: block;
}

.modal input[type="text"],
.modal textarea {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #e8e8e8;
  border-radius: 8px;
  font-size: 16px;
  font-family: inherit;
  transition: all 0.2s ease;
  background: #fafafa;
  box-sizing: border-box;
}

.modal input[type="text"]:focus,
.modal textarea:focus {
  outline: none;
  border-color: #667eea;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.modal textarea {
  resize: vertical;
  min-height: 120px;
  line-height: 1.5;
}

.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid #f0f0f0;
}

.modal-actions button {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 100px;
}

.modal-actions button[type="button"] {
  background: #f5f5f5;
  color: #666;
  border: 1px solid #e0e0e0;
}

.modal-actions button[type="button"]:hover {
  background: #e8e8e8;
  color: #333;
}

.modal-actions button.primary,
.modal-actions button[type="submit"] {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.modal-actions button.primary:hover,
.modal-actions button[type="submit"]:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.modal-actions button:active {
  transform: translateY(0);
}

/* Loading state for submit button */
.modal-actions button[type="submit"]:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

/* Input groups for better organization */
.modal .form-group {
  display: flex;
  flex-direction: column;
}

.modal .form-row {
  display: flex;
  gap: 16px;
}

.modal .form-row .form-group {
  flex: 1;
}

/* Responsive design for smaller screens */
@media (max-width: 768px) {
  .modal-content, .modal {
    padding: 24px 20px;
    width: 94vw;
  }
  
  .modal h3 {
    font-size: 20px;
  }
  
  .modal-actions {
    flex-direction: column;
  }
  
  .modal-actions button {
    width: 100%;
  }
}

/* --- My Posts: actions row --- */
.thread-actions-row {
  margin-top: 12px;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* 編集・削除ボタンスタイルは廃止されました */

/* --- Image Gallery Styles --- */
.comment-images {
  margin-top: 12px;
}

.image-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.gallery-image {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border: 1px solid #e0e0e0;
}

.gallery-image:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Image Modal */
.image-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.8);
  display: none;
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.image-modal-overlay.active {
  display: flex;
}

.image-modal-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-modal-content img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 8px;
}

.image-modal-close {
  position: absolute;
  top: -40px;
  right: 0;
  background: none;
  border: none;
  color: white;
  font-size: 30px;
  cursor: pointer;
  padding: 5px;
  z-index: 1001;
}

.image-modal-close:hover {
  color: #ccc;
}

/* 検索ハイライト */
.search-highlight {
    background-color: #fff3cd;
    color: #856404;
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: 500;
}

/* 検索結果の空状態用ボタン */
.clear-search-btn {
    background-color: #6c757d;
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    margin-top: 15px;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.clear-search-btn:hover {
    background-color: #5a6268;
    transform: translateY(-1px);
}

.clear-search-btn i {
    font-size: 12px;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .search-filters {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .search-main-controls {
        width: 100%;
        justify-content: stretch;
    }
    
    .search-filter-controls {
        width: 100%;
        margin-left: 0;
        justify-content: space-between;
    }
    
    .filter-group {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .search-btn {
        flex: 1;
        justify-content: center;
        margin-left: 10px;
    }
}


.badge-admin {
  display:inline-block;
  padding:2px 8px;
  border-radius:999px;
  background:#222;
  color:#fff;
  font-size:12px;
  font-weight:600;
}

/* 削除依頼・通報リンク */
.my-post-actions {
    margin-top: 8px;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.delete-request-link, .report-link {
    color: #9ca3af;
    font-size: 11px;
    text-decoration: none;
    padding: 2px 4px;
    border-radius: 3px;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
    background: none;
}

.delete-request-link:hover {
    color: #dc2626;
    background-color: #fef2f2;
}

.report-link:hover {
    color: #d97706;
    background-color: #fffbeb;
}

/* スレッド詳細での通報リンク（右上配置用） */
.op-post {
    position: relative; /* 絶対配置の基準点 */
}

.thread-report-link {
    position: absolute;
    top: 8px;
    right: 8px;
    color: #9ca3af;
    font-size: 11px;
    text-decoration: none;
    padding: 2px 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.8);
    transition: all 0.2s ease;
    z-index: 10;
}

.thread-report-link:hover {
    color: #d97706;
    background-color: #fffbeb;
    border-color: #fbbf24;
}

/* スレッドアイテムでの通報リンク（右下配置用） */
.thread-item {
    position: relative; /* 絶対配置の基準点 */
}

.thread-item-report {
    position: absolute;
    bottom: 8px;
    right: 8px;
    color: #9ca3af;
    font-size: 11px;
    text-decoration: none;
    padding: 2px 4px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.8);
    transition: all 0.2s ease;
    z-index: 10;
}

.thread-item-report:hover {
    color: #d97706;
    background-color: #fffbeb;
}

/* 通報・削除依頼ステータス表示 */
.report-status-pending {
    color: #d97706 !important;
    background-color: #fffbeb;
    border: 1px solid #fbbf24;
    cursor: not-allowed;
}

.report-status-approved {
    color: #059669 !important;
    background-color: #ecfdf5;
    border: 1px solid #10b981;
    cursor: not-allowed;
}

.report-status-rejected {
    color: #dc2626 !important;
    background-color: #fef2f2;
    border: 1px solid #f87171;
    cursor: pointer;
}

.report-status-pending:hover,
.report-status-approved:hover {
    transform: none;
    box-shadow: none;
}

.report-status-rejected:hover {
    background-color: #fecaca;
}

/* 通報ボタンのベーススタイル調整 */
.thread-item-report.report-status-pending,
.thread-item-report.report-status-approved,
.thread-item-report.report-status-rejected {
    font-size: 10px;
    padding: 4px 6px;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* コメント内の通報リンクのステータス表示 */
.comment-moderation-links a.report-status-pending,
.comment-moderation-links a.report-status-approved,
.comment-moderation-links a.report-status-rejected {
    font-size: 10px;
    padding: 2px 4px;
    border-radius: 3px;
    text-decoration: none;
    display: inline-block;
    margin: 0 2px;
}

/* コメント・返信でのヘッダー行レイアウト */
.comment-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.comment-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* コメント・返信での通報・削除依頼リンク（ヘッダー右側） */
.comment-moderation-links {
    display: flex;
    gap: 6px;
    font-size: 11px;
    margin-left: auto;
}

.comment-moderation-links a,
.comment-moderation-links button {
    color: #9ca3af;
    text-decoration: none;
    padding: 2px 4px;
    border-radius: 3px;
    background: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 11px;
}

.comment-moderation-links .delete-request-link:hover {
    color: #dc2626;
    background-color: #fef2f2;
}

.comment-moderation-links .report-link:hover {
    color: #d97706;
    background-color: #fffbeb;
}

/* 通報・削除依頼モーダル */
.report-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.report-modal.show {
    display: flex;
}

.report-modal-content {
    background: white;
    padding: 24px;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.report-modal h3 {
    margin-bottom: 16px;
    color: #1f2937;
}

.report-form-group {
    margin-bottom: 16px;
}

.report-form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #374151;
}

.report-form-group select,
.report-form-group textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-family: inherit;
}

.report-form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.report-modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 20px;
}

.report-submit-btn, .report-cancel-btn {
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.report-submit-btn {
    background-color: #dc2626;
    color: white;
}

.report-submit-btn:hover {
    background-color: #b91c1c;
}

.report-cancel-btn {
    background-color: #f3f4f6;
    color: #6b7280;
    border-color: #d1d5db;
}

.report-cancel-btn:hover {
    background-color: #e5e7eb;
}

/* --- 通報リンクを右下に小さく --- */
.post-actions,
.comment-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* 右端に寄せたい場合は、通報リンクを自分で右に押し出す */
.report-link {
  margin-left: auto;           /* 行内で右端へ */
  font-size: 12px;
  color: #6b7280;              /* muted グレー */
  text-decoration: none;
  padding: 2px 4px;
  line-height: 1;
}
.report-link:hover {
  color: #111827;
  text-decoration: underline;
}

/* カード下辺にピタッと寄せたい場合（任意）
   使う時は .comment-item / .post-card に position:relative を付与して
   .report-link-absolute を使ってください。*/
.report-link-absolute {
  position: absolute;
  right: 12px;
  bottom: 12px;
  margin-left: 0; /* 無効化 */
}

/* 返信トグル機能のスタイル（左端配置） */
.replies-toggle-btn {
  background: none !important;
  border: none !important;
  color: #666 !important;
  cursor: pointer !important;
  font-size: 12px !important;
  padding: 5px 10px !important;
  border-radius: 15px !important;
  transition: all 0.3s ease !important;
}

.replies-toggle-btn:hover {
  background-color: #e9ecef !important;
  color: #3b82f6 !important;
}

/* コメントアクション左右分離レイアウト */
.comment-actions-left {
  display: flex;
  align-items: center;
}

.comment-actions-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* 管理者バッジスタイル - 黒色で統一 */
.badge-admin {
  background: linear-gradient(135deg, #374151, #4b5563);
  color: #ffffff;
  font-weight: bold;
  padding: 2px 6px;
  border-radius: 12px;
  font-size: 12px;
  border: 1px solid #1f2937;
  display: inline-block;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
