/* 愿望单插件前端样式 */
.wishlist-buttons {
    display: flex;
    gap: 15px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.wishlist-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    min-height: 48px;
}

.wishlist-add-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.wishlist-add-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.wishlist-view-btn {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(240, 147, 251, 0.3);
}

.wishlist-view-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(240, 147, 251, 0.4);
}

.wishlist-btn .dashicons {
    width: 20px;
    height: 20px;
    font-size: 20px;
}

/* 模态框样式 - 确保在整个页面中间显示 */
.wishlist-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    display: none; /* 默认隐藏 */
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: wishlistFadeIn 0.3s ease;
}

.wishlist-modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5);
    animation: wishlistSlideUp 0.3s ease;
    position: relative;
    margin: 20px;
    transform: translateZ(0); /* 硬件加速 */
    display: flex;
    flex-direction: column;
}

.wishlist-modal-header {
    flex-shrink: 0;
}

.wishlist-modal-body {
    flex-grow: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

.wishlist-modal-footer {
    flex-shrink: 0;
    overflow-x: auto;
    white-space: nowrap;
}

/* 动画定义 */
@keyframes wishlistFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

.wishlist-large {
    max-width: 800px;
    width: 95%;
}

.wishlist-modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e5e5e5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.wishlist-modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.wishlist-close {
    font-size: 28px;
    cursor: pointer;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.wishlist-close:hover {
    opacity: 1;
}

.wishlist-modal-body {
    padding: 24px;
    max-height: calc(90vh - 140px);
    overflow-y: auto;
}

.wishlist-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #e5e5e5;
    background: #f9f9f9;
}

/* 表单样式 */
.wishlist-form-group {
    margin-bottom: 20px;
}

.wishlist-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.wishlist-form-group input[type="text"],
.wishlist-form-group input[type="url"],
.wishlist-form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e5e5;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.wishlist-form-group input:focus,
.wishlist-form-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.wishlist-field-note {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: #666;
    font-style: italic;
}

.wishlist-form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.wishlist-submit-btn {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    flex: 1;
}

.wishlist-cancel-btn {
    background: #f0f0f0;
    color: #666;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    flex: 1;
}

.wishlist-submit-btn:hover {
    background: linear-gradient(135deg, #45a049 0%, #4CAF50 100%);
}

.wishlist-cancel-btn:hover {
    background: #e0e0e0;
}

.wishlist-form-message {
    margin-top: 16px;
    padding: 12px;
    border-radius: 6px;
    font-weight: 500;
}

.wishlist-form-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.wishlist-form-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* 愿望单项目样式 */
.wishlist-item {
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    margin-bottom: 12px;
    padding: 10px;
    background: white;
    transition: all 0.3s ease;
}

.wishlist-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.wishlist-item-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.wishlist-item-name {
    flex: 1;
    min-width: 200px;
    font-size: 15px;
}

.wishlist-item-name span {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.wishlist-item-secondary {
    font-size: 14px;
    color: #666;
    margin-left: 8px;
    font-style: italic;
}

.wishlist-item-link {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

.wishlist-item-link:hover {
    text-decoration: underline;
}

.wishlist-item-meta {
    display: flex;
    align-items: center;
    gap: 12px;
}

.wishlist-status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-pending {
    background: #e3f2fd;
    color: #1976d2;
}

.status-completed {
    background: #e8f5e8;
    color: #2e7d32;
}

.status-denied {
    background: #ffebee;
    color: #c62828;
}

.wishlist-store-link {
    color: #666;
    text-decoration: none;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.wishlist-store-link:hover {
    opacity: 1;
    color: #667eea;
}

/* 加载和空状态 */
.wishlist-loading,
.wishlist-empty {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.wishlist-loading .dashicons {
    animation: spin 1s linear infinite;
    margin-right: 8px;
}

/* 分页样式 */
.wishlist-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 0;
    flex-wrap: wrap;
    width: 100%;
    box-sizing: border-box;
}

.wishlist-page-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background 0.3s ease;
    flex-shrink: 0;
    min-width: 36px;
    justify-content: center;
}

.wishlist-page-btn:hover:not(:disabled) {
    background: #5a6fd8;
}

.wishlist-page-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.wishlist-page-info {
    font-size: 14px;
    color: #666;
    font-weight: 500;
    flex-shrink: 0;
    text-align: center;
    margin: 0 8px;
    min-width: 100px;
}

/* 移动端优化 */
@media (max-width: 768px) {
    .wishlist-modal-content {
        margin: 10px;
        width: calc(100% - 20px);
    }
    
    .wishlist-large {
        max-width: 100%;
        width: calc(100% - 20px);
    }
    
    .wishlist-pagination {
        gap: 6px;
        padding: 12px 8px;
    }
    
    .wishlist-page-btn {
        padding: 6px 12px;
        font-size: 13px;
        min-width: 32px;
    }
    
    .wishlist-page-info {
        font-size: 13px;
        min-width: 80px;
        margin: 0 4px;
    }
    
    .wishlist-modal-body {
        padding: 16px;
    }
    
    .wishlist-modal-footer {
        padding: 12px 16px;
    }
}

/* 动画 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .wishlist-buttons {
        flex-direction: column;
        align-items: stretch;
    }
    
    .wishlist-btn {
        justify-content: center;
    }
    
    .wishlist-modal-content {
        width: 95%;
        margin: 20px;
    }
    
    .wishlist-modal-body {
        padding: 16px;
    }
    
    .wishlist-item-content {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .wishlist-item-meta {
        align-self: stretch;
        justify-content: space-between;
    }
    
    .wishlist-form-actions {
        flex-direction: column;
    }
    
    .wishlist-pagination {
        flex-direction: column;
        gap: 8px;
    }
}

@media (max-width: 480px) {
    .wishlist-modal-header {
        padding: 16px;
    }
    
    .wishlist-modal-header h3 {
        font-size: 18px;
    }
    
    .wishlist-form-group input[type="text"],
    .wishlist-form-group input[type="url"],
    .wishlist-form-group select {
        padding: 10px 12px;
        font-size: 14px;
    }
}