/* Sticky scroll styles for features section */

@media (min-width: 769px) {
    .sticky-scroll-section {
        position: relative;
        overflow: visible;
    }
    
    
    .sticky-scroll-section .container {
        position: relative;
        min-height: 500vh; /* Reduced for quicker item switching */
    }
    
    
    /* Responsive title adjustments */
    @media (max-width: 1200px) {
        .sticky-scroll-section .section-title {
            top: 8vh;
            padding: 1.2rem 2.5rem;
            font-size: clamp(2.4rem, 3.5vw, 3.2rem);
            max-width: 85vw;
        }
    }
    
    @media (max-width: 900px) {
        .sticky-scroll-section .section-title {
            top: 5vh;
            padding: 1rem 2rem;
            font-size: clamp(2rem, 3vw, 2.6rem);
            max-width: 95vw;
            white-space: normal;
            line-height: 1.4;
        }
    }
    
    @media (max-width: 480px) {
        .sticky-scroll-section .section-title {
            top: 3vh;
            padding: 0.8rem 1.5rem;
            font-size: clamp(1.8rem, 2.5vw, 2.2rem);
            border-radius: 10px;
        }
    }
    
    .features-progress {
        text-align: center;
        font-size: 1.8rem;
        font-weight: 600;
        color: var(--primary);
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(15px);
        padding: 1rem 2rem;
        border-radius: 50px;
        position: fixed;
        top: 20vh;
        right: 3rem;
        z-index: 1200;
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
        border: 2px solid rgba(45, 91, 157, 0.3);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }
    
    .features-progress.visible {
        opacity: 1;
        visibility: visible;
    }
    
    .features-progress .current-item {
        font-size: 2rem;
        color: var(--secondary);
        font-weight: 700;
    }
    
    .features-progress .separator {
        margin: 0 0.5rem;
        color: var(--text-light);
    }
    
    .features-progress .total-items {
        color: var(--text-light);
    }

    .features-content {
        position: relative;
        padding: 3rem 0 5rem 0;
    }
    
    .sticky-item {
        display: flex;
        flex-direction: column;
        background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 0.95) 100%);
        backdrop-filter: blur(20px);
        border-radius: 20px;
        padding: 2.5rem 3rem;
        box-shadow: 
            0 25px 50px rgba(0, 0, 0, 0.12),
            0 0 0 1px rgba(255, 255, 255, 0.5);
        border: 1px solid rgba(255, 255, 255, 0.6);
        width: 900px;
        max-width: 90vw;
        height: 420px;
        will-change: transform, opacity, position;
        z-index: 1000;
        position: relative;
        overflow: visible;
    }
    
    /* プログレス風の外側罫線 */
    .sticky-item::before {
        content: '';
        position: absolute;
        top: -3px;
        left: -3px;
        right: -3px;
        bottom: -3px;
        border: 3px solid var(--secondary);
        border-radius: 28px;
        z-index: -1;
        opacity: 0;
        transition: opacity 0.3s ease;
    }
    
    .sticky-item.progress-active::before {
        opacity: 1;
    }
    
    /* Responsive sticky item adjustments */
    @media (max-width: 1200px) {
        .sticky-item {
            width: 90vw;
            max-width: 750px;
            padding: 2rem 2.5rem;
            height: auto;
            min-height: 350px;
        }
        
        .item-icon {
            width: 60px;
            height: 60px;
            font-size: 2rem;
        }
        
        .item-content h3 {
            font-size: 2rem;
            line-height: 1.4;
        }
        
        /* 1200px以下でキャラクターを非表示 */
        .item-character {
            display: none;
        }
    }
    
    @media (max-width: 900px) {
        .sticky-item {
            width: 95vw;
            max-width: 650px;
            padding: 1.8rem;
            gap: 1.2rem;
            flex-direction: column;
            text-align: left;
            height: auto;
            min-height: 400px;
        }
        
        .item-header {
            align-items: center;
            gap: 1.2rem;
        }
        
        .item-icon {
            width: 58px;
            height: 58px;
            font-size: 1.9rem;
            margin-top: 0;
        }
        
        .sticky-item .item-header h3 {
            font-size: 2.3rem !important;
            line-height: 1.4 !important;
            text-align: left;
            font-weight: 800 !important;
        }
        
        .sticky-item .item-header h3::after {
            width: 45px;
            height: 2px;
        }
        
        /* 900px以下での4番目アイテム調整 */
        .sticky-item[data-item="4"] .item-header h3 {
            font-size: 1.9rem !important;
            line-height: 1.3 !important;
        }
        
        .item-content .feature-list li {
            font-size: 1.4rem;
            padding: 0.7rem 0 0.7rem 2rem;
        }
        
        .item-content .feature-list li::before {
            width: 16px;
            height: 16px;
            font-size: 1.1rem;
            top: 0.7rem;
        }
    }
    
    @media (max-width: 600px) {
        .sticky-item {
            width: 95vw;
            max-width: 95vw;
            padding: 1.5rem;
            gap: 1rem;
            height: auto;
            min-height: 350px;
        }
        
        .item-header {
            gap: 1rem;
            align-items: center;
        }
        
        .item-icon {
            width: 52px;
            height: 52px;
            font-size: 1.7rem;
        }
        
        .sticky-item .item-header h3 {
            font-size: 2rem !important;
            line-height: 1.4 !important;
            font-weight: 800 !important;
        }
        
        .sticky-item .item-header h3::after {
            width: 40px;
            height: 1.5px;
        }
        
        /* 600px以下での4番目アイテム調整 */
        .sticky-item[data-item="4"] .item-header h3 {
            font-size: 1.6rem !important;
            line-height: 1.3 !important;
        }
        
        .item-content .feature-list li {
            font-size: 1.3rem;
            padding: 0.6rem 0 0.6rem 1.8rem;
        }
        
        .item-content .feature-list li::before {
            width: 14px;
            height: 14px;
            font-size: 1rem;
            top: 0.6rem;
        }
    }
    
    /* ヘッダー部分（アイコンとタイトル） */
    .item-header {
        display: flex;
        align-items: center;
        gap: 1.5rem;
        margin-bottom: 2rem;
    }
    
    .item-icon {
        flex-shrink: 0;
        width: 70px;
        height: 70px;
        background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
        border-radius: 18px;
        display: flex;
        align-items: center;
        justify-content: center;
        color: white;
        font-size: 2.2rem;
        box-shadow: 0 8px 25px rgba(45, 91, 157, 0.3);
    }
    
    .item-content {
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        overflow-y: auto;
        padding-right: 2rem;
    }
    
    .sticky-item .item-header h3 {
        font-size: 3rem !important;
        color: var(--primary-dark) !important;
        margin: 0 !important;
        font-weight: 800 !important;
        line-height: 1.3 !important;
        text-shadow: 0 3px 6px rgba(0, 0, 0, 0.15);
        flex: 1;
        position: relative;
        padding-bottom: 0.5rem;
    }
    
    .sticky-item .item-header h3::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 0;
        width: 50%;
        height: 3px;
        background: linear-gradient(90deg, var(--secondary), var(--bg-white));
        border-radius: 2px;
    }
    
    /* 4番目のアイテム（業界ランキング）の特別調整 */
    .sticky-item[data-item="4"] .item-header h3 {
        font-size: 2.6rem !important;
        line-height: 1.2 !important;
    }
    
    .item-content .feature-list {
        list-style: none;
        padding: 0;
        margin: 1.5rem 0 0 0;
        flex: 1;
        overflow-y: auto;
        max-height: 280px;
    }
    
    .item-content .feature-list li {
        padding: 1rem 0 1rem 2.5rem;
        font-size: 1.6rem;
        line-height: 1.7;
        color: var(--text);
        position: relative;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    }
    
    .item-content .feature-list li:last-child {
        border-bottom: none;
    }
    
    .item-content .feature-list li::before {
        content: '✓';
        position: absolute;
        left: 0;
        top: 1rem;
        color: var(--secondary);
        font-weight: bold;
        font-size: 1.4rem;
        width: 20px;
        height: 20px;
        background: rgba(248, 160, 26, 0.1);
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* キャラクター要素のスタイル */
    .item-character {
        position: absolute;
        bottom: -50px;
        right: -150px;
        z-index: 1001;
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    
    .character-img {
        width: 240px;
        height: auto;
        filter: drop-shadow(0 6px 20px rgba(0, 0, 0, 0.25));
    }
    
    .character-bubble {
        position: absolute;
        bottom: 140px;
        right: 150px;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(10px);
        border-radius: 20px;
        padding: 1rem 1.5rem;
        font-size: 1.4rem;
        font-weight: 600;
        color: var(--primary-dark);
        border: 2px solid var(--secondary);
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
        white-space: nowrap;
        opacity: 1;
        pointer-events: none;
    }
    
    .character-bubble::after {
        content: '';
        position: absolute;
        bottom: -10px;
        right: 20px;
        width: 0;
        height: 0;
        border: 10px solid transparent;
        border-top-color: var(--secondary);
    }
    
    .character-bubble::before {
        content: '';
        position: absolute;
        bottom: -8px;
        right: 22px;
        width: 0;
        height: 0;
        border: 8px solid transparent;
        border-top-color: rgba(255, 255, 255, 0.95);
        z-index: 1;
    }
    
    
    /* Responsive adjustments */
    @media (max-width: 1200px) {
        .sticky-item {
            flex-direction: column;
            text-align: left;
            gap: 1.5rem;
        }
        
        .item-header {
            align-items: center;
            gap: 1.5rem;
        }
        
        .item-icon {
            width: 65px;
            height: 65px;
            font-size: 2.1rem;
            margin-top: 0;
            flex-shrink: 0;
        }
        
        .sticky-item .item-header h3 {
            font-size: 2.6rem !important;
            margin: 0 !important;
            line-height: 1.4 !important;
            text-align: left;
            font-weight: 800 !important;
        }
        
        .sticky-item .item-header h3::after {
            width: 50px;
            height: 2.5px;
        }
        
        /* 1200px以下での4番目アイテム調整 */
        .sticky-item[data-item="4"] .item-header h3 {
            font-size: 2.2rem !important;
            line-height: 1.3 !important;
        }
        
        .item-content {
            text-align: left;
        }
        
        .item-content .feature-list {
            margin-top: 1.2rem;
        }
        
        .item-content .feature-list li {
            font-size: 1.5rem;
            line-height: 1.7;
            text-align: left;
            padding: 0.8rem 0 0.8rem 2.2rem;
        }
        
        .item-content .feature-list li::before {
            top: 0.8rem;
            left: 0;
            width: 18px;
            height: 18px;
            font-size: 1.2rem;
        }
        
        /* キャラクターは1200px以下で非表示 */
    }
}

/* Responsive adjustments for progress indicator */
@media (max-width: 1200px) {
    .features-progress {
        top: 15vh;
        right: 2rem;
        font-size: 1.6rem;
        padding: 0.8rem 1.5rem;
    }
    
    .features-progress .current-item {
        font-size: 1.8rem;
    }
}

@media (max-width: 900px) {
    .features-progress {
        top: 12vh;
        right: 1.5rem;
        font-size: 1.4rem;
        padding: 0.6rem 1.2rem;
    }
    
    .features-progress .current-item {
        font-size: 1.6rem;
    }
    
    /* 900px以下でキャラクターを非表示 */
    .item-character {
        display: none;
    }
}

/* Mobile fallback - regular layout */
@media (max-width: 768px) {
    .features-progress {
        display: none !important;
    }
    .sticky-scroll-section {
        position: relative !important;
        overflow: visible !important;
    }
    
    .sticky-scroll-section .container {
        min-height: auto !important;
        position: relative !important;
    }
    
    .sticky-scroll-section .section-title {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        transform: none !important;
        z-index: auto !important;
        background: transparent !important;
        backdrop-filter: none !important;
        padding: 2rem 0 !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        border: none !important;
        width: auto !important;
        max-width: none !important;
        margin-bottom: 3rem !important;
        opacity: 1 !important;
        visibility: visible !important;
    }
    
    .features-content {
        position: relative !important;
        padding: 0 !important;
    }
    
    .sticky-item {
        display: block !important;
        background: var(--bg-light) !important;
        border-radius: 15px !important;
        padding: 2rem !important;
        margin: 2rem 0 !important;
        position: relative !important;
        top: auto !important;
        left: auto !important;
        transform: none !important;
        opacity: 1 !important;
        visibility: visible !important;
        z-index: auto !important;
        width: auto !important;
        max-width: none !important;
        height: auto !important;
        min-height: auto !important;
        max-height: none !important;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1) !important;
        backdrop-filter: none !important;
        border: 1px solid var(--border-light) !important;
        transition: none !important;
        will-change: auto !important;
        overflow: visible !important;
    }
    
    .item-icon {
        width: 60px !important;
        height: 60px !important;
        background: var(--primary) !important;
        border-radius: 50% !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        color: white !important;
        font-size: 2rem !important;
        margin: 0 auto 1.5rem !important;
        flex-shrink: 0 !important;
    }
    
    .item-content {
        text-align: center !important;
        flex: none !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
    
    .item-content h3,
    .sticky-item .item-header h3 {
        font-size: 1.8rem !important;
        color: var(--primary-dark) !important;
        margin-bottom: 1rem !important;
        font-weight: 600 !important;
        text-align: center !important;
    }
    
    .item-content .feature-list {
        list-style: none !important;
        padding: 0 !important;
        margin: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
    
    .item-content .feature-list li {
        font-size: 1.4rem !important;
        padding: 0.5rem 1rem 0.5rem 1.5rem !important;
        text-align: left !important;
        line-height: 1.6 !important;
        color: var(--text) !important;
        position: relative !important;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
        word-break: break-word !important;
        white-space: normal !important;
        width: calc(100% - 2rem) !important;
        max-width: calc(100% - 2rem) !important;
        box-sizing: border-box !important;
    }
    
    .item-content .feature-list li::before {
        content: '✓' !important;
        position: absolute !important;
        left: 0 !important;
        color: var(--secondary) !important;
        font-weight: bold !important;
        font-size: 1.2rem !important;
    }
    
    /* モバイルではキャラクターを非表示 */
    .item-character {
        display: none !important;
    }
}