* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #111;
    background-color: #f9fafb;
}

input[type="checkbox"] {
    cursor: pointer;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

html[dir="rtl"] {
    direction: rtl;
}

html[dir="rtl"] .flex-row {
    flex-direction: row-reverse;
}

html[dir="rtl"] .text-left {
    text-align: right;
}

html[dir="rtl"] .text-right {
    text-align: left;
}

html[dir="rtl"] .mr-1 { margin-right: 0; margin-left: 0.25rem; }
html[dir="rtl"] .mr-2 { margin-right: 0; margin-left: 0.5rem; }
html[dir="rtl"] .mr-3 { margin-right: 0; margin-left: 0.75rem; }
html[dir="rtl"] .ml-1 { margin-left: 0; margin-right: 0.25rem; }
html[dir="rtl"] .ml-2 { margin-left: 0; margin-right: 0.5rem; }
html[dir="rtl"] .ml-3 { margin-left: 0; margin-right: 0.75rem; }

html[dir="rtl"] .pr-1 { padding-right: 0; padding-left: 0.25rem; }
html[dir="rtl"] .pr-2 { padding-right: 0; padding-left: 0.5rem; }
html[dir="rtl"] .pl-1 { padding-left: 0; padding-right: 0.25rem; }
html[dir="rtl"] .pl-2 { padding-left: 0; padding-right: 0.5rem; }

html[dir="rtl"] .border-l {
    border-left: none;
    border-right: 1px solid #e5e7eb;
}

html[dir="rtl"] .border-r {
    border-right: none;
    border-left: 1px solid #e5e7eb;
}

html[dir="rtl"] .rounded-l {
    border-radius: 0 0.5rem 0.5rem 0;
}

html[dir="rtl"] .rounded-r {
    border-radius: 0.5rem 0 0 0.5rem;
}

.lang-dropdown {
    position: relative;
    display: inline-block;
}

.lang-dropdown-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    font-size: 14px;
    color: #4b5563;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
}

.lang-dropdown-btn:hover {
    color: #111827;
    border-color: #d1d5db;
}

.lang-dropdown-btn svg {
    width: 16px;
    height: 16px;
    transition: transform 0.15s;
}

.lang-dropdown.open .lang-dropdown-btn svg {
    transform: rotate(180deg);
}

.lang-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 4px;
    min-width: 180px;
    max-height: 320px;
    overflow-y: auto;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.15s;
    z-index: 50;
}

html[dir="rtl"] .lang-dropdown-menu {
    right: auto;
    left: 0;
}

.lang-dropdown.open .lang-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-dropdown-menu a {
    display: block;
    padding: 8px 12px;
    font-size: 14px;
    color: #374151;
    text-decoration: none;
    transition: background 0.1s;
}

.lang-dropdown-menu a:hover {
    background: #f3f4f6;
}

.lang-dropdown-menu a.active {
    color: #111827;
    font-weight: 500;
    background: #f9fafb;
}

.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    padding: 12px 20px;
    background: #111827;
    color: #fff;
    font-size: 14px;
    border-radius: 8px;
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.2);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 100;
}

.toast.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.toast.success {
    background: #111827;
}

.toast.error {
    background: #dc2626;
}

.lang-switch-banner {
    background: #f0f9ff;
    border-bottom: 1px solid #bae6fd;
}

.lang-switch-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 10px 16px;
    flex-wrap: wrap;
}

.lang-switch-text {
    font-size: 13px;
    color: #0369a1;
}

.lang-switch-text strong {
    color: #0c4a6e;
}

.lang-switch-btn {
    padding: 4px 12px;
    font-size: 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

.lang-switch-btn-confirm {
    background: #0284c7;
    color: #fff;
    border: 1px solid #0284c7;
}

.lang-switch-btn-confirm:hover {
    background: #0369a1;
    border-color: #0369a1;
}

.lang-switch-btn-dismiss {
    background: transparent;
    color: #64748b;
    border: 1px solid #cbd5e1;
}

.lang-switch-btn-dismiss:hover {
    background: #f1f5f9;
    color: #475569;
}
