/*
BJEX 高校生採用サイト - スマートフォン専用レスポンシブ画像最適化
新しいレスポンシブ画像 kousotsu_responsive-top.png 対応
Version: Mobile Responsive Image 3.1.0
*/

/* ===== モバイルファースト基本設定（更新版） ===== */
@media (max-width: 768px) {
    
    /* ===== ヒーローセクション：スマートフォン最適化 ===== */
    .hero-asuzac-style {
        position: relative !important;
        width: 100% !important;
        height: 100vh !important;
        min-height: 600px !important;
        max-height: 100vh !important;
        overflow: hidden !important;
        background: linear-gradient(135deg, #e3f2fd 0%, #f0f8ff 50%, #fff3e0 100%) !important;
    }
    
    .hero-main-container {
        position: relative !important;
        width: 100% !important;
        height: 100% !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    
    .hero-main-visual {
        position: relative !important;
        width: 100% !important;
        height: 100% !important;
        overflow: hidden !important;
        background: white !important;
    }
    
    /* ===== レスポンシブ画像コンテナ ===== */
    .responsive-hero-image {
        width: 100% !important;
        height: 100% !important;
        display: block !important;
    }
    
    /* ===== 背景画像：スマートフォン最適化（kousotsu_responsive-top.png対応） ===== */
    .main-bg-image {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
        object-position: center center !important;
        display: block !important;
        filter: brightness(1.1) contrast(1.05) !important;
    }
    
    /* レスポンシブ画像の追加最適化 */
    .responsive-hero-image img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
        object-position: center center !important;
        display: block !important;
        transition: opacity 0.3s ease !important;
    }
    
    /* 画像読み込み完了時のフェードイン */
    .responsive-hero-image img.loaded {
        opacity: 1 !important;
    }
    
    /* 画像読み込み中の状態 */
    .responsive-hero-image img:not(.loaded) {
        opacity: 0.8 !important;
        background: linear-gradient(135deg, #FF6B35 0%, #4ECDC4 50%, #FFE66D 100%) !important;
    }
    
    /* ===== 先輩社員画像：スマートフォン配置 ===== */
    .senior-overlay {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100% !important;
        pointer-events: none !important;
        z-index: 10 !important;
    }
    
    .senior-person {
        position: absolute !important;
        z-index: 11 !important;
        pointer-events: auto !important;
    }
    
    /* 左側先輩：画面下部左 */
    .senior-left {
        top: auto !important;
        bottom: 15% !important;
        left: 5% !important;
        right: auto !important;
        width: 120px !important;
        height: 120px !important;
        animation: slideInFromLeft 1.2s ease-out 0.5s both !important;
    }
    
    /* 右側先輩：画面下部右 */
    .senior-right {
        top: auto !important;
        bottom: 15% !important;
        right: 5% !important;
        left: auto !important;
        width: 120px !important;
        height: 120px !important;
        animation: slideInFromRight 1.2s ease-out 0.8s both !important;
    }
    
    .senior-image {
        width: 120px !important;
        height: 120px !important;
        object-fit: cover !important;
        object-position: center !important;
        border-radius: 50% !important;
        border: 3px solid #FF6B35 !important;
        background: white !important;
        padding: 2px !important;
        box-shadow: 0 4px 15px rgba(255, 107, 53, 0.3) !important;
        display: block !important;
        transition: all 0.3s ease !important;
    }
    
    .senior-person:hover .senior-image {
        transform: scale(1.05) !important;
        box-shadow: 0 6px 20px rgba(255, 107, 53, 0.4) !important;
    }
    
    /* ===== メインタイトル：スマートフォン最適化 ===== */
    .hero-title-overlay {
        position: absolute !important;
        top: 30% !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        z-index: 15 !important;
        text-align: center !important;
        width: 90% !important;
        max-width: 350px !important;
    }
    
    .hero-main-title {
        font-size: 1.8rem !important;
        font-weight: 900 !important;
        color: #2c3e50 !important;
        margin-bottom: 12px !important;
        text-shadow: 2px 2px 4px rgba(255, 255, 255, 0.8) !important;
        line-height: 1.2 !important;
        animation: fadeInScale 1.5s ease-out 0.3s both !important;
    }
    
    .hero-subtitle {
        font-size: 1rem !important;
        font-weight: 600 !important;
        color: #FF6B35 !important;
        margin-bottom: 20px !important;
        text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.8) !important;
        animation: fadeInScale 1.5s ease-out 0.6s both !important;
    }
    
    /* ===== CTAボタン：スマートフォン最適化 ===== */
    .hero-cta-mobile {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 8px !important;
        padding: 16px 24px !important;
        background: linear-gradient(135deg, #FF6B35 0%, #FF6B9D 100%) !important;
        color: white !important;
        text-decoration: none !important;
        border-radius: 50px !important;
        font-size: 1rem !important;
        font-weight: 700 !important;
        box-shadow: 0 6px 20px rgba(255, 107, 53, 0.3) !important;
        transition: all 0.3s ease !important;
        animation: fadeInScale 1.5s ease-out 0.9s both !important;
        min-width: 200px !important;
    }
    
    .hero-cta-mobile:hover,
    .hero-cta-mobile:active {
        transform: translateY(-2px) scale(1.02) !important;
        box-shadow: 0 8px 25px rgba(255, 107, 53, 0.4) !important;
        color: white !important;
    }
    
    /* ===== メッセージバブル：スマートフォン配置 ===== */
    .hero-message-overlay {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100% !important;
        pointer-events: none !important;
        z-index: 12 !important;
    }
    
    .message-bubble {
        position: absolute !important;
        background: white !important;
        border: 3px solid #FF6B35 !important;
        border-radius: 20px !important;
        padding: 12px 16px !important;
        font-weight: 700 !important;
        color: #2c3e50 !important;
        font-size: 0.8rem !important;
        max-width: 160px !important;
        text-align: center !important;
        box-shadow: 0 6px 20px rgba(255, 107, 53, 0.25) !important;
        animation: popInMobile 1s ease-out both !important;
        line-height: 1.3 !important;
        word-wrap: break-word !important;
    }
    
    /* バブル1：画面上部左 */
    .message-1 {
        top: 15% !important;
        left: 8% !important;
        right: auto !important;
        bottom: auto !important;
        animation-delay: 1.5s !important;
        background: linear-gradient(135deg, #fff 0%, #fff5f0 100%) !important;
        border-color: #FF6B35 !important;
    }
    
    /* バブル2：画面上部右 */
    .message-2 {
        top: 20% !important;
        right: 8% !important;
        left: auto !important;
        bottom: auto !important;
        animation-delay: 2s !important;
        background: linear-gradient(135deg, #fff 0%, #f0f8ff 100%) !important;
        border-color: #4ECDC4 !important;
    }
    
    /* バブル3：画面中央 */
    .message-3 {
        top: 45% !important;
        left: 50% !important;
        right: auto !important;
        bottom: auto !important;
        transform: translateX(-50%) !important;
        animation-delay: 2.5s !important;
        background: linear-gradient(135deg, #fff 0%, #fffbf0 100%) !important;
        border-color: #FFE66D !important;
    }
    
    /* バブルの矢印を非表示（スマートフォンでは簡潔に） */
    .message-bubble::before {
        display: none !important;
    }
    
    /* ===== アニメーション定義 ===== */
    @keyframes slideInFromLeft {
        0% {
            opacity: 0;
            transform: translateX(-100px) scale(0.8);
        }
        100% {
            opacity: 1;
            transform: translateX(0) scale(1);
        }
    }
    
    @keyframes slideInFromRight {
        0% {
            opacity: 0;
            transform: translateX(100px) scale(0.8);
        }
        100% {
            opacity: 1;
            transform: translateX(0) scale(1);
        }
    }
    
    @keyframes popInMobile {
        0% {
            opacity: 0;
            transform: scale(0.5) translateY(20px);
        }
        70% {
            opacity: 1;
            transform: scale(1.1) translateY(-5px);
        }
        100% {
            opacity: 1;
            transform: scale(1) translateY(0);
        }
    }
    
    @keyframes fadeInScale {
        0% {
            opacity: 0;
            transform: scale(0.9) translateY(20px);
        }
        100% {
            opacity: 1;
            transform: scale(1) translateY(0);
        }
    }
}

/* ===== 極小デバイス（480px以下）対応 ===== */
@media (max-width: 480px) {
    
    .hero-asuzac-style {
        min-height: 500px !important;
    }
    
    .senior-left,
    .senior-right {
        width: 100px !important;
        height: 100px !important;
        bottom: 12% !important;
    }
    
    .senior-image {
        width: 100px !important;
        height: 100px !important;
        border-width: 2px !important;
    }
    
    .message-bubble {
        font-size: 0.7rem !important;
        padding: 10px 12px !important;
        max-width: 140px !important;
        border-width: 2px !important;
    }
    
    .hero-main-title {
        font-size: 1.5rem !important;
    }
    
    .hero-subtitle {
        font-size: 0.9rem !important;
    }
    
    .hero-cta-mobile {
        font-size: 0.9rem !important;
        padding: 14px 20px !important;
        min-width: 180px !important;
    }
}

/* ===== 横向きスマートフォン対応 ===== */
@media (max-width: 768px) and (orientation: landscape) {
    
    .hero-asuzac-style {
        height: 100vh !important;
        min-height: 400px !important;
    }
    
    .hero-title-overlay {
        top: 20% !important;
    }
    
    .senior-left,
    .senior-right {
        bottom: 8% !important;
        width: 80px !important;
        height: 80px !important;
    }
    
    .senior-image {
        width: 80px !important;
        height: 80px !important;
    }
    
    .message-bubble {
        font-size: 0.7rem !important;
        padding: 8px 12px !important;
        max-width: 120px !important;
    }
    
    .message-1 {
        top: 10% !important;
    }
    
    .message-2 {
        top: 12% !important;
    }
    
    .message-3 {
        top: 35% !important;
    }
}

/* ===== 画像読み込み最適化 ===== */
@media (max-width: 768px) {
    
    /* 画像の遅延読み込み対応 */
    .main-bg-image[loading="lazy"] {
        opacity: 0;
        transition: opacity 0.5s ease;
    }
    
    .main-bg-image.loaded,
    .main-bg-image[loading="eager"] {
        opacity: 1;
    }
    
    /* レスポンシブ画像の最適化 */
    .responsive-hero-image {
        background: linear-gradient(135deg, #e3f2fd 0%, #f0f8ff 50%, #fff3e0 100%) !important;
    }
    
    /* 新しいレスポンシブ画像(kousotsu_responsive-top.png)専用最適化 */
    .responsive-hero-image source[srcset*="kousotsu_responsive-top.png"] + img,
    .main-bg-image[src*="kousotsu_responsive-top.png"] {
        object-fit: cover !important;
        object-position: center top !important;
        filter: brightness(1.05) contrast(1.02) saturate(1.1) !important;
    }
}

/* ===== パフォーマンス最適化 ===== */
@media (max-width: 768px) {
    
    /* GPU アクセラレーション */
    .hero-asuzac-style,
    .main-bg-image,
    .senior-image,
    .hero-title-overlay {
        will-change: transform !important;
        transform: translateZ(0) !important;
    }
    
    /* メモリ最適化 */
    .hero-main-visual {
        contain: layout style paint !important;
    }
}

/* ===== モーション削減設定対応 ===== */
@media (prefers-reduced-motion: reduce) {
    .senior-person,
    .message-bubble,
    .hero-main-title,
    .hero-subtitle,
    .hero-cta-mobile {
        animation: none !important;
        transform: none !important;
    }
    
    .senior-image,
    .hero-cta-mobile {
        transition: none !important;
    }
}

/* ===== 高コントラスト対応 ===== */
@media (prefers-contrast: high) {
    .message-bubble {
        border-width: 4px !important;
        background: white !important;
        color: #000 !important;
    }
    
    .hero-main-title,
    .hero-subtitle {
        text-shadow: none !important;
        color: #000 !important;
    }
    
    .senior-image {
        border-width: 4px !important;
        border-color: #000 !important;
    }
    
    .main-bg-image {
        filter: contrast(1.5) !important;
    }
}

/* ===== 暗いテーマ対応 ===== */
@media (prefers-color-scheme: dark) {
    .hero-main-title {
        color: #ffffff !important;
        text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8) !important;
    }
    
    .hero-subtitle {
        color: #FFE66D !important;
        text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8) !important;
    }
    
    .message-bubble {
        background: rgba(0, 0, 0, 0.8) !important;
        color: white !important;
        border-color: #FF6B35 !important;
    }
}