:root {
    --primary-blue: #0c99ba;
    --primary-blue-lt: #66c2e0;
    --accent-color: #FF6645;
    --accent-color-lt: #FF7A5E;

    --text-dark: #2d3748;
    --text-gray: #718096;
    --border-gray: #e2e8f0;
    --light-blue: #f7fafc;
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    /* ヘッダーの高さを変数で持っておく */
    --header-height: 80px;
}

body {
    /* 固定ヘッダー分だけ下のコンテンツを下げる */
    padding-top: var(--header-height);
}


/* Header Styles */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    align-items: center;
}


.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    text-decoration: none;
}

.logo-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    align-items: center;
    justify-content: center;
}

.logo-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.logo-text {
    font-family: "ab-kikori", "sans-serif";
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-blue);
    letter-spacing: -0.02em;
}

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

.nav-link {
    text-decoration: none;
    color: #333 !important;
    font-weight: 500;
    font-size: 0.95rem;
    position: relative;
    transition: color 0.3s ease;
    padding: 0.5rem 0;
}

.nav-link:hover {
    color: #00C9FF;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #00C9FF, #92FE9D);
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

.cta-button {
    background: linear-gradient(
        135deg,
        var(--primary-blue) 0%,
        var(--primary-blue-lt) 100%
    );
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 20px rgba(12, 153, 186, 0.3);
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(12, 153, 186, 0.4);
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 0.5rem;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: #333;
    margin: 3px 0;
    transition: 0.3s;
    border-radius: 3px;
}



/* --- アカウントメニューのドロップダウンスタイル --- */
.account-menu {
    position: relative;
    margin-left: 1.5rem; /* 他メニューとの間隔 */
}
.account-menu-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: 2px solid transparent;
    border-radius: 50px;
    cursor: pointer;
    padding: 6px 12px;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-dark);
}

.account-menu-toggle:hover {
    background: var(--light-blue);
    border-color: var(--primary-blue-lt);
    transform: translateY(-1px);
}

.account-menu-toggle:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(12, 153, 186, 0.3);
}

/* ゲスト状態のアイコン */
.guest-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--text-gray), #a0aec0);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.guest-text {
    font-size: 0.9rem;
    color: var(--text-gray);
    margin-left: 4px;
}

/* ログイン状態のアバター */
.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-blue-lt));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 1rem;
    position: relative;
    overflow: hidden;
}

.user-avatar .avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.user-avatar .avatar-initial {
    font-size: 1rem;
    font-weight: 600;
}

.online-indicator {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 10px;
    height: 10px;
    background: #48bb78;
    border: 2px solid white;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.8; }
    100% { transform: scale(1); opacity: 1; }
}

.user-name-display {
    font-size: 0.9rem;
    color: var(--text-dark);
    font-weight: 500;
    margin-left: 4px;
}

/* ツールチップ */
.account-tooltip {
    position: absolute;
    bottom: -35px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 1002;
}

.account-tooltip::before {
    content: '';
    position: absolute;
    top: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-bottom: 4px solid rgba(0, 0, 0, 0.8);
}

.account-menu-toggle:hover .account-tooltip,
.account-menu:hover .account-tooltip {
    opacity: 1;
}



.account-menu-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: white;
    border-radius: 16px;
    box-shadow: var(--shadow-xl);
    min-width: 280px;
    padding: 8px;
    z-index: 1001;
    opacity: 0;
    transform: translateY(-10px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    border: 1px solid var(--border-gray);
}

.account-menu-dropdown::before {
    content: '';
    position: absolute;
    top: -8px;
    right: 24px;
    width: 16px;
    height: 16px;
    background: white;
    border: 1px solid var(--border-gray);
    border-bottom: none;
    border-right: none;
    transform: rotate(45deg);
}

.account-menu-dropdown.is-open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}


/* ログイン状態のユーザー情報 */
.dropdown-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border-bottom: 1px solid var(--border-gray);
    margin-bottom: 8px;
}

.user-avatar-large {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-blue-lt));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 1.2rem;
    overflow: hidden;
    flex-shrink: 0;
}

.user-avatar-large .avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.user-info-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.user-name {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 1rem;
}

.user-email {
    color: var(--text-gray);
    font-size: 0.875rem;
}

/* ゲスト状態のウェルカムメッセージ */
.dropdown-welcome {
    padding: 16px;
    text-align: center;
    border-bottom: 1px solid var(--border-gray);
    margin-bottom: 8px;
}

.dropdown-welcome h4 {
    color: var(--text-dark);
    font-size: 1.1rem;
    margin-bottom: 4px;
    font-weight: 600;
}

.dropdown-welcome p {
    color: var(--text-gray);
    font-size: 0.9rem;
}


