/* CareerBridge MVP - Custom Styles */

/* RTL Support */
[dir="rtl"] {
  text-align: right;
}

/* RTL Icon Positioning Fixes */
[dir="rtl"] .mr-2 {
  margin-right: 0;
  margin-left: 0.5rem;
}

[dir="rtl"] .mr-3 {
  margin-right: 0;
  margin-left: 0.75rem;
}

[dir="rtl"] .mr-4 {
  margin-right: 0;
  margin-left: 1rem;
}

[dir="rtl"] .ml-2 {
  margin-left: 0;
  margin-right: 0.5rem;
}

[dir="rtl"] .ml-3 {
  margin-left: 0;
  margin-right: 0.75rem;
}

[dir="rtl"] .ml-4 {
  margin-left: 0;
  margin-right: 1rem;
}

/* RTL Flex Direction and Spacing */
[dir="rtl"] .space-x-2 > :not([hidden]) ~ :not([hidden]) {
  --tw-space-x-reverse: 1;
  margin-right: calc(0.5rem * var(--tw-space-x-reverse));
  margin-left: calc(0.5rem * calc(1 - var(--tw-space-x-reverse)));
}

[dir="rtl"] .space-x-3 > :not([hidden]) ~ :not([hidden]) {
  --tw-space-x-reverse: 1;
  margin-right: calc(0.75rem * var(--tw-space-x-reverse));
  margin-left: calc(0.75rem * calc(1 - var(--tw-space-x-reverse)));
}

[dir="rtl"] .space-x-4 > :not([hidden]) ~ :not([hidden]) {
  --tw-space-x-reverse: 1;
  margin-right: calc(1rem * var(--tw-space-x-reverse));
  margin-left: calc(1rem * calc(1 - var(--tw-space-x-reverse)));
}

/* RTL Text Alignment Fixes */
[dir="rtl"] .text-left {
  text-align: right;
}

[dir="rtl"] .text-right {
  text-align: left;
}

/* RTL Chat Interface Fixes */
[dir="rtl"] .flex.items-start {
  flex-direction: row-reverse;
}

[dir="rtl"] .flex.items-center {
  flex-direction: row-reverse;
}

[dir="rtl"] .justify-between {
  flex-direction: row-reverse;
}

/* RTL Chat Bubble Positioning */
[dir="rtl"] .flex.items-start > div:first-child {
  margin-left: 0.75rem;
  margin-right: 0;
}

[dir="rtl"] .flex.items-start > div:last-child {
  margin-right: 0.75rem;
  margin-left: 0;
}

/* RTL Button and Input Fixes */
[dir="rtl"] .flex.space-x-2 {
  flex-direction: row-reverse;
}

[dir="rtl"] .flex.space-x-2 > input {
  margin-left: 0;
  margin-right: 0.5rem;
}

[dir="rtl"] .flex.space-x-2 > button {
  margin-right: 0;
  margin-left: 0.5rem;
}

/* RTL Gap Fixes for Flex Wrap */
[dir="rtl"] .flex.flex-wrap.gap-2 {
  flex-direction: row-reverse;
}

/* RTL Padding and Border Radius Adjustments */
[dir="rtl"] .rounded-lg {
  border-radius: 0.5rem;
}

[dir="rtl"] .max-w-xs {
  margin-right: auto;
  margin-left: 0;
}

/* RTL Input Placeholder Alignment */
[dir="rtl"] input::placeholder,
[dir="rtl"] textarea::placeholder {
  text-align: right;
  direction: rtl;
}

/* RTL List Alignment */
[dir="rtl"] .list-disc {
  padding-right: 1.5rem;
  padding-left: 0;
}

/* RTL Card Header Fixes */
[dir="rtl"] .flex.items-center > div:first-child {
  margin-left: 1rem;
  margin-right: 0;
}

/* Force RTL for specific chat elements */
[dir="rtl"] .bg-blue-50.rounded-lg {
  text-align: right;
  direction: rtl;
}

