/* 头像上传弹窗样式 */
.avatar-upload-container {
    text-align: center;
    padding: 20px;
}

.upload-area {
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 40px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: #fafafa;
}

.upload-area:hover {
    border-color: #1ab394;
    background-color: #f0f9ff;
}

.upload-placeholder i {
    color: #ccc;
    margin-bottom: 10px;
}

.upload-placeholder p {
    margin: 5px 0;
    color: #666;
}

.preview-area {
    margin-top: 20px;
}

.image-container {
    position: relative;
    display: inline-block;
    max-width: 200px;
}

.image-container img {
    width: 150px;
    height: 150px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.preview-image-container {
    width: 150px;
    height: 150px;
    margin: 0 auto;
    overflow: hidden;
    border-radius: 8px;
    position: relative;
    border: 2px solid #e0e0e0;
    background-color: #f8f9fa;
}

.preview-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.delete-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.delete-overlay:hover {
    opacity: 1;
}

.modal-dialog {
    max-width: 500px;
}

/* 头像加载动画样式 */
.avatar-loading {
    position: relative;
}

.avatar-loading img {
    opacity: 0.5;
    filter: blur(1px);
}

.avatar-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 64px;
    height: 64px;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    z-index: 10;
}

.loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #1ab394;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 头像容器样式优化 */
.profile-element {
    position: relative;
}

.profile-element .img-circle {
    transition: all 0.3s ease;
    position: relative;
    width: 64px;
    height: 64px;
    object-fit: cover;
}

.profile-element .img-circle.loading {
    opacity: 0.7;
}

/* 确保头像容器有正确的定位上下文 */
.nav-header .profile-element {
    position: relative;
    display: inline-block;
}

/* 待审核数量徽章样式 */
#auditPendingCount,
#orderAuditPendingCount {
    position: absolute;
    top: -5px;
    right: -5px;
    font-size: 10px;
    padding: 2px 5px;
    min-width: 18px;
    text-align: center;
    border-radius: 10px;
    animation: badge-appear 0.3s ease-out;
}

/* 审核管理主菜单徽章定位 */
#audit > .badge {
    position: relative;
    top: -2px;
    margin-left: 5px;
}

/* 订单审核子菜单徽章定位 */
#order_audit > .badge {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
}

/* 徽章动画效果 */
.badge-pulse {
    animation: badge-pulse 1s ease-in-out;
}

@keyframes badge-appear {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    70% {
        transform: scale(1.2);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes badge-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(217, 83, 79, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(217, 83, 79, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(217, 83, 79, 0);
    }
}

/* 确保菜单项有相对定位以便徽章定位 */
.nav > li > a {
    position: relative;
}

.nav-second-level > li > a {
    position: relative;
    padding-right: 40px !important;
}
