/* Custom CSS for PlatZone */

/* RTL Support */
[dir="rtl"] {
  font-family: "Cairo", system-ui, sans-serif;
}

[dir="ltr"] {
  font-family: "Inter", system-ui, sans-serif;
}

/* Dark mode styles */
.dark {
  --tw-bg-opacity: 1;
  background-color: rgb(17 24 39 / var(--tw-bg-opacity)) !important;
  color: rgb(249 250 251 / var(--tw-text-opacity)) !important;
}

.dark body {
  background-color: rgb(17 24 39) !important;
  color: rgb(249 250 251) !important;
}

.dark header {
  background-color: rgb(17 24 39 / 0.95) !important;
  border-color: rgb(55 65 81) !important;
}

.dark footer {
  background-color: rgb(31 41 55) !important;
  border-color: rgb(55 65 81) !important;
}

.dark .bg-white {
  background-color: rgb(31 41 55) !important;
}

.dark .bg-gray-50 {
  background-color: rgb(17 24 39) !important;
}

.dark .text-gray-900 {
  color: rgb(249 250 251) !important;
}

.dark .text-gray-600 {
  color: rgb(156 163 175) !important;
}

.dark .text-gray-500 {
  color: rgb(107 114 128) !important;
}

.dark .border-gray-300 {
  border-color: rgb(55 65 81) !important;
}

.dark .hover\:bg-gray-50:hover {
  background-color: rgb(55 65 81) !important;
}

.dark .hover\:bg-gray-100:hover {
  background-color: rgb(55 65 81) !important;
}

/* Dark mode for cards */
.dark .offer-card {
  background-color: rgb(31 41 55) !important;
  border-color: rgb(55 65 81) !important;
}

.dark .offer-card:hover {
  background-color: rgb(55 65 81) !important;
}

/* Dark mode for forms */
.dark .form-input {
  background-color: rgb(31 41 55) !important;
  border-color: rgb(55 65 81) !important;
  color: rgb(249 250 251) !important;
}

.dark .form-input:focus {
  border-color: rgb(147 51 234) !important;
  background-color: rgb(31 41 55) !important;
}

/* Dark mode for buttons */
.dark .btn-secondary {
  background-color: rgb(31 41 55) !important;
  border-color: rgb(55 65 81) !important;
  color: rgb(249 250 251) !important;
}

.dark .btn-secondary:hover {
  background-color: rgb(55 65 81) !important;
}

/* Dark mode for gradients */
.dark .bg-gradient-to-br {
  background: linear-gradient(to bottom right, rgb(17 24 39), rgb(31 41 55), rgb(17 24 39)) !important;
}

/* Dark mode for backdrop blur */
.dark .backdrop-blur {
  background-color: rgba(17, 24, 39, 0.9) !important;
}

/* Custom animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in-up {
  animation: fadeInUp 0.6s ease-out;
}

/* Smooth transitions */
* {
  transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow,
    transform, filter, backdrop-filter;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 150ms;
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
  background: #94a3b8;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #7c3aed;
}

/* Line clamp utility */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Toast styles */
.toast {
  @apply bg-white border border-gray-200 rounded-lg shadow-lg p-4 max-w-sm;
  animation: slideInRight 0.3s ease-out;
}

.toast.success {
  @apply border-green-200 bg-green-50;
}

.toast.error {
  @apply border-red-200 bg-red-50;
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Card hover effects */
.offer-card {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.offer-card:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 10px 10px -5px rgb(0 0 0 / 0.04);
}

.offer-card img {
  transition: transform 0.3s ease;
}

.offer-card:hover img {
  transform: scale(1.1);
}

/* Button styles */
.btn-primary {
  @apply bg-purple-600 text-white px-6 py-3 rounded-lg font-medium hover:bg-purple-700 transition-colors;
}

.btn-secondary {
  @apply border border-gray-300 px-6 py-3 rounded-lg font-medium hover:bg-gray-50 transition-colors;
}

/* Form styles */
.form-input {
  @apply w-full px-3 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-purple-500 focus:border-transparent;
}

.form-label {
  @apply block text-sm font-medium text-gray-700 mb-2;
}

/* Loading spinner */
.spinner {
  border: 2px solid #f3f4f6;
  border-top: 2px solid #7c3aed;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Responsive utilities */
@media (max-width: 768px) {
  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

/* Arabic font optimization */
.font-cairo {
  font-feature-settings: "kern" 1, "liga" 1, "calt" 1;
}

/* Backdrop blur fallback */
@supports not (backdrop-filter: blur(10px)) {
  .backdrop-blur {
    background-color: rgba(255, 255, 255, 0.9);
  }
}

/* Language-specific font classes */
.font-cairo {
  font-family: "Cairo", system-ui, sans-serif !important;
}

.font-inter {
  font-family: "Inter", system-ui, sans-serif !important;
}

/* RTL/LTR specific styles */
[dir="rtl"] {
  font-family: "Cairo", system-ui, sans-serif !important;
}

[dir="ltr"] {
  font-family: "Inter", system-ui, sans-serif !important;
}

/* Smooth transitions for theme and language changes */
* {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease !important;
}
