.marahel-container {
    max-width: 100%;
    margin: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    direction: rtl;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 16px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.08);
}

.marahel-title {
    font-size: 24px;
    font-weight: 700;
    color: #1a1a2e;
    text-align: center;
    margin: 0 0 20px 0;
    padding-bottom: 15px;
    border-bottom: 3px solid #00b4d8;
}

.marahel-search-box {
    position: relative;
    margin-bottom: 25px;
}

#marahel-search-input {
    width: 100%;
    padding: 14px 20px;
    border: 2px solid #e0e5ec;
    border-radius: 12px;
    font-size: 16px;
    background: #ffffff;
    transition: all 0.3s ease;
}

#marahel-search-input:focus {
    border-color: #00b4d8;
    box-shadow: 0 4px 20px rgba(0, 180, 216, 0.15);
    outline: none;
}

#marahel-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    max-height: 400px;
    overflow-y: auto;
    z-index: 999;
    margin-top: 8px;
    padding: 10px 0;
}

.search-result-item {
    padding: 12px 20px;
    border-bottom: 1px solid #f0f2f5;
    cursor: pointer;
    transition: background 0.2s;
}

.search-result-item:hover {
    background: #f0f7ff;
}

.search-result-item .result-title {
    font-weight: 600;
    color: #1a1a2e;
    font-size: 15px;
}

.search-result-item .result-meta {
    font-size: 13px;
    color: #888;
    margin-top: 4px;
}

.search-result-item .result-meta span {
    margin-left: 15px;
}

.search-result-item .result-excerpt {
    font-size: 13px;
    color: #666;
    margin-top: 4px;
}

.search-empty {
    padding: 20px;
    text-align: center;
    color: #888;
}

.marahel-tree-wrapper {
    background: #ffffff;
    border-radius: 12px;
    padding: 10px 0;
}

.marahel-tree {
    list-style: none;
    padding: 0;
    margin: 0;
}

.marahel-tree li {
    list-style: none;
    margin: 0;
    padding: 0;
}

.marahel-node {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-right: 4px solid transparent;
}

.marahel-node:hover {
    background: #f0f7ff;
    border-right-color: #00b4d8;
}

.marahel-toggle {
    font-size: 14px;
    color: #00b4d8;
    width: 24px;
    text-align: center;
    font-weight: bold;
}

.marahel-term-name {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a2e;
    flex: 1;
}

.marahel-count {
    font-size: 12px;
    color: #888;
    background: #f0f2f5;
    padding: 2px 12px;
    border-radius: 20px;
}

.marahel-children {
    list-style: none;
    padding-right: 30px;
    margin: 0;
    border-right: 2px solid #e0e5ec;
    display: none;
}

.marahel-posts {
    list-style: none;
    padding-right: 30px;
    margin: 4px 0 8px 0;
    border-right: 2px solid #e0e5ec;
    display: none;
}

.marahel-post {
    padding: 6px 16px;
    margin: 3px 0;
    background: #f8fafc;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.marahel-post:hover {
    background: #eef3f8;
    transform: translateX(-4px);
}

.marahel-post-link {
    text-decoration: none;
    color: #1a1a2e;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.marahel-post-link:hover {
    color: #00b4d8;
}

.marahel-book {
    font-size: 12px;
    color: #2196F3;
    background: #e3f2fd;
    padding: 2px 10px;
    border-radius: 12px;
}

.marahel-teacher {
    font-size: 12px;
    color: #4CAF50;
    background: #e8f5e9;
    padding: 2px 10px;
    border-radius: 12px;
}

.marahel-views {
    font-size: 12px;
    color: #888;
    background: #f0f2f5;
    padding: 2px 10px;
    border-radius: 12px;
}

.marahel-empty {
    padding: 20px;
    text-align: center;
    color: #888;
    font-size: 16px;
}

.marahel-error {
    color: #f44336;
    padding: 20px;
    background: #ffebee;
    border-radius: 10px;
    text-align: center;
    font-weight: 600;
}

#marahel-loading {
    text-align: center;
    padding: 20px;
    color: #888;
    font-size: 16px;
}

@media (max-width: 600px) {
    .marahel-container {
        padding: 12px;
        margin: 10px 0;
    }
    .marahel-title {
        font-size: 18px;
    }
    #marahel-search-input {
        padding: 10px 14px;
        font-size: 14px;
    }
    .marahel-node {
        padding: 8px 12px;
    }
    .marahel-term-name {
        font-size: 14px;
    }
    .marahel-children,
    .marahel-posts {
        padding-right: 16px;
    }
    .marahel-post-link {
        font-size: 13px;
        flex-direction: column;
        align-items: flex-start;
    }
}