/* =====================================================
   LIVE配信研究所 - ヘッダーCSS
   ===================================================== */

/* ヘッダー - TikTok風 */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 2px solid var(--tiktok-pink);
    box-shadow: 0 0 30px rgba(254, 44, 85, 0.5), 0 4px 20px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    transition: var(--transition);
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
}

.logo-container {
    position: relative;
}

.hologram-logo {
    position: relative;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    text-decoration: none;
    transition: var(--transition);
}

.logo-text {
    font-size: 1.8rem;
    font-weight: 900;
    background: linear-gradient(45deg, var(--tiktok-pink), var(--tiktok-blue), var(--tiktok-pink));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
    z-index: 2;
    text-shadow: var(--tiktok-glow-pink);
}

.logo-glow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--tiktok-pink);
    filter: blur(15px);
    opacity: 0;
    transition: var(--transition);
    z-index: 1;
}

.hologram-logo:hover .logo-glow {
    opacity: 0.3;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 2rem;
}

body.home .nav-item {
    color: var(--tiktok-blue);
    text-decoration: none;
    padding: 0.8rem 1.2rem;
    border-radius: 20px;
    font-weight: 700;
    font-size: 1rem;
    position: relative;
    transition: var(--transition);
    background: rgba(37, 244, 238, 0.1);
    border: 1px solid rgba(37, 244, 238, 0.3);
    text-shadow: 0 0 8px rgba(37, 244, 238, 0.5);
}

body.home .nav-item::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--tiktok-pink);
    transition: var(--transition);
    transform: translateX(-50%);
    box-shadow: var(--tiktok-glow-pink);
}

body.home .nav-item:hover::before {
    width: 80%;
}

body.home .nav-item:hover {
    color: var(--tiktok-pink);
    text-shadow: 0 0 15px rgba(254, 44, 85, 0.8);
    background: rgba(254, 44, 85, 0.15);
    border-color: var(--tiktok-pink);
    transform: translateY(-2px);
}

/* ドロップダウンナビゲーション */
.nav-dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-toggle {
    cursor: pointer;
    user-select: none;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: rgba(0, 0, 0, 0.95);
    border: 1px solid var(--tiktok-cyan);
    border-radius: 10px;
    padding: 0.5rem 0;
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.nav-dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: block;
    padding: 0.8rem 1.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.dropdown-item:hover {
    background: rgba(37, 244, 238, 0.1);
    color: var(--tiktok-cyan);
    border-left-color: var(--tiktok-cyan);
    text-shadow: var(--tiktok-glow-cyan);
}

.dropdown-item.active {
    background: rgba(255, 20, 147, 0.1);
    color: var(--tiktok-pink);
    border-left-color: var(--tiktok-pink);
    text-shadow: var(--tiktok-glow-pink);
}

.chatbot-toggle {
    background: linear-gradient(135deg, var(--tiktok-pink), var(--tiktok-blue));
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    box-shadow: var(--tiktok-glow-mixed);
    font-size: 0.95rem;
}

.chatbot-toggle:hover {
    transform: translateY(-3px);
    box-shadow: var(--tiktok-glow-mixed), 0 8px 25px rgba(254, 44, 85, 0.4);
}

/* PC版でのロボットアイコン非表示 */
@media (min-width: 769px) {
    .desktop-chatbot-toggle::before {
        content: none !important;
    }
}

/* ハンバーガーメニューボタン */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1001;
}

.mobile-menu-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
}

