/* Styles personnalisés pour SimpleAnnonce */

:root {
  --primary-color: #6366f1;
  --secondary-color: #8b5cf6;
  --accent-color: #ec4899;
  --info-color: #06b6d4;
  --success-color: #10b981;
  --warning-color: #f59e0b;
}

/* Global styles */
* {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* Navbar custom styles */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(10px);
  background-color: rgba(255, 255, 255, 0.95);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Grid pattern background */
.bg-grid-pattern {
  background-image:
    linear-gradient(to right, rgba(0, 0, 0, 0.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0, 0, 0, 0.05) 1px, transparent 1px);
  background-size: 40px 40px;
}

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

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

/* Gradient text */
.bg-clip-text {
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Stats responsive */
.stats {
  display: grid;
  grid-auto-flow: column;
  overflow-x: auto;
}

@media (max-width: 768px) {
  .stats {
    grid-auto-flow: row;
  }
}

/* Buttons custom styles */
.btn {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.btn-primary:hover {
  transform: translateY(-2px) scale(1.02);
}

/* Badge animations */
.badge {
  transition: all 0.2s ease;
}

.badge:hover {
  transform: scale(1.1);
}

/* Category cards */
.card-body svg {
  transition: transform 0.3s ease;
}

.card:hover .card-body svg {
  transform: scale(1.1) rotate(5deg);
}

/* Search input icons fix */
.relative .input {
  height: 3rem;
  line-height: 3rem;
}

.relative svg {
  pointer-events: none;
}

/* Footer styles */
footer {
  margin-top: auto;
}

/* Smooth scroll offset for sticky navbar */
section {
  scroll-margin-top: 80px;
}

/* Loading animation */
@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

.skeleton {
  animation: shimmer 2s infinite;
  background: linear-gradient(to right, #f0f0f0 4%, #e0e0e0 25%, #f0f0f0 36%);
  background-size: 1000px 100%;
}

/* Animation utilities */
@keyframes gradient {
  0%, 100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

.animate-gradient {
  background-size: 200% auto;
  animation: gradient 3s ease infinite;
}

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

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

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

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

.fade-in {
  animation: fadeIn 0.8s ease-out;
}

.fade-in-scale {
  animation: fadeInScale 0.6s ease-out;
}

.slide-in-left {
  animation: slideInLeft 0.8s ease-out;
}

.slide-in-right {
  animation: slideInRight 0.8s ease-out;
}

/* Staggered animations for lists */
.stagger-animation > * {
  animation: fadeIn 0.6s ease-out;
  animation-fill-mode: both;
}

.stagger-animation > *:nth-child(1) { animation-delay: 0.1s; }
.stagger-animation > *:nth-child(2) { animation-delay: 0.2s; }
.stagger-animation > *:nth-child(3) { animation-delay: 0.3s; }
.stagger-animation > *:nth-child(4) { animation-delay: 0.4s; }
.stagger-animation > *:nth-child(5) { animation-delay: 0.5s; }
.stagger-animation > *:nth-child(6) { animation-delay: 0.6s; }

/* Responsive utilities - Tablets and smaller */
@media (max-width: 768px) {
  .stats {
    width: 100%;
  }

  h1 {
    font-size: 2rem !important;
  }

  h2 {
    font-size: 1.75rem !important;
  }

  /* Improve touch targets */
  .btn {
    min-height: 44px;
  }

  /* Better spacing */
  .container {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }
}

/* Very small phones (< 480px) */
@media (max-width: 480px) {
  html {
    font-size: 14px;
  }

  h1 {
    font-size: 1.75rem !important;
  }

  h2 {
    font-size: 1.5rem !important;
  }

  h3 {
    font-size: 1.125rem !important;
  }

  /* Reduce padding on small screens */
  .card-body {
    padding: 0.75rem;
  }

  /* Stack badges on small screens */
  .badge {
    font-size: 0.65rem;
    padding: 0.15rem 0.4rem;
  }

  /* Compact buttons */
  .btn-sm {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }

  /* Prevent horizontal overflow */
  .overflow-x-auto {
    -webkit-overflow-scrolling: touch;
  }
}

/* Dark Mode Styles */
[data-theme="dark"] {
  --primary-color: #818cf8;
  --secondary-color: #a78bfa;
  --accent-color: #f472b6;
}

[data-theme="dark"] body {
  background-color: #1e1e2e;
  color: #e0e0e0;
}

[data-theme="dark"] .navbar {
  background-color: rgba(30, 30, 46, 0.95);
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

/* Logo swap en dark mode */
[data-theme="dark"] img[src="/images/logo.svg"] {
  content: url('/images/logo-dark.svg');
}

[data-theme="dark"] .card {
  background-color: #2a2a3e;
  border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .bg-base-100 {
  background-color: #2a2a3e;
}

[data-theme="dark"] .bg-base-200 {
  background-color: #1e1e2e;
}

[data-theme="dark"] .text-base-content {
  color: #e0e0e0;
}

[data-theme="dark"] .text-base-content\/70 {
  color: rgba(224, 224, 224, 0.7);
}

[data-theme="dark"] .border-base-200 {
  border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] input,
[data-theme="dark"] textarea,
[data-theme="dark"] select {
  background-color: #2a2a3e;
  border-color: rgba(255, 255, 255, 0.2);
  color: #e0e0e0;
}

[data-theme="dark"] input:focus,
[data-theme="dark"] textarea:focus,
[data-theme="dark"] select:focus {
  border-color: var(--primary-color);
  background-color: #323247;
}

[data-theme="dark"] .dropdown-content {
  background-color: #2a2a3e;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .menu li > * {
  color: #e0e0e0;
}

[data-theme="dark"] .menu li > *:hover {
  background-color: #323247;
}

[data-theme="dark"] .divider {
  border-color: rgba(255, 255, 255, 0.1);
}

/* Dark Mode - Backgrounds */
[data-theme="dark"] .bg-white {
  background-color: #2a2a3e !important;
}

/* Only override page-level gradient backgrounds, not decorative overlays */
[data-theme="dark"] .min-h-screen.bg-gradient-to-br {
  background: #1e1e2e !important;
}

/* Dark Mode - Text colors */
[data-theme="dark"] .text-gray-500 {
  color: #9ca3af;
}

[data-theme="dark"] .text-gray-400 {
  color: #6b7280;
}

[data-theme="dark"] .text-gray-300 {
  color: #d1d5db;
}

/* Dark Mode - Icon backgrounds */
[data-theme="dark"] .bg-indigo-100 {
  background-color: rgba(129, 140, 248, 0.25);
}

[data-theme="dark"] .bg-purple-100 {
  background-color: rgba(167, 139, 250, 0.25);
}

[data-theme="dark"] .bg-pink-100 {
  background-color: rgba(244, 114, 182, 0.25);
}

[data-theme="dark"] .bg-green-100 {
  background-color: rgba(16, 185, 129, 0.25);
}

/* Dark Mode - Text colors for stats */
[data-theme="dark"] .text-indigo-600 {
  color: #c7d2fe;
}

[data-theme="dark"] .text-purple-600 {
  color: #ddd6fe;
}

[data-theme="dark"] .text-pink-600 {
  color: #fbcfe8;
}

[data-theme="dark"] .text-green-600 {
  color: #86efac;
}

/* Dark Mode - Alert */
[data-theme="dark"] .alert {
  border-color: rgba(255, 255, 255, 0.1);
}

/* Dark Mode - Badge */
[data-theme="dark"] .badge-outline {
  border-color: rgba(129, 140, 248, 0.4);
  color: #c7d2fe;
}

[data-theme="dark"] .badge-outline:hover {
  background-color: rgba(129, 140, 248, 0.3);
  border-color: #818cf8;
  color: #e0e6ff;
}

/* Dark Mode - More text colors */
[data-theme="dark"] .text-gray-600 {
  color: #9ca3af;
}

[data-theme="dark"] .text-gray-700 {
  color: #d1d5db;
}

/* Dark Mode - Navbar white backgrounds */
[data-theme="dark"] .navbar.bg-white,
[data-theme="dark"] nav.bg-white,
[data-theme="dark"] .bg-white\/80 {
  background-color: rgba(30, 30, 46, 0.95) !important;
}

/* Dark Mode - Base backgrounds */
[data-theme="dark"] .bg-base-300 {
  background-color: #323247;
}

[data-theme="dark"] .hover\:bg-base-300:hover {
  background-color: #323247;
}

/* Dark Mode - Logo swap */
[data-theme="dark"] img[src*="logo.svg"]:not([src*="logo-dark"]) {
  content: url('/images/logo-dark.svg');
}

/* Dark Mode - Hero section background visibility */
[data-theme="dark"] .bg-gradient-to-br.from-black\/60 {
  background: linear-gradient(to bottom right, rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.4)) !important;
}

/* Dark Mode - Public search page */
[data-theme="dark"] .bg-gradient-to-br.from-indigo-50 {
  background: #1e1e2e !important;
}

[data-theme="dark"] .bg-gradient-to-r.from-primary.via-secondary {
  background: linear-gradient(to right, rgba(129, 140, 248, 0.25), rgba(167, 139, 250, 0.25), rgba(244, 114, 182, 0.25)) !important;
}

[data-theme="dark"] .alert.bg-gradient-to-r.from-primary {
  background: linear-gradient(to right, rgba(129, 140, 248, 0.2), rgba(167, 139, 250, 0.2), rgba(244, 114, 182, 0.2)) !important;
  border: 1px solid rgba(129, 140, 248, 0.4);
}

[data-theme="dark"] .badge.bg-white\/20 {
  background-color: rgba(129, 140, 248, 0.2) !important;
  border-color: rgba(129, 140, 248, 0.4);
  color: #c7d2fe;
}

[data-theme="dark"] .badge.bg-white\/20:hover {
  background-color: rgba(129, 140, 248, 0.35) !important;
  border-color: rgba(129, 140, 248, 0.6);
  color: #e0e6ff;
}

[data-theme="dark"] #cta-sticky {
  background-color: #2a2a3e !important;
  border-top-color: rgba(255, 255, 255, 0.1) !important;
}

/* Dark Mode - Project cards enhancement */
[data-theme="dark"] .card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(129, 140, 248, 0.2);
  border-color: rgba(129, 140, 248, 0.3);
}

[data-theme="dark"] .badge {
  background-color: rgba(129, 140, 248, 0.2);
  border-color: rgba(129, 140, 248, 0.3);
  color: #c7d2fe;
}

[data-theme="dark"] .badge:hover {
  background-color: rgba(129, 140, 248, 0.3);
  color: #e0e6ff;
}

[data-theme="dark"] .text-primary {
  color: #a5b4fc !important;
}

[data-theme="dark"] .btn-primary {
  background: linear-gradient(135deg, #818cf8 0%, #a78bfa 100%);
  border: none;
  box-shadow: 0 4px 12px rgba(129, 140, 248, 0.3);
  color: #ffffff !important;
}

[data-theme="dark"] .btn-primary:hover {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  box-shadow: 0 6px 20px rgba(129, 140, 248, 0.4);
  transform: translateY(-2px);
}

/* Print styles */
@media print {
  .navbar,
  footer,
  .btn {
    display: none;
  }
}
