/* frontend.css */
/* User Profile Badge Display */
.author-badges {
    margin: 15px 0;
}

.author-badges h4 {
    margin-bottom: 10px;
    font-size: 16px;
}

.user-badges-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.user-badges-container .user-badge {
    position: relative;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
}

.user-badges-container .user-badge img {
    border-radius: 50%;
    border: 2px solid #ddd;
    padding: 3px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s;
}

.user-badges-container .user-badge:hover img {
    transform: scale(1.1);
    border-color: #2271b1;
}

.user-badges-container .user-badge .badge-name {
    font-size: 12px;
    text-align: center;
    margin-top: 5px;
    max-width: 70px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-badges-container.size-small .user-badge img {
    width: 30px;
    height: 30px;
}

.user-badges-container.size-medium .user-badge img {
    width: 50px;
    height: 50px;
}

.user-badges-container.size-large .user-badge img {
    width: 70px;
    height: 70px;
}

/* 添加点击提示 */
.user-badges-container .user-badge {
    cursor: pointer;
}

.user-badges-container .user-badge img {
    transition: transform 0.3s, box-shadow 0.3s;
}

.user-badges-container .user-badge:hover img {
    transform: scale(1.1);
    border-color: #2271b1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Tooltip styling */
.user-badge[title]:hover:after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 5px 10px;
    border-radius: 3px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 10;
    pointer-events: none;
}

/* 简化版 - 使用WordPress内置lightbox功能 */
/* 为徽章图片添加点击放大提示效果 */
.user-badges-container .user-badge {
    position: relative;
}

.user-badges-container .user-badge a.badge-lightbox-trigger {
    display: block;
    text-decoration: none;
}

.user-badges-container .user-badge:hover::after {
    content: "🔍";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    pointer-events: none;
    opacity: 0;
    animation: fadeInIcon 0.3s ease forwards;
}

@keyframes fadeInIcon {
    to { opacity: 1; }
}

/* 改进简单lightbox的样式 */
#badge-simple-lightbox {
    backdrop-filter: blur(3px);
}

#badge-simple-lightbox img {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

#badge-simple-lightbox .close-btn {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transition: all 0.2s ease;
}

#badge-simple-lightbox .close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* 简单的徽章通知样式 - 避免与现有系统冲突 */
#simple-badge-notice {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

#simple-badge-notice h3 {
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

#simple-badge-notice h4 {
    font-weight: 600;
}

#simple-badge-notice p {
    line-height: 1.4;
}

#simple-badge-notice button {
    font-weight: 500;
    transition: all 0.2s ease;
}

#simple-badge-notice button:hover {
    background: rgba(255,255,255,0.3) !important;
    transform: translateY(-1px);
}

@media (max-width: 480px) {
    #simple-badge-notice {
        padding: 20px !important;
        margin: 10px !important;
    }

    #simple-badge-notice h3 {
        font-size: 20px !important;
    }

    .simple-badge-item img,
    .simple-badge-item > div:first-child > div {
        width: 50px !important;
        height: 50px !important;
    }

    .simple-badge-item h4 {
        font-size: 16px !important;
    }

    .simple-badge-item p {
        font-size: 13px !important;
    }
}

/* 保留原有的顶部通知样式作为备用 */
.badge-award-notification {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    max-width: 500px;
    min-width: 350px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 0 0 12px 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    color: white;
    overflow: hidden;
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-top: none;
}

.badge-notice-header {
    padding: 20px 20px 15px;
    position: relative;
    background: rgba(255, 255, 255, 0.1);
}

.badge-notice-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    text-align: center;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.close-badge-notice {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.close-badge-notice:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.badge-notice-content {
    padding: 0 20px 20px;
}

.badge-notice-item {
    display: flex;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    opacity: 0;
    transform: translateX(20px);
    transition: all 0.3s ease;
}

.badge-notice-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.badge-notice-image-wrapper {
    position: relative;
    flex-shrink: 0;
    margin-right: 15px;
    cursor: pointer;
    border-radius: 50%;
    overflow: hidden;
    transition: transform 0.2s ease;
}

.badge-notice-image-wrapper:hover {
    transform: scale(1.05);
}

.badge-notice-image {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.3);
    object-fit: cover;
    transition: all 0.2s ease;
}

.badge-image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: none;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.zoom-icon {
    font-size: 20px;
    color: white;
}

.badge-notice-placeholder {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-right: 15px;
    border: 3px solid rgba(255, 255, 255, 0.3);
}

.badge-notice-info {
    flex: 1;
    min-width: 0;
}

.badge-notice-name {
    margin: 0 0 5px 0;
    font-size: 16px;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    color: #fff;
}

.badge-notice-desc {
    margin: 0;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.4;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .badge-award-notification {
        left: 10px;
        right: 10px;
        transform: none;
        max-width: none;
        min-width: 0;
        border-radius: 0 0 12px 12px;
    }

    .badge-notice-item {
        padding: 12px 0;
    }

    .badge-notice-image,
    .badge-notice-placeholder {
        width: 50px;
        height: 50px;
    }

    .badge-notice-placeholder {
        font-size: 20px;
    }

    .badge-notice-title {
        font-size: 16px;
    }

    .badge-notice-name {
        font-size: 15px;
    }

    .badge-notice-desc {
        font-size: 13px;
    }
}

/* 进入动画 - 从顶部滑入 */
@keyframes slideInFromTop {
    from {
        transform: translateX(-50%) translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

@keyframes slideInFromTopMobile {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.badge-award-notification {
    animation: slideInFromTop 0.8s ease-out;
}

@media (max-width: 768px) {
    .badge-award-notification {
        animation: slideInFromTopMobile 0.8s ease-out;
    }
}
/* 可赢取的徽章容器 */
.available-badges-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    padding: 20px 0;
}

.available-badge {
    border: 2px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    background: #fff;
    transition: all 0.3s ease;
}

.available-badge.obtained {
    border-color: #4CAF50;
    background: #f1f8f4;
}

.available-badge.not-obtained {
    border-color: #ff9800;
}

.available-badge:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.badge-image {
    text-align: center;
    margin-bottom: 10px;
}

.badge-image img {
    max-width: 80px;
    height: auto;
}

.badge-placeholder {
    font-size: 60px;
    display: block;
}

.badge-info {
    text-align: center;
}

.badge-name {
    margin: 10px 0;
    font-size: 18px;
    color: #333;
}

.badge-description {
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
}

.badge-status {
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: bold;
    margin: 10px 0;
}

.badge-status.obtained {
    background: #4CAF50;
    color: white;
}

.badge-status.not-obtained {
    background: #ff9800;
    color: white;
}

.badge-rules {
    text-align: left;
    padding: 10px;
    background: #f9f9f9;
    border-radius: 4px;
    font-size: 13px;
    margin-top: 10px;
}

.badge-rule-list {
    margin: 5px 0;
    padding-left: 20px;
}

.badge-rule-list li {
    margin: 5px 0;
}