/**
 * WPP Hover Popup - Styles
 * かっこいいホバーポップアップデザイン
 */

/* ポップアップ本体 */
.wpp-hover-popup {
    position: fixed;
    z-index: 999999;
    width: 380px;
    max-width: calc(100vw - 40px);
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 
        0 25px 50px -12px rgba(0, 0, 0, 0.25),
        0 12px 24px -8px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(0, 0, 0, 0.05);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px) scale(0.95);
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
    overflow: hidden;
}

.wpp-hover-popup.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.wpp-hover-popup.loading .wpp-popup-loading {
    display: flex;
}

.wpp-hover-popup.loading .wpp-popup-content,
.wpp-hover-popup.loading .wpp-popup-image {
    opacity: 0;
}

/* 矢印 */
.wpp-popup-arrow {
    position: absolute;
    width: 16px;
    height: 16px;
    background: #ffffff;
    transform: rotate(45deg);
    box-shadow: -3px -3px 5px rgba(0, 0, 0, 0.04);
    z-index: -1;
}

.wpp-hover-popup.arrow-top .wpp-popup-arrow {
    top: -8px;
    left: 50%;
    margin-left: -8px;
}

.wpp-hover-popup.arrow-bottom .wpp-popup-arrow {
    bottom: -8px;
    left: 50%;
    margin-left: -8px;
    box-shadow: 3px 3px 5px rgba(0, 0, 0, 0.04);
}

.wpp-hover-popup.arrow-left .wpp-popup-arrow {
    left: -8px;
    top: 50%;
    margin-top: -8px;
}

.wpp-hover-popup.arrow-right .wpp-popup-arrow {
    right: -8px;
    top: 50%;
    margin-top: -8px;
}

/* 内部コンテナ */
.wpp-popup-inner {
    position: relative;
    cursor: pointer;
}

/* 画像エリア */
.wpp-popup-image {
    position: relative;
    height: 180px;
    overflow: hidden;
    transition: opacity 0.3s ease;
}

.wpp-popup-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.wpp-hover-popup:hover .wpp-popup-image img {
    transform: scale(1.08);
}

.wpp-popup-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 80px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.4), transparent);
    pointer-events: none;
}

/* コンテンツエリア */
.wpp-popup-content {
    padding: 20px;
    transition: opacity 0.3s ease;
}

/* メタ情報 */
.wpp-popup-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    font-size: 12px;
}

.wpp-popup-category {
    display: inline-block;
    padding: 4px 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    font-weight: 600;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: 20px;
}

.wpp-popup-date {
    color: #94a3b8;
    font-weight: 500;
}

.wpp-popup-reading-time {
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 4px;
}

.wpp-popup-reading-time::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 4px;
    background: #cbd5e1;
    border-radius: 50%;
}

/* タイトル */
.wpp-popup-title {
    margin: 0 0 12px 0;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.4;
    color: #1e293b;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.2s ease;
}

.wpp-hover-popup:hover .wpp-popup-title {
    color: #667eea;
}

/* 抜粋 */
.wpp-popup-excerpt {
    margin: 0 0 16px 0;
    font-size: 14px;
    line-height: 1.7;
    color: #64748b;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* CTA */
.wpp-popup-cta {
    display: flex;
    justify-content: flex-end;
}

.wpp-popup-read-more {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
    border-radius: 25px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.35);
}

.wpp-popup-read-more svg {
    transition: transform 0.3s ease;
}

.wpp-hover-popup:hover .wpp-popup-read-more {
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
    transform: translateY(-2px);
}

.wpp-hover-popup:hover .wpp-popup-read-more svg {
    transform: translateX(4px);
}

/* ローディング */
.wpp-popup-loading {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #ffffff;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

.wpp-popup-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e2e8f0;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: wpp-spin 0.8s linear infinite;
}

@keyframes wpp-spin {
    to {
        transform: rotate(360deg);
    }
}

/* WordPress Popular Postsのアイテムにホバー効果を追加 */
.wpp-list li,
.wpp-list .wpp-post,
.wpp-item-space,
center.wpp-item-space,
.widget_flavor_flavor_flavor li,
.flavor-popular-posts-widget li {
    position: relative;
}

.wpp-list li img,
.wpp-list .wpp-post img,
.wpp-thumbnail img,
.wpp-item-space img,
center.wpp-item-space img {
    cursor: pointer;
    transition: all 0.3s ease;
}

.wpp-list li img:hover,
.wpp-list .wpp-post img:hover,
.wpp-thumbnail img:hover,
.wpp-item-space img:hover,
center.wpp-item-space img:hover {
    transform: scale(1.03);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* フェードインアニメーション */
@keyframes wpp-fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.wpp-hover-popup.active .wpp-popup-content {
    animation: wpp-fadeIn 0.4s ease 0.1s both;
}

/* シマーエフェクト（ローディング中） */
@keyframes wpp-shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

.wpp-hover-popup.loading .wpp-popup-inner::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.5) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    background-size: 200% 100%;
    animation: wpp-shimmer 1.5s infinite;
}

/* レスポンシブ */
@media (max-width: 480px) {
    .wpp-hover-popup {
        display: none !important;
    }
}

/* ダークモード対応 */
@media (prefers-color-scheme: dark) {
    .wpp-hover-popup {
        background: #1e293b;
    }

    .wpp-popup-arrow {
        background: #1e293b;
    }

    .wpp-popup-title {
        color: #f1f5f9;
    }

    .wpp-hover-popup:hover .wpp-popup-title {
        color: #a5b4fc;
    }

    .wpp-popup-excerpt {
        color: #94a3b8;
    }

    .wpp-popup-loading {
        background: #1e293b;
    }
}
