body {
  margin: 0;
  font-family: 'Satoshi', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

code {
  font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
    monospace;
}

h1, h2, h3 {
  font-weight: 700;
}

p {
  font-weight: 400;
}

button {
  font-weight: 600;
}

/* RTL specific overrides */
body.rtl {
  text-align: right;
  direction: rtl;
  font-family: 'RH-Zak', 'Arial Unicode MS', 'Tahoma', sans-serif;
}

/* Arabic font styling for RTL content */
body.rtl,
body.rtl * {
  font-family: 'RH-Zak', 'Arial Unicode MS', 'Tahoma', sans-serif;
}

/* Specific elements with Arabic font */
body.rtl h1,
body.rtl h2,
body.rtl h3,
body.rtl h4,
body.rtl h5,
body.rtl h6 {
  font-family: 'RH-Zak', 'Arial Unicode MS', 'Tahoma', sans-serif;
  font-weight: 700;
}

body.rtl p,
body.rtl span,
body.rtl div,
body.rtl a,
body.rtl button,
body.rtl input,
body.rtl textarea,
body.rtl select,
body.rtl label {
  font-family: 'RH-Zak', 'Arial Unicode MS', 'Tahoma', sans-serif;
}

/* Ensure buttons and form elements use Arabic font */
body.rtl .btn,
body.rtl .button,
body.rtl .form-control,
body.rtl .dropdown-item {
  font-family: 'RH-Zak', 'Arial Unicode MS', 'Tahoma', sans-serif;
}

/* Flip icons in RTL mode */
body.rtl .icon-flip-rtl {
  transform: scaleX(-1);
}

/* Adjust layout for RTL */
body.rtl .flex-row {
  flex-direction: row-reverse;
}

body.rtl .header nav {
  flex-direction: row-reverse;
}

body.rtl .right-section {
  flex-direction: row-reverse;
}

/* Adjust margins/paddings */
body.rtl .ml-auto {
  margin-left: 0;
  margin-left: initial;
  margin-right: auto;
}

body.rtl .mr-auto {
  margin-right: 0;
  margin-right: initial;
  margin-left: auto;
}

/* Search icon positioning */
body.rtl .UniSearchIconWrapper {
  left: auto;
  right: 0;
}

body.rtl .UniSearchInput {
  padding: 0 50px 0 20px;
}

/* Card content */
body.rtl .university-info {
  padding-right: 100px;
  padding-left: 0;
}

/* Background pattern RTL support */
body.rtl .background-pattern,
body.rtl .app-background-pattern {
  /* Ensure pattern stays centered in RTL */
  transform-origin: center center;
}

body.rtl .pattern-container {
  /* Adjust pattern positioning for RTL */
  transform: rotate(45deg); /* Flip the rotation direction for RTL */
}

/* RTL support for JavaScript-generated background pattern */
body.rtl .app-background-pattern {
  /* Override the JavaScript rotation for RTL */
  transform: rotate(45deg) !important;
}

body.rtl .university-image-container {
  left: auto;
  right: 20px;
}

body.rtl .fees-icon {
  margin-right: 0;
  margin-left: 5px;
}

body.rtl .university-tags {
  flex-direction: row-reverse;
}

body.rtl .tag {
  flex-direction: row-reverse;
}

/* University detail page */
body.rtl .UniversityLogoContainer {
  left: auto;
  right: 40px;
}

body.rtl .HeroContent {
  padding: 20px 180px 20px 30px;
}

body.rtl .section-icon {
  margin-right: 0;
  margin-left: 8px;
}

/* Form fields */
body.rtl label {
  text-align: right;
}

/* Dropdown menus */
body.rtl .dropdown-menu {
  left: auto;
  right: 0;
}

/* Admission badge */
body.rtl .admission-badge {
  right: auto;
  left: 15px;
}

/* Favorite button */
body.rtl .FavoriteButton {
  right: auto;
  left: 15px;
}

/* Header specific RTL adjustments */
body.rtl .header {
  direction: rtl;
}

body.rtl .header-content {
  flex-direction: row-reverse;
}

body.rtl .desktop-nav {
  margin-left: 0;
  margin-right: auto;
}

body.rtl .user-section {
  margin-left: 0;
  margin-right: 24px;
}

body.rtl .mobile-menu-button {
  left: 20px;
  right: auto;
}

/* Media queries for responsive RTL support */
@media (max-width: 768px) {
  body.rtl .university-info {
    padding-right: 90px;
  }
  
  body.rtl .HeroContent {
    padding: 20px 120px 20px 20px;
  }
}

@media (max-width: 480px) {
  body.rtl .university-info {
    padding-right: 70px;
  }
}

/* Background pattern RTL support */
body.rtl .pattern-background {
  /* Ensure background gradient works well with RTL content */
  direction: ltr; /* Keep background direction consistent */
}

/* Pattern styling is handled in BackgroundPattern.css */
.footer {
  width: 100%;
  background: var(--bg-secondary);
  box-shadow: 0 -4px 15px rgba(0, 102, 255, 0.08);
  padding: 30px 0 20px;
  position: relative;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 0 20px 0;
}

.footer-logo-section {
  display: flex;
  justify-content: center;
  margin-bottom: 24px;
}

.footer-logo-link {
  display: flex;
  align-items: center;
}

.footer-logo {
  height: 50px;
  width: auto;
}

.footer-sections {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  width: 100%;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.footer-link {
  text-decoration: none;
  color: var(--text-primary);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.9rem;
  transition: all 0.3s ease;
}

.footer-link:hover {
  background: var(--bg-tertiary);
  color: var(--accent-color);
}

.social-links {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  color: var(--text-primary);
  background: var(--bg-tertiary);
  transition: all 0.3s ease;
  text-decoration: none;
  font-size: 1.2rem;
}

.social-link:hover {
  background: var(--accent-color-light);
  color: var(--accent-color);
  transform: translateY(-2px);
}

.footer-bottom {
  text-align: center;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
}

.copyright {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

/* Scroll to top button */
.scroll-top-button {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent-color);
  color: white;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 102, 255, 0.3);
  z-index: 999;
  opacity: 0.9;
  transition: all 0.3s ease;
}

.scroll-top-button:hover {
  background: var(--accent-color-hover);
  transform: translateY(-4px);
  box-shadow: 0 4px 12px rgba(0, 102, 255, 0.4);
}

/* Mobile Optimizations */
@media (max-width: 768px) {
  .footer {
    padding: 24px 0 16px;
  }
  
  .footer-logo {
    height: 40px;
  }
  
  .footer-logo-section {
    margin-bottom: 20px;
  }
  
  .footer-sections {
    gap: 20px;
  }
}

/* Extra small devices */
@media (max-width: 480px) {
  .footer {
    padding: 20px 0 12px;
  }
  
  .footer-logo {
    height: 36px;
  }
  
  .footer-nav {
    gap: 8px;
  }
  
  .footer-link {
    padding: 6px 10px;
    font-size: 0.85rem;
  }
  
  .social-link {
    width: 36px;
    height: 36px;
    font-size: 1rem;
  }
  
  .copyright {
    font-size: 0.8rem;
  }
  
  .scroll-top-button {
    width: 40px;
    height: 40px;
    bottom: 16px;
    right: 16px;
  }
}

/* Larger screens */
@media (min-width: 768px) {
  .footer-content {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 0 0 24px 0;
  }
  
  .footer-logo-section {
    margin-bottom: 0;
  }
  
  .footer-sections {
    flex-direction: row;
    justify-content: flex-end;
    width: auto;
    gap: 40px;
  }
}

/* Base Reset */
html {
  box-sizing: border-box;
  scroll-behavior: smooth;
}

*, *:before, *:after {
  box-sizing: inherit;
}

/* Apply Satoshi font to all elements */
* {
  font-family: 'Satoshi', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen,
    Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

body {
  margin: 0;
  padding: 0;
  font-family: 'Satoshi', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen,
    Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
  background-color: var(--bg-primary);
 background-image: url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2790%27 height=%2790%27 viewBox=%270 0 24 24%27 fill=%27none%27 stroke=%27rgba%280, 81, 255, 0.08%29%27 stroke-width=%271.5%27 stroke-linecap=%27round%27 stroke-linejoin=%27round%27%3E%3Cpath d=%27M22 10v6M2 10l10-5 10 5-10 5z%27%3E%3C/path%3E%3Cpath d=%27M6 12v5c0 2 2 3 6 3s6-1 6-3v-5%27%3E%3C/path%3E%3C/svg%3E");
 color: var(--text-primary);
  /* Remove the universal transition from body - it's now handled by theme.css */
}

/* Remove default margin */
body,
h1,
h2,
h3,
h4,
p,
figure,
blockquote,
dl,
dd {
  margin: 0;
}

/* Mobile improvements */
input, 
select, 
textarea {
  touch-action: manipulation;
}

button, 
a {
  cursor: pointer;
}

a {
  text-decoration: none;
  color: var(--accent-color);
}

/* Accessibility Improvements */
/* Hide focus outlines for non-keyboard users */
:focus:not(:focus-visible) {
  outline: none;
}

/* Show focus outlines for keyboard users */
.user-is-tabbing :focus {
  outline: 2px solid var(--accent-color);
  outline-offset: 2px;
}

/* Skip navigation link - hidden until focused */
.skip-navigation {
  position: absolute;
  top: -9999px;
  left: 50%;
  background: var(--accent-color);
  color: white;
  padding: 10px 15px;
  transform: translateX(-50%);
  z-index: 9999;
  text-decoration: none;
  font-weight: bold;
  border-radius: 0 0 8px 8px;
  box-shadow: var(--card-shadow);
  transition: top 0.3s ease;
}

.skip-navigation:focus {
  top: 0;
}

/* Screen reader only class */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Root and App Container */
#root {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.App {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding-top: calc(74px + var(--status-bar-height)); /* Adjust for status bar + header height */
  z-index: 1;
}

.content-wrapper {
  flex: 1 1;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  padding: 0 16px;
}

/* Typography */
h1 {
  font-size: 1.8rem;
  margin-bottom: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

h2 {
  font-size: 1.5rem;
  margin-bottom: 0.8rem;
  font-weight: 700;
  color: var(--text-primary);
}

h3 {
  font-size: 1.2rem;
  margin-bottom: 0.6rem;
  font-weight: 700;
  color: var(--text-primary);
}

p {
  margin-bottom: 1rem;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-secondary);
}

/* Container Layouts */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

.page-container {
  padding: 20px 16px;
  margin-top: 0; /* Removed top margin */
}

/* Cards and Boxes */
.card {
  background-color: var(--card-bg);
  border-radius: 12px;
  box-shadow: var(--card-shadow);
  padding: 16px;
  margin-bottom: 16px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border: 1px solid var(--border-color);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Form Elements */
input, 
select, 
textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 16px;
  margin-bottom: 16px;
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
}

input:focus, 
select:focus, 
textarea:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 2px var(--accent-color-light-transparent);
}