.hamburger-line {
    width: 24px;
    height: 2px;
    background: var(--text-light);
    margin: 2px 0;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.mobile-menu-toggle.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* ナビゲーションメニュー - モバイル対応 */
.nav-overlay {
    display: none;
}

.nav-content {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.mobile-header {
    display: none;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    color: var(--text-light);
    text-decoration: none;
    border-radius: 25px;
    transition: all 0.3s ease;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    white-space: nowrap;
}

.nav-item:hover {
    background: var(--gradient-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.nav-icon {
    font-size: 1rem;
}

.nav-text {
    display: inline;
}

/* タッチデバイス用の調整 */
.touch-device .nav-item:hover {
    transform: none;
    box-shadow: none;
}

.touch-device .nav-item:active {
    background: var(--gradient-primary);
    transform: scale(0.95);
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    /* ヘッダー調整 */
    .site-header {
        padding: 0.8rem 0;
        backdrop-filter: blur(15px);
    }
    
    .header-container {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0 1rem;
        position: relative;
    }
    
    /* ハンバーガーメニューボタン - 左側固定 */
    .mobile-menu-toggle {
        display: flex !important;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        order: 1;
        margin-right: auto;
        background: rgba(254, 44, 85, 0.95) !important; /* 明るいピンク背景 */
        border: 2px solid #fe2c55 !important; /* 明確なピンク枠 */
        box-shadow: 0 4px 20px rgba(254, 44, 85, 0.5) !important; /* グロー効果 */
        z-index: 99999 !important;
        position: relative !important;
        width: 46px;
        height: 46px;
        padding: 8px;
        border-radius: 12px;
        cursor: pointer;
        gap: 3px;
        transition: all 0.3s ease !important;
    }
    
    .mobile-menu-toggle:hover {
        background: rgba(254, 44, 85, 1) !important;
        box-shadow: 0 6px 25px rgba(254, 44, 85, 0.7) !important;
        transform: scale(1.05) !important;
    }
    
    /* ハンバーガーラインスタイル */
    .hamburger-line {
        width: 22px;
        height: 2.5px;
        background: #ffffff !important;
        display: block !important;
        transition: all 0.3s ease !important;
        border-radius: 2px;
        box-shadow: 0 1px 2px rgba(0,0,0,0.3) !important; /* ラインに影を追加 */
    }
    
    .mobile-menu-toggle.active .hamburger-line:nth-child(1) {
        transform: rotate(45deg) translate(6px, 6px);
        background: var(--primary-pink) !important;
    }
    
    .mobile-menu-toggle.active .hamburger-line:nth-child(2) {
        opacity: 0;
        transform: scale(0);
    }
    
    .mobile-menu-toggle.active .hamburger-line:nth-child(3) {
        transform: rotate(-45deg) translate(6px, -6px);
        background: var(--primary-pink) !important;
    }
    
    /* ロゴ - 中央配置（ハンバーガーボタンを考慮した微調整） */
    .site-logo {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        font-size: 1.2rem;
        font-weight: 700;
        order: 2;
        z-index: 10;
        margin-left: 0; /* ハンバーガーボタン幅の半分を補正 */
        white-space: nowrap; /* 改行防止 */
    }
    
    /* デスクトップナビゲーションを非表示 */
    .desktop-nav {
        display: none !important;
    }
    
    /* ナビゲーションメニュー - モバイル版の修正 */
    .nav-menu {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: transparent;
        z-index: 1000;
        opacity: 0;
        visibility: hidden;
        transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
        pointer-events: none;
    }
    
    .nav-menu.active {
        opacity: 1;
        visibility: visible;
        pointer-events: all;
    }
    
    .nav-overlay {
        display: block;
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.85);
        backdrop-filter: blur(10px);
        opacity: 0;
        transition: opacity 0.4s ease;
    }
    
    .nav-menu.active .nav-overlay {
        opacity: 1;
    }
    
    .nav-content {
        position: absolute;
        top: 0;
        left: 0;
        width: 300px;
        height: 100%;
        background: rgba(10, 10, 10, 0.98);
        backdrop-filter: blur(25px);
        border-right: 1px solid rgba(255, 255, 255, 0.15);
        display: flex;
        flex-direction: column;
        padding: 0;
        transform: translateX(-100%);
        transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5);
    }
    
    .nav-menu.active .nav-content {
        transform: translateX(0);
    }
    
    .mobile-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 1rem 1.2rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        background: rgba(255, 255, 255, 0.02);
    }
    
    .mobile-logo {
        font-size: 1rem;
        font-weight: 700;
        background: var(--gradient-primary);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
    }
    
    .mobile-close {
        width: 36px;
        height: 36px;
        background: none;
        border: none;
        color: var(--text-light);
        font-size: 1.4rem;
        cursor: pointer;
        border-radius: 8px;
        transition: all 0.3s ease;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .mobile-close:hover {
        background: rgba(255, 255, 255, 0.1);
        color: var(--primary-pink);
    }
    
    .nav-links {
        flex-direction: column;
        gap: 0;
        padding: 0.5rem 0;
        overflow-y: auto;
        flex: 1;
    }
    
    .nav-item {
        width: 100%;
        padding: 0.8rem 1.2rem;
        border-radius: 0;
        justify-content: flex-start;
        font-size: 0.9rem;
        font-weight: 500;
        opacity: 0;
        transform: translateX(30px);
        animation: slideInFromRight 0.5s ease forwards;
        transition: all 0.3s ease;
    }
    
    .nav-item:nth-child(1) { animation-delay: 0.1s; }
    .nav-item:nth-child(2) { animation-delay: 0.2s; }
    .nav-item:nth-child(3) { animation-delay: 0.3s; }
    .nav-item:nth-child(4) { animation-delay: 0.4s; }
    .nav-item:nth-child(5) { animation-delay: 0.5s; }
    .nav-item:nth-child(6) { animation-delay: 0.6s; }
    
    .nav-item:hover,
    .nav-item:active {
        background: rgba(255, 255, 255, 0.08);
        transform: translateX(0);
        box-shadow: none;
        color: var(--primary-blue);
    }
    
    .nav-icon {
        font-size: 1.1rem;
        width: 24px;
        text-align: center;
    }
    
    .nav-text {
        flex: 1;
        font-size: 0.9rem;
    }
    
    /* ドロップダウンメニュー - モバイル版 */
    .dropdown-menu {
        position: static;
        background: rgba(255, 255, 255, 0.05);
        box-shadow: none;
        border: none;
        border-radius: 0;
        padding: 0;
        margin: 0;
        min-width: auto;
        transform: none;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }
    
    .dropdown-menu.active {
        max-height: 300px;
    }
    
    .dropdown-item {
        padding: 0.75rem 2.5rem;
        font-size: 0.9rem;
    }
    
    .dropdown-arrow {
        margin-left: auto;
    }
    
    /* メニューが開いている時のbody固定 */
    html.menu-open,
    body.menu-open {
        overflow: hidden;
        height: 100%;
    }
}

/* デスクトップ用ヘッダーレイアウト */
@media (min-width: 769px) {
    /* モバイル専用要素を非表示 */
    .mobile-menu-toggle,
    .nav-menu {
        display: none !important;
    }
    
    /* デスクトップナビゲーションを表示 */
    .desktop-nav {
        display: flex !important;
    }
    
    /* ヘッダーコンテナのデスクトップレイアウト */
    .header-container {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    /* ロゴをデスクトップ用にリセット */
    .site-logo {
        position: static !important;
        transform: none !important;
        order: 0;
        margin: 0;
    }
}

/* アニメーション */
@keyframes slideInFromRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* アクセシビリティ対応 */
.nav-item:focus,
.mobile-menu-toggle:focus,
.mobile-close:focus,
.dropdown-item:focus {
    outline: 2px solid var(--primary-blue);
    outline-offset: 2px;
}

/* 高コントラストモード対応 */
@media (prefers-contrast: high) {
    .nav-item {
        border: 1px solid rgba(255, 255, 255, 0.3);
    }
    
    .nav-item:hover {
        border-color: var(--primary-blue);
    }
}

/* 動きを減らす設定に対応 */
@media (prefers-reduced-motion: reduce) {
    .nav-menu,
    .nav-content,
    .nav-item,
    .dropdown-menu,
    .mobile-menu-toggle,
    .hamburger-line {
        transition: none;
        animation: none;
    }
}

/* パフォーマンス最適化 */
.nav-menu,
.nav-content,
.nav-overlay {
    will-change: transform, opacity;
}

.mobile-menu-toggle.active {
    will-change: transform;
}

/* タッチ操作の最適化 */
.nav-item,
.mobile-menu-toggle,
.mobile-close,
.dropdown-item {
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

/* スクロール最適化 */
.nav-links {
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

.nav-links::-webkit-scrollbar {
    width: 4px;
}

.nav-links::-webkit-scrollbar-track {
    background: transparent;
}

.nav-links::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
}
