@import './variables.css';

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-secondary);
  background-color: #F5F5F5 !important;
  color: var(--black);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Debug: Ensure all sections have proper background */
.competences-landing,
.news,
.rendez-vous,
.association-logos,
/* .google-reviews-section - Removed: google-carousel.css controls this section's background (white) */
.contact,
.footer {
  background-color: #F5F5F5 !important;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-primary);
  font-weight: 600;
  line-height: 1.2;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-normal);
}

/* Images */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Focus styles */
:focus {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

:focus:not(:focus-visible) {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

/* Selection */
::selection {
  background-color: var(--blue);
  color: var(--white);
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: var(--white);
}

::-webkit-scrollbar-thumb {
  background: var(--blue);
  border-radius: var(--border-radius-sm);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--coral);
}

/* App layout */
.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
}

/* Loading state */
.loading {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 200px;
  color: var(--blue);
}

.loading::after {
  content: '';
  width: 40px;
  height: 40px;
  border: 4px solid var(--blue);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Error state */
.error {
  text-align: center;
  padding: var(--spacing-xl);
  color: var(--coral);
}

.error h2 {
  font-size: 2rem;
  margin-bottom: var(--spacing-md);
}

.error p {
  color: var(--black);
  margin-bottom: var(--spacing-lg);
}

/* Utility classes */
.text-center {
  text-align: center;
}

.mt-auto {
  margin-top: auto;
}

.mb-0 {
  margin-bottom: 0;
}

.w-100 {
  width: 100%;
}

/* High contrast mode */
@media (prefers-contrast: high) {
  :root {
    --blue: #0052cc;
    --black: #000000;
    --white: #F5F5F5;
    --coral: #cc0000;
  }

  * {
    border-color: currentColor !important;
  }
}

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

/* Back to Top Button - Global styles for all pages */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background-color: var(--blue);
  color: var(--white);
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  z-index: 1000;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  background-color: var(--black);
  transform: translateY(-5px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

@media (max-width: 768px) {
  .back-to-top {
    width: 2.5rem;
    height: 2.5rem;
    font-size: 1.25rem;
    bottom: 1.5rem;
    right: 1.5rem;
  }
}

/* Cookie Consent Styles */
.cookie-consent {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: var(--white, #ffffff);
  border-top: 2px solid var(--blue, #007BFF);
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
  z-index: 10000;
  padding: var(--spacing-md, 1.5rem);
  font-family: var(--font-secondary, 'Roboto', sans-serif);
}

.cookie-content {
  max-width: var(--container-max-width, 1200px);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--spacing-lg, 2rem);
  flex-wrap: wrap;
}

.cookie-content p {
  flex: 1;
  min-width: 250px;
  margin: 0;
  color: var(--black, #333333);
  font-size: var(--font-size-base, 1rem);
  line-height: 1.6;
}

.cookie-buttons {
  display: flex;
  gap: var(--spacing-sm, 1rem);
  flex-shrink: 0;
  align-items: stretch;
  min-width: 260px;
}

.cookie-consent .btn {
  padding: 14px 28px;
  border-radius: var(--border-radius-md, 8px);
  font-size: var(--font-size-base, 1rem);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-normal, 0.3s ease);
  font-family: var(--font-primary, 'Montserrat', sans-serif);
  box-sizing: border-box;
  white-space: nowrap;
  border: 2px solid transparent;
  min-width: 0;
  flex: 1 1 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.cookie-consent .btn-primary {
  background-color: var(--blue, #007BFF);
  color: var(--white, #ffffff);
  border-color: var(--blue, #007BFF);
}

.cookie-consent .btn-primary:hover {
  background-color: var(--black, #333333);
  border-color: var(--black, #333333);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.cookie-consent .btn-secondary {
  background-color: transparent;
  color: var(--blue, #007BFF);
  border-color: var(--blue, #007BFF);
}

.cookie-consent .btn-secondary:hover {
  background-color: var(--blue, #007BFF);
  color: var(--white, #ffffff);
}

@media (max-width: 768px) {
  .cookie-content {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }
  
  .cookie-content p {
    margin-bottom: var(--spacing-sm, 1rem);
  }
  
  .cookie-buttons {
    justify-content: center;
    width: 100%;
  }
  
  .cookie-consent .btn {
    flex: 1 1 0;
    min-width: 0;
    padding: 14px 28px;
  }
}

/* Print styles */
@media print {
  body {
    background: white;
    color: black;
  }

  @page {
    margin: 2cm;
  }

  a[href^="http"]:after {
    content: " (" attr(href) ")";
  }
  
  .cookie-consent {
    display: none !important;
  }
}