label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--text-primary);
}

/* Buttons */
.btn {
  display: inline-block;
  background: var(--accent-color);
  color: white;
  border: none;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  text-align: center;
  transition: background 0.3s ease;
  min-height: 44px; /* Better touch target */
}

.btn:hover {
  background: var(--accent-color-hover);
}

.btn-outline {
  background: transparent;
  color: var(--accent-color);
  border: 1px solid var(--accent-color);
}

.btn-outline:hover {
  background: var(--accent-color-light-transparent);
}

/* Header spacing adjusted for mobile */
.custom-header-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;

  padding: 10px 0;

}

.custom-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

/* Grid Layouts */
.grid {
  display: grid;
  grid-template-columns: 1fr;
  grid-gap: 16px;
  gap: 16px;
}

/* Footer */
.custom-footer {
  background-color: var(--bg-secondary);
  padding: 20px 16px;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
  margin-top: auto;
  border-top: 1px solid var(--border-color);
}

/* Error States */
.error-message {
  background-color: rgba(255, 59, 48, 0.2);
  color: var(--danger-color);
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 0.9rem;
  border: 1px solid var(--danger-color);
}

/* Favorites button */
.favorite-btn {
  background: var(--card-bg);
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--card-shadow);
  color: var(--text-muted);
  transition: all 0.2s ease;
}

.favorite-btn.active {
  color: var(--danger-color);
}

.favorite-btn:hover {
  transform: scale(1.1);
}

/* Animations */
@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Search Elements */
.search-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.search-box {
  position: relative;
}

.search-input {
  padding-left: 40px;
}

.search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
}

/* Common Components */
.badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
  text-align: center;
}

.badge-primary {
  background-color: var(--accent-color-light-transparent);
  color: var(--accent-color);
}

.badge-secondary {
  background-color: rgba(255, 149, 0, 0.2);
  color: var(--warning-color);
}
/* Responsive Breakpoints */
@media (min-width: 480px) {
  .page-container {
    padding: 24px;
  }
  
  h1 {
    font-size: 2rem;
  }
  
  h2 {
    font-size: 1.6rem;
  }
  
  h3 {
    font-size: 1.3rem;
  }
}

@media (min-width: 768px) {
  .App {
    padding-top: 64px; /* Keep consistent with header height */
  }
  
  .content-wrapper {
    padding: 0 24px;
  }
  
  .grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .search-container {
    flex-direction: row;
    align-items: center;
  }
  
  h1 {
    font-size: 2.2rem;
  }
  
  .custom-header {
    padding: 0 24px;
  }
}

@media (min-width: 1024px) {
  .grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .content-wrapper {
    padding: 0 32px;
  }
  
  h1 {
    font-size: 2.5rem;
  }
}

/* Touch Device Optimization */
@media (hover: none) {
  .card:hover {
    transform: none;
    box-shadow: var(--card-shadow);
  }
  
  /* Increase spacing between touch targets */
  .nav-link, 
  .dropdown-item, 
  .btn {
    padding: 12px 20px;
  }
  
  /* Enhance tap targets */
  input,
  select,
  textarea,
  button,
  .nav-link {
    min-height: 44px;
  }
}

