/* Employer website — light (day) and dark (night).
   Driven by <html data-theme="light|dark">. Light keeps the existing stylesheet;
   dark recolors surfaces, text, forms, and shared widgets. */

:root {
  --wt-bg: #fafafa;
  --wt-surface: #ffffff;
  --wt-surface-2: #f7f9ff;
  --wt-chip: #edf4ff;
  --wt-chip-hover: #ffffff;
  --wt-input: #ffffff;
  --wt-border: #e7e7e7;
  --wt-text: #0f0f0f;
  --wt-text-2: #3d3d3d;
  --wt-muted: #888888;
  --wt-navy: #191b4d;
  --wt-blue: #3298cb;
  --wt-sidebar: #dfe9ff;
  --wt-shadow: 0 4px 20px rgba(0, 0, 0, 0.04), 0 2px 8px rgba(0, 0, 0, 0.03);
  --wt-danger-soft: #fef3f2;
  --wt-edit-soft: #edf4ff;
}

html[data-theme="light"],
html:not([data-theme]) {
  color-scheme: light;
}

html[data-theme="dark"] {
  color-scheme: dark;
  /* Same palette as the admin dashboard dark theme. */
  --wt-bg: #0a1322;
  --wt-surface: #101b2e;
  --wt-surface-2: #0d1727;
  --wt-chip: #16243c;
  --wt-chip-hover: #1b2d4a;
  --wt-input: #0c1626;
  --wt-border: #1d2c45;
  --wt-text: #e6edf6;
  --wt-text-2: #c5d1e0;
  --wt-muted: #8ea1bb;
  --wt-navy: #e6edf6;
  --wt-blue: #3d9be9;
  --wt-sidebar: #0f1d33;
  --wt-shadow: 0 14px 34px -14px rgba(0, 0, 0, 0.6);
  --wt-danger-soft: rgba(248, 113, 113, 0.13);
  --wt-edit-soft: rgba(61, 155, 233, 0.15);
  --bs-body-color: var(--wt-text);
  --bs-body-bg: var(--wt-bg);
  --bs-emphasis-color: var(--wt-text);
  --bs-heading-color: var(--wt-text);
  --bs-secondary-color: var(--wt-muted);
  --bs-tertiary-color: var(--wt-muted);
  --bs-border-color: var(--wt-border);
}

/* ---------- Switch ---------- */
.theme-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  width: 64px;
  height: 40px;
  padding: 0 9px;
  border: 1px solid var(--wt-border);
  border-radius: 999px;
  background: var(--wt-chip);
  color: #8b93ad;
  cursor: pointer;
  direction: ltr;
}

.theme-switch i {
  position: relative;
  z-index: 1;
  font-size: 13px;
}

.theme-switch-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.16);
  transition: transform 0.28s cubic-bezier(0.3, 0.7, 0.3, 1), background-color 0.2s ease;
}

html[data-theme="light"] .theme-switch .icon-sun,
html:not([data-theme]) .theme-switch .icon-sun {
  color: #f59e0b;
}

html[data-theme="dark"] .theme-switch .icon-moon {
  color: #ffffff;
}

html[data-theme="dark"] .theme-switch-thumb {
  transform: translateX(26px);
  background: #3d9be9;
}

.theme-switch:focus-visible {
  outline: 2px solid #3298cb;
  outline-offset: 2px;
}

.auth-toolbar {
  position: absolute;
  top: 20px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 10px;
}

[dir="rtl"] .auth-toolbar {
  left: 24px;
}

[dir="ltr"] .auth-toolbar {
  right: 24px;
}

.auth-toolbar .toggle-lang-btn {
  position: static;
  text-decoration: none;
}

.auth-toolbar .toggle-lang-btn:hover {
  transform: translate(1px, 2px);
}

.auth-toolbar .theme-switch {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.35);
  color: rgba(255, 255, 255, 0.75);
}

