/* auth.css - 认证组件完整样式 */

/* 模态框基础样式 */
.modal {
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: none;
    flex-direction: row;
    justify-content: flex-start;
    align-items: stretch;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
    position: relative;
    overflow: hidden;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* 关闭按钮 */
.close {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 28px;
    font-weight: bold;
    color: #999;
    cursor: pointer;
    transition: color 0.3s;
    z-index: 1;
}

.close:hover {
    color: #333;
}

/* 标题样式 */
.modal-content h3 {
    text-align: center;
    margin: 30px 0 25px 0;
    color: #2c3e50;
    font-size: 24px;
    font-weight: 600;
    padding: 0 30px;
}

/* 标签页样式 */
.auth-tabs {
    display: flex;
    margin: 0 30px 25px 30px;
    border-bottom: 2px solid #f0f0f0;
    background: #f8f9fa;
    border-radius: 8px 8px 0 0;
    overflow: hidden;
}

.tab-btn {
    flex: 1;
    padding: 15px 20px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    color: #666;
    transition: all 0.3s ease;
    position: relative;
}

.tab-btn.active {
    color: #3498db;
    background: white;
    font-weight: 600;
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 3px;
    background: #3498db;
    border-radius: 3px 3px 0 0;
}

.tab-btn:hover:not(.active) {
    color: #2980b9;
    background: rgba(52, 152, 219, 0.1);
}

/* 表单容器 */
.auth-form {
    padding: 0 30px 30px 30px;
    display: none;
}

.auth-form.active {
    display: block;
}

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

.form-group input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.3s ease;
    box-sizing: border-box;
    background: #f8f9fa;
    font-family: inherit;
}

.form-group input:focus {
    outline: none;
    border-color: #3498db;
    background: white;
    box-shadow: 0 0 0 4px rgba(52, 152, 219, 0.1);
    transform: translateY(-1px);
}

.form-group input::placeholder {
    color: #a0a0a0;
    font-weight: 400;
}

.form-group input:focus::placeholder {
    color: #ccc;
}

/* 文件上传样式 */
.file-label {
    display: block;
    padding: 12px 16px;
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
    transition: all 0.3s ease;
    color: #666;
    font-size: 14px;
}

.file-label:hover {
    background: #e9ecef;
    border-color: #3498db;
    color: #3498db;
}

.file-label span {
    display: block;
}

#avatarPreview {
    margin-top: 12px;
    text-align: center;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

#previewImage {
    border-radius: 50%;
    border: 3px solid #e9ecef;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

#previewImage:hover {
    border-color: #3498db;
    transform: scale(1.05);
}

/* 按钮样式 */
.btn-primary {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    margin-top: 10px;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2980b9, #1c6ea4);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(52, 152, 219, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

/* 用户面板样式 */
#userPanel {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin: 15px;
    color: white;
}

#userInfo {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

#userAvatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

#userAvatar:hover {
    border-color: rgba(255, 255, 255, 0.6);
    transform: scale(1.05);
}

#userName {
    font-weight: 600;
    font-size: 16px;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

#userClan {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
    margin-top: 2px;
}

#userActions {
    display: flex;
    gap: 10px;
}

#loginBtn, .btn-outline {
    padding: 10px 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

#loginBtn:hover, .btn-outline:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

#loggedInActions {
    display: none;
    gap: 8px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 20px;
        max-width: none;
    }
    
    .modal-content h3 {
        font-size: 20px;
        margin: 20px 0 15px 0;
        padding: 0 20px;
    }
    
    .auth-tabs {
        margin: 0 20px 20px 20px;
    }
    
    .tab-btn {
        padding: 12px 15px;
        font-size: 14px;
    }
    
    .auth-form {
        padding: 0 20px 20px 20px;
    }
    
    .form-group input {
        padding: 12px 14px;
        font-size: 14px;
    }
    
    .btn-primary {
        padding: 14px;
        font-size: 15px;
    }
    
    #userPanel {
        flex-direction: column;
        gap: 12px;
        text-align: center;
        margin: 10px;
    }
    
    #userInfo {
        flex-direction: column;
        text-align: center;
    }
    
    #userActions {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .modal-content {
        border-radius: 8px;
    }
    
    .auth-tabs {
        flex-direction: column;
    }
    
    .tab-btn {
        text-align: center;
        border-bottom: 1px solid #f0f0f0;
    }
    
    .tab-btn.active::after {
        display: none;
    }
    
    .tab-btn.active {
        border-bottom: 2px solid #3498db;
    }
}

/* 输入验证状态 */
.form-group input.error {
    border-color: #e74c3c;
    background: #fdf2f2;
}

.form-group input.success {
    border-color: #27ae60;
    background: #f2fdf2;
}

/* 加载状态 */
.btn-primary:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    transform: none;
}

.btn-primary:disabled:hover {
    transform: none;
    box-shadow: none;
}

/* 滚动条样式（针对长表单） */
.modal-content::-webkit-scrollbar {
    width: 6px;
}

.modal-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 焦点指示器（无障碍支持） */
.form-group input:focus-visible {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

/* 减少动画（针对偏好减少动画的用户） */
@media (prefers-reduced-motion: reduce) {
    .modal-content,
    .form-group input,
    .btn-primary,
    #userAvatar,
    #loginBtn,
    .btn-outline {
        animation: none;
        transition: none;
    }
}