/* SOS Serrurier - Optimized CSS for Astro Site */
:root {
  --color-primary: #dc2626;
  --color-primary-dark: #991b1b;
  --color-secondary: #1e40af;
  --color-success: #059669;
  --color-warning: #d97706;
  --color-gray-50: #f9fafb;
  --color-gray-100: #f3f4f6;
  --color-gray-600: #4b5563;
  --color-gray-900: #111827;
  --safe-area-inset-top: env(safe-area-inset-top, 0);
  --safe-area-inset-bottom: env(safe-area-inset-bottom, 0);
}

/* Reset and Base Styles */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.6;
  color: var(--color-gray-900);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  background: white;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  line-height: 1.2;
  font-weight: 700;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

@media (min-width: 768px) {
  h1 { font-size: 3rem; }
  h2 { font-size: 2.5rem; }
  h3 { font-size: 1.75rem; }
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--color-primary);
}

/* Layout Components */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.safe-area-padding {
  padding-top: var(--safe-area-inset-top);
  padding-left: env(safe-area-inset-left, 1rem);
  padding-right: env(safe-area-inset-right, 1rem);
}

/* Header Styles */
.sticky-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  padding: 0 1rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: 9999px;
  font-weight: 600;
  transition: all 0.2s;
  cursor: pointer;
  border: none;
  text-align: center;
}

.btn-emergency {
  background: var(--color-primary);
  color: white;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 9999px;
  font-weight: 700;
  box-shadow: 0 4px 6px rgba(220, 38, 38, 0.3);
  transition: all 0.2s;
}

.btn-emergency:hover {
  background: var(--color-primary-dark);
  box-shadow: 0 6px 12px rgba(220, 38, 38, 0.4);
  transform: translateY(-1px);
}

/* Grid Layouts */
.grid {
  display: grid;
  gap: 1rem;
}

.grid-cols-1 { grid-template-columns: repeat(1, 1fr); }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }

@media (min-width: 768px) {
  .md\:grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
  .md\:grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
  .md\:grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
}

/* Utility Classes */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }

.w-5 { width: 1.25rem; }
.w-6 { width: 1.5rem; }
.w-8 { width: 2rem; }
.h-5 { height: 1.25rem; }
.h-6 { height: 1.5rem; }
.h-8 { height: 2rem; }

.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 1.875rem; }
.text-4xl { font-size: 2.25rem; }

.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

.text-center { text-align: center; }
.text-white { color: white; }
.text-gray-400 { color: #9ca3af; }
.text-gray-600 { color: var(--color-gray-600); }
.text-red-600 { color: var(--color-primary); }
.text-red-900 { color: #7f1d1d; }
.text-green-600 { color: var(--color-success); }
.text-blue-600 { color: var(--color-secondary); }
.text-yellow-600 { color: var(--color-warning); }

.bg-white { background-color: white; }
.bg-gray-50 { background-color: var(--color-gray-50); }
.bg-gray-100 { background-color: var(--color-gray-100); }
.bg-gray-900 { background-color: var(--color-gray-900); }
.bg-red-50 { background-color: #fef2f2; }
.bg-red-600 { background-color: var(--color-primary); }

.bg-gradient-to-br {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
}

/* Spacing */
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.py-12 { padding-top: 3rem; padding-bottom: 3rem; }
.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.pb-4 { padding-bottom: 1rem; }
.pb-8 { padding-bottom: 2rem; }
.pb-24 { padding-bottom: 6rem; }

.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-12 { margin-top: 3rem; }

.mx-auto { margin-left: auto; margin-right: auto; }

/* Components */
.rounded-lg { border-radius: 0.5rem; }
.rounded-full { border-radius: 9999px; }

.shadow-sm { box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); }
.shadow-md { box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); }
.shadow-lg { box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1); }
.shadow-xl { box-shadow: 0 20px 25px rgba(0, 0, 0, 0.1); }

