/* 密码生成器样式 */

/* 字符选项样式 */
.character-options, .advanced-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.option-item {
    display: flex;
    flex-direction: column;
    padding: 15px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    background-color: #f8f9fa;
    transition: all 0.3s ease;
    position: relative; /* 为绝对定位的复选框提供定位上下文 */
}

.option-item:hover {
    background-color: #e9ecef;
    border-color: #007bff;
}

.option-item.selected {
    background-color: rgba(0, 123, 255, 0.1);
    border-color: #007bff;
}

.option-item .form-check-input {
    position: absolute;
    top: 15px;
    left: 15px;
    margin: 0;
    z-index: 2;
}

.option-item .form-check-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    color: #495057;
    cursor: pointer;
    margin: 0 0 8px 0;
    padding-left: 35px; /* 为复选框留出空间 */
}

.option-preview {
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: #6c757d;
    background-color: #fff;
    padding: 8px;
    border-radius: 4px;
    word-break: break-all;
    border: 1px solid #e9ecef;
}

/* 密码长度滑块样式 */
#passwordLength {
    -webkit-appearance: none;
    appearance: none;
    height: 8px;
    border-radius: 4px;
    background: linear-gradient(to right, #dc3545 0%, #ffc107 50%, #28a745 100%);
    outline: none;
    transition: background 0.3s ease;
}

#passwordLength::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #007bff;
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

#passwordLength::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #007bff;
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* 密码结果样式 */
.password-results {
    max-height: 400px;
    overflow-y: auto;
}

.password-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    margin-bottom: 10px;
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    transition: all 0.3s ease;
    flex-wrap: nowrap;
    min-height: 50px;
}

.password-item:hover {
    background-color: #f8f9fa;
    border-color: #007bff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.password-text {
    font-family: 'Courier New', monospace;
    font-size: 14px;
    font-weight: 500;
    color: #495057;
    flex: 1;
    margin-right: 15px;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    position: relative;
}

.password-text:hover {
    white-space: normal;
    word-break: break-all;
    overflow: visible;
    background-color: #fff;
    z-index: 10;
    padding: 8px;
    border: 1px solid #007bff;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.password-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.copy-btn {
    background: none;
    border: none;
    color: #007bff;
    cursor: pointer;
    padding: 5px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
    font-size: 16px;
}

.copy-btn:hover {
    background-color: #007bff;
    color: white;
}

.copy-btn.copied {
    background-color: #28a745;
    color: white;
}

/* 强度统计样式 */
.strength-stats {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.stat-card {
    text-align: center;
    padding: 15px;
    background-color: #fff;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

.stat-card:hover {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.stat-number {
    font-size: 24px;
    font-weight: bold;
    color: #007bff;
    margin-bottom: 5px;
}

.stat-number.strength-weak {
    color: #dc3545;
}

.stat-number.strength-medium {
    color: #ffc107;
}

.stat-number.strength-good {
    color: #28a745;
}

.stat-number.strength-strong {
    color: #17a2b8;
}

.stat-label {
    font-size: 12px;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* 按钮样式增强 */
#generateBtn {
    position: relative;
    overflow: hidden;
}

#generateBtn:active {
    transform: none;
}

#generateBtn.generating {
    pointer-events: none;
}

#generateBtn.generating::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}


/* 响应式设计 */
@media (max-width: 768px) {
    .character-options, .advanced-options {
        gap: 10px;
    }

    .option-item {
        padding: 10px;
    }

    .password-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .password-text {
        margin-right: 0;
        margin-bottom: 10px;
        word-break: break-all;
    }

    .password-actions {
        align-self: flex-end;
    }

    .stat-card {
        margin-bottom: 15px;
    }
}

/* 加载动画 */
.loading-dots {
    display: inline-block;
}

.loading-dots::after {
    content: '';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% { content: ''; }
    40% { content: '.'; }
    60% { content: '..'; }
    80%, 100% { content: '...'; }
}

/* 字符集预览样式 */
.charset-preview {
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 15px;
    margin-top: 15px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    color: #495057;
    word-break: break-all;
    line-height: 1.6;
}

.charset-preview h6 {
    margin-bottom: 10px;
    color: #007bff;
    font-family: inherit;
}

/* 密码强度指示器 */
.strength-indicator {
    height: 8px;
    background-color: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 10px;
}

.strength-bar {
    height: 100%;
    transition: all 0.3s ease;
    border-radius: 4px;
}

.strength-bar.weak {
    width: 25%;
    background-color: #dc3545;
}

.strength-bar.medium {
    width: 50%;
    background-color: #ffc107;
}

.strength-bar.good {
    width: 75%;
    background-color: #28a745;
}

.strength-bar.strong {
    width: 100%;
    background: linear-gradient(90deg, #28a745, #17a2b8);
}