/* TangBuy Dropshipping - Token认证流程版样式 */

/* 🔐 Token认证流程版的主容器 */
.tangbuy-token-auth-wrap {
    background: #f5f5f5;
    margin: -10px 0 0 -20px;
    min-height: 100vh;
}

.tangbuy-container {
    background: white;
    margin: 0;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
}

/* Logo区域 */
.tangbuy-header {
    background: #fff;
    border-bottom: 1px solid #e0e0e0;
    padding: 0;
    margin: 0;
}

.tangbuy-header .nav.nav-pills {
    background: #fff;
    border: none;
    margin: 0;
    padding: 10px 20px;
    border-radius: 0;
}

.tangbuy-logo {
    width: 200px !important;
    height: auto;
    vertical-align: middle;
    max-width: 100%;
    margin-right: 20px;
}

/* 主要内容区域 */
.tangbuy-content {
    background: #f8f9fa;
    padding: 30px;
    min-height: 600px;
}

/* 🔐 连接状态卡片 - 支持多种状态 */
.connection-status-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 0;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.connection-status-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

/* 状态头部 */
.status-header {
    display: flex;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid #e0e0e0;
    background: #fafafa;
}

.status-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    font-size: 24px;
}

/* 🔐 不同认证状态的图标颜色 */
.connection-status-card.connected .status-icon {
    background: #d4edda;
    color: #28a745;
}

.connection-status-card.token-verified .status-icon {
    background: #fff3cd;
    color: #856404;
}

.connection-status-card.disconnected .status-icon {
    background: #f8d7da;
    color: #dc3545;
}

.status-text {
    flex: 1;
}

