/* Teleassistance Romania - Global Styles */
/* Brand: Support, Safety, Love, Valor, Hope, Authority, Peace, Care, Vision, Trust, Accessibility, Efficiency */

html, body {
  height: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  padding: 0;
  font-family: 'Montserrat', 'Roboto', 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  background-color: #FAFAFA;
}

.root {
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* ===== ACCESSIBILITY ENHANCEMENTS ===== */

/* Skip link for keyboard navigation */
.skip-link {
  position: absolute;
  top: -100%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  padding: 12px 24px;
  background-color: #FFBA00;
  color: #1a1a1a;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: 0 0 8px 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 0;
  outline: none;
}

/* Selection styling with brand color */
::selection {
  background-color: rgba(255, 186, 0, 0.3);
  color: inherit;
}

::-moz-selection {
  background-color: rgba(255, 186, 0, 0.3);
  color: inherit;
}

/* Enhanced focus outline for accessibility */
*:focus-visible {
  outline: 2px solid #FFBA00;
  outline-offset: 2px;
}

/* Enhanced focus for interactive elements */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[role="button"]:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid #FFBA00;
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(255, 186, 0, 0.2);
}

/* Focus ring animation for enhanced visibility */
@keyframes focusRingPulse {
  0%, 100% {
    box-shadow: 0 0 0 2px rgba(255, 186, 0, 0.4);
  }
  50% {
    box-shadow: 0 0 0 4px rgba(255, 186, 0, 0.2);
  }
}

/* ===== HIGH CONTRAST MODE SUPPORT ===== */
@media (prefers-contrast: high) {
  body {
    background-color: #000;
    color: #fff;
  }

  *:focus-visible {
    outline: 3px solid #FFBA00 !important;
    outline-offset: 3px !important;
  }

  .MuiButton-root {
    border: 2px solid currentColor !important;
  }

  .MuiCard-root,
  .MuiPaper-root {
    border: 2px solid #fff !important;
  }

  .MuiListItemButton-root:hover,
  .MuiListItemButton-root.Mui-selected {
    background-color: rgba(255, 186, 0, 0.3) !important;
  }

  a {
    text-decoration: underline !important;
  }
}

/* ===== FORCED COLORS (WINDOWS HIGH CONTRAST) ===== */
@media (forced-colors: active) {
  *:focus-visible {
    outline: 3px solid CanvasText !important;
  }

  .MuiButton-root {
    border: 2px solid ButtonText !important;
  }

  .MuiIconButton-root {
    border: 1px solid ButtonText;
  }
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Hide scrollbar but keep functionality on mobile */
@media (max-width: 768px) {
  body {
    -webkit-overflow-scrolling: touch;
  }
}

/* Print styles */
@media print {
  body {
    background-color: white !important;
  }

  .no-print {
    display: none !important;
  }
}

/* Loader animation override */
.loader {
  border-top-color: #FFBA00 !important;
}

/* Animation keyframes */
@keyframes fadeSlideIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeSlideUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

/* Apply animations to MUI components */
.MuiPaper-root.MuiPopover-paper {
  animation: fadeSlideIn 0.2s ease-out;
}

.MuiDialog-paper {
  animation: scaleIn 0.25s ease-out;
}

.MuiCard-root {
  animation: fadeSlideUp 0.3s ease-out;
}

.MuiSnackbar-root .MuiPaper-root {
  animation: fadeSlideUp 0.3s ease-out;
}

/* Smooth transitions for interactive elements */
button,
a,
.MuiButtonBase-root,
.MuiListItemButton-root,
.MuiIconButton-root {
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Skeleton loading animation */
.MuiSkeleton-root {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

/* Better hover states for cards and papers */
.MuiCard-root:hover,
.MuiPaper-root:hover {
  cursor: default;
}

/* Loading spinner custom style */
.loading-spinner {
  animation: pulse 1.5s ease-in-out infinite;
}

/* ===== REDUCED MOTION SUPPORT ===== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .MuiPaper-root.MuiPopover-paper,
  .MuiDialog-paper,
  .MuiCard-root,
  .MuiSnackbar-root .MuiPaper-root {
    animation: none !important;
  }

  .MuiSkeleton-root {
    animation: none !important;
  }
}

/* ===== SCREEN READER ONLY UTILITY ===== */
.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;
}

/* ===== TOUCH TARGET SIZE FOR MOBILE ACCESSIBILITY ===== */
@media (pointer: coarse) {
  button,
  a,
  [role="button"],
  .MuiIconButton-root {
    min-height: 44px;
    min-width: 44px;
  }
}
