/* ========================================
   フルワイドセクション用CSS
   薬学生ポータルサイト - fullwidth-sections.css
   作成日: 2025-07-18
   
   目的: 各サービスを魅力的に紹介する
   全幅セクションのスタイル定義
   ======================================== */

/* ========================================
   共通スタイル
   ======================================== */

/* 基本セクション構造 */
.service-section {
    padding: 80px 0;
    position: relative;
    overflow: hidden;
    min-height: 100vh;
}

/* 各セクションの重なり順序を明確に定義 */
.service-okusuri {
    z-index: 1;
}

.service-game {
    z-index: 2;
}

.service-timer {
    z-index: 3;
}

/* レイアウトグリッド */
.service-layout {
    display: grid;
    grid-template-columns: 40% 60%;
    gap: 60px;
    align-items: center;
    min-height: 600px;
    position: relative;
    z-index: 1;
}

/* 逆レイアウト（画像左、コンテンツ右） */
.service-layout-reverse {
    grid-template-columns: 60% 40%;
}

.service-layout-reverse .service-content {
    order: 2;
}

.service-layout-reverse .service-visuals {
    order: 1;
}

/* コンテンツエリア */
.service-content {
    max-width: 540px;
    position: relative;
    z-index: 20; /* トランジションより前面に */
}

/* ボタンがトランジションに隠れないように明示的に設定 */
.service-cta {
    position: relative;
    z-index: 30;
}

/* アイコンラッパー */
.service-icon-wrapper {
    width: 80px;
    height: 80px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.service-icon-wrapper svg {
    width: 48px;
    height: 48px;
}

/* タイトル・サブタイトル */
.service-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: #2c3e50;
}

.service-subtitle {
    font-size: 1.125rem;
    color: #7f8c8d;
    margin-bottom: 24px;
}

/* 説明文 */
.service-description {
    font-size: 1.125rem;
    line-height: 1.8;
    color: #5d6d7e;
    margin-bottom: 32px;
}

/* ベネフィットリスト */
.service-benefits {
    list-style: none;
    padding: 0;
    margin: 0 0 40px 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.service-benefits li {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 1rem;
    color: #34495e;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.service-benefits li:hover {
    transform: translateX(8px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.benefit-icon {
    font-weight: 700;
    font-size: 1.2rem;
}

/* CTA エリア */
.service-cta {
    margin-top: 48px;
}

.cta-label {
    font-size: 0.875rem;
    color: #7f8c8d;
    margin-bottom: 16px;
}

/* 大きめのボタン */
.button-large {
    padding: 18px 40px;
    font-size: 1.125rem;
    min-width: 200px;
    position: relative;
    z-index: 30; /* トランジションより確実に前面に */
}

/* ========================================
   ビジュアルエリア
   ======================================== */

.service-visuals {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 500px;
}

/* PC画像表示 */
.visual-pc {
    position: relative;
    width: 100%;
    max-width: 600px;
}

/* モバイル画像グループ */
.visual-mobile-group {
    display: flex;
    gap: 30px;
    align-items: center;
    justify-content: center;
}

/* スクリーンショット基本スタイル */
.service-screenshot {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    will-change: transform, box-shadow;
}

.service-screenshot:hover {
    transform: translateY(-10px);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.2);
}

/* PC画面の特別な表示効果（仕様書準拠） */
.visual-pc .service-screenshot {
    width: 100%;
    max-width: 600px;
    border-radius: 8px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.1);
    border: 1px solid rgba(0,0,0,0.1);
    overflow: hidden;
    transform: perspective(1000px) rotateY(-5deg);
}

.visual-pc .service-screenshot:hover {
    transform: perspective(1000px) rotateY(-5deg) scale(1.05);
    box-shadow: 0 30px 70px rgba(0,0,0,0.15);
}

/* モバイルスクリーン（仕様書準拠） */
.mobile-screen {
    width: 280px;
    border-radius: 20px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
    border: 8px solid #1a1a1a;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.mobile-screen:hover {
    transform: scale(1.05);
    box-shadow: 0 20px 50px rgba(0,0,0,0.2);
}

.mobile-screen-1 {
    transform: translateY(-20px);
}

.mobile-screen-2 {
    transform: translateY(20px);
}

/* ========================================
   個別セクションのスタイル
   ======================================== */

/* サクッとお薬ノート */
.service-okusuri {
    background: linear-gradient(135deg, #e6f3ff 0%, #f0f9ff 100%);
}

.service-okusuri .service-icon-wrapper {
    color: var(--service-okusuri);
}

.service-okusuri .benefit-icon {
    color: var(--service-okusuri);
}

.service-okusuri .button-primary {
    background: linear-gradient(135deg, var(--service-okusuri) 0%, #047857 100%);
    box-shadow: 0 4px 14px rgba(5, 150, 105, 0.3);
}

.service-okusuri .button-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(5, 150, 105, 0.4);
}

/* 誰でも薬理マスター */
.service-game {
    background: linear-gradient(135deg, #fef3c7 0%, #fee2e2 100%);
}

.service-game .service-icon-wrapper {
    color: var(--service-game);
}

.service-game .benefit-icon {
    color: var(--service-game);
}

.service-game .button-primary {
    background: linear-gradient(135deg, var(--service-game) 0%, #d97706 100%);
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.3);
}

.service-game .button-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(245, 158, 11, 0.4);
}

/* 薬剤師国試勉強タイマー */
.service-timer {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
}

.service-timer .service-icon-wrapper {
    color: var(--service-timer);
}

.service-timer .benefit-icon {
    color: var(--service-timer);
}

.service-timer .button-primary {
    background: linear-gradient(135deg, var(--service-timer) 0%, #b91c1c 100%);
    box-shadow: 0 4px 14px rgba(220, 38, 38, 0.3);
}

.service-timer .button-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(220, 38, 38, 0.4);
}

/* ========================================
   装飾要素
   ======================================== */

.section-decoration {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 0;
    will-change: transform;
    transform: translateZ(0); /* GPU加速 */
}

/* ========================================
   セクション間のトランジション（仕様書準拠）
   ======================================== */

/* ヒーロー → お薬ノート: 波形の区切り線 */
.hero::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 80px;
    background: white;
    clip-path: polygon(
        0 40px,
        50% 0,
        100% 40px,
        100% 100%,
        0 100%
    );
    z-index: -1;
}

/* お薬ノート → 薬理マスター: 色のグラデーション変化 */
.service-okusuri::after {
    content: '';
    position: absolute;
    bottom: -100px;
    left: 0;
    right: 0;
    height: 200px;
    background: linear-gradient(180deg, 
        rgba(240, 249, 255, 1) 0%, 
        rgba(254, 243, 199, 0.5) 50%,
        rgba(254, 243, 199, 1) 100%
    );
    z-index: -1;
    pointer-events: none;
}

/* 薬理マスター → タイマー: 斜めの区切り線 */
.service-game::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 100px;
    background: #f8fafc;
    clip-path: polygon(
        0 50px,
        100% 0,
        100% 100%,
        0 100%
    );
    z-index: -1;
}