.border { border: 1px solid #e5e7eb; }
.border-l-4 { border-left-width: 4px; }
.border-red-600 { border-color: var(--color-primary); }

.transition-all {
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.transition-colors {
  transition: color 0.2s;
}

.transition-shadow {
  transition: box-shadow 0.2s;
}

/* Hover States */
.hover\:bg-gray-50:hover { background-color: var(--color-gray-50); }
.hover\:text-red-600:hover { color: var(--color-primary); }
.hover\:text-red-700:hover { color: var(--color-primary-dark); }
.hover\:shadow-md:hover { box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); }
.hover\:shadow-lg:hover { box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1); }
.hover\:shadow-xl:hover { box-shadow: 0 20px 25px rgba(0, 0, 0, 0.1); }

/* Group Hover */
.group:hover .group-hover\:text-red-600 {
  color: var(--color-primary);
}

/* Form Elements */
input, select, textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  font-size: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

button[type="submit"] {
  width: 100%;
  padding: 1rem;
  background: var(--color-primary);
  color: white;
  border: none;
  border-radius: 0.5rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
}

button[type="submit"]:hover {
  background: var(--color-primary-dark);
}

/* Details/Summary */
details {
  border-radius: 0.5rem;
  overflow: hidden;
}

summary {
  cursor: pointer;
  user-select: none;
  list-style: none;
}

summary::-webkit-details-marker {
  display: none;
}

/* Animations */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.8; }
}

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

/* Responsive Design */
.hidden { display: none; }

@media (min-width: 768px) {
  .md\:hidden { display: none; }
  .md\:block { display: block; }
  .md\:flex { display: flex; }
  .md\:justify-center { justify-content: center; }
  .md\:text-3xl { font-size: 1.875rem; }
  .md\:text-4xl { font-size: 2.25rem; }
  .md\:text-xl { font-size: 1.25rem; }
  .md\:py-12 { padding-top: 3rem; padding-bottom: 3rem; }
  .md\:pb-8 { padding-bottom: 2rem; }
}

@media (min-width: 640px) {
  .sm\:flex-row { flex-direction: row; }
}

/* Fixed Positioning */
.fixed {
  position: fixed;
}

.bottom-4 { bottom: 1rem; }
.left-4 { left: 1rem; }
.right-4 { right: 1rem; }
.z-40 { z-index: 40; }

/* Prose Content */
.prose {
  max-width: 65ch;
  color: var(--color-gray-900);
}

.prose p {
  margin-bottom: 1rem;
}

.prose strong {
  font-weight: 700;
}

.max-w-none { max-width: none; }
.max-w-2xl { max-width: 42rem; }
.max-w-3xl { max-width: 48rem; }

/* Screen Reader Only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Overflow */
.overflow-x-auto { overflow-x: auto; }
.min-w-max { min-width: max-content; }

@media (min-width: 768px) {
  .md\:min-w-0 { min-width: 0; }
}

/* Print Styles */
@media print {
  .no-print { display: none; }
  body { font-size: 12pt; }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
  :root {
    --color-primary: #b91c1c;
    --color-primary-dark: #7f1d1d;
  }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Dark Mode Support (optional) */
@media (prefers-color-scheme: dark) {
  /* Add dark mode styles here if needed */
}

/* List Styles */
ul {
  list-style: none;
}

/* Breadcrumb styles - remove list numbering */
nav[aria-label="Breadcrumb"] ol {
  list-style: none;
}

.space-y-3 > * + * {
  margin-top: 0.75rem;
}

.space-y-4 > * + * {
  margin-top: 1rem;
}

/* Whitespace */
.whitespace-nowrap {
  white-space: nowrap;
}

/* Flexbox utilities */
.flex-shrink-0 {
  flex-shrink: 0;
}

.flex-wrap {
  flex-wrap: wrap;
}

.items-start {
  align-items: flex-start;
}

/* Min height */
.min-h-screen {
  min-height: 100vh;
}