/**
 * Zibll WebAuthn 样式文件
 * 适配主题色调，支持暗色模式
 */

/* 账户设置页面样式 */
.webauthn-section {
    position: relative;
}

.webauthn-credentials-list {
    margin-bottom: 20px;
}

.webauthn-empty-state {
    padding: 40px 20px;
}

.webauthn-credential-item {
    padding: 15px;
    border-radius: var(--main-radius, 8px);
    background: var(--main-bg-color, #fff);
    border: 1px solid var(--main-border-color, rgba(50, 50, 50, 0.06));
    transition: all 0.3s ease;
}

.webauthn-credential-item:hover {
    box-shadow: 0 2px 8px var(--main-shadow, rgba(116, 116, 116, 0.08));
    transform: translateY(-1px);
}

.webauthn-credential-item .credential-name {
    font-weight: 500;
    color: var(--key-color, #333);
    font-size: 14px;
}

.webauthn-credential-item .type-logo .circular {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 按钮样式 */
.webauthn-add-btn {
    min-width: 160px;
}

.webauthn-login-btn {
    position: relative;
    overflow: hidden;
}

.webauthn-login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(41, 151, 247, 0.3);
}

.webauthn-login-btn i {
    display: inline-block;
    transition: transform 0.3s ease;
}

.webauthn-login-btn:hover i {
    transform: scale(1.1);
}

/* 登录区域 */
.passkey-login-section {
    padding: 20px 15px 10px;
}

/* 重命名对话框 */
#webauthn-rename-modal {
    z-index: 99999;
}

#webauthn-rename-modal .modal-dialog {
    margin: 100px auto;
}

#webauthn-rename-modal .modal-content {
    background: var(--main-bg-color, #fff);
    border-radius: var(--main-radius, 8px);
    box-shadow: 0 4px 20px var(--main-shadow, rgba(116, 116, 116, 0.08));
}

#webauthn-rename-modal .form-control {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid var(--main-border-color, rgba(50, 50, 50, 0.06));
    border-radius: var(--main-radius, 8px);
    background: var(--main-bg-color, #fff);
    color: var(--key-color, #333);
    font-size: 14px;
    transition: all 0.3s ease;
}

#webauthn-rename-modal .form-control:focus {
    outline: none;
    border-color: var(--focus-color, #2997f7);
    box-shadow: 0 0 0 3px var(--focus-shadow-color, rgba(41, 151, 247, 0.1));
}

/* 响应式适配 */
@media (max-width: 768px) {
    .webauthn-credential-item {
        flex-direction: column;
        align-items: flex-start !important;
    }
    
    .webauthn-credential-item .type-logo {
        margin-bottom: 10px;
    }
    
    .webauthn-credential-item .shrink0 {
        width: 100%;
        justify-content: flex-start;
        margin-top: 10px;
    }
    
    .passkey-login-section {
        padding: 15px 10px 5px;
    }
}

/* 加载动画 */
@keyframes webauthn-pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.webauthn-loading {
    animation: webauthn-pulse 1.5s ease-in-out infinite;
}

/* 暗色模式适配 */
.dark-theme .webauthn-credential-item {
    background: var(--main-bg-color, #323335);
    border-color: var(--main-border-color, rgba(114, 114, 114, 0.1));
}

.dark-theme .webauthn-credential-item:hover {
    box-shadow: 0 2px 8px rgba(24, 24, 24, 0.2);
}

.dark-theme #webauthn-rename-modal .modal-content {
    background: var(--main-bg-color, #323335);
}

.dark-theme #webauthn-rename-modal .form-control {
    background: var(--main-bg-color, #323335);
    border-color: var(--main-border-color, rgba(114, 114, 114, 0.1));
    color: var(--key-color, #f8fafc);
}

/* 工具提示 */
.webauthn-tooltip {
    position: relative;
    display: inline-block;
}

.webauthn-tooltip:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 12px;
    background: var(--key-color, #333);
    color: #fff;
    font-size: 12px;
    white-space: nowrap;
    border-radius: 4px;
    margin-bottom: 5px;
    z-index: 1000;
}

/* 过渡动画 */
.webauthn-fade-enter {
    opacity: 0;
    transform: translateY(-10px);
}

.webauthn-fade-enter-active {
    opacity: 1;
    transform: translateY(0);
    transition: all 0.3s ease;
}

.webauthn-fade-exit {
    opacity: 1;
    transform: translateY(0);
}

.webauthn-fade-exit-active {
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

/* 确保与主题的按钮样式兼容 */
.webauthn-section .but {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
}

.webauthn-section .but:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* 分隔线样式与主题保持一致 */
.passkey-login-section .social-separator {
    position: relative;
    text-align: center;
}

.passkey-login-section .social-separator::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: 100%;
    height: 1px;
    background: var(--main-border-color, rgba(50, 50, 50, 0.06));
}

.passkey-login-section .social-separator span,
.passkey-login-section .separator {
    position: relative;
    display: inline-block;
    padding: 0 10px;
    background: var(--main-bg-color, #fff);
    z-index: 1;
}

/* 圆形图标容器 */
.circular {
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* 确保flex布局类兼容 */
.flex {
    display: flex;
}

.ac {
    align-items: center;
}

.jsb {
    justify-content: space-between;
}

.shrink0 {
    flex-shrink: 0;
}