.auth-toolbar .localeBtn {
  background: rgba(255, 255, 255, 0.92);
  padding: 8px 12px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

html[data-theme="dark"] .auth-toolbar .text-black {
  color: #0f0f0f !important;
}

/* ---------- Dark surfaces ---------- */
html[data-theme="dark"] body {
  background-color: var(--wt-bg);
  color: var(--wt-text);
  -webkit-font-smoothing: antialiased;
}

html[data-theme="dark"] h1,
html[data-theme="dark"] h2,
html[data-theme="dark"] h3,
html[data-theme="dark"] h4,
html[data-theme="dark"] h5,
html[data-theme="dark"] h6,
html[data-theme="dark"] label,
html[data-theme="dark"] .form-label,
html[data-theme="dark"] p {
  color: var(--wt-text);
}

html[data-theme="dark"] .text-black,
html[data-theme="dark"] .text-dark,
html[data-theme="dark"] .text-secondary,
html[data-theme="dark"] .text-body {
  color: var(--wt-text) !important;
}

html[data-theme="dark"] .text-primary,
html[data-theme="dark"] .main-title {
  color: var(--wt-navy) !important;
}

html[data-theme="dark"] .text-default,
html[data-theme="dark"] .text-muted,
html[data-theme="dark"] .sign-in .optional-text {
  color: var(--wt-muted) !important;
}

html[data-theme="dark"] .bg-white,
html[data-theme="dark"] .bg-light {
  background-color: var(--wt-surface) !important;
}

html[data-theme="dark"] .page-content,
html[data-theme="dark"] .sign-in .content-div {
  background-color: var(--wt-bg);
}

html[data-theme="dark"] #sidebar,
html[data-theme="dark"] #sidebar.active {
  background: linear-gradient(180deg, #0c182c 0%, #08111f 100%);
}

html[data-theme="dark"] #sidebar .bg-white {
  background: transparent !important;
  box-shadow: none !important;
}

html[data-theme="dark"] #openSidebar,
html[data-theme="dark"] #sidebar #closeSidebar {
  color: var(--wt-text);
}

html[data-theme="dark"] #sidebar .sidebar-tabs li a {
  color: rgba(214, 226, 242, 0.74);
}

html[data-theme="dark"] #sidebar .sidebar-tabs li.active {
  background: linear-gradient(135deg, #1a75bc 0%, #2b8ad6 100%);
  border-color: transparent;
  box-shadow: 0 10px 22px -10px rgba(43, 138, 214, 0.8);
}

html[data-theme="dark"] #sidebar .sidebar-tabs li.active a {
  color: #ffffff;
}

html[data-theme="dark"] #sidebar .sidebar-tabs li a.logout {
  color: #f87171;
}

html[data-theme="dark"] #sidebar .sidebar-tabs li:not(.active) a:not(.logout) img,
html[data-theme="dark"] .head-section .notifications:not(.has-notification) img,
html[data-theme="dark"] .head-section .localeBtn img,
html[data-theme="dark"] .bell-icon img,
html[data-theme="dark"] .show-password img {
  filter: brightness(0) invert(1);
  opacity: 0.74;
}

html[data-theme="dark"] #sidebar .sidebar-tabs li.active a img {
  filter: brightness(0) invert(1);
  opacity: 1;
}

html[data-theme="dark"] .head-section,
html[data-theme="dark"] .order-card,
html[data-theme="dark"] .job-card,
html[data-theme="dark"] .plan-card,
html[data-theme="dark"] .settings,
html[data-theme="dark"] .static-pages-content,
html[data-theme="dark"] .job-form,
html[data-theme="dark"] .plans-container,
html[data-theme="dark"] .notification-item,
html[data-theme="dark"] .notifications-content .notification-item,
html[data-theme="dark"] .modal-content,
html[data-theme="dark"] .dropdown-menu,
html[data-theme="dark"] .list-group-item,
html[data-theme="dark"] .card,
html[data-theme="dark"] .table {
  background-color: var(--wt-surface);
  color: var(--wt-text);
  border-color: var(--wt-border);
  box-shadow: var(--wt-shadow);
}

html[data-theme="dark"] .table {
  --bs-table-bg: var(--wt-surface);
  --bs-table-color: var(--wt-text);
  --bs-table-border-color: var(--wt-border);
  --bs-table-striped-bg: var(--wt-surface-2);
  --bs-table-hover-bg: var(--wt-chip);
}