/* タイマー → お知らせ: フェードトランジション */
.service-timer::after {
    content: '';
    position: absolute;
    bottom: -50px;
    left: 0;
    right: 0;
    height: 100px;
    background: linear-gradient(180deg,
        rgba(226, 232, 240, 1) 0%,
        rgba(226, 232, 240, 0) 100%
    );
    z-index: -1;
    pointer-events: none;
}

/* 各セクションの装飾パターン（仕様書準拠） */

/* お薬ノート - 六角形の分子構造パターン */
.okusuri-decoration::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(5, 150, 105, 0.1) 0%, transparent 70%);
    border-radius: 50%;
}

.okusuri-decoration::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: 
        repeating-linear-gradient(30deg, transparent, transparent 70px, rgba(5, 150, 105, 0.03) 70px, rgba(5, 150, 105, 0.03) 140px),
        repeating-linear-gradient(90deg, transparent, transparent 70px, rgba(5, 150, 105, 0.03) 70px, rgba(5, 150, 105, 0.03) 140px),
        repeating-linear-gradient(150deg, transparent, transparent 70px, rgba(5, 150, 105, 0.03) 70px, rgba(5, 150, 105, 0.03) 140px);
    pointer-events: none;
}

/* 薬理マスター - カラフルなゲーム要素 */
.game-decoration::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(245, 158, 11, 0.1) 0%, transparent 70%);
    border-radius: 50%;
}

.game-decoration::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: 
        radial-gradient(circle at 20% 80%, rgba(245, 158, 11, 0.1) 0%, transparent 25%),
        radial-gradient(circle at 80% 20%, rgba(236, 72, 153, 0.1) 0%, transparent 25%),
        radial-gradient(circle at 50% 50%, rgba(59, 130, 246, 0.05) 0%, transparent 50%);
    pointer-events: none;
}

/* タイマー - 時計パターン */
.timer-decoration::before {
    content: '';
    position: absolute;
    top: 10%;
    right: -15%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(220, 38, 38, 0.1) 0%, transparent 70%);
    border-radius: 50%;
}

.timer-decoration::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 300px;
    height: 300px;
    background: 
        conic-gradient(from 0deg, transparent, rgba(220, 38, 38, 0.05) 90deg, transparent 180deg),
        radial-gradient(circle, transparent 70%, rgba(220, 38, 38, 0.03) 70%, rgba(220, 38, 38, 0.03) 71%, transparent 71%);
    border-radius: 50%;
    pointer-events: none;
}