/* Fix for iOS inputs */
input, 
select, 
textarea {
  -webkit-appearance: none;
  appearance: none;
}
/* RH-Zak font faces for Arabic */
@font-face {
  font-family: 'RH-Zak';
  src: url("/static/media/RH-Zak%20Thin.bbf94a07db6682edf8d7.otf") format('opentype');
  font-weight: 100;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'RH-Zak';
  src: url("/static/media/RH-Zak%20Reg.ff1f1c0fb4e63143e496.otf") format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'RH-Zak';
  src: url("/static/media/RH-Zak%20Bold.10c1e5b0d07727886098.otf") format('opentype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* Satoshi font faces */
@font-face {
  font-family: 'Satoshi';
  src: url(/static/media/Satoshi-Light.66b6be60222486fa8673.otf) format('opentype');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Satoshi';
  src: url(/static/media/Satoshi-LightItalic.3e548608b48257398ed6.otf) format('opentype');
  font-weight: 300;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: 'Satoshi';
  src: url(/static/media/Satoshi-Regular.811ccb0b5af1892a71df.otf) format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Satoshi';
  src: url(/static/media/Satoshi-Italic.931b0a356a39c6d2cae5.otf) format('opentype');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: 'Satoshi';
  src: url(/static/media/Satoshi-Medium.e9d34f0493a853cf10c1.otf) format('opentype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Satoshi';
  src: url(/static/media/Satoshi-MediumItalic.2097b0fefefd54ea376a.otf) format('opentype');
  font-weight: 500;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: 'Satoshi';
  src: url(/static/media/Satoshi-Bold.b5dd7deee13e32689234.otf) format('opentype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Satoshi';
  src: url(/static/media/Satoshi-BoldItalic.ed285528aba1164d387a.otf) format('opentype');
  font-weight: 700;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: 'Satoshi';
  src: url(/static/media/Satoshi-Black.d27fb329e3c56de46506.otf) format('opentype');
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Satoshi';
  src: url(/static/media/Satoshi-BlackItalic.e1c41cedc5fd1276810f.otf) format('opentype');
  font-weight: 900;
  font-style: italic;
  font-display: swap;
}

/* CSS Variables for Consistent Theming */

/* Light mode (default) - Base CSS Variables */
:root, 
.light-mode {
  /* Font family variables */
  --font-family-english: 'Satoshi', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  --font-family-arabic: 'RH-Zak', 'Arial Unicode MS', 'Tahoma', sans-serif;
  --font-family-current: var(--font-family-english); /* Default to English font */
  
  /* Color system for light mode */
  --bg-primary: #ffffff;
  --bg-secondary: #f0f9ff;
  --bg-tertiary: #e6f7ff;
  --bg-tertiary-hover: #d0edff;
  --text-primary: #1a365d;
  --text-secondary: #2e4c89;
  --text-secondary-hover: #3b60b0;
  --text-muted: #6b7db3;
  --text-placeholder: #8ba3d1;
  --accent-color: #0066ff;
  --accent-color-hover: #0047b3;
  --accent-color-light: #b3d9ff;
  --accent-color-light-transparent: rgba(0, 102, 255, 0.18);
  --secondary-color: #6b7db3;
  --secondary-color-hover: #5670a8;
  --success-color: #00cc88;
  --success-color-hover: #00aa71;
  --warning-color: #ff9500;
  --warning-color-hover: #e67700;
  --danger-color: #ff3b30;
  --danger-color-hover: #e0271d;
  --info-color: #30beff;
  --info-color-hover: #1ca3e4;
  --disabled-color: #c5d8f0;
  --border-color: #d0e6ff;
  --border-color-light: #e6f2ff;
  --border-color-dark: #8ba3d1;
  --border-color-hover: #b0c9e8;
  --border-selected: #66adff;
  --card-bg: #ffffff;
  --card-shadow: 0 8px 20px rgba(0, 102, 255, 0.08);
  --card-hover-shadow: 0 12px 28px rgba(0, 102, 255, 0.12);
  --button-shadow: 0 4px 10px rgba(0, 102, 255, 0.15);
  --button-hover-shadow: 0 8px 15px rgba(0, 102, 255, 0.2);
  --selected-shadow: 0 6px 12px rgba(0, 102, 255, 0.25);
  --selected-hover-shadow: 0 10px 20px rgba(0, 102, 255, 0.3);
  --accent-shadow: 0 6px 12px rgba(0, 102, 255, 0.18);
  --accent-shadow-hover: 0 8px 16px rgba(0, 102, 255, 0.25);
  --success-shadow: 0 4px 10px rgba(0, 204, 136, 0.25);
  --danger-shadow: 0 4px 10px rgba(255, 59, 48, 0.25);
  --info-shadow: 0 4px 10px rgba(48, 190, 255, 0.25);
  --tag-shadow: 0 3px 8px rgba(0, 102, 255, 0.1);
  --tag-hover-shadow: 0 5px 10px rgba(0, 102, 255, 0.15);
  --dropdown-shadow: 0 12px 28px rgba(0, 102, 255, 0.15);
  --input-shadow: 0 4px 8px rgba(0, 102, 255, 0.08);
  --header-bg: #ffffff;
  --header-shadow: 0 4px 15px rgba(0, 102, 255, 0.12);
  --tooltip-bg: #2e4c89;
  --tooltip-color: #ffffff;
  --dropdown-bg: #ffffff;
  --modal-overlay: rgba(26, 54, 93, 0.5);
  --pattern-color: rgba(0, 102, 255, 0.12);
  --selected-item-bg: rgba(0, 102, 255, 0.12);
  
  /* Additional admin panel variables */
  --bg-secondary-hover: #e0f7ff;
  --admin-layout-height: 80vh;
  
  /* Status colors with backgrounds */
  --success-bg: rgba(0, 204, 136, 0.15);
  --success-text: #00aa71;
  --danger-bg: rgba(255, 59, 48, 0.15);
  --danger-text: #e0271d;
  --warning-bg: rgba(255, 149, 0, 0.15);
  --warning-text: #e67700;
  --info-bg: rgba(48, 190, 255, 0.15);
  --info-text: #1ca3e4;
  
  /* Link colors */
  --link-color: #0066ff;
  --link-hover-color: #0047b3;
}

/* Dark mode */
.dark-mode {
  --bg-primary: #121212;
  --bg-secondary: #1c1c1e;
  --bg-tertiary: #2c2c2e;
  --bg-tertiary-hover: #3a3a3c;
  --text-primary: #e2e8f0;
  --text-secondary: #cbd5e1;
  --text-secondary-hover: #f1f5f9;
  --text-muted: #94a3b8;
  --text-placeholder: #64748b;
  --accent-color: #004aad;
  --accent-color-hover: #3b6cb7;
  --accent-color-light: #00214d;
  --accent-color-light-transparent: rgba(0, 74, 173, 0.15);
  --secondary-color: #64748b;
  --secondary-color-hover: #94a3b8;
  --success-color: #10b981;
  --success-color-hover: #34d399;
  --warning-color: #f59e0b;
  --warning-color-hover: #fbbf24;
  --danger-color: #ef4444;
  --danger-color-hover: #f87171;
  --info-color: #0ea5e9;
  --info-color-hover: #38bdf8;
  --disabled-color: #4b5563;
  --border-color: #2c2c2e;
  --border-color-light: #3a3a3c;
  --border-color-dark: #64748b;
  --border-color-hover: #4b5563;
  --border-selected: #1e40af;
  --card-bg: #1c1c1e;
  --card-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  --card-hover-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
  --button-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
  --button-hover-shadow: 0 8px 15px rgba(0, 0, 0, 0.4);
  --selected-shadow: 0 4px 8px rgba(59, 130, 246, 0.3);
  --selected-hover-shadow: 0 8px 16px rgba(59, 130, 246, 0.4);
  --accent-shadow: 0 4px 6px rgba(59, 130, 246, 0.2);
  --accent-shadow-hover: 0 6px 10px rgba(59, 130, 246, 0.3);
  --success-shadow: 0 4px 6px rgba(16, 185, 129, 0.3);
  --danger-shadow: 0 4px 6px rgba(239, 68, 68, 0.3);
  --info-shadow: 0 4px 6px rgba(14, 165, 233, 0.3);
  --tag-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  --tag-hover-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
  --dropdown-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
  --input-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  --header-bg: #1c1c1e;
  --header-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  --tooltip-bg: #e2e8f0;
  --tooltip-color: #121212;
  --dropdown-bg: #1c1c1e;
  --modal-overlay: rgba(0, 0, 0, 0.7);
  --pattern-color: rgba(0, 74, 173, 0.10);
  --selected-item-bg: rgba(0, 74, 173, 0.15);
  
  /* Additional admin panel variables */
  --bg-secondary-hover: #2c2c2e;
  --admin-layout-height: 80vh;
  
  /* Status colors with backgrounds */
  --success-bg: rgba(16, 185, 129, 0.15);
  --success-text: #34d399;
  --danger-bg: rgba(239, 68, 68, 0.15);
  --danger-text: #f87171;
  --warning-bg: rgba(245, 158, 11, 0.15);
  --warning-text: #fbbf24;  --info-bg: rgba(14, 165, 233, 0.15);
  --info-text: #38bdf8;
  
  /* Link colors */
  --link-color: #4d80cc;
  --link-hover-color: #6b96d9;
}

/* Ensure proper theme class inheritance */
.light-mode,
.dark-mode {
  /* Use contain to optimize rendering performance */
  contain: layout style paint;
}

/* Global styles with better transition foundation */
html {
  /* Improve rendering performance */
  text-rendering: optimizeLegibility;
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
}

/* Font family rules based on language - Mixed content support */
body {
  font-family: 'Satoshi', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif, 'RH-Zak', 'Arial Unicode MS', 'Tahoma', sans-serif;
  font-family: var(--font-family-english), var(--font-family-arabic);
  font-feature-settings: "kern" 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Mixed language font stack - English first, then Arabic fallback */
* {
  font-family: 'Satoshi', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif, 'RH-Zak', 'Arial Unicode MS', 'Tahoma', sans-serif;
  font-family: var(--font-family-english), var(--font-family-arabic);
}

/* Language-specific font rules for explicit direction */
body:not([dir="rtl"]) {
  font-family: 'Satoshi', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif, 'RH-Zak', 'Arial Unicode MS', 'Tahoma', sans-serif;
  font-family: var(--font-family-english), var(--font-family-arabic);
}

body[dir="rtl"] {
  font-family: 'RH-Zak', 'Arial Unicode MS', 'Tahoma', sans-serif, 'Satoshi', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  font-family: var(--font-family-arabic), var(--font-family-english);
}

/* Alternative class-based approach for more granular control */
.font-english {
  font-family: 'Satoshi', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif !important;
  font-family: var(--font-family-english) !important;
}

.font-arabic {
  font-family: 'RH-Zak', 'Arial Unicode MS', 'Tahoma', sans-serif !important;
  font-family: var(--font-family-arabic) !important;
}

/* Mixed content support - both fonts available */
.font-mixed {
  font-family: 'Satoshi', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif, 'RH-Zak', 'Arial Unicode MS', 'Tahoma', sans-serif;
  font-family: var(--font-family-english), var(--font-family-arabic);
}

/* RTL-specific typography adjustments - Arabic content priority */
[dir="rtl"] {
  font-family: 'RH-Zak', 'Arial Unicode MS', 'Tahoma', sans-serif, 'Satoshi', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  font-family: var(--font-family-arabic), var(--font-family-english);
}

[dir="rtl"] h1,
[dir="rtl"] h2,
[dir="rtl"] h3,
[dir="rtl"] h4,
[dir="rtl"] h5,
[dir="rtl"] h6 {
  font-family: 'RH-Zak', 'Arial Unicode MS', 'Tahoma', sans-serif, 'Satoshi', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  font-family: var(--font-family-arabic), var(--font-family-english);
  font-weight: 700;
}

[dir="rtl"] p,
[dir="rtl"] span,
[dir="rtl"] div {
  font-family: 'RH-Zak', 'Arial Unicode MS', 'Tahoma', sans-serif, 'Satoshi', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  font-family: var(--font-family-arabic), var(--font-family-english);
}

/* English-specific typography - English content priority */
[dir="ltr"] {
  font-family: 'Satoshi', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif, 'RH-Zak', 'Arial Unicode MS', 'Tahoma', sans-serif;
  font-family: var(--font-family-english), var(--font-family-arabic);
}

[dir="ltr"] h1,
[dir="ltr"] h2,
[dir="ltr"] h3,
[dir="ltr"] h4,
[dir="ltr"] h5,
[dir="ltr"] h6 {
  font-family: 'Satoshi', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif, 'RH-Zak', 'Arial Unicode MS', 'Tahoma', sans-serif;
  font-family: var(--font-family-english), var(--font-family-arabic);
}

[dir="ltr"] p,
[dir="ltr"] span,
[dir="ltr"] div {
  font-family: 'Satoshi', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif, 'RH-Zak', 'Arial Unicode MS', 'Tahoma', sans-serif;
  font-family: var(--font-family-english), var(--font-family-arabic);
}

/* Enhanced language detection support */
/* Unicode range-based font application for automatic language detection */
@font-face {
  font-family: 'AutoFont';
  src: local('Satoshi'), local('RH-Zak');
  unicode-range: U+0000-007F, U+0080-00FF, U+0100-017F, U+0180-024F, U+1E00-1EFF, U+2000-206F, U+20A0-20CF, U+2100-214F; /* Latin ranges */
  font-display: swap;
}

@font-face {
  font-family: 'AutoFont';
  src: local('RH-Zak'), local('Satoshi');
  unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF; /* Arabic ranges */
  font-display: swap;
}

/* Utility classes for specific language forcing */
.force-english {
  font-family: 'Satoshi', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif !important;
  font-family: var(--font-family-english) !important;
}

.force-arabic {
  font-family: 'RH-Zak', 'Arial Unicode MS', 'Tahoma', sans-serif !important;
  font-family: var(--font-family-arabic) !important;
}

/* Mixed content containers */
.mixed-content {
  font-family: 'Satoshi', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif, 'RH-Zak', 'Arial Unicode MS', 'Tahoma', sans-serif;
  font-family: var(--font-family-english), var(--font-family-arabic);
}

.mixed-content-rtl {
  font-family: 'RH-Zak', 'Arial Unicode MS', 'Tahoma', sans-serif, 'Satoshi', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  font-family: var(--font-family-arabic), var(--font-family-english);
}

/* Auto-detection for common UI elements */
input, textarea, select {
  font-family: 'Satoshi', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif, 'RH-Zak', 'Arial Unicode MS', 'Tahoma', sans-serif;
  font-family: var(--font-family-english), var(--font-family-arabic);
}

button {
  font-family: 'Satoshi', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif, 'RH-Zak', 'Arial Unicode MS', 'Tahoma', sans-serif;
  font-family: var(--font-family-english), var(--font-family-arabic);
}

/* Navigation and interface elements default to English first */
nav, .nav, .navbar, .menu {
  font-family: 'Satoshi', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif, 'RH-Zak', 'Arial Unicode MS', 'Tahoma', sans-serif;
  font-family: var(--font-family-english), var(--font-family-arabic);
}

/* Content areas support both languages with appropriate priority */
.content, article, main {
  font-family: 'Satoshi', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif, 'RH-Zak', 'Arial Unicode MS', 'Tahoma', sans-serif;
  font-family: var(--font-family-english), var(--font-family-arabic);
}

/* RTL content areas prioritize Arabic */
[dir="rtl"] .content,
[dir="rtl"] article,
[dir="rtl"] main {
  font-family: 'RH-Zak', 'Arial Unicode MS', 'Tahoma', sans-serif, 'Satoshi', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  font-family: var(--font-family-arabic), var(--font-family-english);
}

/* Card styles */
.card {
  background-color: #ffffff;
  background-color: var(--card-bg);
  box-shadow: 0 8px 20px rgba(0, 102, 255, 0.08);
  box-shadow: var(--card-shadow);
  border-color: #d0e6ff;
  border-color: var(--border-color);
}

/* Links */
a {
  color: #0066ff;
  color: var(--link-color);
}

a:hover {
  color: #0047b3;
  color: var(--link-hover-color);
}


.footer-color {
  background-color: #f0f9ff;
  background-color: var(--bg-secondary);
  border-top: 1px solid #d0e6ff;
  border-top: 1px solid var(--border-color);
}

/* Input fields */
input, select, textarea {
  background-color: #e6f7ff;
  background-color: var(--bg-tertiary);
  color: #1a365d;
  color: var(--text-primary);
  border-color: #d0e6ff;
  border-color: var(--border-color);
}

input:focus, select:focus, textarea:focus {
  border-color: #0066ff;
  border-color: var(--accent-color);
}

/* Dropdowns */
.dropdown-menu {
  background-color: #ffffff;
  background-color: var(--dropdown-bg);
  border-color: #d0e6ff;
  border-color: var(--border-color);
  box-shadow: 0 12px 28px rgba(0, 102, 255, 0.15);
  box-shadow: var(--dropdown-shadow);
}

/* Button styles */
button.primary {
  background-color: #0066ff;
  background-color: var(--accent-color);
  color: white;
  box-shadow: 0 4px 10px rgba(0, 102, 255, 0.15);
  box-shadow: var(--button-shadow);
}

button.primary:hover {
  background-color: #0047b3;
  background-color: var(--accent-color-hover);
  box-shadow: 0 8px 15px rgba(0, 102, 255, 0.2);
  box-shadow: var(--button-hover-shadow);
}

/* Background pattern */
.pattern-background {
  background-image: url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2760%27 height=%2760%27 viewBox=%270 0 24 24%27 fill=%27none%27 stroke=%27var%28--pattern-color%29%27 stroke-width=%271.5%27 stroke-linecap=%27round%27 stroke-linejoin=%27round%27%3E%3Cpath d=%27M22 10v6M2 10l10-5 10 5-10 5z%27%3E%3C/path%3E%3Cpath d=%27M6 12v5c0 2 2 3 6 3s6-1 6-3v-5%27%3E%3C/path%3E%3C/svg%3E");
  background-size: 70px 70px;
}

/* Smooth theme transitions - only applied when switching themes */
html.theme-transitioning {
  /* Use will-change to optimize for the transition */
  will-change: transform;
}

html.theme-transitioning body,
html.theme-transitioning .card,
html.theme-transitioning .header-container,
html.theme-transitioning .dropdown-menu,
html.theme-transitioning input,
html.theme-transitioning select,
html.theme-transitioning textarea,
html.theme-transitioning button {
  transition: background-color 0.35s cubic-bezier(0.4, 0, 0.2, 1), 
              color 0.35s cubic-bezier(0.4, 0, 0.2, 1), 
              border-color 0.35s cubic-bezier(0.4, 0, 0.2, 1), 
              box-shadow 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Add specific transitions for high-frequency elements */
html.theme-transitioning .mobile-nav-link,
html.theme-transitioning .dropdown-item,
html.theme-transitioning .theme-toggle {
  transition: background-color 0.25s ease-out, 
              color 0.25s ease-out, 
              border-color 0.25s ease-out;
}

/* Ensure header stability during theme transitions */
html.theme-transitioning .header {
  /* Prevent any positioning changes during theme switch */
  position: fixed !important;
  transform: none !important;
  /* Only allow color/background transitions */
  transition: background-color 0.35s cubic-bezier(0.4, 0, 0.2, 1), 
              color 0.35s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Ensure header content doesn't shift */
html.theme-transitioning .header-content,
html.theme-transitioning .header-container {
  transform: none !important;
  -webkit-backface-visibility: visible !important;
          backface-visibility: visible !important;
}

/* Prevent text rendering issues during theme transitions */
html.theme-transitioning .header *,
html.theme-transitioning .dropdown-menu *,
html.theme-transitioning .mobile-menu * {
  /* Prevent font smoothing changes that can cause text flashing */
  -webkit-font-smoothing: antialiased !important;
  -moz-osx-font-smoothing: grayscale !important;
  /* Prevent text from being affected by transforms */
  transform: none !important;
  /* Ensure text stays visible during transition */
  opacity: 1 !important;
}

/* Optimize theme transitions further */
@media (prefers-reduced-motion: reduce) {
  html.theme-transitioning * {
    transition-duration: 0.01ms !important;
  }
}

/* Improve rendering on lower-end devices */
@media (max-width: 768px) {
  html.theme-transitioning body,
  html.theme-transitioning .card,
  html.theme-transitioning .header-container,
  html.theme-transitioning .dropdown-menu {
    transition-duration: 0.2s;
  }
}
/* Status bar safe area adjustments */
:root {
  --status-bar-height: 0px;
  --status-bar-safe-area: 0px;
  --safe-area-top: var(--status-bar-safe-area);
  --safe-area-bottom: env(safe-area-inset-bottom, 0px);
  --safe-area-left: env(safe-area-inset-left, 0px);
  --safe-area-right: env(safe-area-inset-right, 0px);
}

/* Android / iOS spacing to prevent overlaps with system UI */
.safe-area-padding {
  padding-top: 0px;
  padding-top: var(--safe-area-top);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  padding-bottom: var(--safe-area-bottom);
  padding-left: env(safe-area-inset-left, 0px);
  padding-left: var(--safe-area-left);
  padding-right: env(safe-area-inset-right, 0px);
  padding-right: var(--safe-area-right);
}

/* Specific fix for the top status bar area */
.status-bar-padding {
  padding-top: 0px;
  padding-top: var(--status-bar-height);
}

/* Apply safe-area insets for fixed/absolute positioned elements */
.fixed-with-safe-area {
  top: 0px;
  top: var(--safe-area-top);
  bottom: env(safe-area-inset-bottom, 0px);
  bottom: var(--safe-area-bottom);
  left: env(safe-area-inset-left, 0px);
  left: var(--safe-area-left);
  right: env(safe-area-inset-right, 0px);
  right: var(--safe-area-right);
}

/* Adjustment for fixed headers */
.header-with-statusbar {
  padding-top: 0px;
  padding-top: var(--status-bar-height);
  min-height: calc(56px + 0px);
  min-height: calc(56px + var(--status-bar-height));
}

/* On Android with display cutouts, ensure content stays in safe areas */
@supports (padding-top: env(safe-area-inset-top)) {
  body {
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
  }
}

/* Android-specific optimizations */
.android {
  /* Force hardware acceleration on Android */
  transform: translateZ(0);
  -webkit-backface-visibility: hidden;
          backface-visibility: hidden;
  perspective: 1000px;
}

/* Optimize animations specifically for Android */
.android .modal-overlay.show,
.android .modal-overlay.hide,
.android .modal-card.show,
.android .modal-card.hide,
.android * [style*="animation"] {
  /* Force GPU acceleration */
  transform: translate3d(0, 0, 0);
  will-change: transform, opacity;
  /* Use more efficient animation properties */
  animation-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000);
}

/* Minimize paint operations for scrollable areas on Android */
.android .login-container,
.android [role="scrollable"],
.android .search-results,
.android .content-wrapper,
.android .page-container,
.android [style*="overflow: auto"],
.android [style*="overflow-y: auto"],
.android [style*="overflow-x: auto"] {
  -webkit-overflow-scrolling: touch;
  will-change: transform;
  /* Force GPU acceleration for scrolling */
  transform: translateZ(0);
  /* Reduce the need for repainting during scroll */
  -webkit-backface-visibility: hidden;
          backface-visibility: hidden;
  /* Reduce motion for smoother scrolling */
  scroll-behavior: auto;
}

/* Optimized fade animations for Android */
@media (prefers-reduced-motion: no-preference) {
  .android .fadeIn,
  .android .fadeOut,
  .android [class*="fade"] {
    transition-duration: 0.2s !important;
    animation-duration: 0.2s !important;
  }

  .android .scaleIn,
  .android .scaleOut,
  .android [class*="scale"] {
    transition-duration: 0.2s !important;
    animation-duration: 0.2s !important;
  }
}

/* Disable expensive animations on Android when battery is low */
@media (prefers-reduced-motion), (prefers-reduced-data) {
  .android * {
    animation-duration: 0.001s !important;
    transition-duration: 0.001s !important;
    animation-iteration-count: 1 !important;
  }
}

/* Improve touch responsiveness */
.android button,
.android a,
.android input,
.android [role="button"],
.android [tabindex="0"] {
  touch-action: manipulation;
}

/* Additional android-specific optimizations for improved performance */
.android-optimized-scroll {
  /* Prevent unnecessary repaints */
  contain: content;
  /* Hint to browser that scrolling is important for this element */
  overscroll-behavior: contain;
  /* Smooth out scroll behavior */
  -webkit-overflow-scrolling: touch;
  /* Enable momentum scrolling */
  scroll-snap-type: none;
}

/* Reduce jank for fixed position elements during scrolling */
.android .fixed-element,
.android [style*="position: fixed"],
.android .sticky-header,
.android .footer {
  /* Prevent fixed elements from causing jank during scrolling */
  transform: translateZ(0);
  will-change: transform;
  -webkit-backface-visibility: hidden;
          backface-visibility: hidden;
  z-index: 10;
}

/* Optimize list rendering for Android */
.android ul,
.android ol,
.android dl,
.android [role="list"],
.android .list-container {
  /* Better rendering for large lists */
  contain: content;
  content-visibility: auto;
  /* Set explicit height if known to help browser optimization */
  contain-intrinsic-size: auto 1000px;
}

/* Optimize form inputs */
.android input,
.android textarea {
  /* Faster input rendering */
  -webkit-appearance: none;
  appearance: none;
  /* Prevent zoom/focus issues */
  font-size: 16px;
}

.header {
  width: 100%;
  z-index: 1000;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 85px;
  min-height: calc(70px + var(--status-bar-height));
  padding-top: calc(8px + var(--status-bar-height));
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  background: var(--bg-secondary);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);

}

/* Add spacer for fixed header */
.header-spacer {
  height: calc(25px + var(--status-bar-height));
  width: 100%;
}

.header-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 32px;
  height: 100%;
 
  border-radius: 0;
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  position: relative;
  max-width: 100%;
}

.logo-link {
  display: flex;
  align-items: center;
  z-index: 1001;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  padding: 8px;
  border-radius: 12px;
}

.logo-link:hover {
  transform: scale(1.08);
  background: rgba(0, 102, 255, 0.05);
  background: rgba(var(--accent-color-rgb, 0, 102, 255), 0.05);
}

.logo {
  height: 48px;
  width: auto;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.1));
}

/* Logo Section */
.logo-section {
  display: flex;
  align-items: center;
  position: relative;
  flex-shrink: 0;
}

/* Search Bar Styling - Centered */
.search-bar-container {
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  margin-top: 0;
  margin-bottom: 0;
  padding: 0 24px;
  z-index: 998;
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  display: flex;
  justify-content: center;
  flex: 1 1;
}

.search-bar-container .header-search {
  width: 100%;
  margin: 0 auto;
}

/* Desktop Navigation - Redesigned */
.desktop-nav {
  display: flex;
  gap: 8px;
  margin-left: auto;
  align-items: center;
  flex-shrink: 0;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  text-decoration: none;
  color: var(--text-primary);
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  position: relative;
  white-space: nowrap;
  background: transparent;
  border: 1px solid transparent;
}

.nav-link:hover {
  background: rgba(0, 102, 255, 0.08);
  background: rgba(var(--accent-color-rgb, 0, 102, 255), 0.08);
  color: #0066ff;
  color: var(--accent-color, #0066ff);
  transform: translateY(-2px);
  border-color: rgba(0, 102, 255, 0.2);
  border-color: rgba(var(--accent-color-rgb, 0, 102, 255), 0.2);
  box-shadow: 0 4px 16px rgba(0, 102, 255, 0.15);
  box-shadow: 0 4px 16px rgba(var(--accent-color-rgb, 0, 102, 255), 0.15);
}

.nav-link:after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 50%;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #0066ff, #0052cc);
  background: linear-gradient(90deg, var(--accent-color, #0066ff), var(--accent-color-hover, #0052cc));
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  transform: translateX(-50%);
  border-radius: 1px;
}

.nav-link:hover:after {
  width: 80%;
}

.nav-icon {
  font-size: 1.1em;
  color: #0066ff;
  color: var(--accent-color, #0066ff);
  transition: all 0.3s ease;
}

.nav-link:hover .nav-icon {
  transform: scale(1.1);
}

/* User Section - Redesigned */
.user-section {
  position: relative;
  z-index: 1001;
  margin-left: 24px;
  flex-shrink: 0;
}

.user-dropdown {
  position: relative;
}

.user-button {
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 6px;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  outline: none;
  border-radius: 50%;
  position: relative;
}

.user-button:hover {
  background-color: rgba(0, 102, 255, 0.08);
  background-color: rgba(var(--accent-color-rgb, 0, 102, 255), 0.08);
  transform: scale(1.05);
}

.profile-photo {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  border: 2px solid #0066ff;
  border: 2px solid var(--accent-color, #0066ff);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  position: relative;
  z-index: 2;
  background: #ffffff;
  background: var(--bg-primary, #ffffff);
}

.profile-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Animation for profile photo when menu is open */
.pulse-ring {
  position: absolute;
  top: -4px;
  left: -4px;
  right: -4px;
  bottom: -4px;
  border-radius: 50%;
  border: 2px solid var(--accent-color);
  opacity: 0.6;
  z-index: 1;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    transform: scale(1);
    opacity: 0.6;
  }
  50% {
    transform: scale(1.1);
    opacity: 0.3;
  }
  100% {
    transform: scale(1);
    opacity: 0.6;
  }
}

.profile-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0066ff, #0052cc);
  background: linear-gradient(135deg, var(--accent-color, #0066ff), var(--accent-color-hover, #0052cc));
  color: white;
  font-size: 16px;
  font-weight: 600;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  position: relative;
}

.profile-placeholder::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(45deg, rgba(255,255,255,0.2), transparent);
  border-radius: 50%;
}

/* Dropdown Menu - Redesigned */
.dropdown-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 12px);
  background: #ffffff;
  background: var(--card-bg, #ffffff);
  border-radius: 20px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.05);
  min-width: 340px;
  overflow: hidden;
  z-index: 1002;
  transform-origin: top right;
  border: none;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  animation: dropdownFadeIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.dropdown-menu.closing {
  animation: dropdownFadeOut 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes dropdownFadeIn {
  0% {
    opacity: 0;
    transform: translateY(-12px) scale(0.95);
    filter: blur(4px);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

@keyframes dropdownFadeOut {
  0% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
  100% {
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
    filter: blur(2px);
  }
}

/* Additional Dropdown Menu Improvements */
.dropdown-header {
  padding: 0;
  position: relative;
  background: var(--bg-secondary);
  border-radius: 16px 16px 0 0;
  overflow: hidden;
}

.dropdown-cover-photo {
  height: 80px;
  width: 100%;
  background: linear-gradient(135deg, var(--accent-color), var(--accent-color-hover));
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 12px;
}

.dropdown-cover-photo:after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2725%27 height=%2725%27 viewBox=%270 0 24 24%27 fill=%27none%27 stroke=%27rgba%28255, 255, 255, 0.15%29%27 stroke-width=%271%27 stroke-linecap=%27round%27 stroke-linejoin=%27round%27%3E%3Cpath d=%27M22 10v6M2 10l10-5 10 5-10 5z%27%3E%3C/path%3E%3Cpath d=%27M6 12v5c0 2 2 3 6 3s6-1 6-3v-5%27%3E%3C/path%3E%3C/svg%3E");    background-size: 45px 45px;
  opacity: 0.6;
}

.dropdown-profile {
  display: flex;
  align-items: center;
  padding: 20px;
  position: relative;
  margin-top: 0;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  background-color: var(--card-bg);
  border-radius: 0 0 8px 8px;
}

.dropdown-profile-photo {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  overflow: hidden;
  margin-right: 20px;
  border: 3px solid #ffffff;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
  background-color: var(--bg-tertiary);
  position: relative;
  z-index: 2;
}

.dropdown-profile-photo img, 
.profile-photo img,
.mobile-profile-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.dropdown-profile-info {
  flex: 1 1;
  padding-top: 0;
}

.dropdown-profile-name {
  font-weight: 700;
  font-size: 18px;
  color: var(--text-primary);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
}

.dropdown-profile-email {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 8px;
  word-break: break-all;
}

.dropdown-profile-status {
  display: flex;
  gap: 8px;
  margin-top: 5px;
}

/* Status badge enhancements */
.admin-badge, .active-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.admin-badge {
  background: linear-gradient(135deg, #ff6b6b, #ee5253);
  color: white;
  box-shadow: 0 2px 8px rgba(255, 107, 107, 0.3);
}

.active-badge {
  background: linear-gradient(135deg, #1dd1a1, #10ac84);
  color: white;
  box-shadow: 0 2px 8px rgba(29, 209, 161, 0.3);
}

.dropdown-section {
  padding: 0;
}

.dropdown-section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 12px 20px 8px;
  margin: 0;
  display: block;
  width: 100%;
}

/* Ensure consistent styling for both section titles */
.dropdown-section:last-of-type .dropdown-section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 12px 20px 8px;
}

.dropdown-divider {
  height: 1px;
  background-color: var(--border-color);
  margin: 10px 0;
  opacity: 0.7;
}

.dropdown-item {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 14px 20px;
  text-align: left;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--text-primary);
  transition: all 0.25s ease;
  font-size: 0.95rem;
  text-decoration: none;
  border-left: 3px solid transparent;
  position: relative;
  overflow: hidden;
}

.dropdown-item:before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 3px;
  background: var(--accent-color);
  transform: scaleY(0);
  transition: transform 0.25s ease;
}

.dropdown-item:hover:before {
  transform: scaleY(1);
}

.dropdown-item:after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, 
    rgba(var(--accent-color-rgb), 0.07) 0%, 
    rgba(var(--accent-color-rgb), 0.03) 35%, 
    rgba(var(--accent-color-rgb), 0) 100%
  );
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 0;
}

.dropdown-item:hover:after {
  opacity: 1;
}

.dropdown-icon-wrapper, 
.dropdown-item-content {
  position: relative;
  z-index: 2;
}

.dropdown-icon-wrapper {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  margin-right: 14px;
  background-color: rgba(var(--accent-color-rgb), 0.1);
  transition: all 0.3s ease;
}

.dropdown-icon-wrapper.admin {
  background-color: rgba(255, 107, 107, 0.1);
}

.dropdown-icon-wrapper.warning {
  background-color: rgba(253, 203, 110, 0.1);
}

.dropdown-icon-wrapper.danger {
  background-color: rgba(232, 65, 24, 0.1);
}

.dropdown-icon {
  font-size: 1.1em;
  color: var(--accent-color);
}

.dropdown-icon-wrapper.admin .dropdown-icon {
  color: #ff6b6b;
}

.dropdown-icon-wrapper.warning .dropdown-icon {
  color: #fdcb6e;
}

.dropdown-icon-wrapper.danger .dropdown-icon {
  color: #e84118;
}

.dropdown-item:hover .dropdown-icon-wrapper {
  transform: scale(1.1);
}

.dropdown-item-content {
  display: flex;
  flex-direction: column;
  flex: 1 1;
}

.dropdown-item-title {
  font-weight: 600;
  margin-bottom: 4px;
}

.dropdown-item-description {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.3;
}

.logout-item:hover {
  background-color: rgba(232, 65, 24, 0.08);
}

/* Enhanced Sign-in Button */
.sign-in-button {
  display: inline-flex;
  align-items: center;
  padding: 12px 28px;
  background: linear-gradient(135deg, #0066ff 0%, #0052cc 100%);
  background: linear-gradient(135deg, var(--accent-color, #0066ff) 0%, var(--accent-color-hover, #0052cc) 100%);
  color: white;
  border-radius: 12px;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  box-shadow: 0 4px 16px rgba(0, 102, 255, 0.25);
  border: none;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.sign-in-button::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(45deg, rgba(255,255,255,0.2), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.sign-in-button:hover::before {
  opacity: 1;
}

.sign-in-button:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 24px rgba(0, 102, 255, 0.35);
}

.sign-in-icon {
  font-size: 1.1em;
  margin-right: 10px;
}

/* RTL Sign-in Button */
.header.rtl .sign-in-button {
  direction: rtl;
}

.header.rtl .sign-in-icon {
  margin-right: 0;
  margin-left: 10px;
}

/* Mobile Menu - Redesigned */
.mobile-menu {
  position: fixed;
  top: 0;
  right: -100%;
  width: 90%;
  max-width: 380px;
  padding-top: var(--status-bar-height); 
  height: 100vh;
  background: #ffffff;
  background: var(--card-bg, #ffffff);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.12);
  z-index: 1002;
  transition: right 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  display: flex;
  flex-direction: column;
  border-left: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 24px 0 0 24px;
  overflow: hidden;
}

.mobile-menu.open {
  right: 0;
}

/* RTL Mobile Menu positioning */
.header.rtl .mobile-menu {
  right: auto;
  left: -100%;
  border-left: none;
  border-right: 1px solid var(--border-color);
 
}

.header.rtl .mobile-menu.open {
  left: 0;
}

/* Mobile Menu Toggle Button - Redesigned */
.mobile-menu-button {
  display: none;
  background: transparent;
  border: none;
  font-size: 22px;
  color: var(--text-primary);
  cursor: pointer;
  padding: 12px;
  z-index: 1001;
  border-radius: 12px;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  position: relative;
}

.mobile-menu-button:hover {
  background-color: rgba(0, 102, 255, 0.08);
  background-color: rgba(var(--accent-color-rgb, 0, 102, 255), 0.08);
  transform: rotate(90deg) scale(1.1);
  color: #0066ff;
  color: var(--accent-color, #0066ff);
}

/* Mobile Menu Header - Redesigned */
.mobile-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px; /* Increased padding */
  border-bottom: 1px solid var(--border-color);
  background: linear-gradient(to right, var(--bg-secondary), var(--bg-tertiary)); /* Subtle gradient */
}

.mobile-menu-close {
  background: transparent;
  border: none;
  font-size: 22px;
  color: var(--text-primary);
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.mobile-menu-close:hover {
  background-color: rgba(0,0,0,0.05);
  background-color: var(--bg-tertiary-hover, rgba(0,0,0,0.05)); /* Added fallback */
  color: var(--accent-color);
}

/* Mobile Profile Info - Redesigned */
.mobile-profile-info {
  display: flex;
  align-items: center;
  gap: 16px; /* Increased gap */
}

.mobile-profile-photo {
  width: 60px; /* Larger */
  height: 60px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid var(--accent-color);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.mobile-profile-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.mobile-profile-name {
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.mobile-profile-email {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* Mobile Navigation Links - Redesigned */
.mobile-nav-link {
  display: flex;
  align-items: center;
  padding: 14px 20px;
  text-decoration: none;
  color: var(--text-primary);
  font-size: 1rem;
  font-weight: 500;
  border-bottom: 1px solid var(--border-light);
  transition: all 0.3s ease;
  border-left: 3px solid transparent;
}

.mobile-nav-link:hover {
  background: var(--bg-tertiary);
  color: var(--accent-color);
  border-left: 3px solid var(--accent-color);
  padding-left: 23px;
}

.mobile-nav-link .nav-icon {
  margin-right: 14px;
  color: var(--accent-color);
  font-size: 1.2em;
}

/* Styles for Theme Toggle in Mobile Menu */
.mobile-theme-toggle {
  display: flex;
  align-items: center;
  padding: 14px 20px; /* Consistent padding */
  color: var(--text-primary);
  font-size: 1rem;
  font-weight: 500;
  gap: 12px; /* Space between toggle and label */
  border-bottom: 1px solid var(--border-light); /* Consistent with nav links */
}

.mobile-theme-toggle span {
 flex-grow: 1; /* Allows text to take available space */
}

/* Fix button styling for mobile theme toggle */
button.mobile-nav-link {
  width: 100%;
  display: flex;
  align-items: center;
  background: transparent;
  border: none;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
  padding: 14px 20px;
  color: var(--text-primary);
  transition: all 0.3s ease;
  border-bottom: 1px solid var(--border-light);
  border-left: 3px solid transparent;
}

button.mobile-nav-link:hover {
  background: var(--bg-tertiary);
  color: var(--accent-color);
  border-left: 3px solid var(--accent-color);
  padding-left: 23px;
}

.theme-toggle-wrapper {
  font-size: 1.2em;
  margin-right: 14px;
  color: var(--accent-color);
  display: flex;
  align-items: center;
}

/* Fix Language Selector in mobile menu */
.mobile-nav-link .language-container {
  width: 100%;
  display: flex;
  align-items: center;
}

.mobile-nav-links .language-button {
  color: var(--text-primary);
  padding: 0;
  margin: 0;
  width: 100%;
  justify-content: flex-start;
}

.mobile-nav-links .lang-icon {
  font-size: 1.2em;
  color: var(--accent-color);
  margin-right: 14px !important;
}

.mobile-nav-links .language-container:hover {
  background: transparent;
}

/* Add class for LanguageSelector component so we can target it */
.mobile-menu .mobile-nav-link:last-child {
  border-bottom: 1px solid var(--border-light);
}

/* RTL support for these new elements */
.header.rtl button.mobile-nav-link {
  text-align: right;
}

.header.rtl .theme-toggle-wrapper {
  margin-right: 0;
  margin-left: 14px;
}

.header.rtl .mobile-nav-links .lang-icon {
  margin-right: 0 !important;
  margin-left: 14px !important;
}

/* Custom scrollbar for mobile menu */
.mobile-nav-links {
  flex: 1 1;
  overflow-y: auto;
  padding: 10px 0;
  scrollbar-width: thin;
  scrollbar-color: var(--accent-color) var(--bg-secondary);
}

.mobile-nav-links::-webkit-scrollbar {
  width: 6px;
}

.mobile-nav-links::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

.mobile-nav-links::-webkit-scrollbar-thumb {
  background-color: var(--accent-color);
  border-radius: 6px;
}

/* Mobile Menu Footer Styles */
.mobile-menu-footer {
  padding: 20px;
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-top: 1px solid var(--border-color);
  background-color: rgba(0,0,0,0.02);
  background-color: var(--bg-secondary, rgba(0,0,0,0.02));
}

.mobile-menu-button-styled {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 16px;
  border-radius: 12px;
  border: none;
  font-size: 1rem;
  font-weight: 500;
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.mobile-menu-button-styled:after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.1), rgba(255,255,255,0));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.mobile-menu-button-styled:hover:after {
  opacity: 1;
}

.mobile-menu-button-styled .button-icon {
  margin-right: 12px;
  font-size: 1.1em;
}

.mobile-menu-button-styled.logout {
  background: linear-gradient(135deg, rgba(232, 65, 24, 0.1), rgba(232, 65, 24, 0.1));
  background: linear-gradient(135deg, var(--danger-light, rgba(232, 65, 24, 0.1)), var(--danger-light, rgba(232, 65, 24, 0.1)));
  color: #e84118;
  color: var(--danger, #e84118);
}

.mobile-menu-button-styled.logout:hover {
  background: linear-gradient(135deg, #e84118, #c0392b);
  background: linear-gradient(135deg, var(--danger, #e84118), var(--danger-hover, #c0392b));
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(232, 65, 24, 0.25);
}

/* Add animation for mobile menu items */
.mobile-nav-link {
  animation: slideInRight 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
  animation-delay: calc(var(--index) * 0.05s);
}

@keyframes slideInRight {
  0% {
    transform: translateX(20px);
    opacity: 0;
  }
  100% {
    transform: translateX(0);
    opacity: 1;
  }
}

/* RTL Animation adjustments */
@keyframes slideInLeft {
  0% {
    transform: translateX(-20px);
    opacity: 0;
  }
  100% {
    transform: translateX(0);
    opacity: 1;
  }
}

.header.rtl .mobile-nav-link {
  animation: slideInLeft 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
  animation-delay: calc(var(--index) * 0.05s);
}

/* Mobile menu overlay styling */
.mobile-menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1001;
  animation: fadeIn 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes fadeIn {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

/* Media Queries for Responsive Design */
@media (max-width: 1200px) {
  .header-container {
    padding: 0 24px;
  }

  .search-bar-container {
    max-width: 400px;
    padding: 0 16px;
  }
}

@media (max-width: 1024px) {
  .header-container {
    padding: 0 20px;
  }

  .search-bar-container {
    max-width: 320px;
    padding: 0 12px;
  }

  .desktop-nav {
    gap: 6px;
  }

  .nav-link {
    padding: 10px 12px;
    font-size: 0.85rem;
  }
}

@media (max-width: 950px) {
  .desktop-nav {
    display: none;
  }

  .mobile-menu-button {
    display: block;
    order: 3;
  }

  .search-bar-container {
    max-width: 300px;
    padding: 0 8px;
  }

  .header-content {
    justify-content: space-between;
  }

  .user-section {
    margin-left: 16px;
  }

  /* RTL Media Query Adjustments */
  .header.rtl .mobile-menu-button {
    left: 20px;
    right: auto;
    order: 1;
  }
  
  .header.rtl .logo-section {
    order: 2;
  }
  
  .header.rtl .user-section {
    order: 3;
    margin-right: 16px;
    margin-left: 0;
  }
}

@media (max-width: 768px) {
  .header {
    height: 80px;
    min-height: calc(65px + var(--status-bar-height));
  }

  .header-spacer {
    height: calc(80px + var(--status-bar-height));
  }

  .header-container {
    padding: 0 16px;
  }

  .search-bar-container {
    max-width: 250px;
    padding: 0 8px;
  }

  .logo {
    height: 42px;
  }

  .profile-photo {
    width: 40px;
    height: 40px;
  }

  .user-section {
    margin-left: 12px;
  }
}

@media (max-width: 576px) {
  .header {
    height: 75px;
    min-height: calc(60px + var(--status-bar-height));
  }

  .header-spacer {
    height: calc(75px + var(--status-bar-height));
  }

  .search-bar-container {
    max-width: 200px;
    padding: 0;
  }

  .header-container {
    padding: 0 12px;
  }

  .logo {
    height: 38px;
  }

  .profile-photo {
    width: 36px;
    height: 36px;
  }

  .dropdown-menu {
    min-width: 300px;
    right: -8px;
  }

  /* RTL Media Query Adjustments */
  .header.rtl .dropdown-menu {
    left: -8px;
    right: auto;
  }
  
  .header.rtl .mobile-menu-button {
    left: 12px;
    right: auto;
  }
  
  .header.rtl .user-section {
    margin-right: 12px;
    margin-left: 0;
  }
}

@media (max-width: 480px) {
  .search-bar-container {
    display: none;
  }

  .header-content {
    justify-content: space-between;
  }

  .header-container {
    padding: 0 12px;
  }

  .logo {
    height: 36px;
  }

  .mobile-menu {
    width: 95%;
    border-radius: 16px 0 0 16px;
  }

  /* RTL Media Query Adjustments */
  .header.rtl .header-content {
    padding: 0 12px;
  }
}

/* Responsive adjustments for the account menu */
@media (max-width: 576px) {
  .dropdown-menu {
    min-width: 290px;
    right: -10px;
  }
  
  .dropdown-profile-photo {
    width: 60px;
    height: 60px;
  }
  
  .dropdown-profile {
    padding: 0 16px 16px 16px;
  }
  
  .dropdown-profile-name {
    font-size: 16px;
  }
  
  .dropdown-profile-email {
    font-size: 13px;
  }
  
  .dropdown-item {
    padding: 12px 16px;
  }
  
  .dropdown-item:hover {
    padding-left: 19px;
  }
  
  .dropdown-icon-wrapper {
    width: 30px;
    height: 30px;
    margin-right: 12px;
  }
}

/* RTL adjustments for Account Dropdown Menu */
.header.rtl .dropdown-menu {
  right: auto;
  left: 0;
  transform-origin: top left;
}

/* Profile photo spacing in RTL */
.header.rtl .dropdown-profile-photo {
  margin-right: 0;
  margin-left: 20px;
}

/* Text alignment corrections for RTL */
.header.rtl .dropdown-section-title,
.header.rtl .dropdown-profile-name,
.header.rtl .dropdown-profile-email,
.header.rtl .dropdown-item {
  text-align: right;
}

/* Visually flip the active bar for dropdown items */
.header.rtl .dropdown-item:before {
  left: auto;
  right: 0;
}

/* Hover padding adjustments for RTL */
.header.rtl .dropdown-item:hover {
  padding-left: 12px; /* reset default padding */
  padding-right: 23px; /* provide hover movement on the right side */
}

/* Icon wrapper positioning for RTL */
.header.rtl .dropdown-icon-wrapper {
  margin-right: 0;
  margin-left: 14px;
}

/* RTL Layout Fixes */
.header.rtl {
  direction: rtl;
}

.header.rtl .header-content {
  direction: rtl;
}

/* RTL Logo Section */
.header.rtl .logo-section {
  margin-right: 0;
  margin-left: auto;
}

/* RTL Search Bar */
.header.rtl .search-bar-container {
  direction: rtl; /* Keep search input LTR for usability */
}



/* Improved Auth Section Styles */
.auth-section {
  display: flex;
  align-items: center;
  gap: 16px;
}

.auth-buttons {
  display: flex;
  align-items: center;
  gap: 12px;
}

.login-button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: transparent;  border: 1.5px solid #0066ff;  border: 1.5px solid var(--primary-color, #0066ff);
  color: #0066ff;
  color: var(--primary-color, #0066ff);
  text-decoration: none;
  border-radius: 8px;
  font-weight: 500;
  font-size: 14px;
  transition: all 0.2s ease;
}

.login-button:hover {
  background: #0066ff;
  background: var(--primary-color, #0066ff);
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 102, 255, 0.3);
}

.signup-button {
  display: flex;
  align-items: center;
  padding: 10px 18px;
  background: #0066ff;
  background: var(--primary-color, #0066ff);
  color: white;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 500;
  font-size: 14px;
  transition: all 0.2s ease;
  border: 1.5px solid #0066ff;
  border: 1.5px solid var(--primary-color, #0066ff);
}

.signup-button:hover {
  background: #4338ca;
  background: var(--primary-hover, #4338ca);
  border-color: #4338ca;
  border-color: var(--primary-hover, #4338ca);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 102, 255, 0.4);
}

.login-icon {
  font-size: 12px;
}

/* Dark theme support for auth buttons */
[data-theme="dark"] .login-button {
  border-color: #3385ff;
  color: #3385ff;
}

[data-theme="dark"] .login-button:hover {
  background: #3385ff;
  color: white;
}

[data-theme="dark"] .signup-button {
  background: #3385ff;
  border-color: #3385ff;
}

[data-theme="dark"] .signup-button:hover {
  background: #4d80cc;
  border-color: #4d80cc;
}

/* Responsive design for auth section */
@media (max-width: 768px) {
  .auth-section {
    gap: 8px;
  }
  
  .auth-buttons {
    gap: 8px;
  }
  
  .login-button,
  .signup-button {
    padding: 8px 14px;
    font-size: 13px;
  }
  
  .login-button span,
  .signup-button span {
    display: none;
  }
  
  .login-icon {
    margin: 0;
  }
}

@media (max-width: 480px) {
  .signup-button {
    display: none;
  }
}


