/* ==========================================================
   全体共通・ベースカラー & Glassmorphism変数
   ========================================================== */
:root {
    --bg-color: #0f1220;
    --text-primary: #f8fafc;
    --text-muted: #94a3b8;
    --accent-cyan: #00e5ff;
    --accent-pink: #fe5de9;
    --glass-bg: rgba(30, 41, 59, 0.45);
    --glass-border: rgba(255, 255, 255, 0.15);
    --shadow-light: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-color) !important;
    background-image:
        radial-gradient(circle at 15% 50%, rgba(254, 93, 233, 0.08), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(0, 229, 255, 0.08), transparent 25%) !important;
    background-attachment: fixed !important;
    color: var(--text-primary) !important;
}

/* WordPress (Cocoon等) の白背景コンテナを透明化・上書き */
body .main,
body #main,
body .content,
body .entry-content,
body #content {
    background-color: transparent !important;
    background: transparent !important;
    color: var(--text-primary) !important;
    border: none !important;
    box-shadow: none !important;
}

/* Cocoonデフォルトの暗いテキスト色をダークモード向けに強制上書き */
body,
#main,
#sidebar,
.sidebar,
.widget,
.widget-title,
.entry-content,
.post-meta,
.footer,
h1,
h2,
h3,
h4,
h5,
h6,
.entry-title,
.article h1,
.article h2,
.article h3,
.article h4,
.article h5,
.article h6 {
    color: var(--text-primary) !important;
}

/* リンク色（サイドバーなどのリンクも対象に詳細度をあげる） */
a,
#main a,
#sidebar a,
.sidebar a,
.widget a,
.footer a {
    color: rgba(255, 255, 255, 0.85) !important;
    text-decoration: none;
    transition: color 0.2s ease, text-shadow 0.2s ease;
}

a:hover,
#main a:hover,
#sidebar a:hover,
.sidebar a:hover,
.widget a:hover,
.footer a:hover {
    color: var(--accent-cyan) !important;
    text-decoration: underline;
    text-shadow: 0 0 8px rgba(0, 229, 255, 0.4);
}

/* ==========================================================
   共通UIパーツ (Glassmorphism調カード、ボタン等)
   ========================================================== */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-light);
}

.button-group {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.btn-modern {
    padding: 12px 24px;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.05), rgba(0, 0, 0, 0.2));
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.btn-modern:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.1);
}

.btn-primary {
    background: rgba(0, 229, 255, 0.1);
    border-color: var(--accent-cyan);
    color: var(--text-primary);
    text-shadow: 0 0 5px rgba(0, 229, 255, 0.5);
}

.btn-primary:hover {
    background: var(--accent-cyan);
    color: #000;
    box-shadow: 0 0 15px var(--accent-cyan), 0 0 5px var(--accent-cyan) inset;
    text-shadow: none;
}

.btn-accent {
    background: rgba(254, 93, 233, 0.1);
    border-color: var(--accent-pink);
    color: var(--text-primary);
}

.btn-accent:hover {
    background: var(--accent-pink);
    color: #fff;
    box-shadow: 0 0 15px var(--accent-pink);
}

/* ==========================================================
   共通データテーブル
   ========================================================== */
.table-wrapper {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    background: rgba(0, 0, 0, 0.2);
}

.modern-table {
    width: 100% !important;
    border-collapse: collapse !important;
    text-align: left !important;
    background: transparent !important;
}

.modern-table th {
    background: rgba(15, 23, 42, 0.8) !important;
    color: var(--accent-cyan) !important;
    font-weight: 600 !important;
    padding: 16px !important;
    border-bottom: 1px solid var(--glass-border) !important;
    white-space: nowrap !important;
}

.modern-table td {
    padding: 14px 16px !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
    color: var(--text-primary) !important;
    background: transparent !important;
}

#main table.modern-table tbody tr,
#main table.modern-table tbody tr:nth-of-type(odd),
#main table.modern-table tbody tr:nth-of-type(even),
.modern-table tbody tr,
.modern-table tbody tr:nth-of-type(odd),
.modern-table tbody tr:nth-of-type(even) {
    background-color: transparent !important;
}

.modern-table tbody tr:nth-of-type(2n+1) td {
    background: rgba(255, 255, 255, 0.015) !important;
}

.modern-table tbody tr:nth-of-type(even) td {
    background: transparent !important;
}

.modern-table tbody tr:hover td {
    background: rgba(255, 255, 255, 0.03) !important;
    transition: background 0.2s ease !important;
}

/* バッジスタイル */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--glass-border);
}

.badge.up {
    color: #22c55e;
    border-color: rgba(34, 197, 94, 0.3);
    background: rgba(34, 197, 94, 0.1);
}

.badge.down {
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.3);
    background: rgba(239, 68, 68, 0.1);
}

/* モバイル対応用 */
@media screen and (max-width: 600px) {
    .glass-card {
        padding: 16px;
        margin-bottom: 20px;
    }

    .button-group {
        flex-direction: column;
        gap: 12px;
    }

    .btn-modern {
        width: 100%;
        text-align: center;
        padding: 14px;
    }

    .modern-table th,
    .modern-table td {
        padding: 10px 8px;
        font-size: 0.85rem;
    }

    .badge {
        font-size: 0.7rem;
        padding: 3px 6px;
    }
}

/* ==========================================================
   Cocoonテーマ固有パーツのダークモード・Glassmorphism化
   ========================================================== */
#sidebar .widget,
#sidebar .widget-title,
#sidebar h2,
#sidebar h3,
.sidebar .widget,
.sidebar .widget-title,
.sidebar h2,
.sidebar h3,
/* 追加：パンくずリスト、関連記事、ページャー等 */
.breadcrumb,
.author-info,
.author-box,
.related-entries,
.pager,
.pagination,
.comment-area,
.sns-share,
.sns-follow,
.article h2,
.article h3 {
    background-color: transparent !important;
    background: rgba(15, 23, 42, 0.3) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--glass-border) !important;
    border-left: 1px solid var(--glass-border) !important;
    border-bottom: 1px solid var(--glass-border) !important;
    backdrop-filter: blur(4px);
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 15px;
}

/* ==========================================================
   フッター & SNSボタン内の強制ダーク・透過化
   ========================================================== */
#footer,
.footer,
#footer-in {
    background-color: rgba(15, 23, 42, 0.4) !important;
    background-image: none !important;
    border-top: 1px solid var(--glass-border) !important;
    color: var(--text-primary) !important;
}

/* スキン依存のストライプ柄背景を消去 */
.sns-share-buttons,
.sns-follow-buttons,
.skin-grayish .sns-share-buttons,
.skin-grayish .sns-follow-buttons,
.skin-grayish .article-footer .sns-share-buttons,
.skin-grayish .article-footer .sns-follow-buttons {
    background-image: none !important;
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

/* 白と同化しているSNSボタン自体を半透明のグラス調に */
.sns-buttons a,
.sns-buttons .sns-button {
    background-color: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid var(--glass-border) !important;
    color: var(--text-primary) !important;
    backdrop-filter: blur(4px);
    transition: all 0.3s ease;
}

.sns-buttons a:hover,
.sns-buttons .sns-button:hover {
    background-color: var(--accent-cyan) !important;
    color: #0f1220 !important;
    box-shadow: 0 0 10px rgba(0, 229, 255, 0.6) !important;
    border-color: var(--accent-cyan) !important;
}