/**
 * Academy Mesh Features Plugin CSS
 *
 * @package Academy Mesh_Features
 * @since 1.0.0
 */

/* 通知スタイル */
.am-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 16px 24px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    font-weight: 500;
    z-index: 10000;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s ease;
    max-width: 400px;
}

.am-notification.show {
    opacity: 1;
    transform: translateX(0);
}

.am-notification-success {
    background: #10b981;
    color: white;
}

.am-notification-error {
    background: #ef4444;
    color: white;
}

.am-notification-info {
    background: #3b82f6;
    color: white;
}

/* お気に入りボタン */
.am-favorite-btn {
    cursor: pointer;
    transition: all 0.3s ease;
}

.am-favorite-btn:hover {
    transform: scale(1.05);
}

.am-favorite-btn.active i {
    color: #fbbf24;
}

/* ローディングアニメーション */
.am-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: am-spin 0.8s ease-in-out infinite;
}

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

/* レスポンシブ */
@media (max-width: 768px) {
    .am-notification {
        right: 10px;
        left: 10px;
        max-width: none;
    }
}

/* ==================== バッジシステム ==================== */

/* バッジカード */
.am-badge-card {
    background: white;
    border-radius: 16px;
    padding: 24px;
    text-align: center;
    transition: all 0.3s ease;
    border: 2px solid #e5e7eb;
    position: relative;
    overflow: hidden;
}

.am-badge-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.am-badge-card.earned {
    border-color: transparent;
    background: linear-gradient(135deg, #fef3c7 0%, #fff 100%);
}

.am-badge-card.locked {
    opacity: 0.5;
    filter: grayscale(80%);
}

/* バッジアイコン */
.am-badge-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 36px;
    position: relative;
    transition: all 0.3s ease;
}

.am-badge-card:hover .am-badge-icon {
    transform: scale(1.1) rotate(5deg);
}

.am-badge-icon i {
    color: white;
}

.am-badge-card.locked .am-badge-icon {
    background: #9ca3af !important;
}

/* バッジ情報 */
.am-badge-name {
    font-size: 18px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 8px;
}

.am-badge-description {
    font-size: 14px;
    color: #6b7280;
    line-height: 1.5;
    margin-bottom: 12px;
}

.am-badge-date {
    font-size: 12px;
    color: #9ca3af;
    font-weight: 500;
}

/* ロックアイコン */
.am-badge-lock-icon {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    background: #ef4444;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
}

.am-badge-card.earned .am-badge-lock-icon {
    background: #10b981;
}

/* バッジグリッド */
.am-badges-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 24px;
    margin-top: 24px;
}

@media (max-width: 768px) {
    .am-badges-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 16px;
    }
    
    .am-badge-card {
        padding: 16px;
    }
    
    .am-badge-icon {
        width: 60px;
        height: 60px;
        font-size: 28px;
    }
    
    .am-badge-name {
        font-size: 16px;
    }
}

/* バッジ統計 */
.am-badge-stats {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    padding: 24px;
    color: white;
    margin-bottom: 32px;
}

.am-badge-stats-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    opacity: 0.9;
}

.am-badge-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 16px;
}

.am-badge-stat-item {
    text-align: center;
}

.am-badge-stat-value {
    font-size: 32px;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 4px;
}

.am-badge-stat-label {
    font-size: 13px;
    opacity: 0.8;
}

.am-badge-progress {
    margin-top: 16px;
}

.am-badge-progress-bar {
    height: 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 8px;
}

.am-badge-progress-fill {
    height: 100%;
    background: white;
    border-radius: 4px;
    transition: width 0.6s ease;
}

/* バッジ獲得モーダル */
.am-badge-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.am-badge-modal.show {
    opacity: 1;
    visibility: visible;
}

.am-badge-modal-content {
    background: white;
    border-radius: 24px;
    padding: 48px 32px;
    max-width: 480px;
    width: 90%;
    text-align: center;
    position: relative;
    transform: scale(0.8) translateY(-20px);
    transition: all 0.3s ease;
}

.am-badge-modal.show .am-badge-modal-content {
    transform: scale(1) translateY(0);
}

.am-badge-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f3f4f6;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    transition: all 0.2s ease;
}

.am-badge-modal-close:hover {
    background: #e5e7eb;
    color: #1f2937;
}

.am-badge-modal-title {
    font-size: 28px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 8px;
}

.am-badge-modal-subtitle {
    font-size: 16px;
    color: #6b7280;
    margin-bottom: 32px;
}

.am-badge-modal-icon {
    width: 120px;
    height: 120px;
    margin: 0 auto 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 60px;
    animation: am-badge-bounce 0.6s ease;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.am-badge-modal-icon i {
    color: white;
}

@keyframes am-badge-bounce {
    0% {
        transform: scale(0) rotate(-180deg);
    }
    50% {
        transform: scale(1.1) rotate(10deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
    }
}

.am-badge-modal-name {
    font-size: 24px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 12px;
}

.am-badge-modal-description {
    font-size: 16px;
    color: #6b7280;
    line-height: 1.6;
    margin-bottom: 32px;
}

.am-badge-modal-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.am-badge-modal-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.4);
}

/* 最近のバッジウィジェット */
.am-recent-badges {
    background: white;
    border-radius: 16px;
    padding: 24px;
    border: 2px solid #e5e7eb;
}

.am-recent-badges-title {
    font-size: 18px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.am-recent-badges-title i {
    color: #fbbf24;
}

.am-recent-badge-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px;
    border-radius: 12px;
    transition: all 0.2s ease;
    margin-bottom: 8px;
}

.am-recent-badge-item:hover {
    background: #f9fafb;
}

.am-recent-badge-item:last-child {
    margin-bottom: 0;
}

.am-recent-badge-icon-small {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.am-recent-badge-icon-small i {
    color: white;
}

.am-recent-badge-info {
    flex: 1;
}

.am-recent-badge-name-small {
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 4px;
}

.am-recent-badge-date-small {
    font-size: 12px;
    color: #9ca3af;
}

.am-badge-empty {
    text-align: center;
    padding: 32px;
    color: #9ca3af;
}

.am-badge-empty i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.am-badge-empty-text {
    font-size: 14px;
}

/* サイドバーバッジカウンター */
.am-sidebar-badge-counter {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    margin-bottom: 16px;
}

.am-sidebar-badge-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.am-sidebar-badge-count {
    font-size: 24px;
    font-weight: 700;
    color: #92400e;
    line-height: 1;
    margin-bottom: 4px;
}

.am-sidebar-badge-label {
    font-size: 12px;
    color: #78350f;
    font-weight: 500;
}

/* パルスアニメーション（新規獲得時） */
@keyframes am-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(251, 191, 36, 0.7);
    }
    70% {
        box-shadow: 0 0 0 20px rgba(251, 191, 36, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(251, 191, 36, 0);
    }
}

.am-badge-new {
    animation: am-pulse 2s infinite;
}
