/*
Theme Name: Everstar
Description: 小説投稿の検索機能とダッシュボード機能を持つモダンなテーマ
Version: 1.0
Author: Everstar Team
*/

/* リセットCSS */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    margin: 0;
    padding: 0;
    background-color: #f8fafc; /* 統一された背景色 */
    padding-top: 100px; /* 固定ヘッダーの高さ分 */
}

/* 管理バーが表示されている時のボディパディング調整 */
body.admin-bar {
    padding-top: 132px; /* ヘッダー(100px) + 管理バー(32px) */
}

/* レスポンシブ対応：小さい画面での管理バー */
@media screen and (max-width: 782px) {
    body.admin-bar {
        padding-top: 146px; /* ヘッダー(100px) + モバイル管理バー(46px) */
    }
}

/* ページ全体のパディングとマージンをリセット */
#page {
    margin: 0;
    padding: 0;
    border: none;
    background-color: #f8fafc;
}

.site {
    margin: 0;
    padding: 0;
    border: none;
    background-color: #f8fafc;
}

/* WordPressのbodyクラスに対するリセット - 線やシャドウを削除 */
body.search,
body.search-results,
body.logged-in,
body.admin-bar,
body.wp-theme-Everstar,
body.customize-support,
body.single,
body.archive,
body.page {
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    box-shadow: none !important;
    background-color: #f8fafc !important;
}

/* 検索結果ページ特有のリセット */
body.search .site-header,
body.search-results .site-header,
body.search .header-container,
body.search-results .header-container,
body.search .site-title,
body.search-results .site-title,
body.search .site-title a,
body.search-results .site-title a {
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    box-shadow: none !important;
    text-align: left !important;
    float: none !important;
    position: static !important;
    transform: none !important;
}

/* WordPress標準の検索フォームのリセット */
body.search .search-form,
body.search-results .search-form,
body.search .searchform,
body.search-results .searchform,
body.search .wp-block-search,
body.search-results .wp-block-search {
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    box-shadow: none !important;
    background: none !important;
}

/* WordPress標準の要素がヘッダーに影響しないようリセット */
body.search *,
body.search-results * {
    box-sizing: border-box;
}

body.search .wp-block-search__input,
body.search-results .wp-block-search__input,
body.search .wp-block-search__button,
body.search-results .wp-block-search__button {
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    box-shadow: none !important;
    background: none !important;
    position: static !important;
    float: none !important;
    transform: none !important;
}

/* 検索結果ページのメインコンテンツ内の要素がヘッダーに影響しないよう分離 */
body.search .main-content,
body.search-results .main-content {
    position: relative;
    z-index: 1;
}

body.search .site-header,
body.search-results .site-header {
    position: fixed !important;
    z-index: 1000 !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
}

/* 管理バーのパディングをリセット */
body.admin-bar {
    padding-top: 0 !important;
}

/* 全ページ共通のヘッダー */
.site-header {
    background: #0ea5e9;
    color: white;
    padding: 0 0 0 50px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    width: 100%;
    box-sizing: border-box;
    height: 100px;
    display: flex;
    align-items: center;
}

/* 管理バーが表示されている時のヘッダー位置調整 */
body.admin-bar .site-header {
    top: 32px;
}

/* レスポンシブ対応：小さい画面での管理バー */
@media screen and (max-width: 782px) {
    body.admin-bar .site-header {
        top: 46px;
    }
}

/* 全ページ共通のヘッダーコンテナ */
.header-container {
    max-width: 100%;
    margin: 0;
    padding: 12px 16px; /* 左上はじから適度な余白で固定 */
    display: flex;
    justify-content: space-between; /* 左右に分散配置 */
    align-items: center;
    box-sizing: border-box;
    text-align: left;
    position: relative;
    width: 100%;
}

.site-branding {
    flex: 1; /* サイトブランディングを可能な限り広く */
    margin-right: 20px; /* 右のナビと余白を確保 */
}

.site-title {
    margin: 0;
    padding: 0;
    text-align: left;
    position: relative;
    float: none;
    transform: none;
}

.site-title a {
    color: white;
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: 700;
    transition: opacity 0.3s ease;
    display: block;
    line-height: 1.2;
    text-align: left;
    position: relative;
    float: none;
    transform: none;
}

