/* 密碼生成器特定樣式 */

/* 模板區塊 */
.template-section {
    margin-bottom: 2rem;
}

.template-section h3 {
    color: var(--secondary-color);
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.template-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.template-btn {
    padding: 0.8rem 1.5rem;
    border: 2px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-color);
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.template-btn:hover {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

.template-btn.active {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 12px rgba(247, 147, 26, 0.3);
}

/* 密碼設定 */
.password-settings {
    background: var(--light-gray);
    border-radius: 15px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.setting-row {
    margin-bottom: 2rem;
}

.setting-row label {
    display: block;
    font-weight: 600;
    color: var(--accent-color);
    margin-bottom: 0.8rem;
    font-size: 1.1rem;
}

/* 長度滑塊 */
.length-slider {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: var(--border-color);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
}

.length-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.length-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

/* 字符選項 */
.character-options h4 {
    color: var(--secondary-color);
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.option-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.option-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem;
    background: var(--card-bg);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.option-item:hover {
    border-color: var(--primary-color);
    background: rgba(247, 147, 26, 0.1);
}

.option-item input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: transparent;
    transition: all 0.3s ease;
}

.option-item input[type="checkbox"]:checked + .checkmark {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* 密碼顯示區 */
.password-display {
    margin-bottom: 2rem;
}

.password-display h3 {
    color: var(--secondary-color);
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.password-output {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.password-field {
    flex: 1;
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 1.1rem;
    background: var(--card-bg);
    color: var(--text-color);
    letter-spacing: 1px;
}

.password-field:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(247, 147, 26, 0.1);
}

.btn-icon {
    width: 44px;
    height: 44px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    border-radius: 8px;
}

/* 強度指示器 */
.strength-indicator {
    margin-top: 1rem;
}

.strength-bar {
    width: 100%;
    height: 12px;
    background: var(--border-color);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.strength-fill {
    height: 100%;
    transition: all 0.5s ease;
    border-radius: 6px;
}

.strength-fill.weak {
    background: linear-gradient(90deg, #dc3545, #e74c3c);
}

.strength-fill.poor {
    background: linear-gradient(90deg, #fd7e14, #f39c12);
}

.strength-fill.fair {
    background: linear-gradient(90deg, #ffc107, #f1c40f);
}

.strength-fill.good {
    background: linear-gradient(90deg, #20c997, #17a2b8);
}

.strength-fill.strong {
    background: linear-gradient(90deg, #28a745, #20c997);
}

.strength-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
}

.strength-text {
    font-weight: 600;
}

.crack-time {
    color: var(--text-color);
    opacity: 0.8;
}

/* 批量生成 */
.batch-generation,
.password-history {
    background: var(--light-gray);
    border-radius: 15px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.batch-generation h3,
.password-history h3 {
    color: var(--secondary-color);
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.batch-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.batch-controls label {
    font-weight: 500;
    color: var(--text-color);
}

.batch-controls select {
    padding: 0.5rem;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    background: var(--card-bg);
    color: var(--text-color);
}

.batch-results h4 {
    color: var(--accent-color);
    margin-bottom: 1rem;
}

.batch-list,
.history-list {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 1rem;
    border-radius: 8px;
    background: var(--card-bg);
    padding: 1rem;
}

.batch-item,
.history-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 0.5rem;
}

.batch-item:last-child,
.history-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.batch-number {
    font-weight: 600;
    color: var(--accent-color);
    min-width: 30px;
}

.batch-password,
.history-password input {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9rem;
    background: var(--light-gray);
}

.history-password {
    display: flex;
    gap: 0.5rem;
    flex: 1;
}

.history-time {
    font-size: 0.8rem;
    color: var(--text-color);
    opacity: 0.7;
    min-width: 120px;
}

.batch-actions,
.history-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* 安全指南 */
.security-guide {
    background: linear-gradient(135deg, #e8f5e8, #f0f8f0);
    border-left: 4px solid #28a745;
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.security-guide h4 {
    color: #155724;
    margin: 0 0 1rem 0;
    font-size: 1.1rem;
}

.security-guide ul {
    margin: 0;
    padding-left: 1.5rem;
}

.security-guide li {
    margin-bottom: 0.5rem;
    color: #155724;
}

/* 強度說明 */
.strength-explanation {
    display: grid;
    gap: 1rem;
    margin: 1rem 0;
}

.strength-explanation > div {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.strength-level {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    min-width: 60px;
    text-align: center;
}

.strength-level.weak { background: #dc3545; color: white; }
.strength-level.poor { background: #fd7e14; color: white; }
.strength-level.fair { background: #ffc107; color: black; }
.strength-level.good { background: #20c997; color: white; }
.strength-level.strong { background: #28a745; color: white; }

/* 訊息提示 */
.message-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: 10px;
    background: white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    z-index: 10000;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
    max-width: 350px;
    font-weight: 500;
}

.message-toast.show {
    opacity: 1;
    transform: translateX(0);
}

.message-toast.success {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
}

.message-toast.error {
    background: linear-gradient(135deg, #dc3545, #f86734);
    color: white;
}

.message-toast.warning {
    background: linear-gradient(135deg, #ffc107, #ff9800);
    color: white;
}

.message-toast.info {
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
    color: white;
}

/* 深色模式支援 */
[data-theme="dark"] .password-settings,
[data-theme="dark"] .batch-generation,
[data-theme="dark"] .password-history {
    background: #2a2a2a;
}

[data-theme="dark"] .option-item {
    background: #1e1e1e;
}

[data-theme="dark"] .option-item:hover {
    background: rgba(247, 147, 26, 0.2);
}

[data-theme="dark"] .password-field {
    background: #1e1e1e;
    color: #ffffff;
    border-color: #404040;
}

[data-theme="dark"] .password-field:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(247, 147, 26, 0.2);
}

[data-theme="dark"] .batch-list,
[data-theme="dark"] .history-list {
    background: #1e1e1e;
}

[data-theme="dark"] .batch-password,
[data-theme="dark"] .history-password input {
    background: #2a2a2a;
    color: #ffffff;
    border-color: #404040;
}

[data-theme="dark"] .template-btn {
    background: #333333;
    border-color: #404040;
    color: #ffffff;
}

[data-theme="dark"] .template-btn:hover,
[data-theme="dark"] .template-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

[data-theme="dark"] .security-guide {
    background: linear-gradient(135deg, #1a2f1a, #2a3e2a);
    border-left-color: #4ade80;
}

[data-theme="dark"] .security-guide h4,
[data-theme="dark"] .security-guide li {
    color: #86efac;
}

/* 響應式設計 */
@media (max-width: 768px) {
    .template-buttons {
        flex-direction: column;
    }
    
    .template-btn {
        justify-content: center;
        width: 100%;
    }
    
    .option-grid {
        grid-template-columns: 1fr;
    }
    
    .password-output {
        flex-wrap: wrap;
    }
    
    .password-field {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .batch-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .batch-controls select,
    .batch-controls button {
        width: 100%;
    }
    
    .batch-actions,
    .history-actions {
        flex-direction: column;
    }
    
    .batch-item,
    .history-item {
        flex-wrap: wrap;
        gap: 0.8rem;
    }
    
    .strength-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .message-toast {
        right: 10px;
        left: 10px;
        max-width: none;
    }
}

@media (max-width: 480px) {
    .password-settings,
    .batch-generation,
    .password-history {
        padding: 1.5rem;
    }
    
    .batch-list,
    .history-list {
        max-height: 200px;
    }
    
    .strength-explanation > div {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .strength-level {
        min-width: auto;
    }
}

/* 動畫 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.batch-results,
.password-history {
    animation: fadeIn 0.3s ease;
}

/* 滾動條樣式 */
.batch-list::-webkit-scrollbar,
.history-list::-webkit-scrollbar {
    width: 6px;
}

.batch-list::-webkit-scrollbar-track,
.history-list::-webkit-scrollbar-track {
    background: var(--border-color);
    border-radius: 3px;
}

.batch-list::-webkit-scrollbar-thumb,
.history-list::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 3px;
}

.batch-list::-webkit-scrollbar-thumb:hover,
.history-list::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}