html[data-theme="dark"] .head-section .notifications,
html[data-theme="dark"] .head-section .localeBtn,
html[data-theme="dark"] .plan-card .plan-period,
html[data-theme="dark"] .renew-subscription,
html[data-theme="dark"] .job-card .edit-job,
html[data-theme="dark"] .notifications-content .notification-item .bell-icon,
html[data-theme="dark"] .bell-icon,
html[data-theme="dark"] #deleteJob .cancel-delete,
html[data-theme="dark"] #deleteAccount .cancel-delete,
html[data-theme="dark"] #logout .cancel-delete {
  background-color: var(--wt-chip);
  border-color: var(--wt-chip);
  color: var(--wt-text);
}

html[data-theme="dark"] .renew-subscription:hover,
html[data-theme="dark"] #deleteJob .cancel-delete:hover,
html[data-theme="dark"] #deleteAccount .cancel-delete:hover,
html[data-theme="dark"] #logout .cancel-delete:hover,
html[data-theme="dark"] #deleteJob .confirm-delete:hover,
html[data-theme="dark"] #deleteAccount .confirm-delete:hover,
html[data-theme="dark"] #logout .confirm-delete:hover {
  background-color: var(--wt-surface-2);
  color: var(--wt-text);
}

html[data-theme="dark"] .add-new-job,
html[data-theme="dark"] .order-card .download-cv,
html[data-theme="dark"] .delete-all-btn {
  background-color: transparent;
  color: var(--wt-text-2);
  border-color: var(--wt-border);
}

html[data-theme="dark"] .delete-all-btn {
  color: #ff8b8b;
  border-color: #ff8b8b;
}

html[data-theme="dark"] .delete-all-btn:hover {
  background: #d92d20;
  color: #fff;
}

