/**
 * ACF Elementor Bridge Styles
 * ACF-Elementor連携システム用CSS
 */

/* ==========================================================================
   料金表タブ
   ========================================================================== */

/* 料金表コンテナ */
.acf-pricing-tabs {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 0;
}

.acf-pricing-tabs.pricing-responsive {
    padding: 1rem;
}

/* トグルスイッチナビゲーション */
.pricing-navigation {
    display: flex;
    justify-content: center;
    margin-bottom: 3rem;
}

.pricing-toggle-switch {
    display: inline-block;
}

.toggle-container {
    position: relative;
    display: flex;
    background: #f8f9fa;
    border-radius: 50px;
    padding: 4px;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.1);
}

.toggle-option {
    position: relative;
    z-index: 2;
    margin: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.toggle-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-label {
    display: block;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    color: #6b7280;
    transition: color 0.3s ease;
    white-space: nowrap;
}

.toggle-option.active .toggle-label,
.toggle-option input:checked + .toggle-label {
    color: #ffffff;
}

.toggle-slider {
    position: absolute;
    top: 4px;
    left: 4px;
    bottom: 4px;
    width: calc(50% - 4px);
    background: linear-gradient(135deg, #333333 0%, #1a1a1a 100%);
    border-radius: 46px;
    transition: transform 0.3s ease, width 0.3s ease;
    z-index: 1;
}

/* トグルスライダーの位置は動的にJavaScriptで制御される */

/* 通常のタブスタイル */
.pricing-tabs-list {
    display: flex;
    justify-content: center;
    list-style: none;
    margin: 0;
    padding: 0;
    background: #f8f9fa;
    border-radius: 12px;
    overflow: hidden;
}

.pricing-tab-item {
    flex: 1;
    max-width: 200px;
}

.pricing-tab-link {
    display: block;
    width: 100%;
    padding: 16px 24px;
    border: none;
    background: transparent;
    font-size: 16px;
    font-weight: 600;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.pricing-tab-item.active .pricing-tab-link {
    background: linear-gradient(135deg, #333333 0%, #1a1a1a 100%);
    color: white;
}

/* 料金表コンテンツ */
.pricing-content {
    position: relative;
}

.pricing-plan {
    opacity: 0;
    visibility: hidden;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.pricing-plan.active {
    opacity: 1;
    visibility: visible;
    position: static;
}

/* 料金カードコンテナ */
.pricing-cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
    max-width: 1400px;
    margin: 0 auto;
}

/* 料金カード */
.pricing-card {
    position: relative;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

/* .pricing-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
    border-color: #333333;
} */

.pricing-card.popular {
    border-color: #333333;
    background: linear-gradient(135deg, #f8f8f8 0%, #ffffff 100%);
    transform: scale(1.05);
}

.pricing-card.popular:hover {
    transform: scale(1.05) translateY(-4px);
}

/* 人気バッジ */
.popular-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #333333 0%, #1a1a1a 100%);
    color: white;
    padding: 6px 20px;
    font-size: 12px;
    font-weight: 700;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* カードヘッダー */
.card-header {
    margin-bottom: 1.5rem;
}

.plan-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 1rem 0;
}

.price-container {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 0.25rem;
}

.price {
    font-size: 1.8rem;
    font-weight: 800;
    color: #111827;
    line-height: 1.4;
}

.price-period {
    font-size: 1rem;
    color: #6b7280;
    margin-left: 8px;
}

.price__additional-note {
    font-size: 0.8rem;
    display: block;
}

/* カード説明 */
.card-description {
    color: #6b7280;
    font-size: 1rem;
    line-height: 1.5;
    margin-bottom: 2rem;
}

/* CTAボタン */
.card-cta {
    margin-bottom: 2rem;
}

.pricing-button {
    display: inline-block;
    width: 100%;
    padding: 16px 24px;
    background: linear-gradient(135deg, #333333 0%, #1a1a1a 100%);
    color: white !important;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.pricing-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(51, 51, 51, 0.4);
    text-decoration: none;
    color: white;
}

.pricing-card.popular .pricing-button {
    background: linear-gradient(135deg, #1a1a1a 0%, #000000 100%);
}

.pricing-card.popular .pricing-button:hover {
    box-shadow: 0 8px 16px rgba(26, 26, 26, 0.4);
}

/* クレジット情報 */
.card-credits {
    margin: 1.5rem 0;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    text-align: left;
}

.credits-content {
    font-size: 0.9rem;
    color: #4b5563;
    line-height: 1.5;
    font-weight: 500;
}

.credits-content p {
    margin: 0 0 0.5rem 0;
}

.credits-content p:last-child {
    margin-bottom: 0;
}

/* 機能リスト */
.card-features {
    text-align: left;
}

.features-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #374151;
    margin: 0 0 1rem 0;
    text-align: center;
}

.features-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.feature-item {
    font-size: 0.9rem;
    position: relative;
    padding: 0.5rem 0 0.5rem 2rem;
    color: #4b5563;
    line-height: 1.5;
    border-bottom: 1px solid #f3f4f6;
}

.feature-item:last-child {
    border-bottom: none;
}

.feature-item::before {
    content: "✓";
    position: absolute;
    left: 0;
    top: 0.5rem;
    width: 1.5rem;
    height: 1.5rem;
    background: #444444;
    color: white;
    font-size: 0.75rem;
    font-weight: bold;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* レスポンシブデザイン */
@media (max-width: 1200px) {
    .pricing-cards-container {
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .acf-pricing-tabs {
        padding: 1rem 0;
    }

    .pricing-navigation {
        margin-bottom: 2rem;
    }

    .toggle-label {
        padding: 10px 16px;
        font-size: 14px;
    }

    .pricing-cards-container {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .pricing-card {
        padding: 1.5rem;
    }

    .pricing-card.popular {
        transform: none;
    }

    .pricing-card.popular:hover {
        transform: translateY(-4px);
    }

    .price {
        font-size: 1.8rem;
    }

    .plan-name {
        font-size: 1.25rem;
    }
}

@media (max-width: 480px) {
    .toggle-label {
        padding: 8px 12px;
        font-size: 12px;
    }

    .pricing-card {
        padding: 1rem;
    }

    .price {
        font-size: 1.5rem;
    }
}

/* ==========================================================================
   画像スライダー - シンプルスライダー
   ========================================================================== */

.acf-simple-slider {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    background: #f5f5f5;
}

.acf-simple-slider .slider-container {
    position: relative;
    width: 100%;
    height: auto;
}

.acf-simple-slider .slider-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
}

.acf-simple-slider .slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.acf-simple-slider .slide.active {
    opacity: 1;
    position: relative;
}

.acf-simple-slider .slider-image {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
}

.acf-simple-slider .slide-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 15px;
    font-size: 14px;
    line-height: 1.4;
}

/* スライダーナビゲーション */
.acf-simple-slider .slider-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s ease;
    z-index: 10;
}

.acf-simple-slider .slider-nav:hover {
    background: rgba(0, 0, 0, 0.7);
}

.acf-simple-slider .slider-nav.prev {
    left: 15px;
}

.acf-simple-slider .slider-nav.next {
    right: 15px;
}

/* ページネーション */
.acf-simple-slider .slider-pagination {
    text-align: center;
    padding: 15px 0;
    background: rgba(255, 255, 255, 0.9);
}

.acf-simple-slider .pagination-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ccc;
    border: none;
    margin: 0 5px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.acf-simple-slider .pagination-dot.active {
    background: #333;
}

.acf-simple-slider .pagination-dot:hover {
    background: #666;
}

/* ==========================================================================
   画像スライダー - Swiperスタイル調整
   ========================================================================== */

.acf-swiper-slider {
    border-radius: 8px;
    overflow: hidden;
}

.acf-swiper-slider .swiper-slide img {
    width: 100%;
    height: auto;
    display: block;
}

.acf-swiper-slider .swiper-slide-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 15px;
    font-size: 14px;
    line-height: 1.4;
}

/* ==========================================================================
   画像スライダー - インフィニティスクロール
   ========================================================================== */

.acf-infinity-slider {
    overflow: hidden;
    position: relative;
    width: 100%;
    border-radius: 8px;
}

.acf-infinity-slider .infinity-row {
    position: relative;
    margin-bottom: 15px;
    overflow: hidden;
}

.acf-infinity-slider .infinity-row:last-child {
    margin-bottom: 0;
}

.acf-infinity-slider .infinity-track {
    display: flex;
    width: max-content;
    animation: scroll-infinity var(--scroll-duration, 20s) linear infinite;
}

.acf-infinity-slider.scroll-right .infinity-track {
    animation-direction: reverse;
}

.acf-infinity-slider .infinity-item {
    flex: 0 0 auto;
    margin-right: 20px;
    position: relative;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* .acf-infinity-slider .infinity-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
} */

.acf-infinity-slider .infinity-image-container {
    position: relative;
    width: 200px;
    height: 120px;
    overflow: hidden;
}

.acf-infinity-slider .infinity-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* インフィニティスクロールアニメーション */
@keyframes scroll-infinity {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

/* ホバー一時停止は JavaScript で制御 */

/* 複数行レイアウト */
.acf-infinity-slider.rows-2 .infinity-row:nth-child(2) .infinity-track {
    animation-delay: -10s;
}

.acf-infinity-slider.rows-3 .infinity-row:nth-child(2) .infinity-track {
    animation-delay: -7s;
}

.acf-infinity-slider.rows-3 .infinity-row:nth-child(3) .infinity-track {
    animation-delay: -14s;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .acf-infinity-slider .infinity-image-container {
        width: 150px;
        height: 90px;
    }

    .acf-infinity-slider .infinity-item {
        margin-right: 15px;
    }
}

@media (max-width: 480px) {
    .acf-infinity-slider .infinity-image-container {
        width: 120px;
        height: 80px;
    }

    .acf-infinity-slider .infinity-item {
        margin-right: 10px;
    }
}

/* ==========================================================================
   テキストエリア表示
   ========================================================================== */

.slide-text-area {
    position: relative;
    padding: 15px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 0 0 8px 8px;
    margin-top: -1px;
}

.slide-text-area.text-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    border-radius: 0 0 8px 8px;
}

.slide-text-area.text-side {
    position: absolute;
    top: 0;
    right: 0;
    width: 40%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 0 8px 8px 0;
    padding: 20px;
    display: flex;
    align-items: center;
}

.slide-text-area .text-content {
    line-height: 1.6;
    font-size: 14px;
}

.slide-text-area .text-content h1,
.slide-text-area .text-content h2,
.slide-text-area .text-content h3,
.slide-text-area .text-content h4 {
    margin-top: 0;
    margin-bottom: 10px;
}

.slide-text-area .text-content p {
    margin-bottom: 10px;
}

.slide-text-area .text-content p:last-child {
    margin-bottom: 0;
}

.slide-text-area .read-more-btn {
    background: #007cba;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    margin-top: 10px;
    transition: background 0.3s ease;
}

.slide-text-area .read-more-btn:hover {
    background: #005a87;
}

.slide-text-area .text-full {
    animation: fadeIn 0.3s ease-in-out;
}

/* インフィニティスライダー内のテキストエリア */
.acf-infinity-slider .slide-text-area {
    padding: 10px;
    font-size: 12px;
    background: rgba(255, 255, 255, 0.9);
}

.acf-infinity-slider .slide-text-area .text-content {
    font-size: 12px;
    line-height: 1.4;
}

/* Swiperスライダー内のテキストエリア */
.acf-swiper-slider .slide-text-area.text-overlay {
    z-index: 2;
}

/* ライトボックス内のテキストエリア */
.acf-lightbox-slider .thumbnail .slide-text-area {
    padding: 8px;
    font-size: 11px;
    background: rgba(255, 255, 255, 0.9);
}

/* ==========================================================================
   画像スライダー - ライトボックス
   ========================================================================== */

.acf-lightbox-slider .lightbox-thumbnails {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.acf-lightbox-slider .thumbnail {
    position: relative;
    cursor: pointer;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.acf-lightbox-slider .thumbnail:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.acf-lightbox-slider .thumbnail img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    display: block;
}

.acf-lightbox-slider .thumbnail-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px;
    font-size: 12px;
    line-height: 1.3;
}

/* ライトボックスモーダル */
.lightbox-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    z-index: 1;
}

.lightbox-image-container img {
    max-width: 100%;
    max-height: 80vh;
    border-radius: 8px;
}

.lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: none;
    border: none;
    color: white;
    font-size: 30px;
    cursor: pointer;
    width: 40px;
    height: 40px;
    text-align: center;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.3);
}

.lightbox-nav.prev {
    left: -60px;
}

.lightbox-nav.next {
    right: -60px;
}

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

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

@keyframes slideInFromRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInFromLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ==========================================================================
   ユーティリティクラス
   ========================================================================== */

.acf-bridge-hidden {
    display: none !important;
}

.acf-bridge-loading {
    opacity: 0.5;
    pointer-events: none;
    position: relative;
}

.acf-bridge-loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007cba;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.acf-bridge-error {
    color: #d63384;
    background: #f8d7da;
    border: 1px solid #f1aeb5;
    padding: 10px;
    border-radius: 6px;
    font-size: 14px;
}

.acf-bridge-success {
    color: #0f5132;
    background: #d1e7dd;
    border: 1px solid #a3cfbb;
    padding: 10px;
    border-radius: 6px;
    font-size: 14px;
}

/* Elementor統合スタイル */
.elementor-widget-container .acf-simple-slider,
.elementor-widget-container .acf-swiper-slider,
.elementor-widget-container .acf-lightbox-slider,
.elementor-widget-container .acf-dynamic-tabs {
    margin-bottom: 0;
}