/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
    width: 100%;
    position: relative;
}

body {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    width: 100%;
    min-width: 320px;
    overflow-x: hidden;
    position: relative;
}

/* カラーパレット */
:root {
    --primary-color: #FF9EC8;
    --secondary-color: #B98EE0;
    --accent-color: #F5A623;
    --text-color: #333333;
    --bg-light: #F8F9FA;
    --bg-dark: #2C3E50;
}

/* Header styles */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.98);
    padding: 1rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    transition: transform 0.3s ease;
}

.header.scroll-down {
    transform: translateY(-100%);
}

.header.scroll-up {
    transform: translateY(0);
}

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

.logo h1 {
    color: var(--primary-color);
    font-size: 2.5rem;
    font-weight: 700;
}

.nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    height: 100vh;
    width: 300px;
    background: white;
    padding: 60px 2rem 2rem;
    transition: right 0.3s ease;
    flex-direction: column;
    justify-content: flex-start;
    gap: 1.5rem;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.2);
    z-index: 1000;
}

.nav-links li {
    list-style: none;
}

.nav-links a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    transition: color 0.3s;
    font-size: 1.1rem;
    display: block;
    padding: 0.5rem 0;
}

.nav-links a:hover {
    color: var(--primary-color);
}

.nav-close-button {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--primary-color);
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    z-index: 1001;
}

.nav-close-button:hover {
    background: var(--secondary-color);
    transform: scale(1.1);
}

.mobile-menu-button {
    display: block;
    font-size: 1.5rem;
    cursor: pointer;
    background: none;
    border: none;
    color: var(--primary-color);
    padding: 8px;
    transition: color 0.3s ease;
}

.mobile-menu-button:hover {
    color: var(--secondary-color);
}

.nav-links.active {
    right: 0;
}

