/* AgentIT Internationalization Styles */

/* Language Switcher */
.language-switcher {
    display: inline-flex;
    align-items: center;
    margin-left: 1rem;
}

.language-select {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    color: #333;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 80px;
}

.language-select:hover {
    background: rgba(255, 255, 255, 1);
    border-color: rgba(0, 0, 0, 0.2);
}

.language-select:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.3);
    border-color: #4f46e5;
}

/* RTL Support */
body.rtl {
    direction: rtl;
    text-align: right;
}

body.rtl .language-switcher {
    margin-left: 0;
    margin-right: 1rem;
}

/* RTL layout adjustments for common elements */
body.rtl .header {
    flex-direction: row-reverse;
}

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

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

body.rtl .project-actions {
    justify-content: flex-start;
}

body.rtl .btn {
    margin-left: 0.5rem;
    margin-right: 0;
}

body.rtl .btn:first-child {
    margin-left: 0;
}

body.rtl .btn:last-child {
    margin-right: 0.5rem;
}

/* RTL form elements */
body.rtl input,
body.rtl textarea,
body.rtl select {
    text-align: right;
}

body.rtl input[type="email"],
body.rtl input[type="url"] {
    text-align: left; /* Keep LTR for URLs and emails */
}

/* RTL navigation and menus */
body.rtl .dashboard {
    text-align: right;
}

body.rtl .project-card {
    text-align: right;
}

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

/* RTL React Flow adjustments */
body.rtl .react-flow {
    direction: ltr; /* Keep LTR for flow diagrams */
}

body.rtl .react-flow__node {
    text-align: left; /* Keep LTR for node content */
}

/* RTL CodeMirror adjustments */
body.rtl .CodeMirror {
    direction: ltr; /* Keep LTR for code */
}

/* RTL tool selector adjustments */
body.rtl .tool-selector-content {
    text-align: right;
}

body.rtl .tool-selector-filters {
    flex-direction: row-reverse;
}

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

body.rtl .tool-item {
    text-align: right;
}

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

body.rtl .server-item {
    text-align: right;
}

/* RTL modal adjustments */
body.rtl .modal-content {
    text-align: right;
}

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

body.rtl .close-btn {
    left: 1rem;
    right: auto;
}

/* RTL responsive adjustments */
@media (max-width: 768px) {
    body.rtl .container {
        padding: 0 1rem;
    }
    
    body.rtl .language-switcher {
        margin: 0.5rem 0;
    }
    
    body.rtl .header {
        flex-direction: column;
        text-align: center;
    }
    
    body.rtl .user-info {
        justify-content: center;
        margin-top: 1rem;
    }
}

/* Dark mode adjustments for language switcher */
.bg-gray-900 .language-select,
.dashboard.dark .language-select {
    background: rgba(31, 41, 55, 0.9);
    border-color: rgba(107, 114, 128, 0.3);
    color: #f9fafb;
}

.bg-gray-900 .language-select:hover,
.dashboard.dark .language-select:hover {
    background: rgba(31, 41, 55, 1);
    border-color: rgba(107, 114, 128, 0.5);
}

.bg-gray-900 .language-select:focus,
.dashboard.dark .language-select:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.3);
}

/* Animation for language switching */
.language-transition {
    transition: all 0.3s ease-in-out;
}

/* Loading state for language switching */
.language-loading {
    opacity: 0.7;
    pointer-events: none;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .language-select {
        border-width: 2px;
        border-color: #000;
    }
    
    body.rtl .language-select {
        border-color: #000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .language-select,
    .language-transition {
        transition: none;
    }
}

/* Print styles */
@media print {
    .language-switcher {
        display: none;
    }
}