/* Hirly/styling/main.css */
/* This file contains all global/core styles by importing smaller component files. */

/* External Fonts & Icons - Keep these at the very top */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&display=swap'); /* Added 800 weight */
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css');

/* Core Components - Imported in a logical order */

/* 1. Variables & Base Styles (Foundational) */
@import 'components/_variables.css'; /* All your :root variables */
@import 'components/_base.css';     /* Universal resets, body, img, h1-h6, p, .container, .section-padding, text utilities */

/* 2. Reusable UI Elements (Buttons, Forms, Cards, Dropdowns, Modals) */
@import 'components/_buttons.css';  /* All .btn, .btn-primary, etc. */
@import 'components/_forms.css';    /* .form-group, .form-control, file-upload styles */
@import 'components/_layout.css';   /* .header, .footer, .dashboard-header, .user-menu, .nav-links, general layout elements */
/* @import 'components/_utilities.css'; This file was not provided, assuming utilities are in _base.css or handled otherwise */
@import 'components/_cards.css';    /* .feature-card, .category-card, .step-card, .job-card, .application-card, .talent-card */
@import 'components/_dropdown.css'; /* Styles for dropdown menus */
@import 'components/modals.css';   /* Styles for modals, loading spinners, and toast notifications */


/* Page Specific Styles - Imported last to allow overrides */
/* These paths assume a 'pages' subdirectory within 'styling' */
@import 'pages/page-index.css';
@import 'pages/page-about.css';
@import 'pages/page-contact.css';
@import 'pages/page-jobs.css';
@import 'pages/page-talent.css'; /* Ensure talent page CSS is imported */
@import 'pages/page-job-details.css'; /* Ensure job details page CSS is imported */
@import 'pages/page-applicants.css';
@import 'pages/page-admin_dashboard.css';
@import 'pages/page-employer_profile.css';
@import 'pages/page-hire-dashboard.css';
@import 'pages/page-job-dashboard.css';
@import 'pages/page-post-job.css';
@import 'pages/page-premium_plans.css';

@import 'components/_rtl-overrides.css';
@import 'components/_rtl-exceptions.css'; /* Add this line after rtl-overrides */

/* NEW: Language Switcher Button Styling */
.header .lang-switcher {
    display: flex; /* Arrange flag and text horizontally */
    align-items: center;
    gap: var(--spacing-xs); /* Space between flag and text */
    background-color: var(--white); /* White background for the button */
    color: var(--primary-dark); /* Dark text color */
    border: 1px solid var(--border-color); /* Subtle border */
    padding: var(--spacing-xs) var(--spacing-sm); /* Adjust padding */
    border-radius: var(--border-radius-pill); /* More rounded, pill-like shape */
    font-size: var(--font-size-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-xs); /* Subtle shadow */
    white-space: nowrap; /* Prevent text from wrapping */
    /* Ensure it's always on the right side of the nav, before mobile menu button */
    margin-left: var(--spacing-md); /* Default margin for LTR */
}

.header .lang-switcher:hover {
    background-color: var(--background-light); /* Light background on hover */
    border-color: var(--primary-light); /* Primary border on hover */
    transform: translateY(-1px); /* Slight lift */
    box-shadow: var(--shadow-sm);
}

.header .lang-switcher .lang-flag {
    width: 24px; /* Standard size for flag icon */
    height: 16px; /* Maintain aspect ratio for common flags */
    object-fit: cover; /* Ensure flag covers the area without distortion */
    border-radius: 2px; /* Slightly rounded corners for the flag image itself */
    box-shadow: 0 0 3px rgba(0,0,0,0.2); /* Small shadow on flag for depth */
    flex-shrink: 0; /* Prevent flag from shrinking on smaller screens */
}

.header .lang-switcher .lang-label {
    /* Ensure the text is visible and styled */
    line-height: 1; /* Align text vertically with the flag */
    flex-grow: 1; /* Allow text to take available space */
}

/* RTL specific adjustments for the language switcher */
html[dir="rtl"] .header .lang-switcher {
    margin-left: 0; /* Reset LTR margin */
    margin-right: var(--spacing-md); /* Apply margin for RTL */
}


/* RTL Layout Fix for Header: Ensure Logo and Nav/Auth stay in place */
.header .header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    /* Ensure default flex-direction: row is maintained */
    flex-direction: row;
}

.header .main-nav {
    display: flex;
    align-items: center;
    flex-grow: 1; /* Allow main-nav to take available space */
    justify-content: flex-end; /* Push content to the right (end) in LTR */
    gap: var(--spacing-md); /* Space between nav links and auth/lang buttons */
}

html[dir="rtl"] .header .main-nav {
    /* In RTL, we still want the nav links to be left of auth/lang buttons,
       and the whole main-nav to be on the left of the mobile button.
       The flex-direction: row on header-container should keep the logo left,
       and main-nav/mobile button right.
       Inside main-nav, we want the links to be on the right, and auth/lang on the left.
       So, we reverse the direction *within* main-nav.
    */
    flex-direction: row-reverse; /* Reverse order of children within main-nav */
    justify-content: flex-start; /* Push content to the left (start) in RTL */
}

/* Ensure the order of elements within the header-container is fixed */
.header .header-container .logo {
    order: 0; /* Always first */
}

.header .header-container .main-nav {
    order: 1; /* Always second */
}

.header .header-container .mobile-menu-button {
    order: 2; /* Always third */
}

/* Specific adjustment for auth-buttons and user-menu within main-nav */
.header .main-nav .auth-buttons,
.header .main-nav .user-menu {
    display: flex; /* Ensure these are flex containers too */
    align-items: center;
    gap: var(--spacing-sm); /* Space between login/signup buttons or avatar/menu */
}

html[dir="rtl"] .header .main-nav .auth-buttons,
html[dir="rtl"] .header .main-nav .user-menu {
    /* If main-nav is row-reverse, these groups will naturally be on the left.
       Their internal order should still be row.
    */
    flex-direction: row; /* Keep internal order LTR */
}


/* Responsive adjustment for small screens: hide text, show only flag */
@media (max-width: 576px) {
    .header .lang-switcher .lang-label {
        display: none; /* Hide the language text */
    }
    .header .lang-switcher {
        padding: var(--spacing-xs); /* Smaller padding for icon-only button */
        width: 40px; /* Make it a square button for the flag */
        height: 32px; /* Maintain height */
        justify-content: center; /* Center the flag */
        margin-left: var(--spacing-sm); /* Adjust margin for mobile */
    }
    .header .lang-switcher .lang-flag {
        width: 28px; /* Slightly larger flag when text is hidden */
        height: 18px;
    }
    html[dir="rtl"] .header .lang-switcher {
        margin-right: var(--spacing-sm); /* Adjust margin for mobile in RTL */
    }
}


/* Sidebar Language Switcher Styling */
.sidebar-lang-switcher {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    background-color: transparent;
    color: var(--white);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--border-radius);
    font-size: var(--font-size-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    text-align: left;
    margin: var(--spacing-sm) 0;
}

.sidebar-lang-switcher:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
}

.sidebar-lang-switcher .lang-flag {
    width: 24px;
    height: 16px;
    object-fit: cover;
    border-radius: 2px;
    box-shadow: 0 0 3px rgba(0,0,0,0.2);
    flex-shrink: 0;
}

.sidebar-lang-switcher .lang-label {
    line-height: 1;
    flex-grow: 1;
}

/* RTL specific adjustments for the sidebar language switcher */
html[dir="rtl"] .sidebar-lang-switcher {
    text-align: right;
}
