/* Custom Fonts - Local Files */
@font-face {
    font-family: 'NotoSansArabic';
    src: url('/web/assets/fonts/NotoSansArabic_ExtraCondensed-Black.ttf') format('truetype');
    font-weight: 900;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'OpenSans';
    src: url('/web/assets/fonts/OpenSans_Condensed-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* Default English Font */
html[lang="en"] body {
    font-family: 'OpenSans', 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* RTL Support */
html[dir="rtl"] {
    direction: rtl;
    text-align: right;
}

html[dir="rtl"] body,
html[lang="ar"] body {
    font-family: 'NotoSansArabic', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* RTL Layout Adjustments */
html[dir="rtl"] .sidebar {
    right: 0;
    left: auto;
}

html[dir="rtl"] #page-content-wrapper {
    margin-right: 250px;
    margin-left: 0;
}

html[dir="rtl"] .navbar {
    padding-right: 1rem;
    padding-left: 1rem;
}

html[dir="rtl"] .ms-auto {
    margin-left: 0 !important;
    margin-right: auto !important;
}

html[dir="rtl"] .me-auto {
    margin-right: 0 !important;
    margin-left: auto !important;
}

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

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

/* Language Switcher Floating Button */
.lang-switcher {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1050;
    display: flex;
    gap: 10px;
    background: white;
    padding: 8px;
    border-radius: 50px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

.lang-switcher:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
    transform: translateY(-2px);
}

.lang-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid transparent;
    background: transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    padding: 0;
    position: relative;
    overflow: hidden;
}

.lang-btn:hover {
    transform: scale(1.1);
    border-color: #0d6efd;
}

.lang-btn.active {
    border-color: #0d6efd;
    background: rgba(13, 110, 253, 0.1);
}

.lang-btn::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: rgba(13, 110, 253, 0.1);
    border-radius: 50%;
    transform: scale(0);
    transition: transform 0.3s ease;
}

.lang-btn:active::after {
    transform: scale(1);
}

/* Flag Icons */
.flag-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
}

/* Tooltip for language names */
.lang-btn[data-lang]::before {
    content: attr(data-lang);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.lang-btn:hover::before {
    opacity: 1;
    transform: translateX(-50%) translateY(-12px);
}

/* RTL adjustments for floating button */
html[dir="rtl"] .lang-switcher {
    right: auto;
    left: 30px;
}

/* Smooth transitions for language changes */
body {
    transition: font-family 0.3s ease;
}

/* Arabic-specific typography improvements */
html[lang="ar"] {
    font-size: 16px;
    line-height: 1.8;
}

html[lang="ar"] h1, 
html[lang="ar"] h2, 
html[lang="ar"] h3, 
html[lang="ar"] h4, 
html[lang="ar"] h5, 
html[lang="ar"] h6 {
    font-weight: 600;
    letter-spacing: 0;
}

html[lang="ar"] .fw-bold {
    font-weight: 700;
}

html[lang="ar"] .fw-semibold {
    font-weight: 600;
}

/* Better spacing for Arabic text */
html[lang="ar"] .btn {
    padding: 0.5rem 1.2rem;
}

html[lang="ar"] .badge {
    padding: 0.35em 0.8em;
}
