/**
 * OE Event Favorites - Stylesheet
 * Version: 1.0.0
 */

/* ============================================
   お気に入りボタン - 基本スタイル
============================================ */

.oe-fav-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
    background: transparent;
    color: #6b7280;
    font-size: 14px;
    line-height: 1;
}

.oe-fav-action:hover {
    background: #f9fafb;
    border-color: #d1d5db;
    color: #374151;
}

.oe-fav-action:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* アイコン */
.oe-fav-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    min-width: 24px;
    min-height: 24px;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

/* SVGアイコン（インライン） */
.oe-fav-icon svg {
    width: 100%;
    height: 100%;
    max-width: 24px;
    max-height: 24px;
    display: block;
}

/* ホバー時 */
.oe-fav-action:hover .oe-fav-icon svg {
    opacity: 0.8;
}

/* カウント */
.oe-fav-count {
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    min-width: 20px;
    text-align: center;
}

/* ============================================
   状態: アクティブ（お気に入り済み）
============================================ */

.oe-fav-action.is-active {
    /* 背景色とボーダー色は変更しない */
    /* アイコン画像の切り替えで視覚的フィードバックを行う */
}

.oe-fav-action.is-active:hover {
    /* ホバー時も通常と同じ */
}

/* アイコンは画像切り替えで対応するため、追加のスタイルは不要 */

/* ============================================
   状態: ローディング
============================================ */

.oe-fav-action.is-loading {
    pointer-events: none;
    opacity: 0.6;
    cursor: wait;
}

.oe-fav-action.is-loading .oe-fav-icon {
    animation: oe-fav-pulse 1s ease-in-out infinite;
}

@keyframes oe-fav-pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* ============================================
   アニメーション: バウンス
============================================ */

.oe-fav-action.oe-fav-bounce .oe-fav-icon {
    animation: oe-fav-bounce 0.6s ease;
}

@keyframes oe-fav-bounce {
    0% {
        transform: scale(1);
    }
    25% {
        transform: scale(1.3);
    }
    50% {
        transform: scale(0.9);
    }
    75% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

/* ============================================
   通知（トースト）
============================================ */

.oe-fav-notice {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    padding: 12px 24px;
    background: #1f2937;
    color: white;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    z-index: 9999;
    font-size: 14px;
    font-weight: 500;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
    max-width: 90%;
}

.oe-fav-notice.is-visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.oe-fav-notice-success {
    background: #059669;
}

.oe-fav-notice-error {
    background: #dc2626;
}

.oe-fav-notice-info {
    background: #3b82f6;
}

/* ============================================
   .em-event-actions への統合
============================================ */

.em-event-actions .oe-fav-action {
    /* 既存の .em-like-action などと並ぶ場合 */
    margin: 0;
}

/* ============================================
   レスポンシブ
============================================ */

@media (max-width: 768px) {
    .oe-fav-action {
        padding: 6px 10px;
        font-size: 13px;
    }
    
    .oe-fav-icon {
        width: 18px;
        height: 18px;
    }
    
    .oe-fav-icon-fallback {
        font-size: 16px;
    }
    
    .oe-fav-notice {
        bottom: 16px;
        font-size: 13px;
        padding: 10px 20px;
    }
}

@media (max-width: 480px) {
    .oe-fav-action {
        padding: 5px 8px;
        font-size: 12px;
        gap: 4px;
    }
    
    .oe-fav-icon {
        width: 16px;
        height: 16px;
    }
    
    .oe-fav-icon-fallback {
        font-size: 14px;
    }
    
    .oe-fav-count {
        font-size: 12px;
        min-width: 18px;
    }
    
    .oe-fav-notice {
        bottom: 12px;
        font-size: 12px;
        padding: 8px 16px;
    }
}

/* ============================================
   アクセシビリティ
============================================ */

.oe-fav-action:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* 高コントラストモード対応 */
@media (prefers-contrast: high) {
    .oe-fav-action {
        border-width: 2px;
    }
    
    .oe-fav-action.is-active {
        border-width: 2px;
    }
}

/* モーション削減設定 */
@media (prefers-reduced-motion: reduce) {
    .oe-fav-action,
    .oe-fav-icon,
    .oe-fav-notice {
        animation: none !important;
        transition: none !important;
    }
}

/* ダークモード対応（任意） */
@media (prefers-color-scheme: dark) {
    .oe-fav-action {
        border-color: #374151;
        color: #9ca3af;
    }
    
    .oe-fav-action:hover {
        background: #1f2937;
        border-color: #4b5563;
        color: #d1d5db;
    }
    
    .oe-fav-action.is-active {
        background: #450a0a;
        border-color: #991b1b;
        color: #fca5a5;
    }
    
    .oe-fav-action.is-active:hover {
        background: #7f1d1d;
        border-color: #b91c1c;
        color: #fecaca;
    }
}