@import url('assets/css/style.css');

:root {
    /* シアターテーマの変数を再定義または補完 */
    --primary-color: #d4af37;
    --secondary-color: rgba(212, 175, 55, 0.2);
    --accent-color: #00f2ff;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
}

/* ヘッダーの調整（シアターのスタイルに合わせる） */
header {
    padding: 6rem 1rem 2rem;
    background: none;
    box-shadow: none;
    text-align: center;
}

header h1 {
    font-family: 'M PLUS Rounded 1c', sans-serif;
    font-size: 4rem;
    font-weight: 800;
    background: linear-gradient(to bottom, #fff 20%, #ffc1e3 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 5px 20px rgba(255, 193, 227, 0.3);
    line-height: 1.2;
    filter: drop-shadow(0 0 10px rgba(255, 193, 227, 0.2));
}

header h1 small {
    font-family: 'M PLUS Rounded 1c', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    display: block;
    -webkit-text-fill-color: #ffb7d5;
    opacity: 0.9;
    letter-spacing: 2px;
    margin-bottom: 0.5rem;
}

main {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* タブナビゲーション（シアター風） */
.tab-nav {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.tab-btn {
    background: var(--glass-bg);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    color: var(--text-color);
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    gap: 0.5rem;
    min-width: fit-content;
}

.tab-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
    border-color: var(--primary-color);
}

.tab-btn.active {
    background: linear-gradient(135deg, var(--primary-color), #b8860b);
    color: #000;
    border-color: var(--primary-color);
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.4);
}

/* コンテンツエリア */
.content-area {
    background: var(--card-bg);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    padding: 3rem;
    border-radius: 24px;
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow);
    min-height: 400px;
}

.loading {
    text-align: center;
    color: var(--text-muted);
    font-size: 1.2rem;
}

/* 共通のガラスフレームスタイル */
.group-section,
.investigations-section,
.description-box {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    transition: all 0.3s ease;
}

.group-section {
    padding: 1rem 1.5rem;
    margin-bottom: 1rem;
}

.group-section.level-0 {
    background: rgba(255, 255, 255, 0.07);
    border-left: 6px solid var(--primary-color);
    border-radius: 16px;
    margin-bottom: 1.5rem;
}

.group-section.level-1 {
    background: rgba(255, 255, 255, 0.04);
    border-left: 4px solid #4da6ff;
    margin-top: 1rem;
}

.group-section.level-2 {
    background: rgba(255, 255, 255, 0.02);
    border-left: 3px solid #a6ff4d;
    border-radius: 12px;
    margin-top: 0.8rem;
    padding: 0.8rem 1rem;
}

.group-section:hover {
    border-color: rgba(212, 175, 55, 0.6);
}

.group-container {
    transition: all 0.3s ease-in-out;
    overflow: hidden;
}

.group-section.collapsed>.group-container {
    display: none;
}

.group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
}

.group-section.collapsed .group-header {
    border-bottom: none;
    padding-bottom: 0;
}

.group-name {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.level-1 .group-name {
    font-size: 1.2rem;
    color: #4da6ff;
}

.level-2 .group-name {
    font-size: 1.1rem;
    color: #a6ff4d;
}

.toggle-btn {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-color);
    border: 1px solid var(--glass-border);
    padding: 0.4rem 1rem;
    border-radius: 30px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s;
}

.group-section:not(.collapsed)>.group-header .toggle-btn {
    background: var(--primary-color);
    color: #000;
    border-color: var(--primary-color);
}

.level-2:not(.collapsed)>.group-header .toggle-btn {
    background: #4da6ff;
    color: #000;
    border-color: #4da6ff;
}

.toggle-btn i {
    transition: transform 0.3s;
}

.group-section:not(.collapsed)>.group-header .toggle-btn i {
    transform: rotate(180deg);
}

.article-list {
    list-style: none;
    padding: 1rem 0 0.5rem 1rem;
    display: grid;
    gap: 0.8rem;
    border-left: 2px solid rgba(255, 255, 255, 0.05);
    margin-left: 0.5rem;
}

