/* Font Face Declarations */
@font-face {
    font-family: 'Bahij Lotus';
    src: url('../../Fonts/Bahij-Lotus-Light.ttf') format('truetype');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Bahij Lotus';
    src: url('../../Fonts/Bahij Lotus-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* RTL Font Classes */
.rtl-font {
    font-family: 'Bahij Lotus', 'Segoe UI', Tahoma, Arial, sans-serif !important;
}

.rtl-font-light {
    font-family: 'Bahij Lotus', 'Segoe UI', Tahoma, Arial, sans-serif !important;
    font-weight: 300 !important;
}

.rtl-font-bold {
    font-family: 'Bahij Lotus', 'Segoe UI', Tahoma, Arial, sans-serif !important;
    font-weight: 700 !important;
}

/* ===== LTR TYPOGRAPHY CLASSES ===== */
/* Default LTR styles for typography classes */
/* RTL styles are handled by rtl-styles.css when RTL mode is active */

/* LTR Menu Text - 18px (using Bahij Lotus as primary font) */
.rtl-menu {
    font-family: 'Bahij Lotus', 'Open Sans', sans-serif;
    font-size: 18px !important;
    font-weight: 700 !important;
    line-height: 1.4;
}

/* LTR Title Text - 24px */
.rtl-title {
    font-family: 'Open Sans', sans-serif;
    font-size: 24px;
    font-weight: 600;
    line-height: 1.3;
}

/* LTR Label Text - 13px */
.rtl-label {
    font-family: 'Open Sans', sans-serif;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
}

/* LTR Body Text - 14px */
.rtl-body {
    font-family: 'Open Sans', sans-serif;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.5;
}

/* LTR Small Text - 12px */
.rtl-small {
    font-family: 'Open Sans', sans-serif;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.4;
}

/* LTR Large Text - 16px */
.rtl-large {
    font-family: 'Open Sans', sans-serif;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.4;
}

/* LTR Input/Form Elements - 14px */
.rtl-input {
    font-family: 'Open Sans', sans-serif;
    font-size: 14px;
    font-weight: 400;
}

/* LTR Button Text - 14px */
.rtl-button {
    font-family: 'Open Sans', sans-serif;
    font-size: 14px;
    font-weight: 500;
}

/* LTR Table Text - 14px */
.rtl-table {
    font-family: 'Open Sans', sans-serif;
    font-size: 14px;
    font-weight: 400;
}

/* LTR Table Header - 14px */
.rtl-table-header {
    font-family: 'Open Sans', sans-serif;
    font-size: 14px;
    font-weight: 600;
}

/* LTR Navigation Items - 14px */
.rtl-nav {
    font-family: 'Open Sans', sans-serif;
    font-size: 14px;
    font-weight: 500;
}

/* LTR Card Title - 18px */
.rtl-card-title {
    font-family: 'Open Sans', sans-serif;
    font-size: 18px;
    font-weight: 600;
}

/* LTR Card Text - 14px */
.rtl-card-text {
    font-family: 'Open Sans', sans-serif;
    font-size: 14px;
    font-weight: 400;
}

/* RTL styles are now handled by rtl-styles.css when RTL mode is active */

/* Additional RTL font class for manual application */
.rtl-font {
    font-family: 'Bahij Lotus', 'Segoe UI', Tahoma, Arial, sans-serif !important;
}

/* Force RTL font on all text elements - more aggressive approach */
body[dir="rtl"] *:not(script):not(style):not(meta):not(link):not(title) {
    font-family: 'Bahij Lotus', 'Segoe UI', Tahoma, Arial, sans-serif !important;
}

/* Specific overrides for common text elements */
body[dir="rtl"] a,
body[dir="rtl"] li,
body[dir="rtl"] ul,
body[dir="rtl"] ol,
body[dir="rtl"] strong,
body[dir="rtl"] b,
body[dir="rtl"] em,
body[dir="rtl"] i,
body[dir="rtl"] small,
body[dir="rtl"] code,
body[dir="rtl"] pre {
    font-family: 'Bahij Lotus', 'Segoe UI', Tahoma, Arial, sans-serif !important;
}

/* Font loading fallback and optimization */
body {
    font-display: swap;
}

/* Ensure smooth font loading */
@supports (font-display: swap) {
    body[dir="rtl"] {
        font-display: swap;
    }
}

/* Font loading indicator (optional) */
.font-loading {
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.font-loaded {
    opacity: 1;
}


.field-validation-error {
    color: red !important;
}

.thead {
    background-color: #f8f9fa;
    color: #495057;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.875rem;
    border-bottom: 2px solid #dee2e6;
    position: sticky;
    top: 0;
    z-index: 1;
}

    .thead th {
        padding: 12px 15px;
        vertical-align: middle;
        white-space: nowrap;
        border-bottom: none !important;
    }

        .thead th:hover {
            background-color: #e9ecef;
            cursor: pointer;
        }
/* Spinner Styles */
.spinner-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.spinner-overlay.show {
    display: flex;
}

/* Login Page Styles */
.company-title {
    font-family: 'Poppins', sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    color: #ffffff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    letter-spacing: 1px;
    margin-bottom: 1.5rem !important;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: titleGlow 2s ease-in-out infinite alternate;
}

@keyframes titleGlow {
    from {
        text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3), 0 0 10px rgba(255, 255, 255, 0.2);
    }

    to {
        text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3), 0 0 20px rgba(255, 255, 255, 0.4);
    }
}

.logo-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 1rem 0;
}