.site-title a:hover {
    opacity: 0.8;
}

.site-description {
    font-size: 1rem;
    opacity: 0.9;
    margin: 0;
    padding: 0;
    text-align: left;
    position: relative;
    float: none;
    transform: none;
}

/* ナビゲーション */
.main-navigation {
    background: white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    position: fixed;
    top: 80px; /* ヘッダーの高さ分下げる */
    left: 0;
    right: 0;
    z-index: 999;
    width: 100%;
    box-sizing: border-box;
}

/* 管理バーが表示されている時のナビゲーション位置調整 */
body.admin-bar .main-navigation {
    top: 112px; /* 管理バー + ヘッダーの高さ分下げる */
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.main-navigation ul {
    list-style: none;
    display: flex;
    gap: 2rem;
    margin: 0;
    padding: 0;
}

.main-navigation a {
    display: block;
    padding: 1rem 0;
    text-decoration: none;
    color: #0ea5e9;
    font-weight: 500;
    transition: color 0.3s ease;
}

.main-navigation a:hover {
    color: #0284c7;
}

/* 全ページ共通のメインコンテンツ */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    margin-top: 140px; /* 固定ヘッダー + ナビゲーションの高さ分のマージンを調整 */
    box-sizing: border-box;
}

/* 管理バーが表示されている時のメインコンテンツ位置調整 */
body.admin-bar .main-content {
    margin-top: 172px; /* 管理バー + 固定ヘッダー + ナビゲーションの高さ分のマージンを調整 */
}

/* ダッシュボード */
.dashboard {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    margin-bottom: 2rem;
}

/* 統一された見出しスタイル */
.dashboard h1,
.search-title,
.entry-title,
.page-title {
    color: #0ea5e9;
    margin-bottom: 1.5rem;
    font-size: 2rem;
    line-height: 1.3;
}

.entry-title {
    margin: 0 !important;
    padding: 0 !important;
    line-height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    min-height: 2.5rem;
    height: 100%;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid #0ea5e9;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: #0ea5e9;
    margin-bottom: 0.5rem;
}

.stat-label {
    color: #64748b;
    font-weight: 500;
}

/* 検索フォーム */
.search-section {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    margin-bottom: 2rem;
}

/* WordPress標準の検索フォーム */
.search-form {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 2rem;
}

