/* 文字加密解密專用樣式 */

/* 模式切換 */
.mode-section {
    margin-bottom: 2rem;
}

.mode-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    max-width: 600px;
    margin: 0 auto;
}

.mode-tab {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1.25rem;
    background: var(--card-bg, white);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text-color);
    font-size: 1.1rem;
    font-weight: 600;
}

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

.mode-tab.active {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    box-shadow: 0 4px 12px rgba(247, 147, 26, 0.3);
}

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

/* 設定區塊 */
.settings-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--card-bg, white);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.settings-section h3 {
    margin: 0 0 1.5rem 0;
    color: var(--text-color);
    font-size: 1.1rem;
    font-weight: 600;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.5rem;
}

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

.setting-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.setting-group label {
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.95rem;
}

.setting-select {
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.95rem;
    background: var(--card-bg, white);
    color: var(--text-color);
    cursor: pointer;
    transition: border-color 0.3s ease;
}

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

.setting-hint {
    font-size: 0.85rem;
    color: var(--text-color);
    opacity: 0.7;
}

/* 密碼區塊 */
.password-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--light-gray);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

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

.password-input-group {
    display: grid;
    gap: 1.5rem;
}

.password-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.password-field label {
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.95rem;
}

.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input {
    flex: 1;
    padding: 0.75rem 3rem 0.75rem 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    background: var(--card-bg, white);
    color: var(--text-color);
    transition: border-color 0.3s ease;
}

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

.btn-toggle-password {
    position: absolute;
    right: 0.5rem;
    padding: 0.5rem;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    transition: transform 0.2s ease;
}

.btn-toggle-password:hover {
    transform: scale(1.1);
}

/* 密碼強度指示器 */
.password-strength {
    margin-top: 0.5rem;
}

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

.strength-fill {
    height: 100%;
    width: 0%;
    transition: all 0.3s ease;
    border-radius: 3px;
}

.strength-fill.weak {
    width: 33%;
    background: #dc3545;
}

.strength-fill.medium {
    width: 66%;
    background: #ffc107;
}

.strength-fill.strong {
    width: 100%;
    background: #28a745;
}

.strength-text {
    font-size: 0.85rem;
    font-weight: 500;
}

.strength-text.weak {
    color: #dc3545;
}

.strength-text.medium {
    color: #ffc107;
}

.strength-text.strong {
    color: #28a745;
}

.password-actions {
    display: flex;
    justify-content: center;
}

/* 文字區塊 */
.text-section {
    margin-bottom: 2rem;
}

.text-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.text-panel {
    display: flex;
    flex-direction: column;
    background: var(--card-bg, white);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
}

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

.text-header h4 {
    margin: 0;
    color: var(--text-color);
    font-size: 1rem;
    font-weight: 600;
}

.text-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-small {
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    border-radius: 6px;
    background: var(--card-bg, white);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

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

.text-editor {
    flex: 1;
    padding: 1.5rem;
    border: none;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.95rem;
    line-height: 1.6;
    resize: none;
    background: var(--card-bg, white);
    color: var(--text-color);
}

.text-editor:focus {
    outline: none;
    background: var(--light-gray);
}

.output-text {
    background: var(--light-gray);
}

.text-info {
    padding: 0.75rem 1.5rem;
    background: var(--light-gray);
    border-top: 1px solid var(--border-color);
    font-size: 0.85rem;
    color: var(--text-color);
}

.char-count {
    font-weight: 500;
}

.char-count span {
    font-weight: 600;
    color: var(--primary-color);
}

/* 主要操作按鈕 */
.main-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.85rem 1.75rem;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    box-shadow: 0 4px 12px rgba(247, 147, 26, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(247, 147, 26, 0.4);
}

.btn:not(.btn-primary) {
    background: var(--card-bg, white);
    color: var(--text-color);
    border: 2px solid var(--border-color);
}

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

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

/* 安全提示 */
.security-notice {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border-radius: 12px;
    border: 1px solid #ffc107;
}

.security-notice h3 {
    margin: 0 0 1rem 0;
    color: #856404;
    font-size: 1.1rem;
    font-weight: 600;
}

.notice-content ul {
    margin: 0;
    padding-left: 1.5rem;
    color: #856404;
}

.notice-content li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

/* 範例區塊 */
.examples-section {
    margin-bottom: 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;
    font-weight: 600;
}

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

.example-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    background: var(--card-bg, white);
    color: var(--text-color);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.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.5rem;
}

.example-name {
    font-weight: 600;
    font-size: 0.9rem;
    text-align: center;
}

/* 教學內容樣式 */
.password-guide {
    display: grid;
    gap: 1rem;
    margin-top: 1rem;
}

.strength-level {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--light-gray);
    border-radius: 8px;
}

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

.level-badge.weak {
    background: #dc3545;
    color: white;
}

.level-badge.medium {
    background: #ffc107;
    color: #856404;
}

.level-badge.strong {
    background: #28a745;
    color: white;
}

.strength-level p {
    margin: 0;
    color: var(--text-color);
}

.comparison-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.comparison-table th,
.comparison-table td {
    padding: 0.75rem;
    text-align: left;
    border: 1px solid var(--border-color);
}

.comparison-table thead th {
    background: var(--primary-color);
    color: white;
    font-weight: 600;
}

.comparison-table tbody tr:nth-child(even) {
    background: var(--light-gray);
}

/* 響應式設計 */
@media (max-width: 968px) {
    .text-container {
        grid-template-columns: 1fr;
    }

    .settings-grid {
        grid-template-columns: 1fr;
    }

    .mode-tabs {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .text-header {
        flex-direction: column;
        gap: 0.75rem;
        align-items: flex-start;
    }

    .text-actions {
        width: 100%;
        justify-content: space-between;
    }

    .btn-small {
        flex: 1;
    }

    .text-editor {
        font-size: 0.9rem;
        padding: 1rem;
    }

    .main-actions {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    .examples-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .security-notice,
    .examples-section {
        padding: 1rem;
    }

    .examples-grid {
        grid-template-columns: 1fr;
    }

    .comparison-table {
        font-size: 0.85rem;
    }

    .comparison-table th,
    .comparison-table td {
        padding: 0.5rem;
    }
}