/* ========== BCHA Lab 銀河背景スタイル ========== */

/* カラーパレット更新 */
:root {
    /* 宇宙・銀河テーマカラー */
    --galaxy-dark: #0a0e27;
    --galaxy-medium: #151b3d;
    --galaxy-light: #1e2749;
    --star-white: #ffffff;
    --nebula-purple: #8b5cf6;
    --nebula-blue: #3b82f6;
    --nebula-cyan: #06b6d4;
    --cosmic-pink: #ec4899;
    --cosmic-orange: #f97316;
    
    /* グラデーション */
    --galaxy-gradient: linear-gradient(135deg, var(--galaxy-dark) 0%, var(--galaxy-medium) 50%, var(--galaxy-light) 100%);
    --nebula-gradient: radial-gradient(circle at 30% 50%, rgba(139, 92, 246, 0.1) 0%, transparent 50%);
}

/* 全体の背景を宇宙に */
body {
    background: var(--galaxy-dark) !important;
    color: var(--star-white) !important;
    position: relative;
    overflow-x: hidden;
}

/* 全体のテキスト色を強制適用 */
* {
    color: inherit;
}

body * {
    color: var(--star-white) !important;
}

/* グラデーションテキストは例外 */
.hero-title .highlight {
    -webkit-text-fill-color: transparent !important;
    color: transparent !important;
}

/* 銀河背景エフェクト */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 80%, rgba(139, 92, 246, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(59, 130, 246, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(236, 72, 153, 0.1) 0%, transparent 50%),
        var(--galaxy-gradient);
    z-index: -2;
}

/* 星のアニメーション */
@keyframes twinkle {
    0%, 100% { opacity: 0; }
    50% { opacity: 1; }
}

@keyframes float {
    0%, 100% { transform: translateY(0) translateX(0); }
    33% { transform: translateY(-10px) translateX(5px); }
    66% { transform: translateY(5px) translateX(-5px); }
}

/* 星を生成 */
.stars {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

.star {
    position: absolute;
    width: 2px;
    height: 2px;
    background: var(--star-white);
    border-radius: 50%;
    animation: twinkle 3s infinite;
}

/* JavaScript で動的に生成される星用のクラス */
.star-small {
    width: 1px;
    height: 1px;
    animation-duration: 4s;
}

.star-medium {
    width: 2px;
    height: 2px;
    animation-duration: 3s;
}

.star-large {
    width: 3px;
    height: 3px;
    animation-duration: 2s;
    box-shadow: 0 0 6px rgba(255, 255, 255, 0.8);
}

/* セクション背景の調整 */
section {
    background: rgba(10, 14, 39, 0.5) !important;
    position: relative;
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* 個別セクションの背景強化 */
.about {
    background: rgba(21, 27, 61, 0.9) !important;
    backdrop-filter: blur(15px);
}

.projects {
    background: rgba(30, 39, 73, 0.8) !important;
    backdrop-filter: blur(15px);
}

.line-notify-buddy {
    background: rgba(10, 14, 39, 0.9) !important;
    backdrop-filter: blur(15px);
}

.download {
    background: rgba(21, 27, 61, 0.9) !important;
    backdrop-filter: blur(15px);
}

.contact {
    background: rgba(30, 39, 73, 0.8) !important;
    backdrop-filter: blur(15px);
}

/* 全セクションのテキスト強化 */
section h1,
section h2,
section h3,
section h4,
section h5,
section h6,
section p,
section li,
section span,
section div {
    color: var(--star-white) !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.7);
}

/* サブタイトルの色を少し暗く */
.section-subtitle {
    color: rgba(255, 255, 255, 0.85) !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.7);
}