/* ========================================
   レスポンシブデザイン
   ======================================== */

/* タブレット (1024px以下) */
@media (max-width: 1024px) {
    .service-section {
        padding: 80px 0;
    }
    
    .service-layout {
        gap: 40px;
    }
    
    .service-title {
        font-size: 2rem;
    }
    
    .visual-pc {
        max-width: 500px;
    }
    
    .mobile-screen {
        max-width: 240px;
    }
}

/* モバイル (768px以下) */
@media (max-width: 768px) {
    .service-section {
        padding: 60px 0;
        min-height: auto;
    }
    
    /* 縦積みレイアウト */
    .service-layout,
    .service-layout-reverse {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    .service-layout-reverse .service-content {
        order: 1;
    }
    
    .service-layout-reverse .service-visuals {
        order: 2;
    }
    
    /* コンテンツ調整 */
    .service-content {
        max-width: 100%;
        text-align: center;
    }
    
    .service-icon-wrapper {
        margin: 0 auto 24px;
    }
    
    .service-title {
        font-size: 1.75rem;
    }
    
    .service-description {
        font-size: 1rem;
    }
    
    .service-benefits {
        max-width: 400px;
        margin: 0 auto 32px;
    }
    
    .service-cta {
        margin-top: 32px;
    }
    
    /* ビジュアル調整 */
    .service-visuals {
        min-height: auto;
    }
    
    .visual-pc {
        max-width: 100%;
    }
    
    .visual-mobile-group {
        gap: 20px;
    }
    
    .mobile-screen {
        max-width: 45%;
    }
    
    .mobile-screen-1,
    .mobile-screen-2 {
        transform: none;
    }
    
    /* ボタンを全幅に */
    .button-large {
        width: 100%;
    }
}

/* 小型モバイル (480px以下) */
@media (max-width: 480px) {
    .service-section {
        padding: 40px 0;
    }
    
    .service-title {
        font-size: 1.5rem;
    }
    
    .service-subtitle {
        font-size: 1rem;
    }
    
    .service-benefits li {
        font-size: 0.875rem;
        padding: 10px 16px;
    }
}

/* タッチデバイスでのホバー効果無効化 */
@media (hover: none) {
    .service-screenshot:hover,
    .mobile-screen:hover {
        transform: none;
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    }
    
    .visual-pc .service-screenshot:hover {
        transform: perspective(1000px) rotateY(-5deg);
        box-shadow: 0 20px 50px rgba(0,0,0,0.1);
    }
}

/* モバイルでの装飾要素制御 */
@media (max-width: 768px) {
    .section-decoration::before,
    .section-decoration::after,
    .okusuri-decoration::before,
    .okusuri-decoration::after,
    .game-decoration::before,
    .game-decoration::after,
    .timer-decoration::before,
    .timer-decoration::after {
        display: none;
    }
    
    /* セクション間トランジションも簡略化 */
    .service-okusuri::after,
    .service-game::after {
        height: 50px;
    }
}

/* アニメーション軽減モード対応 */
@media (prefers-reduced-motion: reduce) {
    .service-section,
    .service-section * {
        animation: none !important;
        transition: none !important;
    }
    
    .section-decoration {
        will-change: auto;
        transform: none;
    }
}

/* ========================================
   アニメーション
   ======================================== */

/* スクロールフェードイン */
.service-section {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease, transform 0.8s ease;
    will-change: opacity, transform;
}

.service-section.visible {
    opacity: 1;
    transform: translateY(0);
    will-change: auto; /* アニメーション完了後はリセット */
}

/* 要素の順次アニメーション */
.service-section.visible .service-icon-wrapper {
    animation: fadeInUp 0.6s ease 0.2s both;
}

.service-section.visible .service-title {
    animation: fadeInUp 0.6s ease 0.3s both;
}

.service-section.visible .service-subtitle {
    animation: fadeInUp 0.6s ease 0.4s both;
}

.service-section.visible .service-description {
    animation: fadeInUp 0.6s ease 0.5s both;
}

.service-section.visible .service-benefits li:nth-child(1) {
    animation: fadeInUp 0.6s ease 0.6s both;
}

.service-section.visible .service-benefits li:nth-child(2) {
    animation: fadeInUp 0.6s ease 0.7s both;
}

.service-section.visible .service-benefits li:nth-child(3) {
    animation: fadeInUp 0.6s ease 0.8s both;
}

.service-section.visible .service-cta {
    animation: fadeInUp 0.6s ease 0.9s both;
}

.service-section.visible .service-screenshot {
    animation: fadeInScale 0.8s ease 0.4s both;
}

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

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}