/* Horizontal Rule */
.md-hr {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    margin: 12px 0;
    height: 0;
}

.bubble.me .md-hr {
    border-top-color: rgba(255, 255, 255, 0.2);
}

.bubble:not(.me) .md-hr {
    border-top-color: rgba(0, 0, 0, 0.1);
}

/* Markdown Tables */
.md-table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 6px;
    overflow: hidden;
    font-size: 0.9em;
}

.md-table th,
.md-table td {
    padding: 8px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* RTL tables */
.md-table[dir="rtl"] th,
.md-table[dir="rtl"] td {
    text-align: right;
}

/* LTR tables */
.md-table[dir="ltr"] th,
.md-table[dir="ltr"] td {
    text-align: left;
}

.md-table th {
    background: rgba(0, 0, 0, 0.3);
    font-weight: 600;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
}

.md-table tbody tr:last-child td {
    border-bottom: none;
}

.md-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* Markdown Headers */
.md-h1, .md-h2, .md-h3 {
    margin: 12px 0 8px 0;
    font-weight: 600;
}

.md-h1 {
    font-size: 1.4em;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 4px;
}

.md-h2 { font-size: 1.3em; }
.md-h3 { font-size: 1.1em; }

/* Markdown Inline Code */
.md-code {
    background: rgba(0, 0, 0, 0.3);
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    direction: ltr;
    display: inline-block;
}

/* Markdown Code Blocks */
.md-code-block {
    background: rgba(0, 0, 0, 0.4);
    border-left: 3px solid rgba(255, 255, 255, 0.2);
    padding: 12px;
    margin: 10px 0;
    border-radius: 4px;
    overflow-x: auto;
    direction: ltr;
    text-align: left;
}

.md-code-block code {
    font-family: 'Courier New', monospace;
    font-size: 0.85em;
    line-height: 1.5;
    color: #e0e0e0;
    white-space: pre;
}

/* Markdown Lists */
.md-list {
    margin: 8px 0;
}

.md-list[dir="rtl"] {
    padding-right: 20px;
}

.md-list[dir="ltr"] {
    padding-left: 20px;
}

.md-list li {
    margin: 4px 0;
}

/* Markdown Paragraphs */
p[dir="rtl"] {
    text-align: right;
    direction: rtl;
    margin: 0;
}

p[dir="ltr"] {
    text-align: left;
    direction: ltr;
    margin: 0;
}