.article-item {
    background: rgba(255, 255, 255, 0.03);
    padding: 0.8rem 1.2rem;
    border-radius: 12px;
    transition: all 0.3s;
    border: 1px solid var(--glass-border);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.article-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--secondary-color);
    transition: background 0.3s;
}

.article-item:hover {
    transform: translateX(8px);
    background: rgba(255, 255, 255, 0.07);
    border-color: var(--primary-color);
}

.article-item:hover::before {
    background: var(--primary-color);
}

.article-link {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 700;
    font-size: 1rem;
    line-height: 1.4;
    transition: color 0.3s;
}

.article-link:hover {
    color: var(--primary-color);
}

.article-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* スキルタグ */
.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.4rem;
}

.tab-btn .count {
    background: rgba(212, 175, 55, 0.2);
    color: var(--primary-color);
    font-size: 0.75rem;
    padding: 2px 10px;
    border-radius: 20px;
    font-weight: 700;
    border: 1px solid rgba(212, 175, 55, 0.3);
    flex-shrink: 0;
}

.tab-btn.active .count {
    background: rgba(0, 0, 0, 0.1);
    color: #000;
    border-color: rgba(0, 0, 0, 0.2);
}

.skill-tag {
    background: rgba(0, 242, 255, 0.1);
    color: var(--accent-color);
    padding: 0.2rem 0.8rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    border: 1px solid rgba(0, 242, 255, 0.2);
}

.skill-tag:hover {
    background: var(--accent-color);
    color: #000;
    transform: scale(1.05);
}

/* スキルフィルタリング表示 */
.filter-info {
    background: rgba(212, 175, 55, 0.1);
    padding: 1.5rem;
    border-radius: 16px;
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid var(--secondary-color);
}