/* ドロップダウン内の区切り線 */
/* .account-menu-dropdown hr {
    border: none;
    border-top: 1px solid var(--border-gray);
    margin: 0.5rem 0;
} */

/* 各メニュー項目のリンク */
.dropdown-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-dark);
    text-decoration: none;
    font-size: 0.95rem;
    border-radius: 8px;
    transition: all 0.2s ease;
    margin-bottom: 2px;
    position: relative;
    overflow: hidden;
}

.dropdown-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--primary-blue-lt), var(--primary-blue));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.dropdown-link:hover::before {
    opacity: 0.1;
}

.dropdown-link:hover {
    background: var(--light-blue);
    transform: translateX(4px);
}


.dropdown-link i {
    width: 20px;
    text-align: center;
    color: var(--text-gray);
    transition: color 0.2s ease;
    z-index: 1;
    position: relative;
}

.dropdown-link span {
    z-index: 1;
    position: relative;
}

.dropdown-link:hover i {
    color: var(--primary-blue);
}

/* プライマリリンク（ログインボタン） */
.primary-link {
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-blue-lt));
    color: white;
    font-weight: 600;
    box-shadow: var(--shadow-sm);
}

.primary-link i,
.primary-link span {
    color: white;
}

.primary-link::before {
    display: none;
}

.primary-link:hover {
    background: linear-gradient(135deg, var(--primary-blue-lt), var(--primary-blue));
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* ログアウトリンク */
.logout-link,
.logout-link i {
    color: #e53e3e;
}

.logout-link::before {
    background: linear-gradient(135deg, #feb2b2, #fc8181);
}

.logout-link:hover {
    background: #fed7d7;
}

/* ゲスト用のバッジ */
.guest-badge {
    background: var(--accent-color);
    color: white;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 12px;
    margin-left: auto;
    font-weight: 600;
    z-index: 1;
    position: relative;
}

/* 区切り線 */
.dropdown-divider {
    border: none;
    border-top: 1px solid var(--border-gray);
    margin: 8px 0;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .account-menu {
        margin-left: 1rem;
    }
    
    .account-menu-toggle {
        padding: 6px 8px;
    }
    
    .guest-text,
    .user-name-display {
        display: none; /* モバイルではテキストを非表示 */
    }
    
    .account-menu-dropdown {
        min-width: 260px;
        right: -20px;
    }
    
    .account-tooltip {
        display: none; /* モバイルではツールチップを非表示 */
    }
    
    .dropdown-link {
        padding: 14px 16px;
        font-size: 1rem;
    }
}








/* あしびもちゃんポップアップのスタイル */
.asibimo-popup {
    position: absolute;
    z-index: 2000;
    pointer-events: none;
    opacity: 0;
    transform: translateX(-50%) translateY(0) scale(0.8);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.asibimo-popup.show {
    opacity: 1;
    transform: translateX(-50%) translateY(-22px) scale(1);
}

.asibimo-popup.bounce {
    animation: asibimoBouncyBounce 0.6s ease-in-out;
}

.asibimo-character {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    box-shadow: 0 4px 15px rgba(12, 153, 186, 0.3);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);/* 要素の背後にあるすべての描画内容が10px分ソフトにぼかされ、フォアグラウンドのテキストやアイコンが際立つ */
}

/* あしびもちゃんのバウンスアニメーション */
@keyframes asibimoBouncyBounce {
    0% {
        transform: translateX(-50%) translateY(-22px) scale(1);
    }
    25% {
        transform: translateX(-50%) translateY(-37px) scale(1.1) rotate(-3deg);
    }
    50% {
        transform: translateX(-50%) translateY(-47px) scale(1.15) rotate(3deg);
    }
    75% {
        transform: translateX(-50%) translateY(-27px) scale(1.05) rotate(-1deg);
    }
    100% {
        transform: translateX(-50%) translateY(-22px) scale(1) rotate(0deg);
    }
}

/* ホバー時のプルプル効果 */
.asibimo-trigger:hover + .asibimo-popup .asibimo-character,
.asibimo-trigger:hover .asibimo-character {
    animation: asibimoWiggle 0.5s ease-in-out infinite;
}

@keyframes asibimoWiggle {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-3deg) scale(1.05); }
    75% { transform: rotate(3deg) scale(1.05); }
}


/* レスポンシブ対応 */
@media (max-width: 768px) {
    .nav-menu {
        display: none;
    }
    
    .hamburger {
        display: flex;
    }

    .asibimo-character {
        width: 35px;
        height: 35px;
    }
    
    .asibimo-popup {
        transform: translateX(-50%) translateY(0) scale(0.8);
    }
    
    .asibimo-popup.show {
        /* 高さ(35px) + 余白(5px) = 40px */
        transform: translateX(-50%) translateY(-12px) scale(0.85);
    }    
}
