/* Language Switcher Styles */

.language-switcher {
    position: relative;
    margin-left: 0.8rem;
}

.lang-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--lighter-bg);
    border: none;
    border-radius: 10px;
    color: var(--text-medium);
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    font-size: 0.9rem;
}

.lang-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

.lang-dropdown {
    position: absolute;
    top: calc(100% + 0.8rem);
    right: 0;
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border-light);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1001;
    padding: 0.5rem;
}

.language-switcher:hover .lang-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-option {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem 1rem;
    color: var(--text-dark);
    background: none;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    text-align: left;
    font-size: 0.95rem;
}

.lang-option:hover {
    background: var(--lighter-bg);
    color: var(--primary-color);
}

.lang-option.active {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary-color);
    font-weight: 600;
}

.lang-flag {
    font-size: 1.3rem;
}

.lang-name {
    flex: 1;
}

.check-icon {
    opacity: 0;
    color: var(--primary-color);
    font-weight: bold;
}

.lang-option.active .check-icon {
    opacity: 1;
}

/* RTL Support */
body.rtl {
    direction: rtl;
    text-align: right;
}

/* RTL Navbar */
body.rtl .navbar .container {
    flex-direction: row-reverse;
}

body.rtl .logo {
    flex-direction: row-reverse;
}

body.rtl .nav-links {
    flex-direction: row-reverse;
}

body.rtl .nav-actions {
    flex-direction: row-reverse;
}

body.rtl .language-switcher {
    margin-left: 0;
    margin-right: 0.8rem;
}

body.rtl .lang-dropdown {
    right: auto;
    left: 0;
}

body.rtl .lang-option {
    text-align: right;
    flex-direction: row-reverse;
}

/* RTL Hero Section */
body.rtl .hero-content {
    text-align: right;
}

body.rtl .hero-stats {
    flex-direction: row-reverse;
}

body.rtl .cta-buttons {
    flex-direction: row-reverse;
}

body.rtl .btn-arrow {
    transform: rotate(180deg);
}

/* RTL Services */
body.rtl .services-grid {
    direction: rtl;
}

body.rtl .service-features {
    text-align: right;
}

/* RTL Portfolio */
body.rtl .portfolio-tags {
    flex-direction: row-reverse;
}

/* RTL Footer */
body.rtl .footer-content {
    flex-direction: row-reverse;
}

body.rtl .footer-links {
    flex-direction: row-reverse;
}

body.rtl .footer-bottom {
    flex-direction: row-reverse;
}

/* RTL Forms */
body.rtl .contact-form input,
body.rtl .contact-form textarea,
body.rtl .contact-form select {
    text-align: right;
}

/* RTL Cards */
body.rtl .service-card,
body.rtl .portfolio-item,
body.rtl .pricing-card,
body.rtl .team-card,
body.rtl .blog-card {
    text-align: right;
}

/* RTL Pricing */
body.rtl .pricing-features {
    text-align: right;
}

/* RTL Team */
body.rtl .team-social {
    flex-direction: row-reverse;
}

/* RTL FAQ */
body.rtl .faq-question {
    flex-direction: row-reverse;
}

body.rtl .faq-icon {
    transform: rotate(180deg);
}

/* RTL Blog */
body.rtl .post-meta {
    flex-direction: row-reverse;
}

body.rtl .post-footer {
    flex-direction: row-reverse;
}

body.rtl .post-author {
    flex-direction: row-reverse;
}

/* RTL Testimonials */
body.rtl .testimonial-author {
    flex-direction: row-reverse;
}

/* RTL Chat Widget */
body.rtl .chat-widget {
    right: auto;
    left: 100px;
}

body.rtl .chat-message {
    flex-direction: row-reverse;
}

body.rtl .chat-message.user {
    flex-direction: row;
}

body.rtl .chat-input-area {
    flex-direction: row-reverse;
}

/* RTL FAB */
body.rtl .fab-container {
    right: auto;
    left: 30px;
}

body.rtl .fab-item {
    flex-direction: row-reverse;
}

/* RTL Newsletter */
body.rtl .newsletter-popup {
    left: auto;
    right: 30px;
    text-align: right;
    transform: translateX(500px);
}

body.rtl .newsletter-popup.show {
    transform: translateX(0);
}

body.rtl .newsletter-close {
    right: auto;
    left: 0.75rem;
    /* Ensure it's always on top and clickable */
    z-index: 1002 !important;
    pointer-events: auto !important;
}

body.rtl .newsletter-form {
    flex-direction: column;
}

body.rtl .newsletter-form input {
    text-align: right;
}

body.rtl .newsletter-popup h3,
body.rtl .newsletter-popup p {
    text-align: right;
}

/* RTL Back to Top */
body.rtl .back-to-top {
    right: auto;
    left: 30px;
}

/* RTL Social Share */
body.rtl .social-share-fixed {
    left: auto;
    right: 30px;
}

/* RTL Animations */
body.rtl .btn-arrow,
body.rtl .read-more {
    transform: scaleX(-1);
}

body.rtl .dropdown-icon {
    transform: scaleX(-1);
}

/* RTL Mobile Menu */
@media (max-width: 768px) {
    body.rtl .nav-links {
        right: auto;
        left: 0;
        transform: translateX(100%);
    }
    
    body.rtl .nav-links.active {
        transform: translateX(0);
    }
}

/* Dark Mode for Language Switcher */
[data-theme="dark"] .lang-btn {
    background: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .lang-dropdown {
    background: #1e293b;
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .lang-option:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* Smooth Transitions */
* {
    transition-property: margin, padding, text-align, direction;
    transition-duration: 0.3s;
    transition-timing-function: ease;
}