[dir="rtl"] .bg-purple-50.rounded-lg {
  text-align: right;
  direction: rtl;
}

/* Specific RTL fixes for chat interface */
[dir="rtl"] #chat-messages .flex.items-start {
  flex-direction: row-reverse;
}

[dir="rtl"] #chat-messages .flex.items-start .w-8.h-8 {
  margin-left: 0.75rem;
  margin-right: 0;
}

[dir="rtl"] #chat-messages .max-w-xs {
  margin-right: 0;
  margin-left: auto;
}

/* RTL Input container fix */
[dir="rtl"] .flex.space-x-2:has(input[id="chat-input"]) {
  flex-direction: row-reverse;
}

[dir="rtl"] .flex.space-x-2:has(input[id="chat-input"]) > * + * {
  margin-left: 0;
  margin-right: 0.5rem;
}

/* RTL Button group fixes */
[dir="rtl"] .flex.flex-wrap.gap-2 > button {
  text-align: center;
}

/* Override any remaining left alignments in RTL */
[dir="rtl"] * {
  direction: rtl;
}

[dir="rtl"] .text-center {
  text-align: center !important;
}

/* Ensure placeholders are RTL */
[dir="rtl"] input[placeholder] {
  text-align: right;
  direction: rtl;
}

/* Arabic Font Enhancement */
.font-arabic {
  font-family: 'Noto Sans Arabic', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Custom components */
.gradient-bg {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* Global Language Toggle Button */
#global-language-toggle {
  animation: slideInDown 0.5s ease-out;
}

#global-language-toggle button {
  backdrop-filter: blur(10px);
  background-color: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

#global-language-toggle button:hover {
  background-color: rgba(255, 255, 255, 1);
  transform: translateY(-1px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

#global-language-toggle button:active {
  transform: translateY(0px);
}

@keyframes slideInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0px);
  }
}

/* Form enhancements */
input[type="text"],
input[type="email"],
input[type="password"],
select,
textarea {
  font-family: 'Noto Sans Arabic', sans-serif;
  padding: 12px 16px;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  transition: all 0.2s ease-in-out;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Button enhancements */
.btn-primary {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: white;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  text-align: center;
  transition: all 0.2s ease-in-out;
  border: none;
  cursor: pointer;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(99, 102, 241, 0.3);
}

.btn-success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  text-align: center;
  transition: all 0.2s ease-in-out;
  border: none;
  cursor: pointer;
}

.btn-success:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(16, 185, 129, 0.3);
}

/* Card enhancements */
.card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  padding: 24px;
  transition: all 0.2s ease-in-out;
}

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

/* Navigation enhancements */
.nav-link {
  color: #4b5563;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 6px;
  transition: all 0.2s ease-in-out;
}

.nav-link:hover {
  color: #6366f1;
  background-color: #f3f4f6;
}

/* Statistics section */
.stats-card {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  padding: 24px;
  text-align: center;
}

/* Loading and animations */
.fade-in {
  animation: fadeIn 0.6s ease-in-out;
}

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

.slide-up {
  animation: slideUp 0.8s ease-out;
}

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

/* Responsive enhancements */
@media (max-width: 768px) {
  .container-mobile {
    padding: 16px;
  }
  
  .text-responsive {
    font-size: 1.5rem;
  }
}

/* Success/Error messages */
.alert {
  padding: 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-weight: 500;
}

.alert-success {
  background-color: #d1fae5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.alert-error {
  background-color: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
}

.alert-info {
  background-color: #dbeafe;
  color: #1e40af;
  border: 1px solid #93c5fd;
}

