/**
 * components.css - 组件样式
 * 单一职责：组件专用样式
 */

/* 宠物卡片 */
.pet-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s;
    cursor: pointer;
}

.pet-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 107, 53, 0.3);
}

.pet-card-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.pet-avatar {
    font-size: 40px;
    margin-right: 15px;
}

.pet-name {
    font-size: 18px;
    font-weight: 600;
    color: #fff;
}

.pet-card-body {
    margin-bottom: 15px;
}

.pet-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 15px;
}

.stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
}

.stat-label {
    font-size: 12px;
    color: #aaa;
}

.stat-value {
    font-size: 14px;
    font-weight: 600;
    color: #3498db;
}

.pet-mood {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
}

.mood-label {
    font-size: 12px;
    color: #aaa;
}

.mood-value {
    font-size: 14px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
}

.mood-value.mood-happy {
    background: rgba(46, 204, 113, 0.2);
    color: #2ecc71;
}

.mood-value.mood-good {
    background: rgba(52, 152, 219, 0.2);
    color: #3498db;
}

.mood-value.mood-normal {
    background: rgba(241, 196, 15, 0.2);
    color: #f1c40f;
}

.mood-value.mood-sad {
    background: rgba(230, 126, 34, 0.2);
    color: #e67e22;
}

.mood-value.mood-angry {
    background: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
}

.pet-card-footer {
    display: flex;
    gap: 8px;
}

/* 宠物网格 */
.pets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

/* 空状态 */
.pets-empty {
    text-align: center;
    padding: 50px 20px;
}

.empty-icon {
    font-size: 60px;
    margin-bottom: 20px;
}

.pets-empty h3 {
    color: #fff;
    margin-bottom: 10px;
    font-size: 24px;
}

.pets-empty p {
    color: #aaa;
    margin-bottom: 30px;
}

/* 模态框 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: rgba(26, 26, 46, 0.95);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-header h3 {
    color: #ff6b35;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    color: #aaa;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.modal-body {
    padding: 20px;
}

/* 宠物详情 */
.pet-detail-header {
    display: flex;
    align-items: center;
    margin-bottom: 30px;
}

.pet-detail-avatar {
    font-size: 60px;
    margin-right: 20px;
}

.pet-detail-info h4 {
    font-size: 24px;
    color: #fff;
    margin-bottom: 5px;
}

.pet-type {
    color: #aaa;
    font-size: 14px;
}

.pet-detail-stats {
    margin-bottom: 30px;
}

.pet-detail-stats h5 {
    color: #3498db;
    margin-bottom: 15px;
    font-size: 18px;
}

.stats-grid {
    display: grid;
    gap: 15px;
}

.stat-item {
    display: grid;
    grid-template-columns: 80px 1fr 60px;
    align-items: center;
    gap: 15px;
}

.stat-name {
    color: #aaa;
    font-size: 14px;
}

.stat-value {
    color: #fff;
    font-size: 14px;
    font-weight: 600;
}

.stat-bar {
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.stat-fill {
    height: 100%;
    border-radius: 4px;
    background: #3498db;
}

.stat-fill.health {
    background: #2ecc71;
}

.stat-fill.attack {
    background: #e74c3c;
}

.stat-fill.defense {
    background: #f1c40f;
}

.stat-fill.speed {
    background: #9b59b6;
}

.pet-detail-mood {
    margin-bottom: 30px;
}

.pet-detail-mood h5 {
    color: #3498db;
    margin-bottom: 15px;
    font-size: 18px;
}

.mood-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    margin-bottom: 10px;
}

.mood-label {
    color: #aaa;
    font-size: 14px;
}

.mood-value.hunger-full,
.mood-value.clean-clean {
    background: rgba(46, 204, 113, 0.2);
    color: #2ecc71;
    padding: 2px 8px;
    border-radius: 4px;
}

.mood-value.hunger-good,
.mood-value.clean-good {
    background: rgba(52, 152, 219, 0.2);
    color: #3498db;
    padding: 2px 8px;
    border-radius: 4px;
}

.mood-value.hunger-normal,
.mood-value.clean-normal {
    background: rgba(241, 196, 15, 0.2);
    color: #f1c40f;
    padding: 2px 8px;
    border-radius: 4px;
}

.mood-value.hunger-hungry,
.mood-value.clean-dirty {
    background: rgba(230, 126, 34, 0.2);
    color: #e67e22;
    padding: 2px 8px;
    border-radius: 4px;
}

.mood-value.hunger-starving,
.mood-value.clean-very-dirty {
    background: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
    padding: 2px 8px;
    border-radius: 4px;
}

.pet-detail-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.pet-detail-actions .btn {
    flex: 1;
    min-width: 120px;
}

/* 加载状态 */
.loading-state {
    text-align: center;
    padding: 50px 20px;
}

.loading-state p {
    color: #aaa;
    margin-top: 20px;
}

/* 禁用状态 */
.nav-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.nav-btn.disabled:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: none;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .pets-grid {
        grid-template-columns: 1fr;
    }
    
    .stat-item {
        grid-template-columns: 70px 1fr 50px;
        gap: 10px;
    }
    
    .pet-detail-actions .btn {
        min-width: 100%;
    }
    
    .modal-content {
        width: 95%;
        margin: 10px;
    }
}

@media (max-width: 480px) {
    .pet-stats {
        grid-template-columns: 1fr;
    }
    
    .stat-item {
        grid-template-columns: 60px 1fr 40px;
        gap: 8px;
    }
    
    .pet-detail-header {
        flex-direction: column;
        text-align: center;
    }
    
    .pet-detail-avatar {
        margin-right: 0;
        margin-bottom: 15px;
    }
}