/* ナビゲーションバー */
.navbar {
    background: rgba(10, 14, 39, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.navbar.scrolled {
    background: rgba(10, 14, 39, 0.95);
    box-shadow: 0 4px 30px rgba(139, 92, 246, 0.2);
}

/* ナビゲーションブランドの視認性向上（テキストのみ） */
.nav-brand {
    display: flex !important;
    align-items: center !important;
}

.nav-title {
    color: var(--star-white) !important;
    font-weight: 700 !important;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8) !important;
    font-size: 1.8rem !important;
    letter-spacing: 0.5px !important;
    background: linear-gradient(135deg, var(--star-white) 0%, var(--nebula-blue) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transition: all var(--transition-fast);
}

.nav-brand a {
    display: flex !important;
    align-items: center !important;
    text-decoration: none !important;
    color: inherit !important;
}

.nav-brand a:hover .nav-title {
    background: linear-gradient(135deg, var(--nebula-purple) 0%, var(--nebula-cyan) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transform: scale(1.05);
}

/* フッターロゴテキスト */
.footer-logo-text {
    color: var(--star-white) !important;
    font-weight: 700 !important;
    font-size: 1.5rem !important;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8) !important;
    margin-bottom: 0.5rem !important;
    background: linear-gradient(135deg, var(--star-white) 0%, var(--nebula-blue) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ヒーローセクション */
.hero {
    background: transparent;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.2) 0%, transparent 70%);
    animation: float 20s ease-in-out infinite;
}

/* カード要素の背景 */
.feature-card,
.project-card,
.download-box,
.contact-form-container,
.about-content,
.research-item,
.app-feature,
.contact-item {
    background: rgba(30, 39, 73, 0.9) !important;
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* カード内のテキスト強化 */
.feature-card h3,
.feature-card p,
.project-card h3,
.project-card p,
.app-feature h3,
.app-feature p,
.contact-item h4,
.contact-item p {
    color: var(--star-white) !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.feature-card:hover,
.project-card:hover,
.research-item:hover {
    background: rgba(30, 39, 73, 0.8);
    border-color: var(--nebula-purple);
    box-shadow: 0 8px 32px rgba(139, 92, 246, 0.3);
}

/* プライマリーボタン */
.btn-primary {
    background: linear-gradient(135deg, var(--nebula-purple) 0%, var(--nebula-blue) 100%);
    border: none;
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, transparent 70%);
    transform: scale(0);
    transition: transform 0.6s;
}

.btn-primary:hover::before {
    transform: scale(1);
}

/* セカンダリーボタン */
.btn-secondary {
    background: transparent;
    border: 2px solid var(--nebula-purple);
    color: var(--star-white);
}

.btn-secondary:hover {
    background: rgba(139, 92, 246, 0.2);
    border-color: var(--nebula-blue);
}

/* テキストカラー調整 */
.text-primary,
h1, h2, h3, h4, h5, h6 {
    color: var(--star-white) !important;
}

.text-secondary,
p, li, span {
    color: rgba(255, 255, 255, 0.9) !important;
}

/* セクション全体のテキスト強化 */
section h2,
section h3,
section p,
section li {
    color: var(--star-white) !important;
}

/* セクションヘッダーのテキスト強化 */
.section-subtitle {
    color: rgba(255, 255, 255, 0.8) !important;
}

/* セクションヘッダー */
.section-title {
    color: var(--star-white) !important;
    text-shadow: 0 2px 8px rgba(139, 92, 246, 0.5);
    font-weight: 700;
}

/* グラデーションテキストの代替 */
.hero-title .highlight {
    background: linear-gradient(135deg, var(--nebula-purple) 0%, var(--nebula-blue) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* フッター */
.footer {
    background: rgba(10, 14, 39, 0.9);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* モーダル背景 */
.modal {
    background: rgba(10, 14, 39, 0.8);
}

.modal-content {
    background: rgba(30, 39, 73, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* フォーム要素 */
.form-group input,
.form-group select,
.form-group textarea {
    background: rgba(10, 14, 39, 0.8) !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
    color: var(--star-white) !important;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--nebula-purple) !important;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.3) !important;
}

/* フォームラベル */
.form-group label {
    color: var(--star-white) !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* プレースホルダー */
.form-group input::placeholder,
.form-group textarea::placeholder {
    color: rgba(255, 255, 255, 0.5) !important;
}

/* プロジェクトカード特別スタイル */
.project-card.featured {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.3) 0%, rgba(59, 130, 246, 0.3) 100%);
}

/* 流れ星エフェクト */
@keyframes shooting-star {
    0% {
        transform: translateX(-100px) translateY(-100px) rotate(45deg);
        opacity: 1;
    }
    70% {
        opacity: 1;
    }
    100% {
        transform: translateX(1000px) translateY(1000px) rotate(45deg);
        opacity: 0;
    }
}

.shooting-star {
    position: fixed;
    width: 2px;
    height: 100px;
    background: linear-gradient(to bottom, transparent, var(--star-white), transparent);
    animation: shooting-star 3s linear infinite;
    z-index: -1;
}

/* パーティクルエフェクトの更新 */
.hero-particle {
    background: radial-gradient(circle, var(--nebula-purple) 0%, transparent 70%);
    filter: blur(40px);
}

/* スクロールバーのカスタマイズ */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: var(--galaxy-dark);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(to bottom, var(--nebula-purple), var(--nebula-blue));
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(to bottom, var(--nebula-blue), var(--nebula-purple));
}

/* リンクカラー */
a {
    color: var(--nebula-blue) !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

a:hover {
    color: var(--nebula-purple) !important;
    text-shadow: 0 2px 4px rgba(139, 92, 246, 0.5);
}

/* フッターリンク */
.footer a {
    color: rgba(255, 255, 255, 0.8) !important;
}

.footer a:hover {
    color: var(--star-white) !important;
}

/* コードブロック */
code {
    background: rgba(139, 92, 246, 0.1);
    color: var(--nebula-blue);
    border: 1px solid rgba(139, 92, 246, 0.3);
}

/* セキュリティハッシュ表示 */
.security-hash {
    background: rgba(10, 14, 39, 0.8);
    border: 1px solid rgba(139, 92, 246, 0.3);
}

/* Cookie バナー */
.cookie-banner {
    background: rgba(30, 39, 73, 0.95);
    border-top: 2px solid var(--nebula-purple);
}

/* ローディング画面 */
#loading-screen {
    background: var(--galaxy-dark);
}

.loader-circle {
    border-color: rgba(139, 92, 246, 0.2);
    border-top-color: var(--nebula-purple);
}

/* ダウンロードボックス */
.download-box {
    position: relative;
    overflow: hidden;
}

.download-box::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, var(--nebula-purple), var(--nebula-blue), var(--cosmic-pink), var(--nebula-purple));
    border-radius: 20px;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: -1;
}

.download-box:hover::before {
    opacity: 1;
    animation: gradient-rotate 3s linear infinite;
}

@keyframes gradient-rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ブラウザ固有の要素調整 */
select option {
    background: var(--galaxy-dark) !important;
    color: var(--star-white) !important;
}

/* テーブル要素 */
table,
th,
td {
    color: var(--star-white) !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
}

/* 強制的にすべてのテキストを白に */
.container *,
.section-header *,
.hero-text *,
.about-text *,
.project-card *,
.contact-info *,
.download-info * {
    color: var(--star-white) !important;
}

/* 例外：グラデーションテキスト */
.hero-title .highlight,
.section-title.gradient-text {
    -webkit-text-fill-color: transparent !important;
    color: transparent !important;
}

/* 追加のテキストシャドウ */
h1, h2, h3, h4, h5, h6 {
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8) !important;
}

p, li, span {
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6) !important;
}

/* ダークモード調整不要（既に宇宙テーマ） */
@media (prefers-color-scheme: dark) {
    /* 既に暗いテーマなので調整不要 */
}