/* CareerBridge specific branding */
.brand-gradient {
  background: linear-gradient(135deg, #059669 0%, #0d9488 50%, #0891b2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-pattern {
  background-image: 
    radial-gradient(circle at 25px 25px, rgba(5, 150, 105, 0.1) 2px, transparent 0),
    radial-gradient(circle at 75px 75px, rgba(13, 148, 136, 0.1) 2px, transparent 0);
  background-size: 100px 100px;
}

/* Saudi-inspired color palette */
.saudi-green {
  background-color: #006C35;
}

.saudi-gold {
  background-color: #FFD700;
}

/* Enhanced animations */
.float {
  animation: float 6s ease-in-out infinite;
}

@keyframes float {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
}

.pulse-slow {
  animation: pulse 3s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.bounce-slow {
  animation: bounce 2s infinite;
}

/* Gradient backgrounds */
.gradient-emerald {
  background: linear-gradient(135deg, #059669 0%, #0d9488 100%);
}

.gradient-teal {
  background: linear-gradient(135deg, #0d9488 0%, #0891b2 100%);
}

.gradient-cyan {
  background: linear-gradient(135deg, #0891b2 0%, #0284c7 100%);
}

/* Card hover effects */
.card-hover {
  transition: all 0.3s ease;
}

.card-hover:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

/* Saudi flag inspired elements */
.saudi-flag-border {
  border-image: linear-gradient(45deg, #006C35, #FFFFFF) 1;
}

/* Interactive elements */
.interactive-scale {
  transition: transform 0.2s ease;
}

.interactive-scale:hover {
  transform: scale(1.05);
}

.interactive-scale:active {
  transform: scale(0.95);
}

/* Enhanced shadows */
.shadow-emerald {
  box-shadow: 0 10px 25px rgba(5, 150, 105, 0.3);
}

.shadow-teal {
  box-shadow: 0 10px 25px rgba(13, 148, 136, 0.3);
}

.shadow-cyan {
  box-shadow: 0 10px 25px rgba(8, 145, 178, 0.3);
}

/* Language toggle styles */
.language-toggle {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.language-toggle button.active {
  background: rgba(5, 150, 105, 0.9);
  color: white;
  box-shadow: 0 2px 8px rgba(5, 150, 105, 0.3);
}

/* Modal enhancements */
.modal-backdrop {
  backdrop-filter: blur(5px);
  background: rgba(0, 0, 0, 0.6);
}

.modal-content {
  animation: modalSlideUp 0.3s ease-out;
}

@keyframes modalSlideUp {
  from {
    opacity: 0;
    transform: translateY(50px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Testimonial cards */
.testimonial-card {
  position: relative;
  overflow: hidden;
}

.testimonial-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #059669, #0d9488, #0891b2);
}

/* Enhanced typography */
.heading-gradient {
  background: linear-gradient(135deg, #1f2937 0%, #374151 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

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

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

/* Performance optimizations */
.gpu-accelerated {
  transform: translateZ(0);
  backface-visibility: hidden;
  perspective: 1000px;
}

/* Advanced Visual Effects */
.glow-effect {
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.5);
  animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
  from {
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.5);
  }
  to {
    box-shadow: 0 0 30px rgba(59, 130, 246, 0.8);
  }
}

.particle-background {
  position: relative;
  overflow: hidden;
}

.particle-background::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(255, 119, 198, 0.3) 0%, transparent 50%),
    radial-gradient(circle at 40% 40%, rgba(120, 219, 255, 0.3) 0%, transparent 50%);
  animation: particleMove 20s ease-in-out infinite;
}

@keyframes particleMove {
  0%, 100% {
    transform: translateX(0) translateY(0) scale(1);
  }
  33% {
    transform: translateX(-30px) translateY(-30px) scale(1.1);
  }
  66% {
    transform: translateX(30px) translateY(30px) scale(0.9);
  }
}

/* 3D Card Effects */
.card-3d {
  transform-style: preserve-3d;
  transition: transform 0.5s ease;
}

.card-3d:hover {
  transform: rotateY(10deg) rotateX(10deg) scale(1.05);
}

.card-3d::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 100%);
  border-radius: inherit;
  z-index: 1;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.card-3d:hover::before {
  opacity: 1;
}

/* Gradient Text Effects */
.gradient-text-primary {
  background: linear-gradient(135deg, #059669 0%, #0d9488 50%, #0891b2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientShift 3s ease-in-out infinite;
}

@keyframes gradientShift {
  0%, 100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

.gradient-text-secondary {
  background: linear-gradient(135deg, #7c3aed 0%, #c026d3 50%, #dc2626 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Morphing Shapes */
.morph-shape {
  background: linear-gradient(45deg, #059669, #0d9488, #0891b2);
  border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
  animation: morph 8s ease-in-out infinite;
}

@keyframes morph {
  0% {
    border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
  }
  50% {
    border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%;
  }
  100% {
    border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
  }
}

/* Liquid Animation */
.liquid-bg {
  background: linear-gradient(-45deg, #059669, #0d9488, #0891b2, #06b6d4);
  background-size: 400% 400%;
  animation: liquidMove 15s ease infinite;
}

@keyframes liquidMove {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* Progress Bar Animations */
.progress-bar {
  position: relative;
  background: #e5e7eb;
  border-radius: 10px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #059669, #0d9488);
  border-radius: 10px;
  position: relative;
  animation: progressGlow 2s ease-in-out infinite;
}

@keyframes progressGlow {
  0%, 100% {
    box-shadow: 0 0 10px rgba(5, 150, 105, 0.5);
  }
  50% {
    box-shadow: 0 0 20px rgba(5, 150, 105, 0.8);
  }
}

.progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
  animation: progressShine 2s ease-in-out infinite;
}

@keyframes progressShine {
  0% {
    left: -100%;
  }
  100% {
    left: 100%;
  }
}

/* Floating Elements */
.float-1 {
  animation: float1 6s ease-in-out infinite;
}

.float-2 {
  animation: float2 8s ease-in-out infinite;
}

.float-3 {
  animation: float3 10s ease-in-out infinite;
}

@keyframes float1 {
  0%, 100% {
    transform: translateY(0px) rotate(0deg);
  }
  50% {
    transform: translateY(-20px) rotate(5deg);
  }
}

@keyframes float2 {
  0%, 100% {
    transform: translateY(0px) rotate(0deg);
  }
  50% {
    transform: translateY(-15px) rotate(-3deg);
  }
}

@keyframes float3 {
  0%, 100% {
    transform: translateY(0px) rotate(0deg);
  }
  50% {
    transform: translateY(-25px) rotate(7deg);
  }
}

/* Neon Effects */
.neon-glow {
  text-shadow: 
    0 0 5px currentColor,
    0 0 10px currentColor,
    0 0 15px currentColor,
    0 0 20px currentColor;
  animation: neonFlicker 2s ease-in-out infinite alternate;
}

@keyframes neonFlicker {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.8;
  }
}

/* Ripple Effect */
.ripple {
  position: relative;
  overflow: hidden;
}

.ripple::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.ripple:hover::before {
  width: 300px;
  height: 300px;
}

/* Image Placeholder with Gradient */
.image-placeholder {
  background: linear-gradient(135deg, #f3f4f6, #e5e7eb);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9ca3af;
  font-size: 3rem;
  border-radius: 12px;
  position: relative;
  overflow: hidden;
}

.image-placeholder::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, transparent, rgba(255,255,255,0.1), transparent);
  animation: shimmer 2s infinite;
  transform: rotate(45deg);
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%) rotate(45deg);
  }
  100% {
    transform: translateX(100%) rotate(45deg);
  }
}

/* Video Play Button Effect */
.video-play-btn {
  position: relative;
  transition: all 0.3s ease;
}

.video-play-btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(1);
  animation: videoPulse 2s infinite;
}

@keyframes videoPulse {
  0% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -50%) scale(1.5);
    opacity: 0;
  }
}