/* ==========================================================================
   PulseHR Enterprise HRMS — Core Design Tokens, Keyframes & RTL Styles
   ========================================================================== */

/* Native Dropdown Dark Mode Fix */
.dark select option {
  background-color: #060D0B !important;
  color: #f8fafc !important;
}

/* Biometric Scan Keyframes */
@keyframes scan {
  0% { top: 0%; opacity: 0.8; }
  50% { top: 95%; opacity: 1; }
  100% { top: 0%; opacity: 0.8; }
}

/* Architectural Engineering Grid Mesh Background */
.bg-enterprise-grid {
  background-size: 32px 32px;
  background-image: 
    linear-gradient(to right, rgba(16, 185, 129, 0.07) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(16, 185, 129, 0.07) 1px, transparent 1px);
}
.dark .bg-enterprise-grid {
  background-size: 32px 32px;
  background-image: 
    linear-gradient(to right, rgba(16, 185, 129, 0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(16, 185, 129, 0.04) 1px, transparent 1px);
}

/* Floating Cursors & Badges Keyframes */
@keyframes float-badge {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-8px) rotate(0.5deg); }
}

@keyframes float-badge-alt {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-6px) rotate(-1deg); }
}

@keyframes float-cursor-1 {
  0%, 100% { transform: translate(0px, 0px); }
  25% { transform: translate(12px, -8px); }
  50% { transform: translate(6px, 10px); }
  75% { transform: translate(-8px, 4px); }
}

@keyframes float-cursor-2 {
  0%, 100% { transform: translate(0px, 0px); }
  30% { transform: translate(-10px, 6px); }
  65% { transform: translate(8px, -10px); }
  85% { transform: translate(4px, 4px); }
}

@keyframes pulse-wave {
  0%, 100% {
    opacity: 0.85;
    filter: drop-shadow(0 0 6px rgba(16, 185, 129, 0.4));
  }
  50% {
    opacity: 1;
    filter: drop-shadow(0 0 14px rgba(16, 185, 129, 0.8));
  }
}

.animate-float-badge { animation: float-badge 4s ease-in-out infinite; }
.animate-float-badge-alt { animation: float-badge-alt 5s ease-in-out infinite; }
.animate-cursor-1 { animation: float-cursor-1 6s ease-in-out infinite; }
.animate-cursor-2 { animation: float-cursor-2 7s ease-in-out infinite; }
.animate-pulse-wave { animation: pulse-wave 3s ease-in-out infinite; }

/* Infinite Marquee Keyframes */
@keyframes marquee {
  0% { transform: translateX(0%); }
  100% { transform: translateX(-50%); }
}

/* Custom Scrollbars in Pure CSS */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background-color: #cbd5e1;
  border-radius: 9999px;
}
.dark ::-webkit-scrollbar-thumb {
  background-color: #1c2826;
}
::-webkit-scrollbar-thumb:hover {
  background-color: #94a3b8;
}
.dark ::-webkit-scrollbar-thumb:hover {
  background-color: #334155;
}

.glow-brand { box-shadow: 0 0 30px -5px rgba(5, 150, 105, 0.35); }
.glow-emerald { box-shadow: 0 0 30px -5px rgba(16, 185, 129, 0.4); }
.glow-gold { box-shadow: 0 0 30px -5px rgba(217, 119, 6, 0.35); }

.glow-card {
  transition: all 0.25s ease-in-out;
}
.glow-card:hover {
  box-shadow: 0 10px 30px -10px rgba(5, 150, 105, 0.25);
  border-color: rgba(52, 211, 153, 0.4);
}

/* Page Transition & View Animations */
@keyframes pageFadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

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

.animate-page-enter {
  animation: pageFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-shimmer {
  background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0) 100%);
  background-size: 200% 100%;
  animation: shimmer 2.5s infinite;
}

/* Micro-interaction card lift */
.interactive-card {
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.interactive-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 28px -8px rgba(0, 0, 0, 0.12), 0 0 20px -3px rgba(16, 185, 129, 0.2);
}

