/**
 * I2DS RTL (Right-to-Left) Stylesheet
 * Arabic language support
 */

/* ==================== Base RTL Settings ==================== */

body.rtl {
    direction: rtl;
    text-align: right;
    font-family: 'Noto Sans Arabic', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ==================== Typography ==================== */

body.rtl h1, 
body.rtl h2, 
body.rtl h3, 
body.rtl h4, 
body.rtl h5, 
body.rtl h6 {
    font-family: 'Noto Sans Arabic', 'Inter', sans-serif;
}

body.rtl p,
body.rtl span,
body.rtl a,
body.rtl li,
body.rtl label,
body.rtl input,
body.rtl textarea,
body.rtl button {
    font-family: 'Noto Sans Arabic', 'Inter', sans-serif;
}

/* ==================== Navigation ==================== */

body.rtl .navbar-container {
    flex-direction: row-reverse;
}

body.rtl .navbar-nav {
    flex-direction: row-reverse;
}

body.rtl .navbar-actions {
    flex-direction: row-reverse;
}

body.rtl .navbar-brand {
    flex-direction: row-reverse;
}

body.rtl .nav-link {
    margin-left: 0;
    margin-right: var(--space-lg);
}

body.rtl .nav-link i {
    margin-right: 0;
    margin-left: var(--space-xs);
}

/* Mobile menu */
body.rtl .mobile-menu {
    text-align: right;
}

body.rtl .mobile-menu a {
    justify-content: flex-end;
}

/* ==================== Buttons & Icons ==================== */

body.rtl .btn i {
    margin-right: 0;
    margin-left: var(--space-sm);
}

body.rtl .btn-icon-right i {
    margin-left: 0;
    margin-right: var(--space-sm);
}

/* Arrows flip direction */
body.rtl .fa-arrow-right::before {
    content: "\f060"; /* arrow-left */
}

body.rtl .fa-arrow-left::before {
    content: "\f061"; /* arrow-right */
}

body.rtl .fa-chevron-right::before {
    content: "\f053"; /* chevron-left */
}

body.rtl .fa-chevron-left::before {
    content: "\f054"; /* chevron-right */
}

/* ==================== Hero Section ==================== */

body.rtl .home-hero-content {
    flex-direction: row-reverse;
}

body.rtl .hero-text {
    text-align: right;
}

body.rtl .home-subtitle {
    margin-right: 0;
    margin-left: auto;
}

/* ==================== Cards & Grids ==================== */

body.rtl .link-card,
body.rtl .blog-preview-card,
body.rtl .gallery-slide,
body.rtl .strength-item {
    text-align: right;
}

body.rtl .link-arrow,
body.rtl .blog-preview-link {
    flex-direction: row-reverse;
}

body.rtl .link-card:hover .link-arrow,
body.rtl .blog-preview-card:hover .blog-preview-link {
    transform: translateX(-4px);
}

/* ==================== Forms ==================== */

body.rtl .form-group label {
    text-align: right;
}

body.rtl input,
body.rtl textarea,
body.rtl select {
    text-align: right;
}

body.rtl input::placeholder,
body.rtl textarea::placeholder {
    text-align: right;
}

body.rtl .form-hint {
    text-align: right;
}

/* ==================== Blog ==================== */

body.rtl .blog-section-header {
    flex-direction: row-reverse;
}

body.rtl .blog-post-meta {
    flex-direction: row-reverse;
}

body.rtl .blog-post-meta span {
    flex-direction: row-reverse;
}

body.rtl .blog-breadcrumb {
    flex-direction: row-reverse;
}

body.rtl .blog-post-share {
    flex-direction: row-reverse;
}

/* ==================== Gallery ==================== */

body.rtl .gallery-nav.gallery-prev {
    left: auto;
    right: -25px;
}

body.rtl .gallery-nav.gallery-next {
    right: auto;
    left: -25px;
}

body.rtl .gallery-track {
    flex-direction: row-reverse;
}

/* ==================== Chat & Chatbot ==================== */

body.rtl .chat-msg.user {
    flex-direction: row;
}

body.rtl .chat-msg.assistant {
    flex-direction: row-reverse;
}

body.rtl .chat-msg.user .msg-content {
    border-bottom-right-radius: 18px;
    border-bottom-left-radius: 4px;
}

body.rtl .chat-msg.assistant .msg-content {
    border-bottom-left-radius: 18px;
    border-bottom-right-radius: 4px;
}

body.rtl .chatbot-main-header {
    flex-direction: row-reverse;
}

body.rtl .chatbot-main-header .status-indicator {
    margin-right: auto;
    margin-left: 0;
}

body.rtl .chatbot-main-input {
    flex-direction: row-reverse;
}

/* ==================== Talk to I2DS Section ==================== */

body.rtl .talk-content {
    text-align: right;
}

body.rtl .query-chips {
    justify-content: flex-end;
}

body.rtl .query-chip {
    flex-direction: row-reverse;
}

body.rtl .query-chip i {
    margin-right: 0;
    margin-left: var(--space-xs);
}

/* ==================== Admin Panel ==================== */

body.rtl .admin-layout {
    flex-direction: row-reverse;
}

body.rtl .admin-sidebar {
    border-right: none;
    border-left: 1px solid var(--gray-200);
}

body.rtl .sidebar-nav .nav-item {
    flex-direction: row-reverse;
}

body.rtl .sidebar-nav .nav-item svg {
    margin-right: 0;
    margin-left: var(--space-md);
}

body.rtl .admin-table th,
body.rtl .admin-table td {
    text-align: right;
}

body.rtl .action-buttons {
    flex-direction: row-reverse;
}

/* ==================== Footer ==================== */

body.rtl .footer-grid {
    direction: rtl;
}

body.rtl .footer-links {
    text-align: right;
}

/* ==================== Alerts & Messages ==================== */

body.rtl .alert {
    flex-direction: row-reverse;
    text-align: right;
}

body.rtl .alert i {
    margin-right: 0;
    margin-left: var(--space-md);
}

body.rtl .alert-close {
    right: auto;
    left: var(--space-md);
}

/* ==================== Pagination ==================== */

body.rtl .pagination,
body.rtl .blog-pagination {
    flex-direction: row-reverse;
}

/* ==================== Misc ==================== */

body.rtl .meta-info {
    flex-direction: row-reverse;
}

body.rtl .meta-info i {
    margin-right: 0;
    margin-left: var(--space-sm);
}

body.rtl .status-indicator {
    flex-direction: row-reverse;
}

body.rtl .status-dot {
    margin-right: 0;
    margin-left: var(--space-sm);
}

/* ==================== Language Switcher ==================== */

.language-switcher {
    margin-right: var(--space-md);
}

.lang-btn {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-xs) var(--space-sm);
    background: var(--gray-100);
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--gray-700);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all var(--transition-fast);
}

.lang-btn:hover {
    background: var(--gray-200);
    color: var(--gray-900);
}

.lang-flag {
    font-size: 1.1rem;
}

.lang-text {
    font-weight: 600;
}

body.rtl .language-switcher {
    margin-right: 0;
    margin-left: var(--space-md);
}

/* Mobile language switcher */
.mobile-lang-switcher {
    padding: var(--space-md);
    border-bottom: 1px solid var(--gray-200);
    margin-bottom: var(--space-sm);
}

.mobile-lang-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: var(--gray-100);
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--gray-700);
    font-weight: 500;
}

/* ==================== Responsive Adjustments ==================== */

@media (max-width: 1024px) {
    body.rtl .home-hero-content {
        flex-direction: column;
        text-align: center;
    }
    
    body.rtl .hero-text {
        text-align: center;
    }
    
    body.rtl .blog-section-header {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 768px) {
    body.rtl .gallery-nav.gallery-prev {
        right: 10px;
    }
    
    body.rtl .gallery-nav.gallery-next {
        left: 10px;
    }
}
