/**
 * ============================================
 * סרגל נגישות צף (Accessibility Toolbar)
 * ============================================
 * סרגל נגישות מתקדם המאפשר למשתמשים לשלוט בנגישות האתר
 * כולל: Dark Mode, גודל גופן, ניגודיות, הפסקת אנימציות
 */

/* ============================================
   סרגל נגישות ראשי
   ============================================ */
.accessibility-bar {
  position: fixed;
  top: 50%;
  left: 10px;
  transform: translateY(-50%);
  z-index: var(--z-accessibility-bar, 1400);
  background: rgba(13, 17, 23, 0.95);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  padding: 0.75rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5),
              0 0 0 1px rgba(192, 192, 192, 0.1);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* מצב מכווץ */
.accessibility-bar.collapsed {
  padding: 0.5rem;
}

.accessibility-bar.collapsed .accessibility-controls {
  display: none;
}

/* כפתור פתיחה/סגירה */
.accessibility-toggle {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--color-primary-silver, #C0C0C0), var(--color-silver-metallic, #A8A9AD));
  color: var(--color-navy-deep, #0A2540);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  transition: all 0.3s ease;
  box-shadow: 0 0 15px rgba(192, 192, 192, 0.3);
}

.accessibility-toggle:hover {
  transform: scale(1.05);
  box-shadow: 0 0 25px rgba(192, 192, 192, 0.5);
}

.accessibility-toggle:focus {
  outline: 3px solid var(--focus-outline-color, #38BDF8);
  outline-offset: 2px;
}

/* אייקון */
.accessibility-toggle svg {
  width: 24px;
  height: 24px;
}

/* פקדי נגישות */
.accessibility-controls {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* כפתור פקד בודד */
.accessibility-control {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: var(--color-bg-card, #1A1F2E);
  color: var(--color-text-secondary, #C0C0C0);
  border: 1px solid rgba(192, 192, 192, 0.2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.125rem;
  transition: all 0.3s ease;
  position: relative;
}

.accessibility-control:hover {
  background: var(--color-bg-card-hover, #242B3D);
  border-color: var(--color-primary-silver, #C0C0C0);
  color: var(--color-primary-silver, #C0C0C0);
  transform: translateX(-3px);
}

.accessibility-control:focus {
  outline: 3px solid var(--focus-outline-color, #38BDF8);
  outline-offset: 2px;
}

/* מצב פעיל */
.accessibility-control.active {
  background: linear-gradient(135deg, var(--color-primary-silver, #C0C0C0), var(--color-silver-metallic, #A8A9AD));
  color: var(--color-navy-deep, #0A2540);
  border-color: var(--color-gold-champagne, #C9A961);
  box-shadow: 0 0 15px rgba(192, 192, 192, 0.3);
}

/* Tooltip */
.accessibility-control::after {
  content: attr(aria-label);
  position: absolute;
  left: 100%;
  top: 50%;
  transform: translateY(-50%);
  margin-left: 0.75rem;
  background: rgba(13, 17, 23, 0.95);
  color: var(--color-text-primary, #FAFAF9);
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  font-size: 0.875rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  z-index: 1;
}

.accessibility-control::before {
  content: '';
  position: absolute;
  left: 100%;
  top: 50%;
  transform: translateY(-50%);
  margin-left: 0.25rem;
  border: 6px solid transparent;
  border-left-color: rgba(13, 17, 23, 0.95);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 1;
}

.accessibility-control:hover::after,
.accessibility-control:hover::before {
  opacity: 1;
}

/* ============================================
   מצבי נגישות
   ============================================ */

/* Dark Mode */
body.dark-mode {
  --color-bg-dark: #0D1117;
  --color-text-primary: #FAFAF9;
  color-scheme: dark;
}

/* Light Mode */
body.light-mode {
  --color-bg-dark: #FFFFFF;
  --color-bg-card: #F8FAFC;
  --color-text-primary: #1E293B;
  --color-text-secondary: #475569;
  color-scheme: light;

  background: linear-gradient(
    to left,
    #f0f0f0 0%,
    #f0f0f0 25%,
    #ffffff 65%,
    #1a1a1a 100%
  ) !important;
}

/* High Contrast Mode */
body.high-contrast {
  --color-text-primary: #FFFFFF;
  --color-bg-dark: #000000;
  --color-bg-card: #1a1a1a;
  --color-primary-silver: #FFFFFF;
  --shadow-sm: none;
  --shadow-md: 0 0 0 2px #FFFFFF;
  --shadow-lg: 0 0 0 3px #FFFFFF;
}

body.high-contrast a,
body.high-contrast button {
  text-decoration: underline;
  text-decoration-thickness: 2px;
}

/* Large Font */
body.large-font {
  font-size: 1.125rem;
}

body.large-font h1 {
  font-size: clamp(2.5rem, 6vw, 4rem);
}

body.large-font h2 {
  font-size: clamp(2rem, 5vw, 3rem);
}

body.large-font .btn {
  font-size: 1.25rem;
  padding: 1rem 2.5rem;
}

/* Extra Large Font */
body.xl-font {
  font-size: 1.25rem;
}

body.xl-font h1 {
  font-size: clamp(3rem, 7vw, 4.5rem);
}

body.xl-font h2 {
  font-size: clamp(2.5rem, 6vw, 3.5rem);
}

body.xl-font .btn {
  font-size: 1.5rem;
  padding: 1.25rem 3rem;
}

/* No Animations */
body.no-animations *,
body.no-animations *::before,
body.no-animations *::after {
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
  scroll-behavior: auto !important;
}

/* ============================================
   רספונסיבי
   ============================================ */

/* מובייל */
@media (max-width: 768px) {
  .accessibility-bar {
    left: auto;
    right: 10px;
    top: auto;
    bottom: 80px; /* מעל Bottom Nav */
    transform: none;
  }

  .accessibility-control::after,
  .accessibility-control::before {
    left: auto;
    right: 100%;
    margin-left: 0;
    margin-right: 0.75rem;
  }

  .accessibility-control::before {
    border-left-color: transparent;
    border-right-color: rgba(13, 17, 23, 0.95);
    margin-right: 0.25rem;
  }
}

/* טאבלט */
@media (min-width: 769px) and (max-width: 1024px) {
  .accessibility-bar {
    left: 5px;
  }
}

/* ============================================
   אנימציות ואפקטים
   ============================================ */

/* Pulse effect לכפתור ראשי */
@keyframes pulse {
  0%, 100% {
    box-shadow: 0 0 15px rgba(192, 192, 192, 0.3);
  }
  50% {
    box-shadow: 0 0 25px rgba(192, 192, 192, 0.6);
  }
}

.accessibility-toggle.pulse {
  animation: pulse 2s ease-in-out infinite;
}

/* כניסה ראשונית */
.accessibility-bar.first-load {
  animation: bounceIn 0.6s ease;
}

@keyframes bounceIn {
  0% {
    opacity: 0;
    transform: translateY(-50%) scale(0.3);
  }
  50% {
    opacity: 1;
    transform: translateY(-50%) scale(1.05);
  }
  70% {
    transform: translateY(-50%) scale(0.9);
  }
  100% {
    transform: translateY(-50%) scale(1);
  }
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
  .accessibility-bar {
    display: none;
  }
}
