/* ============================================
   Multi-Language System Styles
   Includes language switcher and RTL support
   ============================================ */

/* === Language Switcher === */
.language-switcher {
    position: relative;
}

.language-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    background: rgba(212, 175, 55, 0.1);
    border: 2px solid var(--color-gold);
    border-radius: var(--radius-md);
    color: var(--color-gold);
    font-size: var(--font-size-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
    white-space: nowrap;
}

.navbar-link,
.language-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-icon {
    font-size: 1.1rem;
    line-height: 1;
}

.language-btn:hover {
    background: var(--color-gold);
    color: var(--color-dark-chocolate);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.3);
}

.current-lang {
    color: inherit;
    font-weight: 600;
}

.lang-icon {
    width: 18px;
    height: 18px;
}

.language-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    min-width: 250px;
    max-height: 400px;
    overflow-y: auto;
    background: var(--color-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-2xl);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--transition-base);
    z-index: 1000;
    padding: 0.5rem;
}

.language-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.75rem 1rem;
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    text-align: left;
    cursor: pointer;
    transition: all var(--transition-base);
    position: relative;
}

.lang-option:hover {
    background: linear-gradient(135deg, var(--color-cream) 0%, var(--color-gold-light) 100%);
}

.lang-option.active {
    background: var(--gradient-gold);
    font-weight: 600;
}

.lang-flag {
    font-size: 1.5rem;
    line-height: 1;
}

.lang-name {
    flex: 1;
    font-size: var(--font-size-sm);
    color: var(--color-dark-chocolate);
}

.checkmark {
    color: var(--color-gold);
    font-weight: bold;
    font-size: 1.125rem;
}

.lang-option.active .checkmark {
    color: var(--color-dark-chocolate);
}

/* === RTL Support === */
html[dir="rtl"],
html[dir="rtl"] body {
    direction: rtl;
    text-align: right;
}

html[dir="rtl"] .navbar-menu {
    direction: rtl;
}

html[dir="rtl"] .navbar-brand {
    flex-direction: row-reverse;
}

html[dir="rtl"] .navbar-text {
    margin-right: 0.75rem;
    margin-left: 0;
}

html[dir="rtl"] .footer-grid {
    direction: rtl;
}

html[dir="rtl"] .timeline-item:nth-child(even) .timeline-content {
    text-align: left;
}

html[dir="rtl"] .timeline-item .timeline-content {
    text-align: right;
}

html[dir="rtl"] .why-choose-item {
    flex-direction: row-reverse;
}

html[dir="rtl"] .iso-badge {
    flex-direction: row-reverse;
}

html[dir="rtl"] .value-card {
    border-left: none;
    border-right: 4px solid var(--color-gold);
}

html[dir="rtl"] .value-card:hover {
    transform: translateX(-10px);
}

html[dir="rtl"] .iso-product-list li {
    padding-left: 0;
    padding-right: var(--spacing-md);
    border-left: none;
    border-right: 3px solid var(--color-gold);
}

html[dir="rtl"] .product-card {
    text-align: right;
}

html[dir="rtl"] .cta-buttons {
    flex-direction: row-reverse;
}

html[dir="rtl"] .mission-vision-grid,
html[dir="rtl"] .why-choose-grid,
html[dir="rtl"] .iso-content-grid {
    direction: rtl;
}

/* RTL specific font adjustments for Arabic */
html[dir="rtl"] body,
html[dir="rtl"] p,
html[dir="rtl"] li,
html[dir="rtl"] span {
    font-family: 'Cairo', 'Tajawal', 'Amiri', Arial, sans-serif;
}

html[dir="rtl"] h1,
html[dir="rtl"] h2,
html[dir="rtl"] h3,
html[dir="rtl"] h4 {
    font-family: 'Cairo', 'Tajawal', Arial, sans-serif;
}

/* Adjust margins and padding for RTL */
html[dir="rtl"] .card-icon,
html[dir="rtl"] .badge-icon {
    margin-left: 0;
    margin-right: 0;
}

/* Language switcher RTL adjustments */
html[dir="rtl"] .language-dropdown {
    right: auto;
    left: 0;
}

html[dir="rtl"] .lang-option {
    text-align: right;
    flex-direction: row-reverse;
}

html[dir="rtl"] .language-btn {
    flex-direction: row-reverse;
}

/* Responsive adjustments */
@media (max-width: 968px) {
    .language-switcher {
        width: 100%;
    }

    .language-btn {
        width: 100%;
        justify-content: center;
    }

    .language-dropdown {
        right: 0;
        left: 0;
        width: 100%;
    }
}

/* Arabic font import */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700;900&family=Tajawal:wght@400;500;700&display=swap');

/* Smooth transitions for language switching */
* {
    transition: direction 0.3s ease;
}