.search-field {
    flex: 1;
    padding: 0.75rem;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.search-field:focus {
    outline: none;
    border-color: #0ea5e9;
}

.search-submit {
    background: linear-gradient(135deg, #0ea5e9, #0284c7);
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.2s ease;
    min-width: 120px;
}

.search-submit:hover {
    transform: translateY(-2px);
}

/* カスタム検索フォーム */
.custom-search-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
    padding: 2rem;
    background: white;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #374151;
}

.form-group input,
.form-group select {
    padding: 0.75rem;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #0ea5e9;
}

.search-button {
    background: linear-gradient(135deg, #0ea5e9, #0284c7);
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.2s ease;
    min-width: 120px;
}

.search-button:hover {
    transform: translateY(-2px);
}

.search-button.clear {
    background: linear-gradient(135deg, #6b7280, #4b5563);
    margin-left: 1rem;
}

.search-button.clear:hover {
    background: linear-gradient(135deg, #4b5563, #374151);
}

.button-group {
    display: flex;
    justify-content: center;
    gap: 1rem;
    grid-column: 1 / -1;
}

/* 検索結果 */
.search-results {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.search-results h2 {
    color: #0ea5e9;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.novel-list {
    list-style: none;
}

.novel-item {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
    background: white;
}

.novel-item:hover {
    border-color: #0ea5e9;
    box-shadow: 0 4px 15px rgba(14, 165, 233, 0.1);
}

.novel-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #0ea5e9;
    margin-bottom: 0.5rem;
    text-decoration: none;
}

.novel-title:hover {
    text-decoration: underline;
}

.novel-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: #6b7280;
}

.novel-excerpt {
    color: #374151;
    line-height: 1.6;
}

/* 小説詳細ページ */
.novel-detail {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.novel-detail h1 {
    color: #0ea5e9;
    margin-bottom: 1rem;
    font-size: 2rem;
}

/* 小説詳細ページのコンテナ */
.novel-container {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    margin-bottom: 2rem;
}

/* サムネイル部分（1/6の幅） */
.novel-thumbnail {
    flex: 0 0 calc(100% / 6);
    max-width: 200px;
    height: 180px;
}

.novel-thumbnail-img {
    width: 100%;
    height: 180px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease;
    object-fit: cover;
}

.novel-thumbnail-img:hover {
    transform: scale(1.02);
}

.no-thumbnail {
    width: 100%;
    height: 180px;
    background: #f8f9fa;
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    font-style: italic;
    font-size: 0.9rem;
}

/* 小説情報部分（5/6の幅、サムネイルと同じ高さ） */
.novel-info {
    flex: 0 0 calc(100% / 6 * 5);
    background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid #0ea5e9;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: stretch;
}

.novel-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.8rem;
    width: 100%;
    align-content: start;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .novel-container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .novel-thumbnail,
    .novel-info {
        flex: none;
        max-width: 100%;
    }
    
    .novel-thumbnail {
        max-width: 180px;
        margin: 0 auto;
    }
    
    .novel-info {
        display: block;
    }
    
    .novel-info-grid {
        grid-template-columns: 1fr;
        gap: 0.6rem;
    }
}

.novel-content {
    line-height: 1.8;
    color: #374151;
}

/* 全ページ共通のフッター */
.site-footer {
    background: #1e293b;
    color: white;
    padding: 2rem 0;
    margin-top: 4rem;
    width: 100%;
    box-sizing: border-box;
    position: relative;
    bottom: 0;
}

/* 全ページ共通のフッターコンテナ */
.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    text-align: center;
    box-sizing: border-box;
}

/* ホームに戻るリンク - 文字のみ、ボタンスタイルなし */
.home-back-button {
    margin-bottom: 2rem;
    padding: 0;
    border: none;
    background: none;
}

.btn-home {
    color: #0ea5e9;
    text-decoration: none;
    font-weight: 500;
    display: inline;
    padding: 0;
    border-radius: 0;
    transition: color 0.3s ease;
    background: none;
    border: none;
}

.btn-home:hover {
    color: #0284c7;
    text-decoration: underline;
    background: none;
}

/* 検索結果にもどるリンク - 文字のみ、ボタンスタイルなし */
.back-to-search {
    margin-bottom: 2rem;
    padding: 0;
    border: none;
    background: none;
}

.btn-back-search {
    color: #0ea5e9;
    text-decoration: none;
    font-weight: 500;
    display: inline;
    padding: 0;
    border-radius: 0;
    transition: color 0.3s ease;
    background: none;
    border: none;
}

.btn-back-search:hover {
    color: #0284c7;
    text-decoration: underline;
    background: none;
}

/* エクスポートボタン */
.table-actions {
    margin-bottom: 2rem;
    text-align: right;
}

.btn-export {
    background: #0ea5e9;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 1rem;
}

.btn-export:hover {
    background: #0284c7;
}

.post-export {
    margin-top: 2rem;
    text-align: center;
}

.post-export-right {
    margin: 0;
    text-align: right;
    display: flex;
    align-items: center;
    height: 100%;
}

.title-download-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0;
    min-height: 2.5rem;
    margin-bottom: 2rem;
    line-height: 2.5rem;
}

.btn-export-post {
    background: #0ea5e9;
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-export-post:hover {
    background: #0284c7;
}

.btn-comments-outline {
    background: transparent;
    color: #0ea5e9;
    border: 2px solid #0ea5e9;
    padding: 1rem 2rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-right: 1rem;
}

.btn-comments-outline:hover {
    background: #0ea5e9;
    color: white;
}

/* 本文コピーボタンのスタイル */
.copy-button-container {
    text-align: right;
    margin: 1rem 0;
}

.btn-copy-content {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-copy-content:hover {
    background: #e5e7eb;
    border-color: #9ca3af;
}

.btn-copy-content svg {
    width: 16px;
    height: 16px;
}

/* 検索フォーム */
.search-section {
    margin-bottom: 2rem;
}

.search-form-container {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    margin-bottom: 2rem;
    width: 100%;
    box-sizing: border-box;
}

.search-main {
    margin-bottom: 2rem;
}

.search-main .search-field {
    width: 100%;
    padding: 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1.1rem;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.search-main .search-field:focus {
    outline: none;
    border-color: #0ea5e9;
}

.search-options {
    border-top: 1px solid #e5e7eb;
    padding-top: 2rem;
}

.form-row {
    display: flex;
    align-items: flex-end;
    gap: 1rem;
    margin-bottom: 1.5rem;
    width: 100%;
}

.form-group {
    flex: 1;
    min-width: 0;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #374151;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #0ea5e9;
}

.range-separator {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 1rem;
    height: 100%;
    margin-bottom: 0.5rem;
}

.range-separator span {
    font-size: 1.5rem;
    color: #6b7280;
    font-weight: 600;
    line-height: 1;
}

.search-submit-container {
    text-align: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #e5e7eb;
}

.search-submit {
    background: #0ea5e9;
    color: white;
    border: none;
    padding: 1rem 3rem;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.search-submit:hover {
    background: #0284c7;
}

/* ソート機能 */
.search-sort {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

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

.search-sort h3 {
    margin: 0;
    color: #374151;
    font-size: 1.1rem;
    display: inline-block;
    line-height: 1;
    padding: 0;
}

.sort-form {
    margin: 0;
    display: flex;
    align-items: center;
}

.sort-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.sort-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sort-group label {
    font-weight: 600;
    color: #374151;
    margin: 0;
}

.sort-group select {
    padding: 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: white;
    font-size: 0.9rem;
}

.sort-group select:focus {
    outline: none;
    border-color: #0ea5e9;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
        gap: 1rem;
    }
    
    .range-separator {
        padding: 0;
    }
    
    .sort-options {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .search-form-container {
        padding: 1.5rem;
    }
    
    .header-container,
    .nav-container,
    .main-content {
        padding: 0 1rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .search-form {
        grid-template-columns: 1fr;
    }
    
    .main-navigation ul {
        flex-direction: column;
        gap: 0;
    }
    
    .main-content {
        margin-top: 120px; /* モバイル用の調整 */
    }
    
    body.admin-bar .main-content {
        margin-top: 152px; /* モバイル用の管理バー調整 */
    }
} 

/* 検索結果なし */
.no-results {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    margin: 2rem 0;
    border: 1px solid #e2e8f0;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.no-results h2 {
    color: #374151;
    margin: 0 0 1rem 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.no-results p {
    color: #6b7280;
    margin: 0 0 1.5rem 0;
    line-height: 1.6;
    font-size: 1rem;
}

.no-results ul {
    text-align: left;
    display: inline-block;
    margin: 0 0 2rem 0;
    padding: 0;
    list-style: none;
}

.no-results li {
    color: #6b7280;
    margin: 0.5rem 0;
    padding: 0.5rem 0;
    border-bottom: 1px solid #e5e7eb;
    line-height: 1.5;
}

.no-results li:last-child {
    border-bottom: none;
}

.search-again {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #e2e8f0;
}

.search-again h3 {
    color: #374151;
    margin: 0 0 1rem 0;
    font-size: 1.25rem;
    font-weight: 600;
} 

/* ダッシュボードグラフ */
.dashboard-graphs {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #e5e7eb;
}

.dashboard-graphs h3 {
    color: #374151;
    margin-bottom: 1.5rem;
    font-size: 1.4rem;
    text-align: center;
}

.graphs-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.graph-card {
    background: white;
    border-radius: 8px;
    padding: 1rem;
    border: 1px solid #e2e8f0;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.graph-card h4 {
    color: #374151;
    margin: 0 0 1rem 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.graph-card canvas {
    max-width: 100%;
    height: 200px !important;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .graphs-container {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .graph-card {
        padding: 0.75rem;
    }
    
    .graph-card canvas {
        height: 180px !important;
    }
} 

/* 検索結果テーブル */
.search-results-table {
    margin-bottom: 2rem;
    overflow-x: auto;
}

.results-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

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

.results-table th {
    background: #e5e7eb;
    font-weight: 600;
    color: #6b7280;
    position: sticky;
    top: 0;
    z-index: 10;
    font-size: 0.8rem;
    text-align: center;
}

.results-table tbody tr:hover {
    background: #f9fafb;
}

/* 各列のスタイル */
.post-id {
    font-family: 'Courier New', monospace;
    font-weight: 600;
    color: #6b7280;
    width: 80px;
}

.post-title {
    min-width: 200px;
}

.post-title a {
    color: #0ea5e9;
    text-decoration: none;
    font-weight: 500;
}

.post-title a:hover {
    text-decoration: underline;
}

.post-author {
    min-width: 120px;
    color: #374151;
}

.post-date {
    min-width: 100px;
    color: #6b7280;
    font-family: 'Courier New', monospace;
}

.post-chars {
    min-width: 100px;
    text-align: right;
    font-family: 'Courier New', monospace;
    color: #059669;
}

.post-category {
    min-width: 150px;
    color: #7c3aed;
}

.post-tags {
    min-width: 150px;
    color: #6b7280;
}

.post-pv {
    min-width: 80px;
    text-align: right;
    font-family: 'Courier New', monospace;
    color: #ea580c;
}

.post-stars {
    min-width: 80px;
    text-align: center;
    font-family: 'Courier New', monospace;
    color: #f59e0b;
    font-weight: 600;
}

.post-contest-exclude,
.post-past-award,
.post-book-exclude,
.post-commercial-hope {
    min-width: 120px;
    text-align: center;
    font-size: 0.85rem;
    color: #6b7280;
}

.post-contest-exclude {
    min-width: 120px;
}

.post-past-award {
    min-width: 100px;
    color: #dc2626;
    font-weight: 600;
}

.post-book-exclude {
    min-width: 120px;
}

.post-commercial-hope {
    min-width: 120px;
    color: #059669;
    font-weight: 600;
}

.post-status {
    min-width: 100px;
    text-align: center;
}

.post-ai-summary {
    text-align: center;
    min-width: 80px;
    max-width: 80px;
}

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-published {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.status-draft {
    background: white;
    color: #6b7280;
    border: 1px solid #e5e7eb;
}

/* レスポンシブ対応 */
@media (max-width: 1024px) {
    .search-results-table {
        padding: 1rem;
    }
    
    .results-table {
        font-size: 0.8rem;
    }
    
    .results-table th,
    .results-table td {
        padding: 0.5rem;
    }
    
    .post-title {
        min-width: 150px;
    }
    
    .post-category,
    .post-tags {
        min-width: 120px;
    }
}

/* ジャンルのチェックボックススタイル */
.genre-checkbox-group {
    padding: 1rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.genre-checkbox {
    display: flex;
    align-items: center;
    padding: 0.5rem 0;
    cursor: pointer;
    font-size: 0.9rem;
    color: #374151;
    transition: color 0.2s ease;
    line-height: 1;
    min-height: 2rem;
}

.genre-checkbox:hover {
    color: #0ea5e9;
}

.genre-checkbox input[type="checkbox"] {
    margin-right: 1rem;
    width: 1.5rem;
    height: 1.5rem;
    accent-color: #0ea5e9;
    margin: 0 1rem 0 0;
    flex-shrink: 0;
    vertical-align: middle;
}

.genre-checkbox .checkmark {
    position: relative;
    width: 1.5rem;
    height: 1.5rem;
    border: 2px solid #d1d5db;
    border-radius: 0.25rem;
    margin-right: 0.75rem;
    transition: all 0.2s ease;
    flex-shrink: 0;
    vertical-align: middle;
}

.genre-checkbox span:not(.checkmark) {
    vertical-align: middle;
    line-height: 1.5rem;
}

.genre-checkbox input[type="checkbox"]:checked + .checkmark {
    background: #0ea5e9;
    border-color: #0ea5e9;
}

.genre-checkbox input[type="checkbox"]:checked + .checkmark::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 0.8rem;
    font-weight: bold;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .genre-checkbox {
        font-size: 0.85rem;
        padding: 0.4rem 0;
    }
}

.search-main .form-group {
    margin-bottom: 1rem;
}

.search-main .form-group:last-child {
    margin-bottom: 0;
}

/* サムネイルサイズ調整 */
.results-table .post-thumb img {
    width: 80px;
    height: 100px;
    object-fit: cover;
    display: block;
}

/* あらすじ列のスタイル */
.results-table .post-excerpt {
    text-align: center;
    min-width: 80px;
    max-width: 80px;
}

/* あらすじボタンのスタイル */
.excerpt-btn {
    background: #0ea5e9 !important;
    color: white !important;
    border: none !important;
    padding: 5px 10px !important;
    border-radius: 3px !important;
    cursor: pointer !important;
    font-size: 12px !important;
    width: 60px;
    text-align: center;
}

.ai-view-btn {
    background: #0ea5e9 !important;
    color: white !important;
    border: none !important;
    padding: 5px 10px !important;
    border-radius: 3px !important;
    cursor: pointer !important;
    font-size: 12px !important;
    width: 50%;
    text-align: center;
    display: none; /* Initially hidden */
    margin-top: 5px;
}

/* AI生成ボタンのスタイル */
.ai-generate-btn {
    background: #6b7280 !important;
    color: white !important;
    border: none !important;
    padding: 5px 8px !important;
    border-radius: 3px !important;
    cursor: pointer !important;
    font-size: 12px !important;
    width: 30px;
    height: 26px;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.ai-generate-btn:hover {
    background: #4b5563 !important;
}

.ai-generate-btn:disabled {
    background: #9ca3af !important;
    cursor: not-allowed;
}


/* 外部リンクアイコンの左右反転 */
.link-icon span {
    transform: scaleX(-1);
    display: inline-block;
}

/* 作家によるタグの色付け */
.results-table .post-tags {
    color: #0ea5e9;
    font-weight: 500;
}

/* ポップアップの閉じるボタンの色 */
.excerpt-modal .close {
    background: #0ea5e9 !important;
    color: white !important;
}

/* トピック別検索のスタイル */
.topic-selection {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 1rem;
}

/* フィルタチェックボックスのスタイル */
.filter-checkbox-selection {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 1rem;
}

.filter-checkbox-group {
    border: 1px solid #ddd;
    padding: 1rem;
    border-radius: 8px;
    background: #fff;
}

.filter-checkbox {
    display: flex;
    align-items: center;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
}

.filter-checkbox input[type="checkbox"] {
    margin-right: 0.5rem;
    width: 1.2rem;
    height: 1.2rem;
    accent-color: #0ea5e9;
}

.topic-group {
    border: 1px solid #ddd;
    padding: 1rem;
    border-radius: 8px;
    background: #fff;
}

.topic-radio {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #374151;
}

.topic-radio input[type="radio"] {
    margin-right: 0.5rem;
    width: 1.2rem;
    height: 1.2rem;
    accent-color: #0ea5e9;
}

.topic-options {
    margin-top: 0.5rem;
    padding-left: 1.5rem;
    height: 100px;
    display: flex;
    align-items: center;
}

/* 初期状態でも高さを固定 */
.topic-options[style*="display: none"] {
    height: 100px;
    display: flex !important;
    visibility: hidden;
}

.topic-checkbox {
    display: flex;
    align-items: center;
    margin: 0.3rem 0;
    font-size: 0.9rem;
    color: #6b7280;
}

.topic-checkbox input[type="checkbox"] {
    margin-right: 0.5rem;
    width: 1rem;
    height: 1rem;
    accent-color: #0ea5e9;
}

/* フィルター機能のスタイル */
.search-filters {
    margin: 2rem 0;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    overflow: hidden;
}

.filter-header {
    padding: 1rem 1.5rem;
    background: #e9ecef;
    border-bottom: 1px solid #dee2e6;
    transition: background-color 0.2s ease;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.filter-header:hover {
    background: #dee2e6;
}

.filter-content {
    padding: 1.5rem;
}

.search-filters h3 {
    margin: 0;
    padding: 0;
    color: #495057;
    font-size: 1.1rem;
}

.toggle-icon {
    border: solid black;
    border-width: 0 2px 2px 0;
    display: inline-block;
    padding: 3px;
    transform: rotate(45deg);
    transition: transform 0.2s ease;
}

.filter-header.closed .toggle-icon {
    transform: rotate(-45deg);
}

.filter-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.filter-group {
    display: flex;
    flex-direction: column;
}

.filter-group label {
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: #495057;
    font-size: 0.9rem;
}

.filter-group input,
.filter-group select {
    padding: 0.5rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 0.9rem;
}

.filter-group input:focus,
.filter-group select:focus {
    outline: none;
    border-color: #0ea5e9;
    box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.2);
}

.filter-actions {
    grid-column: 1 / -1;
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1rem;
}

.btn-filter,
.btn-reset {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 5px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: all 0.2s ease;
}

.btn-filter {
    background: #0ea5e9;
    color: white;
}

.btn-filter:hover {
    background: #0284c7;
}

.btn-reset {
    background: #6c757d;
    color: white;
}

.btn-reset:hover {
    background: #5a6268;
}

/* ドロップダウンのスタイル */
.topic-dropdown {
    width: 120px;
    padding: 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    background: #fff;
    font-size: 0.9rem;
    color: #374151;
    margin-left: 0;
}

/* お気に入りボタンのスタイル */
.favorite-btn {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 5px;
    color: #666;
    transition: all 0.2s ease;
    border-radius: 4px;
}

.favorite-btn:hover {
    transform: scale(1.1);
    background-color: rgba(255, 107, 107, 0.1);
}

.favorite-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.favorite-icon {
    display: inline-block;
    transition: color 0.2s ease;
}

.favorite-icon.favorited {
    color: #ffd700;
    text-shadow: 0 0 5px rgba(255, 215, 0, 0.5);
}

.post-favorite {
    text-align: center;
    vertical-align: middle;
}

/* お気に入りページ用のスタイル */
.favorites-summary {
    font-size: 1.1rem;
    color: #374151;
    margin-bottom: 1rem;
}

.btn-search {
    display: inline-block;
    background-color: #0ea5e9;
    color: white;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 5px;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.btn-search:hover {
    background-color: #0284c7;
    text-decoration: none;
    color: white;
}

/* ヘッダーナビゲーションのスタイル */
.header-nav {
    display: flex;
    align-items: center;
    flex-shrink: 0; /* 縮小しないように */
    margin-left: auto; /* 右端に押し出す */
}

.nav-mypage {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: transparent;
    color: white !important;
    text-decoration: none;
    border: 2px solid white;
    border-radius: 50%;
    transition: none; /* ホバーエフェクトを無効化 */
}

.nav-mypage:hover {
    background: transparent;
    color: white !important;
    text-decoration: none;
    transform: none; /* ホバー時の変形を無効化 */
    box-shadow: none; /* ホバー時のシャドウを無効化 */
}

.nav-mypage.active {
    background: rgba(255, 255, 255, 0.2);
    border-color: white;
    color: white !important;
}

.user-icon {
    width: 20px;
    height: 20px;
    color: white !important;
    fill: white !important;
}

.nav-text {
    display: none; /* テキストを常に非表示 */
}

/* ページネーションのスタイル */
.pagination-wrapper {
    margin: 2rem 0;
    text-align: center;
}

.pagination {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: white;
    padding: 1rem;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    border: 1px solid #e5e7eb;
}

.page-btn {
    background: white;
    color: #374151;
    border: 1px solid #d1d5db;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 40px;
    text-align: center;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.page-btn:hover {
    background: #f9fafb;
    border-color: #9ca3af;
    color: #111827;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.page-btn.active {
    background: #0ea5e9;
    color: white;
    border-color: #0ea5e9;
    font-weight: 600;
}

.page-btn.active:hover {
    background: #0284c7;
    border-color: #0284c7;
    transform: translateY(-1px);
}

.page-btn:disabled {
    background: #f3f4f6;
    color: #9ca3af;
    border-color: #e5e7eb;
    cursor: not-allowed;
    opacity: 0.6;
}

.page-btn:disabled:hover {
    transform: none;
    box-shadow: none;
}

.page-ellipsis {
    color: #9ca3af;
    font-weight: 500;
    padding: 0 0.25rem;
    user-select: none;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .pagination {
        gap: 0.25rem;
        padding: 0.75rem;
    }
    
    .page-btn {
        padding: 0.4rem 0.6rem;
        font-size: 0.85rem;
        min-width: 36px;
    }
    
    .page-ellipsis {
        padding: 0 0.1rem;
    }
}