.clear-filter-btn {
    background: linear-gradient(135deg, #ef5350, #d32f2f);
    color: white;
    border: none;
    padding: 0.5rem 1.2rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: bold;
    transition: all 0.3s;
}

.clear-filter-btn:hover {
    filter: brightness(1.2);
    transform: translateY(-1px);
}

footer {
    margin-top: 5rem;
    border-top: 1px solid var(--glass-border);
    padding: 3rem 1rem;
    text-align: center;
    color: var(--text-muted);
}

@media (max-width: 600px) {
    .tab-btn {
        flex: 1 1 45%;
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }

    .content-area {
        padding: 1rem 0.8rem;
    }

    /* フォルダ階層の余白調整 */
    .group-section {
        padding: 0.8rem 0.8rem;
    }

    .group-section.level-0 {
        padding: 0.8rem 0.8rem;
        border-left-width: 4px;
    }

    .group-section.level-1 {
        padding: 0.8rem 0.6rem;
        border-left-width: 3px;
        margin-left: 0.2rem;
    }

    .group-section.level-2 {
        padding: 0.6rem 0.5rem;
        border-left-width: 2px;
        margin-left: 0.2rem;
    }

    .group-header {
        gap: 0.5rem;
    }

    .group-name {
        font-size: 1.1rem;
        gap: 0.5rem;
        word-break: break-all;
    }

    .level-1 .group-name {
        font-size: 1rem;
    }

    .level-2 .group-name {
        font-size: 0.95rem;
    }

    .toggle-btn {
        padding: 0.3rem 0.6rem;
        font-size: 0.75rem;
        min-width: fit-content;
    }

    .article-list {
        padding-left: 0.5rem;
        margin-left: 0.2rem;
    }

    .article-item {
        padding: 0.6rem 0.8rem;
    }

    .article-link {
        font-size: 0.95rem;
    }
}

/* 290pxなどの極端に狭い画面向けの調整 */
@media (max-width: 320px) {
    .content-area {
        padding: 0.8rem 0.4rem;
    }

    .group-section {
        padding: 0.5rem 0.3rem;
        margin-left: 0.1rem;
    }

    .group-section.level-0 {
        padding: 0.5rem 0.3rem;
        border-left-width: 3px;
    }

    .group-section.level-1 {
        padding: 0.4rem 0.2rem;
        border-left-width: 2px;
        margin-left: 0.1rem;
    }

    .group-section.level-2 {
        padding: 0.4rem 0.2rem;
        border-left-width: 1px;
        margin-left: 0.1rem;
    }

    .group-name {
        font-size: 0.95rem;
        gap: 0.3rem;
        word-break: break-all;
    }

    .level-1 .group-name {
        font-size: 0.9rem;
    }

    .level-2 .group-name {
        font-size: 0.85rem;
    }

    .toggle-btn {
        padding: 0.2rem 0.4rem;
        font-size: 0.7rem;
        gap: 0.2rem;
        min-width: 60px;
        justify-content: center;
    }

    .article-list {
        padding-left: 0.3rem;
        margin-left: 0.1rem;
    }

    .article-item {
        padding: 0.5rem 0.5rem;
    }

    .article-link {
        font-size: 0.85rem;
    }

    .group-name i {
        font-size: 0.8rem;
    }
}

/* -----------------------------------------
   Portal Layout (Hero & Grid)
----------------------------------------- */
.portal-container {
    max-width: 1000px;
    margin: -1rem auto 3rem;
    padding: 0 1rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* リンクカード共通 */
.portal-card {
    text-decoration: none;
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-radius: 24px;
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.portal-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.5);
    border-color: var(--primary-color);
}

.portal-card-content {
    padding: 2.5rem;
    z-index: 2;
    background: linear-gradient(to right, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.4) 60%, rgba(0,0,0,0) 100%);
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* メインヒーロー: アメブロアーカイブ */
.hero-card {
    height: 320px;
    background: #111; /* fallback */
    background-image: linear-gradient(135deg, rgba(212, 175, 55, 0.2), rgba(0, 0, 0, 0.8)), url('assets/img/hero_ameblo.webp');
    background-size: cover;
    background-position: center;
}

.hero-card .portal-title {
    font-size: 2.4rem;
    font-family: 'Outfit', 'M PLUS Rounded 1c', sans-serif;
    font-weight: 900;
    margin-bottom: 0.8rem;
    background: linear-gradient(to right, #fff, var(--primary-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* サブヒーロー: マップ調査 */
.sub-hero-card {
    height: 200px;
    background: #111;
    background-image: linear-gradient(135deg, rgba(77, 166, 255, 0.2), rgba(0, 0, 0, 0.8)), url('assets/img/hero_map.webp');
    background-size: cover;
    background-position: center;
}

.sub-hero-card .portal-title {
    font-size: 1.8rem;
    font-weight: 800;
    color: #4da6ff;
    margin-bottom: 0.5rem;
}

/* その他ツールのグリッド */
.portal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.2rem;
}

.grid-item {
    height: 160px;
    background: rgba(255, 255, 255, 0.05);
    -webkit-backdrop-filter: blur(15px);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.grid-item .portal-card-content {
    background: linear-gradient(to top, rgba(0,0,0,0.6) 0%, rgba(0,0,0,0.2) 100%);
    padding: 1.5rem;
}

.grid-item .portal-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #fff;
}

.portal-desc {
    font-size: 0.95rem;
    color: #ddd;
    line-height: 1.5;
    max-width: 90%;
}

.hero-card .portal-desc { font-size: 1.1rem; color: #eee; }

.portal-badge {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    padding: 0.4rem 1.2rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 800;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    z-index: 3;
}

/* 既存セクションの非表示化（HTML側でも消すが安全のため） */
.investigations-section {
    display: none;
}

/* レスポンシブ調整 */
@media (max-width: 600px) {
    .portal-container { gap: 1rem; margin-top: 0; }
    .hero-card { height: 260px; }
    .hero-card .portal-title { font-size: 1.8rem; }
    .sub-hero-card { height: 180px; }
    .sub-hero-card .portal-title { font-size: 1.4rem; }
    .portal-card-content { padding: 1.5rem; }
    .portal-desc { max-width: 100%; font-size: 0.85rem; }
    .portal-grid { grid-template-columns: 1fr; }
}