/**
 * Arabic Language Switcher - Styles
 * ==================================
 * 
 * Include this CSS file in your project
 * <link rel="stylesheet" href="arabic-language-switcher.css">
 */

/* ============ CSS VARIABLES ============ */
:root {
  --gold: #c9a84c;
  --gold-light: #e8d48b;
  --gold-dark: #a07d2e;
  --gold-rgb: 201, 168, 76;
  --text-primary: #ffffff;
  --text-secondary: #b0a89e;
  --border-color: rgba(201, 168, 76, 0.15);
}

/* ============ LIGHT MODE VARIABLES ============ */
body.light-mode,
:root[data-theme="light"] {
  --gold: #a07d2e;
  --gold-dark: #7a5f2c;
  --text-primary: #1a1208;
  --text-secondary: #5a5048;
  --border-color: rgba(160, 125, 46, 0.3);
}

/* ============ LANGUAGE TOGGLE BUTTON ============ */

.lang-toggle-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  margin-right: 10px;
  transition: all 0.3s ease;
}

.lang-toggle-btn:hover {
  opacity: 0.8;
}

.lang-toggle-btn:focus {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* Track (outer circle) */
.lang-toggle-track {
  width: 52px;
  height: 28px;
  border-radius: 14px;
  background: rgba(var(--gold-rgb), 0.1);
  border: 2px solid var(--gold);
  position: relative;
  transition: all 0.4s ease;
  box-shadow: 0 0 10px rgba(var(--gold-rgb), 0.1);
}

.lang-toggle-btn:hover .lang-toggle-track {
  box-shadow: 0 0 15px rgba(var(--gold-rgb), 0.2);
}

/* Thumb (sliding circle) */
.lang-toggle-thumb {
  position: absolute;
  top: 1px;
  left: 1px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--gold);
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(var(--gold-rgb), 0.3);
}

/* Language labels (EN/AR text) */
.lang-label {
  position: absolute;
  font-size: 9px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.5px;
  width: 100%;
  text-align: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  -webkit-user-select: none;
  user-select: none;
  pointer-events: none;
  line-height: 1;
}

.lang-label#lang-label-en {
  left: 4px;
  opacity: 1;
}

.lang-label#lang-label-ar {
  right: 4px;
  opacity: 0;
}

/* ============ RTL STATE (Arabic Active) ============ */

/* When RTL is active, move thumb to the right and swap label visibility */
body.rtl .lang-toggle-thumb {
  left: 27px;
}

body.rtl .lang-label#lang-label-en {
  opacity: 0;
}

body.rtl .lang-label#lang-label-ar {
  opacity: 1;
}

/* ============ RESPONSIVE DESIGN ============ */

/* Mobile devices */
@media (max-width: 768px) {
  .lang-toggle-btn {
    margin-right: 8px;
  }

  .lang-toggle-track {
    width: 48px;
    height: 26px;
    border-radius: 13px;
  }

  .lang-toggle-thumb {
    width: 20px;
    height: 20px;
  }

  body.rtl .lang-toggle-thumb {
    left: 24px;
  }

  .lang-label {
    font-size: 8px;
  }
}

/* ============ LIGHT MODE OVERRIDES ============ */

body.light-mode .lang-toggle-track,
:root[data-theme="light"] .lang-toggle-track {
  background: rgba(160, 125, 46, 0.1);
  border-color: var(--gold);
  box-shadow: 0 0 10px rgba(160, 125, 46, 0.1);
}

body.light-mode .lang-toggle-btn:hover .lang-toggle-track,
:root[data-theme="light"] .lang-toggle-btn:hover .lang-toggle-track {
  box-shadow: 0 0 15px rgba(160, 125, 46, 0.2);
}

body.light-mode .lang-toggle-thumb,
:root[data-theme="light"] .lang-toggle-thumb {
  background: var(--gold);
  box-shadow: 0 2px 8px rgba(160, 125, 46, 0.3);
}

/* ============ ACCESSIBILITY ============ */

/* High contrast mode */
@media (prefers-contrast: more) {
  .lang-toggle-track {
    border-width: 3px;
  }

  .lang-toggle-thumb {
    box-shadow: 0 0 0 1px var(--text-primary);
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {

  .lang-toggle-track,
  .lang-toggle-thumb,
  .lang-label {
    transition: none;
  }
}

/* ============ DARK MODE (DEFAULT) ============ */

/* Ensure proper text styling for RTL languages */
body.rtl {
  direction: rtl;
  unicode-bidi: embed;
}

body.rtl [data-i18n],
body.rtl [data-i18n-ph],
body.rtl [data-i18n-value] {
  direction: rtl;
}

/* ============ UTILITY CLASSES ============ */

/* For hiding content based on language */
.lang-en {
  display: block;
}

body.rtl .lang-en {
  display: none;
}

.lang-ar {
  display: none;
}

body.rtl .lang-ar {
  display: block;
}

/* For inline language-specific content */
.lang-inline-en {
  display: inline;
}

body.rtl .lang-inline-en {
  display: none;
}

.lang-inline-ar {
  display: none;
}

body.rtl .lang-inline-ar {
  display: inline;
}