/* Hero section */
.hero {
    height: 100vh;
    background: linear-gradient(135deg, #FF9EC8, #B98EE0);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    padding: 0 2rem;
    position: relative;
    margin-top: 80px; /* ヘッダーの高さ分のみ確保 */
}

/* バブル装飾 */
.bubble {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(2px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    box-shadow: 
        inset 0 0 20px rgba(255, 255, 255, 0.2),
        0 0 15px rgba(255, 255, 255, 0.1);
    max-width: 100px;
    max-height: 100px;
}

.bubble-1 {
    width: 15vw;
    height: 15vw;
    top: 10%;
    right: 15%;
    animation: floatBubble 8s infinite ease-in-out;
}

.bubble-2 {
    width: 10vw;
    height: 10vw;
    top: 20%;
    right: 25%;
    animation: floatBubble 6s infinite ease-in-out -2s;
}

.bubble-3 {
    width: 12vw;
    height: 12vw;
    bottom: 15%;
    left: 10%;
    animation: floatBubble 7s infinite ease-in-out -1s;
}

.bubble-4 {
    width: 8vw;
    height: 8vw;
    bottom: 25%;
    left: 20%;
    animation: floatBubble 5s infinite ease-in-out -3s;
}

/* リボン装飾 */
.ribbon {
    position: absolute;
    background: rgba(255, 255, 255, 0.15);
    transform-origin: center;
}

.ribbon-1 {
    width: 200px;
    height: 40px;
    top: -20px;
    right: -40px;
    transform: rotate(45deg);
    animation: waveRibbon 12s infinite ease-in-out;
}

.ribbon-2 {
    width: 160px;
    height: 30px;
    bottom: -15px;
    left: -30px;
    transform: rotate(-45deg);
    animation: waveRibbon 10s infinite ease-in-out reverse;
}

/* デコレーティブな要素 */
.decoration {
    position: absolute;
    width: 15px;
    height: 15px;
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(45deg);
}

.decoration-1 {
    top: 25%;
    right: 10%;
    animation: sparkle 4s infinite ease-in-out;
}

.decoration-2 {
    bottom: 20%;
    left: 15%;
    animation: sparkle 4s infinite ease-in-out -2s;
}

/* アニメーション定義 */
@keyframes floatBubble {
    0%, 100% {
        transform: translate(0, 0) scale(1);
        opacity: 0.6;
    }
    50% {
        transform: translate(-5px, -20px) scale(1.1);
        opacity: 0.8;
    }
}

@keyframes waveRibbon {
    0%, 100% {
        transform: rotate(45deg) translate(0, 0);
    }
    50% {
        transform: rotate(45deg) translate(-10px, -20px) scaleX(1.1);
    }
}

@keyframes sparkle {
    0%, 100% {
        transform: rotate(45deg) scale(1);
        opacity: 0.3;
    }
    50% {
        transform: rotate(225deg) scale(1.2);
        opacity: 0.6;
    }
}

/* ヒーローリボン */
.hero-ribbon {
    position: absolute;
    width: 100%;
    height: 120%; /* 高さを増やして上部まで表示 */
    top: -10%; /* 上部にはみ出すように配置 */
    left: 0;
    object-fit: cover;
    z-index: 2;
    pointer-events: none;
    animation: floatHeroRibbon 4s ease-in-out infinite;
    content: url('https://dairy-chan.com/images/bigsukeribon.png');
}

@keyframes floatHeroRibbon {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.hero-content {
    position: relative;
    z-index: 3;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
}

.hero-content h2 {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
    animation: fadeInUp 1s ease-out;
}

.hero-content p {
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    animation: fadeInUp 1s ease-out 0.3s;
    opacity: 0;
    animation-fill-mode: forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Topics section */
.topics {
    padding: 5rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.topic-item {
    margin-bottom: 2rem;
    padding: 2rem;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.topic-item:hover {
    transform: translateX(10px);
}

.topic-item h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.date {
    color: #666;
    font-size: 0.9rem;
}

/* About section */
.about {
    padding: 5rem 2rem;
    background: #f9f9f9;
    text-align: center;
}

.about-content {
    max-width: 800px;
    margin: 0 auto;
}

.about h3 {
    text-align: center;
    font-size: 2.2rem;
    margin-bottom: 3rem;
    position: relative;
}

.about h3::after {
    content: '';
    display: block;
    width: 50px;
    height: 3px;
    background: #ff6b6b;
    margin: 1rem auto;
}

/* Features section */
.features {
    padding: 5rem 2rem;
    background: var(--bg-light);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.feature-item {
    text-align: center;
    padding: 2.5rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Shop section */
.shop {
    padding: 5rem 2rem;
    background: #f9f9f9;
    text-align: center;
}

/* News section */
.news {
    padding: 5rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.news-more {
    display: inline-block;
    padding: 1rem 2rem;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 4px;
    margin-top: 2rem;
    transition: background 0.3s;
}

.news-more:hover {
    background: var(--secondary-color);
}

/* Footer */
.footer {
    padding: 3rem 2rem;
    background: var(--bg-dark);
    color: white;
    text-align: center;
}

.social-links {
    margin-bottom: 1rem;
}

.social-links a {
    color: white;
    font-size: 1.8rem;
    margin: 0 1rem;
    transition: color 0.3s;
}

.social-links a:hover {
    color: var(--secondary-color);
}

/* Responsive design */
@media (max-width: 768px) {
    html, body {
        overflow-x: hidden;
        width: 100%;
        position: relative;
    }

    .container, 
    .hero, 
    .about,
    .features,
    .news,
    .howto,
    .shop,
    .footer {
        width: 100%;
        max-width: 100%;
        padding-left: 1rem;
        padding-right: 1rem;
        margin-left: 0;
        margin-right: 0;
        box-sizing: border-box;
        overflow: hidden;
    }

    .about-content,
    .features-grid,
    .news-item,
    .steps-container,
    .hero-content {
        width: 100%;
        max-width: 100%;
        padding: 0;
        margin-left: auto;
        margin-right: auto;
        box-sizing: border-box;
    }

    .hero {
        height: 70vh;
        margin-top: 60px;
        position: relative;
    }

    .hero-ribbon {
        content: url('https://dairy-chan.com/images/minisukeribon.png');
        width: 100%;
        height: auto;
        max-height: 120%;
        top: 10%;
        left: 0;
        transform: none;
    }

    .bubble {
        max-width: 60px;
        max-height: 60px;
    }

    .bubble-1 { right: 5%; }
    .bubble-2 { right: 15%; }
    .bubble-3 { left: 5%; }
    .bubble-4 { left: 15%; }

    @keyframes floatBubble {
        0%, 100% {
            transform: translate(0, 0) scale(1);
        }
        50% {
            transform: translate(-5px, -10px) scale(1.1);
        }
    }

    .floating-mascot {
        bottom: 0;
        left: 10px;
        width: 120px;
        transform: none;
    }

    .floating-mascot img {
        width: 120px;
        max-width: 100%;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .steps-container {
        grid-template-columns: 1fr;
    }

    .step {
        padding: 1.5rem;
    }

    .feature-item.with-image {
        flex-direction: column;
        text-align: center;
    }

    .feature-image {
        max-width: 150px;
        margin-top: 1.5rem;
    }

    .nav {
        width: 100%;
        padding: 0 1rem;
        box-sizing: border-box;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        height: 100vh;
        width: 80%;
        background: white;
        padding: 60px 2rem 2rem;
        transition: right 0.3s ease;
        flex-direction: column;
        justify-content: flex-start;
        gap: 1.5rem;
        box-shadow: -2px 0 10px rgba(0, 0, 0, 0.2);
        z-index: 1000;
    }

    .nav-close-button {
        display: flex;
    }

    .nav-links.active {
        right: 0;
    }

    .mobile-menu-button {
        display: block;
        font-size: 1.5rem;
        cursor: pointer;
        background: none;
        border: none;
        color: var(--primary-color);
        padding: 8px;
    }
}

/* Section headers */
section h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    position: relative;
}

section h2::after {
    content: '';
    display: block;
    width: 50px;
    height: 3px;
    background: #ff6b6b;
    margin: 1rem auto;
}

/* Language select */
.language-select select {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    cursor: pointer;
}

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

.fade-in {
    animation: fadeIn 0.8s ease-out forwards;
}

/* ヘッダーのスクロールアニメーション */
.header {
    transition: transform 0.3s ease;
}

.header.scroll-down {
    transform: translateY(-100%);
}

.header.scroll-up {
    transform: translateY(0);
}

/* ホバーエフェクト */
.feature-item {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.feature-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.topic-item {
    transition: transform 0.3s ease;
}

.topic-item:hover {
    transform: translateX(10px);
}

/* ニュースアイテムのスタイル */
.news-item {
    padding: 2rem;
    margin-bottom: 1.5rem;
    border-left: 4px solid var(--primary-color);
    background: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.news-item:hover {
    transform: translateX(10px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.news-item h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: #333;
}

.news-item p {
    color: #666;
    margin-bottom: 0.5rem;
}

/* ローディングアニメーション */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.loading {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 1000px 100%;
    animation: shimmer 2s infinite linear;
}

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

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #ff6b6b;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #ff5252;
}

/* フォーカス状態のスタイル */
a:focus, button:focus, select:focus {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
}

/* 使い方セクション */
.howto {
    padding: 5rem 2rem;
    background: white;
}

.steps-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.step {
    text-align: center;
    padding: 2rem;
    position: relative;
}

.step-number {
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin: 0 auto 1.5rem;
}

.step h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.step p {
    color: #666;
}

.step:hover .step-number {
    transform: scale(1.1);
    transition: transform 0.3s ease;
}

.register-button {
    display: inline-block;
    margin-top: 1rem;
    padding: 0.8rem 2rem;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.register-button:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

@media (max-width: 768px) {
    .register-button {
        padding: 0.7rem 1.5rem;
        font-size: 0.9rem;
    }
}

/* フローティング画像 */
@keyframes floatingAnimation {
    0% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-15px);
    }
    100% {
        transform: translateY(0);
    }
}

.floating-mascot {
    position: fixed;
    bottom: 0;
    left: 30px;
    z-index: 1000;
    animation: floatingAnimation 3s ease-in-out infinite;
    max-width: 100%;
    box-sizing: border-box;
}

.floating-mascot.hidden {
    display: none;
}

.floating-mascot img {
    width: 200px;
    height: auto;
    filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.2));
    pointer-events: none;
    max-width: 100%;
}

.close-button {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
    z-index: 1001;
    pointer-events: auto;
}

.close-button:hover {
    background: rgba(0, 0, 0, 0.9);
}

/* モバイル対応 */
@media (max-width: 768px) {
    .floating-mascot {
        bottom: 0;
        left: 10px;
        width: 120px;
    }

    .floating-mascot img {
        width: 120px;
        max-width: 100%;
    }

    /* 全体のコンテンツ幅を制御 */
    body {
        overflow-x: hidden;
        width: 100%;
    }

    .hero, 
    .about,
    .features,
    .news,
    .howto,
    .shop {
        width: 100%;
        padding-left: 1rem;
        padding-right: 1rem;
        box-sizing: border-box;
    }

    .about-content,
    .features-grid,
    .news-item,
    .steps-container {
        width: 100%;
        max-width: 100%;
        margin-left: auto;
        margin-right: auto;
        box-sizing: border-box;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        height: 100vh;
        width: 80%;
        background: white;
        padding: 60px 2rem 2rem;
        transition: right 0.3s ease;
        flex-direction: column;
        justify-content: flex-start;
        gap: 1.5rem;
        box-shadow: -2px 0 10px rgba(0, 0, 0, 0.2);
        z-index: 1000;
    }

    .nav-close-button {
        display: flex;
    }

    .nav-links.active {
        right: 0;
    }

    .mobile-menu-button {
        display: block;
        font-size: 1.5rem;
        cursor: pointer;
        background: none;
        border: none;
        color: var(--primary-color);
        padding: 8px;
    }
}

.nav-register {
    color: var(--primary-color) !important;
    font-weight: bold;
    padding: 8px 16px !important;
    border: 2px solid var(--primary-color);
    border-radius: 20px;
    transition: all 0.3s ease;
}

.nav-register:hover {
    background-color: var(--primary-color);
    color: white !important;
}

/* モバイル対応 */
@media (max-width: 768px) {
    .nav-register {
        margin: 10px 0;
        text-align: center;
        display: inline-block;
    }
} 

