/* ClassPet Pro - 宠物认养系统和自定义图片样式 */

/* ==================== 宠物认养中心 ==================== */
.adoption-center {
    max-width: 900px;
    width: 95vw;
    max-height: 85vh;
    overflow-y: auto;
}

.my-pet-info {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    color: white;
    text-align: center;
}

.my-pet-info h3 {
    margin: 0 0 15px 0;
    font-size: 18px;
}

.current-pet-card {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 10px;
}

.current-pet-emoji {
    font-size: 60px;
}

.current-pet-info {
    text-align: left;
}

.current-pet-info .pet-name {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 5px;
}

.current-pet-info .pet-meta {
    display: flex;
    gap: 10px;
    font-size: 14px;
}

.pet-style {
    padding: 4px 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.3);
}

.pet-rarity {
    padding: 4px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: bold;
}

.my-pet-stats {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

/* 筛选按钮 */
.filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
}

.filter-btn {
    padding: 10px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    background: white;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    transition: all 0.3s;
}

.filter-btn:hover {
    border-color: #667eea;
    color: #667eea;
}

.filter-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: transparent;
}

/* 宠物库网格 */
.pet-library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    padding: 10px;
    max-height: 400px;
    overflow-y: auto;
}

.pet-library-item {
    background: white;
    border-radius: 15px;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid #e0e0e0;
    position: relative;
    overflow: hidden;
}

.pet-library-item:hover:not(.disabled):not(.current) {
    transform: translateY(-5px);
    border-color: #667eea;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.pet-library-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f8f9fa;
}

.pet-library-item.current {
    border-color: #f093fb;
    background: linear-gradient(135deg, rgba(240, 147, 251, 0.1) 0%, rgba(245, 87, 108, 0.1) 100%);
}

.pet-card-emoji {
    font-size: 50px;
    margin-bottom: 10px;
}

.pet-card-info {
    margin-bottom: 10px;
}

.pet-card-name {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 5px;
    color: #333;
}

.pet-card-meta {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 10px;
}

.pet-style-tag {
    font-size: 20px;
}

.pet-rarity-tag {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
}

.pet-card-cost {
    font-size: 16px;
    font-weight: bold;
    color: #667eea;
}

.pet-card-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: bold;
}

.no-pets-message {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    color: #999;
    font-size: 16px;
}

.current-pet-empty {
    padding: 30px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 16px;
}

/* ==================== 自定义图片上传 ==================== */
.custom-upload {
    max-width: 500px;
    width: 90vw;
}

.upload-info {
    text-align: center;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
}

.upload-info p {
    margin: 5px 0;
    font-size: 14px;
    color: #666;
}

.upload-info span {
    font-weight: bold;
    color: #333;
}

.toggle-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
}

.toggle-container span {
    font-weight: 500;
    color: #333;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #667eea;
}

input:checked + .slider:before {
    transform: translateX(26px);
}

/* 图片上传区域 */
.image-upload-area {
    margin-bottom: 20px;
    min-height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.upload-placeholder {
    border: 3px dashed #ccc;
    border-radius: 15px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    width: 100%;
}

.upload-placeholder:hover,
.upload-placeholder.dragover {
    border-color: #667eea;
    background: #f8f9ff;
}

.upload-placeholder span {
    font-size: 48px;
    margin-bottom: 10px;
    display: block;
}

.upload-placeholder p {
    margin: 5px 0;
    color: #666;
}

.upload-placeholder .hint {
    font-size: 12px;
    color: #999;
}

.custom-preview {
    max-width: 250px;
    max-height: 250px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* 上传操作按钮 */
.upload-actions {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.upload-actions button {
    flex: 1;
    padding: 15px;
    font-size: 16px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
}

.upload-actions .btn-secondary {
    background: #f8f9fa;
    color: #666;
}

.upload-actions .btn-secondary:hover {
    background: #e9ecef;
}

.upload-actions .btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.upload-actions .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

/* 自定义图片按钮 */
.btn-custom-image {
    width: 100%;
    padding: 15px;
    font-size: 18px;
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    color: white;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s;
    margin-bottom: 10px;
}

.btn-custom-image:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(250, 112, 154, 0.4);
}

/* 宠物操作按钮容器 */
.pet-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}

/* 认养宠物按钮 */
.btn-adopt-pet {
    width: 100%;
    padding: 15px;
    font-size: 18px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s;
}

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

/* 自定义图片显示 */
.pet-image-custom {
    width: 120px;
    height: 120px;
    object-fit: contain;
    border-radius: 10px;
}

.pet-image-custom-modal {
    width: 150px;
    height: 150px;
    object-fit: contain;
    border-radius: 10px;
}

/* ==================== 音乐上传样式 ==================== */
.music-upload-area {
    margin-bottom: 20px;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#musicUploadPlaceholder {
    border: 3px dashed #ccc;
    border-radius: 15px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    width: 100%;
}

#musicUploadPlaceholder:hover {
    border-color: #667eea;
    background: #f8f9ff;
}

#musicUploadPlaceholder span {
    font-size: 48px;
    margin-bottom: 10px;
    display: block;
}

#musicUploadPlaceholder p {
    margin: 5px 0;
    color: #666;
}

#musicUploadPlaceholder .hint {
    font-size: 12px;
    color: #999;
}

/* 宠物名称小标签 */
.pet-name-mini {
    position: absolute;
    bottom: 35px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    white-space: nowrap;
}

.pet-name-badge {
    position: absolute;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(102, 126, 234, 0.9);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .adoption-center {
        width: 100vw;
        max-width: none;
        max-height: 90vh;
    }

    .pet-library-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 10px;
    }

    .filters {
        gap: 8px;
    }

    .filter-btn {
        padding: 8px 15px;
        font-size: 12px;
    }

    .custom-upload {
        width: 95vw;
    }
}

@media (max-width: 480px) {
    .pet-library-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 8px;
    }

    .current-pet-card {
        flex-direction: column;
        gap: 10px;
    }

    .upload-actions {
        flex-direction: column;
    }
}