/* Border Beam Laser Animation */
@keyframes rotate-beam {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.border-beam-container {
  position: relative;
  overflow: hidden;
}
.border-beam-container::after {
  content: '';
  position: absolute;
  inset: -2px;
  background: conic-gradient(from 0deg at 50% 50%, transparent 0deg, transparent 60deg, #10b981 120deg, #34d399 180deg, #fbbf24 220deg, transparent 270deg);
  border-radius: inherit;
  z-index: 0;
  animation: rotate-beam 6s linear infinite;
  opacity: 0.65;
  pointer-events: none;
}
.border-beam-content {
  position: relative;
  z-index: 1;
}

/* Sonar Radar Sweep */
@keyframes sonar-sweep {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
.animate-sonar-sweep {
  animation: sonar-sweep 4s linear infinite;
  transform-origin: center;
}

/* ECG Telemetry Heartbeat */
@keyframes ecg-dash {
  0% { stroke-dashoffset: 400; }
  100% { stroke-dashoffset: 0; }
}
.animate-ecg {
  stroke-dasharray: 400;
  animation: ecg-dash 2.5s ease-in-out infinite;
}

/* Aurora Ambient Breathing */
@keyframes aurora-pulse {
  0%, 100% { opacity: 0.4; transform: scale(1) translate(-50%, 0); }
  50% { opacity: 0.75; transform: scale(1.08) translate(-50%, -10px); }
}
.animate-aurora-breathe {
  animation: aurora-pulse 8s ease-in-out infinite;
}

/* Animated Gradient Text Shimmer */
@keyframes text-shimmer {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
.animate-text-shimmer {
  background-size: 200% auto;
  animation: text-shimmer 4s ease-in-out infinite;
}

/* Premium Button Light Beam Shimmer */
.btn-shimmer {
  position: relative;
  overflow: hidden;
}
.btn-shimmer::before {
  content: '';
  position: absolute;
  top: 0;
  left: -120%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.28), transparent);
  transform: skewX(-25deg);
  transition: all 0.75s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}
.btn-shimmer:hover::before {
  left: 150%;
}

/* Interactive Table Row Slide Highlight */
.interactive-row {
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  border-left: 3px solid transparent;
}
.interactive-row:hover {
  border-left-color: #10b981;
  transform: translateX(3px);
  background-color: rgba(16, 185, 129, 0.04);
}
.dark .interactive-row:hover {
  border-left-color: #34d399;
  background-color: rgba(16, 185, 129, 0.08);
}

/* ==========================================================================
   STANDALONE DEDICATED RTL (RIGHT-TO-LEFT) SUPPORT
   ========================================================================== */
[dir="rtl"] {
  text-align: right;
  direction: rtl;
}

[dir="rtl"] body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
}

/* Mirror Sidebars in Admin Layout */
[dir="rtl"] .sidebar-admin {
  border-right-width: 0px !important;
  border-left-width: 1px !important;
}

/* Mirror Table Row slide */
[dir="rtl"] .interactive-row {
  border-left-width: 0px;
  border-right: 3px solid transparent;
}
[dir="rtl"] .interactive-row:hover {
  border-right-color: #10b981;
  border-left-color: transparent;
  transform: translateX(-3px);
}
[dir="rtl"] .dark .interactive-row:hover {
  border-right-color: #34d399;
  border-left-color: transparent;
}

/* Mirror Icons & Chevrons in RTL */
[dir="rtl"] .rtl-mirror {
  transform: scaleX(-1);
}
[dir="rtl"] .lucide-chevron-right {
  transform: scaleX(-1);
}
[dir="rtl"] .lucide-arrow-right {
  transform: scaleX(-1);
}
[dir="rtl"] .lucide-arrow-left {
  transform: scaleX(-1);
}

/* Mirror padding and text alignments where required */
[dir="rtl"] .text-left {
  text-align: right !important;
}
[dir="rtl"] .text-right {
  text-align: left !important;
}

/* ==========================================================================
   Universal Modal Dialog Architecture (Centered & Accessible)
   ========================================================================== */
.modal-backdrop {
  position: fixed !important;
  inset: 0 !important;
  z-index: 9999 !important;
  background-color: rgba(6, 13, 11, 0.75) !important;
  backdrop-filter: blur(8px) !important;
  padding: 1.5rem !important;
  overflow-y: auto !important;
}

.modal-backdrop:not(.hidden) {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.modal-backdrop.hidden {
  display: none !important;
}

.modal-backdrop > div {
  margin: auto !important;
}


/* ==========================================================================
   Documentation Portal Scrollspy & Support Cards Styling
   ========================================================================== */
.h-\[calc\(100vh-64px\)\] {
  height: calc(100vh - 64px) !important;
}

.doc-nav-link {
  transition: all 0.15s ease-in-out;
  border-left: 2.5px solid transparent;
}

.doc-nav-link:hover {
  background-color: rgba(241, 245, 249, 0.9);
  color: #0f172a;
}

.dark .doc-nav-link:hover {
  background-color: rgba(20, 35, 31, 0.7);
  color: #ffffff;
}

.doc-nav-link.active {
  background-color: rgba(16, 185, 129, 0.12) !important;
  color: #059669 !important;
  font-weight: 700 !important;
  border-left-color: #10b981 !important;
}

.dark .doc-nav-link.active {
  background-color: rgba(16, 185, 129, 0.18) !important;
  color: #34d399 !important;
  font-weight: 700 !important;
  border-left-color: #34d399 !important;
}

/* Explicit Support Section Dark Mode Contrast */
.dark #support-license .bg-white {
  background-color: #0A1411 !important;
}

.dark #support-license .border-slate-200 {
  border-color: #1C2826 !important;
}

.dark #support-license .bg-slate-50 {
  background-color: #14231F !important;
}

.dark #support-license .text-slate-900 {
  color: #ffffff !important;
}

.dark #support-license .text-slate-600 {
  color: #cbd5e1 !important;
}

.dark #support-license .text-slate-500 {
  color: #94a3b8 !important;
}