.status-text h3 {
    margin: 0 0 5px 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.status-text p {
    margin: 0;
    color: #666;
    font-size: 14px;
}

.status-badge .badge {
    font-size: 12px;
    padding: 6px 12px;
}

/* 连接详情 */
.connection-details {
    padding: 25px;
    background: #fff;
}

.detail-item {
    margin-bottom: 15px;
}

.detail-item label {
    display: block;
    font-weight: 600;
    color: #333;
    font-size: 12px;
    text-transform: uppercase;
    margin-bottom: 5px;
    letter-spacing: 0.5px;
}

.detail-value {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 8px 12px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    color: #495057;
}

/* 连接操作按钮 */
.connection-actions {
    padding: 20px 25px;
    border-top: 1px solid #e0e0e0;
    background: #fafafa;
    display: flex;
    gap: 10px;
    align-items: center;
}

/* 按钮样式 */
.btn {
    border-radius: 6px;
    padding: 10px 20px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.btn-primary {
    background: #007bff;
    border-color: #007bff;
    color: white;
}

.btn-primary:hover {
    background: #0056b3;
    border-color: #0056b3;
    color: white;
}

.btn-outline-danger {
    border-color: #dc3545;
    color: #dc3545;
    background: transparent;
}

.btn-outline-danger:hover {
    background: #dc3545;
    color: white;
}

.btn-outline-secondary {
    border-color: #6c757d;
    color: #6c757d;
    background: transparent;
}

.btn-outline-secondary:hover {
    background: #6c757d;
    color: white;
}

.btn-success {
    background: #28a745;
    border-color: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
    border-color: #1e7e34;
}

.btn-lg {
    padding: 12px 30px;
    font-size: 16px;
}

/* 🔐 认证流程指南 */
.connection-guide {
    padding: 25px;
    background: #fff;
}

.auth-flow-steps h4 {
    color: #333;
    margin-bottom: 20px;
    font-weight: 600;
}

.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.step {
    display: flex;
    align-items: flex-start;
    padding: 20px;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
}

.step-number {
    width: 35px;
    height: 35px;
    background: #007bff;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-right: 15px;
    flex-shrink: 0;
}

.step-content h5 {
    margin: 0 0 8px 0;
    color: #333;
    font-size: 16px;
    font-weight: 600;
}

.step-content p {
    margin: 0;
    color: #666;
    font-size: 14px;
    line-height: 1.5;
}

/* 🔐 手动Token输入区域 */
.manual-token-section {
    margin-top: 30px;
}

.manual-token-section .card {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.manual-token-section .card-header {
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
    padding: 15px 20px;
}

.manual-token-section .card-header h6 {
    margin: 0;
    color: #495057;
    font-weight: 600;
}

.manual-token-section .card-body {
    padding: 20px;
}

#manual-token {
    font-family: 'Courier New', monospace;
    font-size: 13px;
}

/* 消息和警告 */
.alert {
    border: none;
    border-radius: 6px;
    padding: 15px 20px;
    margin-bottom: 15px;
}

.alert-info {
    background: #cce7ff;
    color: #004085;
}

.alert-success {
    background: #d4edda;
    color: #155724;
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .tangbuy-content {
        padding: 15px;
    }
    
    .tangbuy-logo {
        width: 150px !important;
        max-width: 90vw;
    }
    
    .tangbuy-header .nav.nav-pills {
        padding: 10px 15px;
    }
    
    .status-header {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .connection-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .connection-actions .btn {
        width: 100%;
    }
    
    .steps {
        grid-template-columns: 1fr;
    }
    
    .step {
        flex-direction: column;
        text-align: center;
    }
    
    .step-number {
        margin: 0 auto 15px auto;
    }
    
    .manual-token-section .row {
        margin: 0;
    }
    
    .manual-token-section .col-md-8,
    .manual-token-section .col-md-4 {
        padding: 0;
        margin-bottom: 10px;
    }
    
    .manual-token-section .btn {
        width: 100%;
    }
}

/* 动画效果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.connection-status-card {
    animation: fadeInUp 0.5s ease-out;
}

/* 加载动画 */
.fa-spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* 隐藏WordPress默认样式 */
.tangbuy-token-auth-wrap .wrap h1 {
    display: none;
}

/* 🔐 确保Token认证流程版布局清洁 */
.tangbuy-token-auth-wrap * {
    box-sizing: border-box;
}

/* Bootstrap覆盖 */
.btn:focus,
.btn.focus {
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,.25);
}

.btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

/* 🔐 特殊状态的强调样式 */
.connection-status-card.token-verified {
    border-left: 4px solid #ffc107;
}

.connection-status-card.connected {
    border-left: 4px solid #28a745;
}

.connection-status-card.disconnected {
    border-left: 4px solid #dc3545;
}

.plugin-wrapper {
    min-height: 100vh;
    background: #EFF4FE;
    margin: -10px -20px;
}
.plugin-header {
    background-color: #FFF;
    height: 74px;
    padding-top: 10px;
}
.plugin-container {
    max-width: 1200px;
    margin-inline: auto;
}
.plugin-header-container {
    display: flex;
    height: 64px;
    align-items: center;
    padding-inline: 20px;
}
.plugin-logo {
    height: 40px;
}
.plugin-content {
    padding-inline: 20px;
    background-image: url(../images/tangbuybg.webp);
    background-position: left 407px top;
    background-size: auto 430px;
    background-repeat: no-repeat;
    min-height: 430px;
    box-sizing: border-box;
}
.plugin-box {
    background-color: #FFF;
    width: 436px;
    box-sizing: border-box;
    margin-top: 39px;
    padding: 15px 25px 25px;
}
.plugin-title {
    font-size: 18px;
    line-height: 25px;
    display: flex;
    gap: 4px;
}
.plugin-success-icon {
    height: 25px;
    width: 25px;
    display: block;
}
.plugin-desc {
    font-size: 12px;
    color: #666;
    margin-top: 4px;
}
.plugin-step {
    margin-top: 36px;
}
.plugin-step-item {
    position: relative;
    display: flex;
    gap: 12px;
}
.plugin-step-item-num {
    height: 24px;
    line-height: 24px;
    width: 24px;
    min-width: 24px;
    display: block;
    background-color: #2E66DF;
    border-radius: 999px;
    color: #FFF;
    font-size: 16px;
    text-align: center;
}
.plugin-step-item+.plugin-step-item {
    margin-top: 29px;
}
.plugin-step-item:not(:last-child)::after {
    content: '';
    display: block;
    position: absolute;
    left: 12px;
    height: calc(100% + 5px);
    top: 24px;
    border-left: 1px dashed rgba(46,90,239,0.24);
}
.plugin-step-item-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}
.plugin-step-item-desc {
    font-size: 12px;
    margin-top: 4px;
    color: #666;
}
.plugin-login {
    height: 52px;
    background: #333333;
    color: #FFF;
    border: none;
    font-size: 16px;
    margin-top: 113px;
    border-radius: 6px;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    text-decoration: none;
    outline: none;
}
.plugin-login:hover, .plugin-login:active, .plugin-login:focus {
    color: #FFF;
}
.plugin-enter {
    height: 52px;
    background: #333333;
    color: #FFF;
    border: none;
    font-size: 16px;
    margin-top: 31px;
    border-radius: 6px;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    text-decoration: none;
    outline: none;
}

.plugin-enter:hover, .plugin-enter:active, .plugin-enter:focus {
    color: #FFF;
}

.plugin-close {
    height: 52px;
    border: 1px solid #333;
    border-radius: 6px;
    color: #333;
    cursor: pointer;
    background: #FFF;
    display: block;
    margin-top: 12px;
    width: 100%;
    font-size: 16px;
}
.plugin-item+.plugin-item {
    margin-top: 19px;
}
.plugin-label {
    font-weight: 600;
}
.plugin-label-desc {
    font-size: 12px;
    color: #666;
    margin-top: 4px;
}
.plugin-messages {
    width: 436px;
    margin-top: 20px;
}