:root {
  --bg-ice-blue: #dae2f8;
  --bg-vintage-rose: #d6a4a4;
  --bg-very-light-gray: #f9fafb;
  --bg-light-blue: #60a5fa;
  --bg-white: #ffffff;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
}

body {
  background: linear-gradient(135deg, var(--bg-ice-blue), var(--bg-vintage-rose));
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #0f172a;
}

#app-sidebar.icons-only a span {
  display: none;
}

#app-sidebar.icons-only a {
  justify-content: center;
  padding: 0.75rem;
}

#app-sidebar.icons-only svg {
  margin: 0;
}

.selection-blue::selection {
  background: rgba(96, 165, 250, 0.35);
}

.fade-in {
  animation: fade-in 1500ms ease-out both;
}

@keyframes fade-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Loader élégant */
.app-loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.3s ease;
}

.app-loader.hidden {
  opacity: 0;
  pointer-events: none;
}

.loader-spinner {
  width: 50px;
  height: 50px;
  border: 3px solid rgba(96, 165, 250, 0.2);
  border-top: 3px solid #60a5fa;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* Responsive improvements */
@media (max-width: 640px) {
  .glass {
    border-radius: 12px;
    margin: 0 8px;
  }
  
  
  
  /* Adjust text sizes for mobile */
  .text-3xl {
    font-size: 1.75rem;
    line-height: 2.25rem;
  }
  
  .text-2xl {
    font-size: 1.5rem;
    line-height: 2rem;
  }
  
  /* Better spacing on mobile */
  .p-6 {
    padding: 1rem;
  }
  
  .p-8 {
    padding: 1.25rem;
  }
  
  /* Mobile sidebar adjustments */
  #app-sidebar {
    border-radius: 0 16px 16px 0;
  }
  
  /* Better touch targets */
  button, .btn {
    min-height: 44px;
    min-width: 44px;
  }
  
  /* Mobile form improvements */
  input[type="email"], 
  input[type="password"], 
  input[type="text"] {
    font-size: 16px; /* Prevents zoom on iOS */
    padding: 12px 16px;
  }
}

@media (max-width: 768px) {
  /* Tablet adjustments */
  .grid-cols-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Smooth transitions */
.transition-all {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Better focus states for accessibility */
.focus-ring:focus {
  outline: 2px solid #60a5fa;
  outline-offset: 2px;
}

/* Improved scrollbar styling */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.1);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.5);
}

/* Enhanced contrast and color consistency */
.text-slate-900 {
  color: #0f172a;
}

.text-slate-600 {
  color: #475569;
}

.border-slate-300 {
  border-color: #cbd5e1;
}

.bg-slate-50 {
  background-color: #f8fafc;
}

/* Better button focus states */
button:focus,
a:focus,
input:focus,
textarea:focus {
  outline: 2px solid #60a5fa;
  outline-offset: 2px;
}

/* Mobile-first touch improvements */
@media (hover: none) and (pointer: coarse) {
  .hover-scale-102:hover {
    transform: none;
  }
  
  .hover-bg-gray-100:hover {
    background-color: transparent;
  }
  
  /* Better touch spacing */
  .gap-2 {
    gap: 0.75rem;
  }
  
  .gap-4 {
    gap: 1.25rem;
  }
}

/* Enhanced glass effect for better readability */
.glass {
  background: rgba(255, 255, 255, 0.25);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(2, 6, 23, 0.15);
}



/* Better form validation styling */
input:invalid {
  border-color: #ef4444;
}

input:valid {
  border-color: #10b981;
}

/* Smooth page transitions */
.page-transition {
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.page-transition.entering {
  opacity: 0;
  transform: translateY(10px);
}

.page-transition.entered {
  opacity: 1;
  transform: translateY(0);
}

@media (min-width: 1024px) {
  main {
    transition: margin-left 0.3s ease;
  }

  #app-sidebar ~ main {
    margin-left: 13rem !important;
  }

  #app-sidebar.icons-only ~ main {
    margin-left: 4rem !important;
  }
}