/* Dark Mode Support для Tailwind v4
 * Tailwind v4.1.13 еще не полностью поддерживает dark: variants
 * Этот файл добавляет недостающие стили БЕЗ !important
 */

:root {
  color-scheme: light dark;
}

/* Плавные переходы */
* {
  transition-property: background-color, border-color, color;
  transition-duration: 200ms;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Основные темные фоны */
.dark body {
  background-color: rgb(17 24 39);
}

.dark header {
  background-color: rgb(31 41 55);
}

/* Переопределяем светлые фоны на темные */
.dark .bg-white {
  background-color: rgb(31 41 55);
}

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

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

.dark .bg-gray-800 {
  background-color: rgb(31 41 55);
}

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

/* Темный текст становится светлым */
.dark .text-gray-300 {
  color: rgb(209 213 219);
}

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

.dark .text-gray-600,
.dark .text-gray-700,
.dark .text-gray-900 {
  color: rgb(229 231 235);
}

.dark .text-white {
  color: rgb(255 255 255);
}

/* Ссылки в темном режиме */
.dark .text-indigo-400 {
  color: rgb(129 140 248);
}

.dark .text-indigo-600 {
  color: rgb(129 140 248);
}

/* Границы в темном режиме */
.dark .border-gray-200,
.dark .border-gray-300 {
  border-color: rgb(75 85 99);
}

.dark .border-gray-600,
.dark .border-gray-700 {
  border-color: rgb(75 85 99);
}

/* Hover состояния */
.dark .hover\:bg-gray-50:hover,
.dark .hover\:bg-gray-100:hover {
  background-color: rgb(55 65 81);
}

.dark .hover\:bg-gray-600:hover {
  background-color: rgb(75 85 99);
}

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

.dark .hover\:text-indigo-300:hover {
  color: rgb(165 180 252);
}

.dark .hover\:text-white:hover {
  color: rgb(255 255 255);
}

/* Чат - сообщения */
.dark .bg-gray-200 {
  background-color: rgb(55 65 81);
}

.dark .bg-gray-700 {
  background-color: rgb(55 65 81);
}

.dark .text-gray-100 {
  color: rgb(243 244 246);
}

/* Аватары */
.dark .bg-gray-300 {
  background-color: rgb(75 85 99);
}

.dark .bg-gray-600 {
  background-color: rgb(75 85 99);
}

/* Placeholder для форм */
.dark input::placeholder,
.dark textarea::placeholder {
  color: rgb(156 163 175);
}

/* Ссылки синие */
.dark .text-blue-400 {
  color: rgb(96 165 250);
}

.dark .text-blue-600 {
  color: rgb(96 165 250);
}

.dark .hover\:text-blue-300:hover {
  color: rgb(147 197 253);
}

.dark .hover\:text-blue-800:hover {
  color: rgb(147 197 253);
}

.dark .hover\:text-gray-100:hover {
  color: rgb(243 244 246);
}

/* Ошибки */
.dark .bg-red-100 {
  background-color: rgba(127 29 29 / 0.3);
}

.dark .border-red-400 {
  border-color: rgb(220 38 38);
}

.dark .border-red-600 {
  border-color: rgb(220 38 38);
}

.dark .text-red-300 {
  color: rgb(252 165 165);
}

.dark .text-red-400 {
  color: rgb(248 113 113);
}

.dark .text-red-700 {
  color: rgb(252 165 165);
}

.dark .text-red-800 {
  color: rgb(248 113 113);
}

/* Админка */
.dark .bg-gray-950 {
  background-color: rgb(3 7 18);
}

/* Indigo цвета */
.dark .bg-indigo-100 {
  background-color: rgba(99 102 241 / 0.15);
}

.dark .text-indigo-400 {
  color: rgb(129 140 248);
}

.dark .text-indigo-500 {
  color: rgb(129 140 248);
}

.dark .hover\:text-indigo-400:hover {
  color: rgb(165 180 252);
}

.dark .hover\:text-indigo-600:hover {
  color: rgb(165 180 252);
}

.dark .bg-indigo-600 {
  background-color: rgb(79 70 229);
}

.dark .bg-indigo-700 {
  background-color: rgb(67 56 202);
}

.dark .hover\:bg-indigo-600:hover {
  background-color: rgb(67 56 202);
}

.dark .hover\:bg-indigo-700:hover {
  background-color: rgb(55 48 163);
}

/* Green цвета (success, accepted) */
.dark .bg-green-50 {
  background-color: rgba(34 197 94 / 0.15);
}

.dark .border-green-200 {
  border-color: rgb(22 163 74);
}

.dark .border-green-700 {
  border-color: rgb(22 163 74);
}

.dark .text-green-300 {
  color: rgb(134 239 172);
}

.dark .text-green-400 {
  color: rgb(74 222 128);
}

.dark .text-green-600 {
  color: rgb(74 222 128);
}

.dark .text-green-700 {
  color: rgb(74 222 128);
}

.dark .text-green-900 {
  color: rgb(134 239 172);
}

/* Yellow цвета (pending, warning) */
.dark .bg-yellow-50 {
  background-color: rgba(234 179 8 / 0.15);
}

.dark .border-yellow-200 {
  border-color: rgb(202 138 4);
}

.dark .border-yellow-700 {
  border-color: rgb(202 138 4);
}

.dark .text-yellow-300 {
  color: rgb(253 224 71);
}

.dark .text-yellow-400 {
  color: rgb(250 204 21);
}

.dark .text-yellow-600 {
  color: rgb(250 204 21);
}

.dark .text-yellow-700 {
  color: rgb(250 204 21);
}

.dark .text-yellow-900 {
  color: rgb(253 224 71);
}

/* Indigo border */
.dark .border-indigo-100 {
  border-color: rgb(79 70 229);
}

.dark .border-indigo-800 {
  border-color: rgb(79 70 229);
}

/* Yellow Balance Badge */
.dark .bg-yellow-400 {
  background-color: rgb(250 204 21);
}

.dark .bg-yellow-500 {
  background-color: rgb(234 179 8);
}

.dark .text-yellow-900 {
  color: rgb(113 63 18);
}

.dark .text-yellow-950 {
  color: rgb(66 32 6);
}

/* Blue colors */
.dark .bg-blue-100 {
  background-color: rgba(59 130 246 / 0.15);
}

.dark .text-blue-400 {
  color: rgb(96 165 250);
}

.dark .text-blue-600 {
  color: rgb(96 165 250);
}

.dark .border-blue-500 {
  border-color: rgb(59 130 246);
}

.dark .border-blue-600 {
  border-color: rgb(59 130 246);
}

/* Purple colors */
.dark .bg-purple-100 {
  background-color: rgba(168 85 247 / 0.15);
}

.dark .text-purple-300 {
  color: rgb(216 180 254);
}

.dark .text-purple-400 {
  color: rgb(192 132 252);
}

.dark .text-purple-600 {
  color: rgb(192 132 252);
}

.dark .text-purple-800 {
  color: rgb(216 180 254);
}

.dark .border-purple-500 {
  border-color: rgb(168 85 247);
}

.dark .border-purple-600 {
  border-color: rgb(168 85 247);
}

/* Green border */
.dark .border-green-500 {
  border-color: rgb(34 197 94);
}

.dark .border-green-600 {
  border-color: rgb(34 197 94);
}

/* Indigo borders for edit profile */
.dark .border-indigo-200 {
  border-color: rgb(79 70 229);
}

.dark .border-indigo-700 {
  border-color: rgb(67 56 202);
}

/* Orange colors (disputed) */
.dark .bg-orange-100 {
  background-color: rgba(234 88 12 / 0.15);
}

.dark .text-orange-300 {
  color: rgb(253 186 116);
}

.dark .text-orange-800 {
  color: rgb(253 186 116);
}

/* ==========================================
   Turbo Progress Bar & Loading Styles
   ========================================== */

/* Turbo progress bar styling */
.turbo-progress-bar {
  height: 3px;
  background: linear-gradient(90deg, #6366F1, #8B5CF6, #EC4899);
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9999;
}

/* Pulse animation for skeleton loaders */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

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

/* Shimmer effect for premium skeleton feel */
@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

.skeleton-shimmer {
  background: linear-gradient(
    90deg,
    rgb(229 231 235) 0%,
    rgb(243 244 246) 50%,
    rgb(229 231 235) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
}

.dark .skeleton-shimmer {
  background: linear-gradient(
    90deg,
    rgb(55 65 81) 0%,
    rgb(75 85 99) 50%,
    rgb(55 65 81) 100%
  );
  background-size: 200% 100%;
}

/* Loading overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease-in-out;
}

.loading-overlay.active {
  opacity: 1;
  pointer-events: all;
}

/* Spinner */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.animate-spin {
  animation: spin 1s linear infinite;
}

/* ==========================================
   Hero Section Floating Animations
   ========================================== */

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

@keyframes hero-float-delayed {
  0%, 100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-15px) rotate(-5deg);
  }
}

.hero-float {
  animation: hero-float 6s ease-in-out infinite;
}

.hero-float-delayed {
  animation: hero-float-delayed 8s ease-in-out infinite;
  animation-delay: 2s;
}

/* ==========================================
   Fade-in Animations for Page Elements
   ========================================== */

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

@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

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

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

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

.animate-fade-in-left {
  animation: fadeInLeft 0.6s ease-out forwards;
}

.animate-fade-in-right {
  animation: fadeInRight 0.6s ease-out forwards;
}

.animate-fade-in-scale {
  animation: fadeInScale 0.5s ease-out forwards;
}

/* Staggered delays for list items */
.animate-stagger-1 { animation-delay: 0.1s; opacity: 0; }
.animate-stagger-2 { animation-delay: 0.2s; opacity: 0; }
.animate-stagger-3 { animation-delay: 0.3s; opacity: 0; }
.animate-stagger-4 { animation-delay: 0.4s; opacity: 0; }
.animate-stagger-5 { animation-delay: 0.5s; opacity: 0; }

/* ==========================================
   Mobile Bottom Navigation
   ========================================== */

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  padding: 0.5rem;
  color: rgb(107 114 128);
  transition: all 0.2s ease-in-out;
}

.dark .bottom-nav-item {
  color: rgb(156 163 175);
}

.bottom-nav-item:hover,
.bottom-nav-item.active {
  color: rgb(79 70 229);
}

.dark .bottom-nav-item:hover,
.dark .bottom-nav-item.active {
  color: rgb(129 140 248);
}

.bottom-nav-item.active svg {
  transform: scale(1.1);
}

.bottom-nav-create {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
}

/* Safe area for iPhone notch and home indicator */
.safe-area-bottom {
  padding-bottom: env(safe-area-inset-bottom, 0);
}

/* Add padding to main content on mobile to account for bottom nav */
@media (max-width: 767px) {
  body {
    padding-bottom: 5rem;
  }
}
