/* ZenHan.css - Scope all styles under .zenhan-app to prevent side effects on other pages */

.zenhan-app {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #2d3748;
    max-width: 900px;
    margin: 10px auto 30px auto;
    padding: 0 10px;
}

.zenhan-app * {
    box-sizing: border-box;
}

/* Header Banner */
.zenhan-app .zh-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    padding: 24px 28px;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(118, 75, 162, 0.25);
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.zenhan-app .zh-header-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: -0.02em;
}

.zenhan-app .zh-header-subtitle {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.85);
    margin: 4px 0 0 0;
}

/* Main Container Card */
.zenhan-app .zh-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    border: 1px solid #edf2f7;
    margin-bottom: 24px;
}

/* Mode Selection Grids */
.zenhan-app .zh-mode-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 12px;
    display: block;
}

.zenhan-app .zh-mode-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 10px;
    margin-bottom: 24px;
}

.zenhan-app .zh-mode-option {
    position: relative;
}

.zenhan-app .zh-mode-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.zenhan-app .zh-mode-option label {
    display: flex;
    flex-direction: column;
    padding: 12px 16px;
    background: #f7fafc;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.zenhan-app .zh-mode-option label:hover {
    background: #edf2f7;
    border-color: #cbd5e0;
}

.zenhan-app .zh-mode-option input[type="radio"]:checked + label {
    background: #f0f4ff;
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.zenhan-app .zh-mode-option .zh-opt-title {
    font-weight: 600;
    font-size: 0.925rem;
    color: #2d3748;
}

.zenhan-app .zh-mode-option input[type="radio"]:checked + label .zh-opt-title {
    color: #5a67d8;
}

.zenhan-app .zh-mode-option .zh-opt-desc {
    font-size: 0.775rem;
    color: #718096;
    margin-top: 2px;
}

/* Editor Workspace (Grid of Textareas) */
.zenhan-app .zh-workspace {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    position: relative;
}

@media (max-width: 768px) {
    .zenhan-app .zh-workspace {
        grid-template-columns: 1fr;
    }
}

.zenhan-app .zh-panel {
    display: flex;
    flex-direction: column;
}

.zenhan-app .zh-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.zenhan-app .zh-panel-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: #4a5568;
}

.zenhan-app .zh-panel-counter {
    font-size: 0.775rem;
    color: #a0aec0;
    background: #edf2f7;
    padding: 2px 8px;
    border-radius: 12px;
}

.zenhan-app .zh-textarea {
    width: 100%;
    min-height: 220px;
    padding: 14px;
    font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 0.95rem;
    line-height: 1.6;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    resize: vertical;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    background-color: #ffffff;
}

.zenhan-app .zh-textarea:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.zenhan-app .zh-textarea[readonly] {
    background-color: #f8fafc;
    color: #2d3748;
}

/* Action Toolbar */
.zenhan-app .zh-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
    flex-wrap: wrap;
    gap: 10px;
}

.zenhan-app .zh-btn-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.zenhan-app .zh-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.zenhan-app .zh-btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.zenhan-app .zh-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.zenhan-app .zh-btn-secondary {
    background: #edf2f7;
    color: #4a5568;
}

.zenhan-app .zh-btn-secondary:hover {
    background: #e2e8f0;
    color: #2d3748;
}

.zenhan-app .zh-btn-success {
    background: #38a169;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(56, 161, 105, 0.25);
}

.zenhan-app .zh-btn-success:hover {
    background: #2f855a;
}

.zenhan-app .zh-btn-outline {
    background: transparent;
    border: 1px solid #cbd5e0;
    color: #4a5568;
}

.zenhan-app .zh-btn-outline:hover {
    background: #f7fafc;
    border-color: #a0aec0;
}

/* Related Tools Section */
.zenhan-app .zh-related-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 20px 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
    border: 1px solid #edf2f7;
}

.zenhan-app .zh-related-title {
    font-size: 1rem;
    font-weight: 700;
    color: #2d3748;
    margin: 0 0 14px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.zenhan-app .zh-related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.zenhan-app .zh-related-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    color: #4a5568;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.zenhan-app .zh-related-item:hover {
    border-color: #667eea;
    color: #5a67d8;
    background: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.1);
}

/* Toast notification */
.zenhan-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #2d3748;
    color: #ffffff;
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 0.875rem;
    font-weight: 500;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
    pointer-events: none;
    z-index: 9999;
}

.zenhan-toast.show {
    opacity: 1;
    transform: translateY(0);
}
