/**
 * 收藏按钮样式
 * 为收藏功能提供美观的UI样式
 */

/* 全局动画样式 */
@keyframes slideIn {
    from { 
        transform: translateX(100%); 
        opacity: 0; 
    }
    to { 
        transform: translateX(0); 
        opacity: 1; 
    }
}

@keyframes fadeIn {
    from { 
        opacity: 0; 
        transform: scale(0.9); 
    }
    to { 
        opacity: 1; 
        transform: scale(1); 
    }
}

/* 收藏按钮基础样式（星星按钮） */
button[data-favorited] {
    background: transparent !important;
    border: none !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    font-size: 16px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    outline: none !important;
}

/* 菜单中的收藏按钮 */
.el-menu .el-menu-item button[data-favorited] {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    color: rgba(255, 255, 255, 0.6);
    z-index: 1001;
    text-shadow: 0 0 3px rgba(0,0,0,0.3);
}

/* 表格中的收藏按钮 */
table button[data-favorited] {
    width: 26px;
    height: 26px;
    color: rgba(128, 128, 128, 0.8);
    margin-left: 6px;
    text-shadow: 0 0 2px rgba(0,0,0,0.2);
}

/* 已收藏状态 */
button[data-favorited="true"] {
    color: #FFD700 !important;
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.6) !important;
}

/* 我的收藏按钮样式 */
.el-button.el-button--default.waves-effect[style*="linear-gradient"] {
    transition: all 0.3s ease;
}

/* 收藏卡片容器样式 */
#favorites-cards-container {
    padding: 20px;
    background: #f5f5f5;
    margin: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    animation: fadeIn 0.3s ease;
}

/* 收藏卡片网格 */
#favorites-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 20px;
    padding: 0;
}

/* 单个收藏卡片样式 */
#favorites-cards-grid > div {
    background: white;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    min-height: 100px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* 卡片悬停效果 */
#favorites-cards-grid > div:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

/* 卡片删除按钮 */
#favorites-cards-grid button {
    position: absolute;
    top: 5px;
    right: 5px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

/* 空状态样式 */
#favorites-cards-grid > div[style*="grid-column: 1/-1"] {
    grid-column: 1/-1;
    text-align: center;
    color: #999;
    padding: 60px 20px;
    font-size: 18px;
    background: white;
    border-radius: 8px;
    border: 2px dashed #ddd;
}

/* 通知消息样式 */
div[style*="position: fixed"][style*="right: 20px"][style*="top: 60px"] {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 25px;
    z-index: 99999;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    animation: slideIn 0.3s ease;
    max-width: 300px;
    word-wrap: break-word;
}

/* 成功通知 */
div[style*="background: #2ed573"] {
    background: linear-gradient(135deg, #56CCF2 0%, #2F80ED 100%) !important;
}

/* 错误通知 */
div[style*="background: #ff6b81"] {
    background: linear-gradient(135deg, #FF6B6B 0%, #FF8E8E 100%) !important;
}

/* 响应式设计 */
@media (max-width: 768px) {
    #favorites-cards-container {
        margin: 10px;
        padding: 15px;
    }
    
    #favorites-cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 15px;
    }
    
    button[data-favorited] {
        font-size: 14px !important;
        width: 20px !important;
        height: 20px !important;
    }
    
    div[style*="position: fixed"][style*="right: 20px"] {
        right: 10px !important;
        font-size: 14px !important;
        padding: 12px 20px !important;
    }
}

@media (max-width: 480px) {
    #favorites-cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        gap: 10px;
    }
    
    #favorites-cards-container {
        margin: 5px;
        padding: 10px;
    }
}

/* 深色主题兼容 */
@media (prefers-color-scheme: dark) {
    #favorites-cards-container {
        background: #2c3e50;
        color: #ecf0f1;
    }
    
    #favorites-cards-grid > div {
        background: #34495e;
        color: #ecf0f1;
    }
    
    #favorites-cards-grid > div:hover {
        background: #3b5270;
    }
    
    button[data-favorited] {
        filter: brightness(1.2);
    }
}

/* 减少动画选项支持 */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
    button[data-favorited] {
        border: 1px solid currentColor !important;
    }
    
    #favorites-cards-grid > div {
        border: 2px solid #333;
    }
}