html[data-theme="dark"] .main-btn,
html[data-theme="dark"] .main-btn:hover,
html[data-theme="dark"] .ad-type-toggle-btn.active {
  background: linear-gradient(135deg, #1a4f8c 0%, #2b8ad6 100%);
  color: #ffffff;
}

html[data-theme="dark"] .ad-type-toggle-btn {
  background-color: var(--wt-surface-2);
  color: var(--wt-text);
}

html[data-theme="dark"] .ad-type-toggle-btn:hover:not(.active) {
  background-color: var(--wt-chip);
}

html[data-theme="dark"] .job-card .title,
html[data-theme="dark"] .order-card .description,
html[data-theme="dark"] .contact-us .head h4,
html[data-theme="dark"] .notification-title,
html[data-theme="dark"] .notifications-content .notification-item .notification-title {
  color: var(--wt-text);
}

html[data-theme="dark"] .job-card .description,
html[data-theme="dark"] .order-card .title,
html[data-theme="dark"] .static-pages-content .static-content p,
html[data-theme="dark"] .faq p,
html[data-theme="dark"] .notification-time,
html[data-theme="dark"] .notifications-content .notification-item .notification-time,
html[data-theme="dark"] .job-form .lookup-hint {
  color: var(--wt-muted);
}

html[data-theme="dark"] .job-form .head,
html[data-theme="dark"] .contact-us .head,
html[data-theme="dark"] .subscriptions-content .plans-container {
  border-color: var(--wt-border);
}

html[data-theme="dark"] .job-card .delete-job,
html[data-theme="dark"] .delete-notification-container,
html[data-theme="dark"] .notifications-content .delete-notification-container {
  background-color: var(--wt-danger-soft);
  border-color: var(--wt-danger-soft);
}

html[data-theme="dark"] .delete-notification-container:hover {
  background: #5a2430;
}

html[data-theme="dark"] .delete-account {
  color: #ffb4a8;
}

html[data-theme="dark"] .vacancy-badge-vacant {
  background-color: #143528;
  color: #8ee0b2;
}

html[data-theme="dark"] .vacancy-badge-filled {
  background-color: #3a1d24;
  color: #ffb4a8;
}

html[data-theme="dark"] .cv-status.cv-status-new {
  color: #8ee0b2;
}

html[data-theme="dark"] .cv-status.cv-status-downloaded {
  color: var(--wt-muted);
}

html[data-theme="dark"] .pending-request-alert {
  background: #3a3014;
  border-color: #8a6a12;
  color: #ffe08a;
}

html[data-theme="dark"] .step {
  background: var(--wt-surface-2);
  color: var(--wt-muted);
}

/* ---------- Forms ---------- */
html[data-theme="dark"] input[type="text"],
html[data-theme="dark"] input[type="password"],
html[data-theme="dark"] input[type="email"],
html[data-theme="dark"] input[type="number"],
html[data-theme="dark"] input[type="tel"],
html[data-theme="dark"] input[type="search"],
html[data-theme="dark"] input[type="date"],
html[data-theme="dark"] textarea,
html[data-theme="dark"] .form-control,
html[data-theme="dark"] .form-select,
html[data-theme="dark"] input:disabled,
html[data-theme="dark"] .verification-code--inputs input[type="text"] {
  background-color: var(--wt-input);
  color: var(--wt-text);
  border-color: var(--wt-border);
}

html[data-theme="dark"] .form-control:focus,
html[data-theme="dark"] input:focus-visible,
html[data-theme="dark"] textarea:focus-visible {
  border-color: var(--wt-blue) !important;
}

html[data-theme="dark"] ::placeholder {
  color: #7d87a8;
}

html[data-theme="dark"] .form-control:disabled,
html[data-theme="dark"] .form-select:disabled,
html[data-theme="dark"] .select2-container--default.select2-container--disabled .select2-selection--single {
  background-color: var(--wt-surface-2);
  color: var(--wt-muted);
}

html[data-theme="dark"] .uploadAttachments {
  border-color: var(--wt-border);
}

html[data-theme="dark"] .uploadAttachments h4 {
  color: var(--wt-muted);
}

html[data-theme="dark"] .country-code-picker-toggle,
html[data-theme="dark"] .country-code-picker-item {
  color: var(--wt-text);
}

html[data-theme="dark"] .country-code-picker-menu,
html[data-theme="dark"] .country-code-picker--inline .country-code-picker-toggle,
html[data-theme="dark"] .country-code-picker-search {
  background: var(--wt-surface);
  color: var(--wt-text);
  border-color: var(--wt-border);
}

html[data-theme="dark"] .country-code-picker-item:hover,
html[data-theme="dark"] .country-code-picker-item.is-active {
  background: var(--wt-chip);
}

html[data-theme="dark"] .country-code-picker-item-code,
html[data-theme="dark"] .countrey-code span {
  color: var(--wt-muted);
}

/* ---------- Selects ---------- */
html[data-theme="dark"] .nice-select,
html[data-theme="dark"] .nice-select .list,
html[data-theme="dark"] .nice-select:active,
html[data-theme="dark"] .nice-select.open,
html[data-theme="dark"] .nice-select:focus,
html[data-theme="dark"] .nice-select:hover {
  background-color: var(--wt-input);
  color: var(--wt-text);
  border-color: var(--wt-border);
}

html[data-theme="dark"] .nice-select .current,
html[data-theme="dark"] .nice-select span.current {
  color: var(--wt-text) !important;
}

html[data-theme="dark"] .nice-select:after {
  border-color: var(--wt-text) !important;
}

html[data-theme="dark"] .nice-select ul.list li:hover,
html[data-theme="dark"] .nice-select ul.list .selected {
  background-color: var(--wt-chip) !important;
  color: var(--wt-text);
}

html[data-theme="dark"] .select2-container--default .select2-selection--single,
html[data-theme="dark"] .select2-container--default .select2-selection--multiple,
html[data-theme="dark"] .select2-dropdown,
html[data-theme="dark"] .select2-search--dropdown .select2-search__field,
html[data-theme="dark"] .select2-container--default .select2-search--inline .select2-search__field {
  background-color: var(--wt-input) !important;
  color: var(--wt-text) !important;
  border-color: var(--wt-border) !important;
}

html[data-theme="dark"] .select2-container--default .select2-selection--single .select2-selection__rendered {
  color: var(--wt-text);
  background-color: transparent;
}

html[data-theme="dark"] .select2-container--default .select2-selection--multiple .select2-selection__choice {
  color: var(--wt-text);
  background-color: var(--wt-chip);
  border-color: var(--wt-border);
}

html[data-theme="dark"] .select2-selection__placeholder,
html[data-theme="dark"] .filters .select2-selection__placeholder {
  color: var(--wt-muted) !important;
}

html[data-theme="dark"] .select2-container--default .select2-results__option {
  background-color: var(--wt-surface);
  color: var(--wt-text);
}

html[data-theme="dark"] .select2-container--default .select2-results__option--highlighted.select2-results__option--selectable,
html[data-theme="dark"] .select2-container--default .select2-results__option--selected {
  background-color: #1a75bc;
  color: #ffffff;
}

html[data-theme="dark"] .select2-container--default .select2-selection--single .select2-selection__arrow b {
  border-color: var(--wt-text) transparent transparent transparent;
}

/* ---------- FAQ, pagination, calendar, toasts ---------- */
html[data-theme="dark"] .faq .accordion-item,
html[data-theme="dark"] .faq .accordion-button,
html[data-theme="dark"] .faq .accordion-button:not(.collapsed),
html[data-theme="dark"] .accordion-faq .accordion-item,
html[data-theme="dark"] .accordion-faq .accordion-button,
html[data-theme="dark"] .accordion-faq .accordion-button:not(.collapsed),
html[data-theme="dark"] .accordion-faq .faq-accordion-body,
html[data-theme="dark"] .faq .accordion-body {
  background: var(--wt-surface) !important;
  background-color: var(--wt-surface) !important;
  color: var(--wt-text) !important;
  border-color: var(--wt-border) !important;
  box-shadow: none !important;
}

html[data-theme="dark"] .accordion-button::after {
  filter: invert(1);
}

html[data-theme="dark"] .pagination-btn,
html[data-theme="dark"] .page-link {
  background-color: var(--wt-surface);
  color: var(--wt-text);
  border-color: var(--wt-border);
}

html[data-theme="dark"] .pagination-btn:hover:not(:disabled):not(.disabled):not(.active),
html[data-theme="dark"] .page-link:hover {
  background-color: var(--wt-chip);
  color: var(--wt-text);
  border-color: var(--wt-border);
}

html[data-theme="dark"] .pagination-btn.active,
html[data-theme="dark"] .page-item.active .page-link {
  background-color: #1a75bc;
  border-color: #1a75bc;
  color: #ffffff;
}

html[data-theme="dark"] .pagination-btn:disabled,
html[data-theme="dark"] .pagination-btn.disabled {
  background-color: var(--wt-surface-2);
}

html[data-theme="dark"] .flatpickr-calendar,
html[data-theme="dark"] .flatpickr-months,
html[data-theme="dark"] .flatpickr-weekdays,
html[data-theme="dark"] span.flatpickr-weekday,
html[data-theme="dark"] .flatpickr-current-month,
html[data-theme="dark"] .flatpickr-day,
html[data-theme="dark"] .flatpickr-time input,
html[data-theme="dark"] .flatpickr-time .flatpickr-am-pm {
  background: var(--wt-surface);
  color: var(--wt-text);
  border-color: var(--wt-border);
  fill: var(--wt-text);
}

html[data-theme="dark"] .flatpickr-day:hover,
html[data-theme="dark"] .flatpickr-day:focus {
  background: var(--wt-chip);
  border-color: var(--wt-chip);
}

html[data-theme="dark"] .flatpickr-day.selected,
html[data-theme="dark"] .flatpickr-day.startRange,
html[data-theme="dark"] .flatpickr-day.endRange {
  background: #1a75bc;
  border-color: #1a75bc;
  color: #ffffff;
}

html[data-theme="dark"] .flatpickr-months .flatpickr-prev-month,
html[data-theme="dark"] .flatpickr-months .flatpickr-next-month {
  fill: var(--wt-text);
  color: var(--wt-text);
}

html[data-theme="dark"] #toast-container > .toast,
html[data-theme="dark"] .toast {
  background-color: var(--wt-surface-2);
  color: var(--wt-text);
  box-shadow: var(--wt-shadow);
}

html[data-theme="dark"] #toast-container > .toast-error,
html[data-theme="dark"] .toast-error {
  background-color: #b71c1c !important;
  color: #ffffff;
}

html[data-theme="dark"] .btn-close {
  filter: invert(1);
}

html[data-theme="dark"] ::-webkit-scrollbar-thumb {
  background: #2c3558;
}

html[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
  background: #3d4874;
}

html[data-theme="dark"] .alert-danger {
  background-color: #3a1d24;
  border-color: #ff8b8b;
  color: #ffb4a8 !important;
}

@media (max-width: 991px) {
  html[data-theme="dark"] #sidebar {
    background: linear-gradient(180deg, #0c182c 0%, #08111f 100%);
  }
}
