/**
 * استایل‌های راست به چپ (RTL) - بهینه برای فارسی
 */
[dir="rtl"] {
    text-align: right;
}
body, .login-box, .box, input, select, button, label {
    font-family: 'Vazir', 'Vazir', 'Tahoma', sans-serif !important;
}
.option-hint { font-size: 0.75rem; color: #888; display: block; margin-top: 4px; }
.im-badge {
    background: linear-gradient(135deg,#00b894,#55efc4);
    color:#fff;
    padding:6px 14px;
    border-radius:20px;
    font-size:0.85rem;
    display:inline-flex;
    align-items:center;
    gap:6px;
    margin-bottom:0.5rem;
}
.header-nav {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-direction: row;
}
[dir="rtl"] .header-nav { flex-direction: row; }
.tools-top-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 1rem;
    padding: 10px 0;
    border-bottom: 1px solid rgba(108,92,231,0.2);
}
.tool-nav-link {
    padding: 10px 18px;
    background: rgba(108,92,231,0.08);
    color: #6c5ce7;
    border-radius: 10px;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.tool-nav-link:hover { background: rgba(108,92,231,0.18); }
.tool-nav-link.active { background: linear-gradient(135deg,#6c5ce7,#a29bfe); color: white; }
.tool-nav-link.disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }
body.dark-mode .tools-top-nav { border-color: rgba(108,92,231,0.3); }
body.dark-mode .tool-nav-link { color: #a29bfe; background: rgba(108,92,231,0.15); }
body.dark-mode .tool-nav-link.active { background: linear-gradient(135deg,#6c5ce7,#a29bfe); color: white; }
.tool-title { font-size: 1.4rem; color: #333; margin-bottom: 0.5rem; }
.tool-desc { color: #666; margin-bottom: 1.5rem; }
body.dark-mode .tool-title { color: var(--dark-text); }
body.dark-mode .tool-desc { color: var(--dark-secondary-text); }
.user-menu {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
[dir="rtl"] .user-menu { margin-right: auto; }
.user-name {
    color: #6c5ce7;
    font-weight: 600;
    margin-inline-start: 10px;
}
.nav-btn {
    padding: 8px 16px;
    background: rgba(108,92,231,0.1);
    color: #6c5ce7;
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s;
}
.nav-btn:hover { background: rgba(108,92,231,0.2); }
.dark-mode-wrap {
    position: absolute;
    top: 1rem;
    inset-inline-start: 1rem;
}
.save-hint { font-size: 0.85rem; color: #666; margin-top: 0.5rem; }
.save-hint a { color: #6c5ce7; }
.my-images-section {
    margin: 2rem 0;
    padding: 1.5rem;
    background: rgba(108,92,231,0.05);
    border-radius: 10px;
}
.my-images-section h3 { margin-bottom: 1rem; color: #6c5ce7; }
.saved-images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1rem;
}
.saved-image-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.saved-image-item img { width: 100%; height: 100px; object-fit: cover; display: block; }
.saved-image-item .img-actions {
    position: absolute;
    bottom: 0;
    inset-inline-start: 0;
    inset-inline-end: 0;
    background: rgba(0,0,0,0.7);
    padding: 8px;
    display: flex;
    justify-content: space-around;
    flex-direction: row;
}
[dir="rtl"] .saved-image-item .img-actions { flex-direction: row; }
.saved-image-item .img-actions a,
.saved-image-item .img-actions button {
    color: white;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.save-server-btn { background: linear-gradient(135deg, #00b894 0%, #55efc4 100%) !important; }
/* RTL: جدول و تراز */
[dir="rtl"] .images-table th,
[dir="rtl"] .images-table td { text-align: right; }
[dir="rtl"] .batch-actions { flex-direction: row; }
[dir="rtl"] .batch-right-actions { flex-direction: row; margin-right: auto; }
