/* 哈希生成器專用樣式 */

/* 輸入模式選擇 */
.input-mode-section {
    margin-bottom: 2rem;
}

.input-mode-section h3 {
    margin-bottom: 1rem;
    color: var(--text-color);
    font-size: 1.1rem;
    font-weight: 600;
}

.mode-tabs {
    display: flex;
    background: var(--light-gray);
    border-radius: 10px;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
}

.mode-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text-color);
    font-size: 1rem;
}

.mode-tab:hover {
    background: rgba(247, 147, 26, 0.1);
}

.mode-tab.active {
    background: var(--primary-color);
    color: white;
    font-weight: 600;
}

.tab-icon {
    font-size: 1.2rem;
}

/* 輸入區域 */
.input-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--light-gray);
    border-radius: 10px;
    border: 1px solid var(--border-color);
}

.input-section h3 {
    margin: 0 0 1rem 0;
    color: var(--text-color);
    font-size: 1.1rem;
    font-weight: 600;
}

.text-input {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 1rem;
    line-height: 1.5;
    background: var(--card-bg, white);
    color: var(--text-color);
    resize: vertical;
    transition: border-color 0.3s ease;
}

.text-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.input-info {
    display: flex;
    gap: 2rem;
    margin-top: 0.75rem;
    font-size: 0.9rem;
    color: var(--text-color);
    opacity: 0.8;
}

/* 檔案上傳區 */
.file-upload-area {
    border: 2px dashed var(--border-color);
    border-radius: 10px;
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--card-bg, white);
    position: relative;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.file-upload-area:hover {
    border-color: var(--primary-color);
    background: rgba(247, 147, 26, 0.05);
}

.file-upload-area.dragover {
    border-color: var(--primary-color);
    background: rgba(247, 147, 26, 0.1);
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.6;
}

.upload-main {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.upload-sub {
    font-size: 0.9rem;
    color: var(--text-color);
    opacity: 0.7;
    margin: 0;
}

.file-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(247, 147, 26, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(247, 147, 26, 0.3);
}

.file-details {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.file-name {
    font-weight: 600;
    color: var(--text-color);
    font-size: 1rem;
}

.file-size {
    font-size: 0.9rem;
    color: var(--text-color);
    opacity: 0.8;
}

.btn-clear {
    background: none;
    border: none;
    color: #dc2626;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: background 0.3s ease;
}

.btn-clear:hover {
    background: rgba(220, 38, 38, 0.1);
}

/* 算法選擇區 */
.algorithm-section {
    margin-bottom: 2rem;
}

.algorithm-section h3 {
    margin-bottom: 1rem;
    color: var(--text-color);
    font-size: 1.1rem;
    font-weight: 600;
}

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

.algorithm-option {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--card-bg, white);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.algorithm-option:hover {
    border-color: var(--primary-color);
}

.algorithm-option input[type="checkbox"] {
    margin-top: 0.25rem;
    transform: scale(1.2);
    accent-color: var(--primary-color);
}

.algorithm-label {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.algorithm-name {
    font-weight: 600;
    color: var(--text-color);
    font-size: 1rem;
}

.algorithm-desc {
    font-size: 0.85rem;
    color: var(--text-color);
    opacity: 0.7;
    line-height: 1.3;
}

/* 操作按鈕區 */
.action-section {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    text-decoration: none;
    min-height: 44px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), #e68a00);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(247, 147, 26, 0.3);
}

.btn:not(.btn-primary) {
    background: var(--light-gray);
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.btn:not(.btn-primary):hover {
    background: var(--border-color);
}

.btn-icon {
    font-size: 1.1rem;
}

/* 結果顯示區 */
.results-section {
    margin-bottom: 2rem;
}

.results-section h3 {
    margin-bottom: 1rem;
    color: var(--text-color);
    font-size: 1.1rem;
    font-weight: 600;
}

.results-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.result-item {
    background: var(--card-bg, white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--light-gray);
    border-bottom: 1px solid var(--border-color);
}

.result-algorithm {
    font-weight: 600;
    color: var(--text-color);
    font-size: 1rem;
}

.result-length {
    font-size: 0.9rem;
    color: var(--text-color);
    opacity: 0.7;
}

.result-value {
    padding: 1rem;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9rem;
    word-break: break-all;
    line-height: 1.5;
    color: var(--text-color);
    background: var(--card-bg, white);
    position: relative;
}

.result-copy {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.result-item:hover .result-copy {
    opacity: 1;
}

.result-copy:hover {
    background: #e68a00;
}

.results-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* 進度條 */
.progress-section {
    margin-bottom: 2rem;
    text-align: center;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--light-gray);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 4px;
}

.progress-text {
    font-size: 0.9rem;
    color: var(--text-color);
    opacity: 0.8;
}

/* 常用範例區 */
.examples-section {
    margin-top: 2rem;
    padding: 1.5rem;
    background: var(--light-gray);
    border-radius: 10px;
    border: 1px solid var(--border-color);
}

.examples-section h3 {
    margin: 0 0 1rem 0;
    color: var(--text-color);
    font-size: 1.1rem;
}

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

.example-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--card-bg, white);
    color: var(--text-color);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    font-size: 0.95rem;
}

.example-btn:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.example-icon {
    font-size: 1.2rem;
}

.example-name {
    font-weight: 500;
}

/* 功能特色區塊 */
.features-section {
    margin-bottom: 3rem;
}

.features-section h2 {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--text-color);
    font-size: 2rem;
}

/* 算法介紹 */
.algorithm-intro {
    display: grid;
    gap: 1rem;
}

.algo-item {
    padding: 1rem;
    background: var(--light-gray);
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.algo-item h4 {
    margin-bottom: 0.5rem;
    color: var(--primary-color);
    font-size: 1.1rem;
}

.algo-item p {
    margin: 0;
    color: var(--text-color);
    line-height: 1.5;
}

/* 響應式設計 */
@media (max-width: 768px) {
    .mode-tabs {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .mode-tab {
        justify-content: flex-start;
    }
    
    .algorithm-grid {
        grid-template-columns: 1fr;
    }
    
    .action-section {
        flex-direction: column;
        align-items: center;
    }
    
    .results-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .examples-grid {
        grid-template-columns: 1fr;
    }
    
    .input-info {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .file-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .input-section {
        padding: 1rem;
    }
    
    .file-upload-area {
        padding: 2rem 1rem;
    }
    
    .upload-icon {
        font-size: 2rem;
    }
    
    .algorithm-option {
        padding: 0.75rem;
    }
    
    .result-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .result-copy {
        position: static;
        opacity: 1;
        margin-top: 0.5rem;
    }
    
    .examples-section {
        padding: 1rem;
    }
    
    .example-btn {
        padding: 0.75rem;
        font-size: 0.9rem;
    }
}