.company-logo {
    max-width: 100%;
    height: auto;
    max-height: 120px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
    transition: transform 0.3s ease-in-out;
}

    .company-logo:hover {
        transform: scale(1.05);
    }

.tagline {
    font-family: 'Open Sans', sans-serif;
    font-size: 1.1rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    margin-top: 1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .company-title {
        font-size: 2rem;
        margin-bottom: 1rem !important;
    }

    .company-logo {
        max-height: 80px;
    }

    .tagline {
        font-size: 1rem;
    }
}

@media (max-width: 576px) {
    .company-title {
        font-size: 1.5rem;
        margin-bottom: 0.75rem !important;
    }

    .company-logo {
        max-height: 60px;
    }

    .tagline {
        font-size: 0.9rem;
    }
}

@media (max-width: 400px) {
    .company-title {
        font-size: 1.25rem;
    }

    .company-logo {
        max-height: 50px;
    }

    .tagline {
        font-size: 0.8rem;
    }
}

/* Login Error Message Styles */
.login-error {
    border-left: 4px solid #dc3545;
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    border: 1px solid #f5c6cb;
    color: #721c24;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(220, 53, 69, 0.1);
    animation: slideInDown 0.5s ease-out;
}

    .login-error .btn-close {
        background: none;
        border: none;
        font-size: 1.2rem;
        color: #721c24;
        opacity: 0.7;
        transition: opacity 0.3s ease;
    }

        .login-error .btn-close:hover {
            opacity: 1;
        }

    .login-error i {
        color: #dc3545;
    }

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Form Enhancement */
.form-control:focus {
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.form-control.is-invalid {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

/* Button Enhancement */
.btn-primary {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    border: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

    .btn-primary:hover {
        background: linear-gradient(135deg, #0056b3 0%, #004085 100%);
        transform: translateY(-1px);
        box-shadow: 0 4px 8px rgba(0, 123, 255, 0.3);
    }

    .btn-primary:active {
        transform: translateY(0);
    }

/* Dropdown Settings Icon */
.btn-reveal {
    transition: all 0.3s ease;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

    .btn-reveal:hover {
        background-color: rgba(0, 123, 255, 0.1);
        color: #007bff !important;
        transform: rotate(90deg);
    }

    .btn-reveal i {
        transition: all 0.3s ease;
    }

    .btn-reveal:hover i {
        color: #007bff;
    }

/* Dropdown Menu Styling */
.dropdown-menu {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 0.5rem;
    min-width: 150px;
}

.dropdown-item {
    padding: 0.5rem 1rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
}

    .dropdown-item:hover {
        background-color: #f8f9fa;
        color: #495057;
    }

    .dropdown-item.text-danger:hover {
        background-color: #f8d7da;
        color: #721c24;
    }

/* RTL font overrides are now handled by rtl-styles.css */

/* ===== TYPOGRAPHY CLASSES USAGE GUIDE ===== */
/*
CONDITIONAL BEHAVIOR:
- When LTR (English): Uses defined fonts and sizes for each class (defined in custom.css)
- When RTL (Persian/Urdu/Pashto): Uses Bahij Lotus font with RTL-specific sizes (defined in rtl-styles.css)

HOW IT WORKS:
- custom.css: Contains base styles for all typography classes (always loaded)
- rtl-styles.css: Loads only when RTL mode is active, overrides with RTL styles
- ONLY elements with specific classes get RTL font - no universal font application
- No need to check body[dir="rtl"] in CSS - it's handled by conditional loading

USAGE EXAMPLES:

1. MENU TEXT:
   LTR: 18px Bahij Lotus | RTL: 18px Bahij Lotus
   <a class="rtl-menu" href="#">Menu</a>
   <a class="rtl-menu" href="#">منو</a>

2. TITLES:
   LTR: 24px Open Sans | RTL: 20px Bahij Lotus
   <h1 class="rtl-title">Main Title</h1>
   <h1 class="rtl-title">عنوان اصلی</h1>

3. LABELS:
   LTR: 13px Open Sans | RTL: 16px Bahij Lotus
   <label class="rtl-label">Label</label>
   <label class="rtl-label">برچسب</label>

4. BODY TEXT:
   LTR: 14px Open Sans | RTL: 16px Bahij Lotus
   <p class="rtl-body">Body text</p>
   <p class="rtl-body">متن اصلی</p>

5. INPUTS:
   LTR: 14px Open Sans | RTL: 16px Bahij Lotus
   <input class="rtl-input" type="text" placeholder="Input text">
   <input class="rtl-input" type="text" placeholder="متن ورودی">

6. BUTTONS:
   LTR: 14px Open Sans | RTL: 16px Bahij Lotus
   <button class="rtl-button">Button</button>
   <button class="rtl-button">دکمه</button>

7. TABLES:
   LTR: 14px Open Sans | RTL: 16px Bahij Lotus
   <td class="rtl-table">Table content</td>
   <th class="rtl-table-header">Table header</th>

8. NAVIGATION:
   LTR: 14px Open Sans | RTL: 18px Bahij Lotus
   <nav class="rtl-nav">Navigation</nav>
   <nav class="rtl-nav">منوی ناوبری</nav>

9. CARDS:
   LTR: 18px/14px Open Sans | RTL: 20px/16px Bahij Lotus
   <h5 class="rtl-card-title">Card Title</h5>
   <p class="rtl-card-text">Card text</p>

10. SMALL TEXT:
    LTR: 12px Open Sans | RTL: 14px Bahij Lotus
    <small class="rtl-small">Small text</small>

11. LARGE TEXT:
    LTR: 16px Open Sans | RTL: 18px Bahij Lotus
    <span class="rtl-large">Large text</span>

AVAILABLE CLASSES:
- .rtl-menu (LTR: 18px Bahij Lotus | RTL: 18px Bahij Lotus)
- .rtl-title (LTR: 24px Open Sans | RTL: 20px Bahij Lotus)
- .rtl-label (LTR: 13px Open Sans | RTL: 16px Bahij Lotus)
- .rtl-body (LTR: 14px Open Sans | RTL: 16px Bahij Lotus)
- .rtl-input (LTR: 14px Open Sans | RTL: 16px Bahij Lotus)
- .rtl-button (LTR: 14px Open Sans | RTL: 16px Bahij Lotus)
- .rtl-table (LTR: 14px Open Sans | RTL: 16px Bahij Lotus)
- .rtl-table-header (LTR: 14px Open Sans | RTL: 16px Bahij Lotus)
- .rtl-nav (LTR: 14px Open Sans | RTL: 18px Bahij Lotus)
- .rtl-card-title (LTR: 18px Open Sans | RTL: 20px Bahij Lotus)
- .rtl-card-text (LTR: 14px Open Sans | RTL: 16px Bahij Lotus)
- .rtl-small (LTR: 12px Open Sans | RTL: 14px Bahij Lotus)
- .rtl-large (LTR: 16px Open Sans | RTL: 18px Bahij Lotus)

FILES:
- custom.css: LTR styles (always loaded)
- rtl-styles.css: RTL styles (loaded only when RTL mode is active)
*/

/* ===== NAVBAR & MENU - THEME COLOR SET (from Customize) ===== */
/* Uses --falcon-primary and theme vars so navbar/menu follow Color Scheme + Navbar Style */

/* Base: vertical navbar and top navbar use theme colors */
.navbar-vertical,
.content .navbar-top.navbar-glass {
    --navbar-bg: transparent;
    --navbar-text: var(--falcon-gray-800, #4d5969);
    --navbar-link: var(--falcon-gray-700, #5e6e82);
    --navbar-link-hover: var(--falcon-primary, #2c7be5);
    --navbar-border: transparent;
}

/* Transparent (default): light background from theme */
.navbar-vertical.navbar-transparent,
.content .navbar-top.navbar-transparent {
    background-color: var(--falcon-gray-100, #f9fafd);
    color: var(--falcon-gray-800, #4d5969);
    border-color: var(--falcon-gray-200, #edf2f9);
}

.navbar-vertical.navbar-transparent .nav-link,
.content .navbar-top.navbar-transparent .nav-link,
.content .navbar-top.navbar-transparent h4 {
    color: var(--falcon-gray-800, #4d5969);
}

.navbar-vertical.navbar-transparent .nav-link:hover,
.content .navbar-top.navbar-transparent .nav-link:hover {
    color: var(--falcon-primary, #2c7be5);
}

/* Inverted: dark background, light text */
.navbar-vertical.navbar-inverted,
.content .navbar-top.navbar-inverted {
    background-color: var(--falcon-gray-900, #344050);
    color: var(--falcon-white, #fff);
    border-color: var(--falcon-gray-800, #4d5969);
}

.navbar-vertical.navbar-inverted .nav-link,
.content .navbar-top.navbar-inverted .nav-link,
.content .navbar-top.navbar-inverted h4,
.content .navbar-top.navbar-inverted .navbar-nav-icons {
    color: var(--falcon-gray-200, #edf2f9);
}

.navbar-vertical.navbar-inverted .nav-link:hover,
.content .navbar-top.navbar-inverted .nav-link:hover {
    color: var(--falcon-white, #fff);
}

/* Card: card-style background */
.navbar-vertical.navbar-card,
.content .navbar-top.navbar-card {
    background-color: var(--falcon-white, #fff);
    color: var(--falcon-gray-800, #4d5969);
    border: 1px solid var(--falcon-gray-200, #edf2f9);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.navbar-vertical.navbar-card .nav-link,
.content .navbar-top.navbar-card .nav-link,
.content .navbar-top.navbar-card h4 {
    color: var(--falcon-gray-800, #4d5969);
}

.navbar-vertical.navbar-card .nav-link:hover,
.content .navbar-top.navbar-card .nav-link:hover {
    color: var(--falcon-primary, #2c7be5);
}

/* Vibrant: primary color background */
.navbar-vertical.navbar-vibrant,
.content .navbar-top.navbar-vibrant {
    background: linear-gradient(135deg, var(--falcon-primary, #2c7be5) 0%, #1a5bb5 100%);
    color: var(--falcon-white, #fff);
    border: none;
}

.navbar-vertical.navbar-vibrant .nav-link,
.content .navbar-top.navbar-vibrant .nav-link,
.content .navbar-top.navbar-vibrant h4,
.content .navbar-top.navbar-vibrant .navbar-nav-icons {
    color: rgba(255, 255, 255, 0.95);
}

.navbar-vertical.navbar-vibrant .nav-link:hover,
.content .navbar-top.navbar-vibrant .nav-link:hover {
    color: var(--falcon-white, #fff);
}

/* Menu (vertical sidebar): link and active state from theme color set */
.navbar-vertical .nav-link {
    color: var(--falcon-gray-800, #4d5969);
}

.navbar-vertical .nav-link:hover {
    color: var(--falcon-primary, #2c7be5);
}

.navbar-vertical .nav-link.active,
.navbar-vertical .nav-item.active > .nav-link {
    color: var(--falcon-primary, #2c7be5);
    background-color: rgba(var(--falcon-primary-rgb, 44, 123, 229), 0.1);
    font-weight: 600;
}

/* Active indicator line using primary */
.navbar-vertical .nav-item.active > .nav-link {
    border-left: 3px solid var(--falcon-primary, #2c7be5);
    padding-left: calc(1rem - 3px);
}

body[dir="rtl"] .navbar-vertical .nav-item.active > .nav-link {
    border-left: none;
    border-right: 3px solid var(--falcon-primary, #2c7be5);
    padding-right: calc(1rem - 3px);
    padding-left: 1rem;
}

/* Inverted navbar: menu links and active stay readable */
.navbar-vertical.navbar-inverted .nav-link {
    color: var(--falcon-gray-200, #edf2f9);
}

.navbar-vertical.navbar-inverted .nav-link:hover {
    color: var(--falcon-white, #fff);
}

.navbar-vertical.navbar-inverted .nav-link.active,
.navbar-vertical.navbar-inverted .nav-item.active > .nav-link {
    color: var(--falcon-white, #fff);
    background-color: rgba(255, 255, 255, 0.15);
}

.navbar-vertical.navbar-inverted .nav-item.active > .nav-link {
    border-left-color: var(--falcon-white, #fff);
}

body[dir="rtl"] .navbar-vertical.navbar-inverted .nav-item.active > .nav-link {
    border-right-color: var(--falcon-white, #fff);
}

/* Vibrant navbar: menu active state */
.navbar-vertical.navbar-vibrant .nav-link.active,
.navbar-vertical.navbar-vibrant .nav-item.active > .nav-link {
    color: var(--falcon-white, #fff);
    background-color: rgba(255, 255, 255, 0.2);
}

.navbar-vertical.navbar-vibrant .nav-item.active > .nav-link {
    border-left-color: var(--falcon-white, #fff);
}

body[dir="rtl"] .navbar-vertical.navbar-vibrant .nav-item.active > .nav-link {
    border-right-color: var(--falcon-white, #fff);
}

/* Dark theme (Color Scheme = Dark): navbar and menu follow dark palette */
html.dark .navbar-vertical.navbar-transparent,
html.dark .content .navbar-top.navbar-transparent {
    background-color: var(--falcon-gray-1000, #232e3c);
    color: var(--falcon-gray-200, #edf2f9);
    border-color: var(--falcon-gray-800, #4d5969);
}

html.dark .navbar-vertical.navbar-transparent .nav-link,
html.dark .content .navbar-top.navbar-transparent .nav-link,
html.dark .content .navbar-top.navbar-transparent h4 {
    color: var(--falcon-gray-300, #d8e2ef);
}

html.dark .navbar-vertical.navbar-transparent .nav-link:hover,
html.dark .content .navbar-top.navbar-transparent .nav-link:hover {
    color: var(--falcon-primary, #2c7be5);
}

html.dark .navbar-vertical.navbar-transparent .nav-link.active,
html.dark .navbar-vertical.navbar-transparent .nav-item.active > .nav-link {
    color: var(--falcon-primary, #2c7be5);
    background-color: rgba(var(--falcon-primary-rgb, 44, 123, 229), 0.2);
}

html.dark .navbar-vertical.navbar-card,
html.dark .content .navbar-top.navbar-card {
    background-color: var(--falcon-gray-1000, #232e3c);
    border-color: var(--falcon-gray-700, #5e6e82);
    color: var(--falcon-gray-200, #edf2f9);
}

html.dark .navbar-vertical.navbar-card .nav-link,
html.dark .content .navbar-top.navbar-card .nav-link,
html.dark .content .navbar-top.navbar-card h4 {
    color: var(--falcon-gray-300, #d8e2ef);
}

html.dark .navbar-vertical.navbar-card .nav-link:hover,
html.dark .content .navbar-top.navbar-card .nav-link:hover {
    color: var(--falcon-primary, #2c7be5);
}

html.dark .navbar-vertical .nav-link {
    color: var(--falcon-gray-300, #d8e2ef);
}

html.dark .navbar-vertical .nav-link.active,
html.dark .navbar-vertical .nav-item.active > .nav-link {
    color: var(--falcon-primary, #2c7be5);
    background-color: rgba(var(--falcon-primary-rgb, 44, 123, 229), 0.2);
}
