/* 认证模块样式 */
/* 遵循苹果风格设计，与现有项目风格保持一致 */

/* 认证容器 */
.auth-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    padding: 24px;
    margin: 20px auto;
    max-width: 400px;
    position: relative;
    overflow: hidden;
}

/* 用户状态显示 */
.user-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px;
    background: var(--surface-muted);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.user-details {
    flex: 1;
    min-width: 0;
}

.user-email {
    font-weight: 600;
    color: var(--brand-color);
    margin-bottom: 4px;
    font-size: 14px;
}

.user-since {
    font-size: 12px;
    color: var(--text-muted);
}

.logout-btn {
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.logout-btn:hover {
    background: #dc2626;
    transform: translateY(-1px);
}

/* 认证切换按钮 */
.auth-toggle {
    display: flex;
    background: var(--surface-muted);
    border-radius: 8px;
    padding: 4px;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
}

.auth-btn {
    flex: 1;
    background: transparent;
    border: none;
    padding: 10px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
}

.auth-btn.active {
    background: white;
    color: var(--brand-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.auth-btn:hover:not(.active) {
    color: var(--brand-color);
}

/* 认证表单 */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.auth-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.auth-form label {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
}

.auth-form input {
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    background: white;
    transition: all 0.2s ease;
}

.auth-form input:focus {
    outline: none;
    border-color: var(--brand-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.auth-form input::placeholder {
    color: #9ca3af;
}

.auth-form small {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* 表单操作按钮 */
.form-actions {
    margin-top: 8px;
}

.submit-btn {
    width: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.submit-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.submit-btn:active {
    transform: translateY(0);
}

.submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* 加载状态 */
.auth-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 32px 16px;
}

.loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--brand-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 500;
}

/* 错误提示 */
.auth-error {
    background: #fef2f2;
    color: #dc2626;
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid #fecaca;
    font-size: 14px;
    margin-top: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.auth-error::before {
    content: "⚠️";
    font-size: 16px;
}

/* 成功提示 */
.auth-success {
    background: #f0fdf4;
    color: #16a34a;
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid #bbf7d0;
    font-size: 14px;
    margin-top: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.auth-success::before {
    content: "✅";
    font-size: 16px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .auth-container {
        margin: 16px;
        padding: 20px;
        max-width: none;
    }
    
    .user-status {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    .user-info {
        justify-content: center;
    }
    
    .logout-btn {
        width: 100%;
        justify-content: center;
    }
}

/* 动画效果 */
.auth-container {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 表单切换动画 */
.auth-form {
    transition: opacity 0.2s ease;
}

.auth-form[style*="display: none"] {
    opacity: 0;
}

/* 焦点状态优化 */
.auth-form input:focus {
    transform: translateY(-1px);
}

/* 按钮悬停效果 */
.submit-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.submit-btn:hover::before {
    left: 100%;
}

/* 浮动用户状态栏 */
.floating-user-status {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    padding: 12px 16px;
    z-index: 1000;
    animation: slideInRight 0.3s ease-out;
    width: auto;
    min-width: auto;
}

.user-info-compact {
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-avatar-small {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.user-email-compact {
    font-size: 14px;
    font-weight: 500;
    color: var(--brand-color);
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.logout-btn-compact {
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.logout-btn-compact:hover {
    background: #dc2626;
    transform: translateY(-1px);
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .floating-user-status {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
        width: auto;
        min-width: auto;
    }
    
    .user-info-compact {
        width: 100%;
        justify-content: space-between;
    }
    
    .user-email-compact {
        max-width: 120px;
        flex: 1;
        text-align: center;
    }
    
    .user-avatar-small {
        width: 28px;
        height: 28px;
    }
    
    .logout-btn-compact {
        padding: 4px;
    }
}

/* 暗色模式支持 */
@media (prefers-color-scheme: dark) {
    .auth-container {
        background: rgba(30, 30, 30, 0.95);
        border-color: rgba(255, 255, 255, 0.1);
    }
    
    .auth-form input {
        background: rgba(40, 40, 40, 0.8);
        border-color: rgba(255, 255, 255, 0.1);
        color: white;
    }
    
    .auth-form input::placeholder {
        color: #6b7280;
    }
    
    .user-status {
        background: rgba(40, 40, 40, 0.8);
        border-color: rgba(255, 255, 255, 0.1);
    }
    
    .auth-toggle {
        background: rgba(40, 40, 40, 0.8);
        border-color: rgba(255, 255, 255, 0.1);
    }
    
    .auth-btn.active {
        background: rgba(60, 60, 60, 0.8);
    }
    
    .floating-user-status {
        background: rgba(30, 30, 30, 0.95);
        border-color: rgba(255, 255, 255, 0.1);
    }
}
