/* Global styles */
body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #0e1117;
  color: #f0f0f0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Wrapper pour gérer le header fixed */
.wrapper-content {
  padding-top: 70px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 70px);
}
header {
  background: rgba(34, 34, 34, 0.9);
  padding: 0.6rem 1.5rem;
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  z-index: 1003;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
}

.main-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
}

.nav-brand .brand-link {
  color: #5fa38d;
  font-size: 1.5rem;
  font-weight: bold;
  text-decoration: none;
  font-family: 'Orbitron', sans-serif;
  letter-spacing: 2px;
  display: flex;
  align-items: center;
}

.nav-brand .brand-logo {
  height: 48px;
  width: auto;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-links a {
  color: #f0f0f0;
  text-decoration: none;
  font-weight: bold;
  position: relative;
  padding: 6px 4px;
  transition: color 0.3s ease, transform 0.2s ease;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: #ff8c15;
  transition: width 0.3s ease;
}

.nav-links a:hover::after {
  width: 100%;
}

.nav-links a:hover {
  color: #ff8c15;
  transform: translateY(-2px);
}

.nav-links a.active {
  color: #ff8c15;
}

.nav-links a.active::after {
  width: 100%;
}

.logout-link {
  padding: 6px 8px;
  border-radius: 6px;
  transition: background 0.3s ease;
  margin-left: 8px;
}

.logout-link:hover {
  background: #2a3038;
}

.logout-link img {
  width: 20px;
  height: 20px;
  filter: brightness(0) saturate(100%) invert(54%) sepia(38%) saturate(1189%) hue-rotate(336deg) brightness(93%) contrast(87%);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 40px;
  height: 40px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 1002;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.nav-toggle:hover {
  background: rgba(255, 140, 21, 0.1);
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: #ff8c15;
  border-radius: 2px;
  transition: all 0.3s ease;
  position: relative;
}

.nav-toggle span:not(:last-child) {
  margin-bottom: 5px;
}

/* Animation burger → croix */
.nav-toggle.active span:nth-child(1) {
  transform: translateY(9px) rotate(45deg);
  background: #ff8c15;
}

.nav-toggle.active span:nth-child(2) {
  opacity: 0;
  transform: translateX(-10px);
}

.nav-toggle.active span:nth-child(3) {
  transform: translateY(-9px) rotate(-45deg);
  background: #ff8c15;
}

/* Overlay sombre pour mobile */
.nav-overlay {
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1001;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  pointer-events: none;
}

.nav-overlay.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* Media queries pour mobile - portrait et paysage */
@media (max-width: 768px), (max-height: 500px) and (orientation: landscape) {
  /* Ajustement du body pour le mode paysage où la hauteur est limitée */
  body {
    padding-top: 45px;
  }
  
  header {
    position: fixed;
    left: 0;
    right: 0;
    top: 0;
    z-index: 1003;
  }
  
  .main-nav {
    flex-wrap: nowrap;
    padding: 0.25rem 0.75rem;
    height: auto;
    min-height: 36px;
  }
  
  .nav-brand .brand-logo {
    height: 26px;
  }
  
  .nav-links {
    position: fixed;
    top: 0;
    right: 0;
    width: 80%;
    max-width: 320px;
    height: 100vh;
    flex-direction: column;
    background: linear-gradient(180deg, #1a1a1a 0%, #0d0d0d 100%);
    padding: 80px 20px 40px 20px;
    box-sizing: border-box;
    gap: 0.5rem;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.5);
    z-index: 1002;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
    transform: translateX(100%);
    opacity: 0;
    visibility: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    display: flex;
  }
  
  .nav-links.active {
    transform: translateX(0);
    opacity: 1;
    visibility: visible;
  }
  
  .nav-toggle {
    display: flex;
  }
  
  .nav-links a {
    width: 100%;
    padding: 11px 16px;
    font-size: 1.1rem;
    border-radius: 8px;
    border-bottom: none;
    justify-content: flex-start;
    border-left: 3px solid transparent;
  }
  
  .nav-links a::after {
    display: none;
  }
  
  .nav-links a:hover {
    transform: translateX(0);
    background: rgba(255, 140, 21, 0.08);
    border-left-color: #ff8c15;
    padding-left: 20px;
  }
  
  .nav-links a.active {
    background: rgba(255, 140, 21, 0.12);
    border-left-color: #ff8c15;
  }
  
  .logout-link {
    width: 100%;
    margin-left: 0;
    padding: 11px 16px;
    margin-top: auto;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    background: rgba(255, 140, 21, 0.05);
    border: 1px solid rgba(255, 140, 21, 0.2);
  }
  
  .logout-link:hover {
    background: rgba(255, 140, 21, 0.15);
  }
  
  .logout-link::before {
    content: 'Déconnexion';
    font-size: 1.1rem;
    font-weight: 600;
  }
  
  /* Scrollbar stylisée pour mobile */
  .nav-links::-webkit-scrollbar {
    width: 4px;
  }
  
  .nav-links::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
  }
  
  .nav-links::-webkit-scrollbar-thumb {
    background: rgba(255, 140, 21, 0.4);
    border-radius: 4px;
  }
  
  .nav-links::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 140, 21, 0.6);
  }
}

main {
  padding: 2rem;
  flex: 1;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

main h1, main h2, main h3, main h4, main h5, main h6 {
  text-align: center;
  color: #ff8c15;
  margin-bottom: 1.5rem;
}

/* Footer styles - Desktop optimized */
footer {
  background: #1a1a1a;
  color: #f0f0f0;
  margin-top: auto;
  padding: 1.5rem 2rem;
}
.footer-container {
  max-width: 1200px;
  margin: 0 auto;
}
.footer-grid {
  display: grid;
  grid-template-columns: 280px 1fr 1fr;
  gap: 2rem;
  margin-bottom: 1.5rem;
  align-items: start;
}
.footer-column h3 {
  color: #ff8c15;
  margin-bottom: 1rem;
  font-size: 1.1rem;
}
.footer-column p {
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
  color: #b0b0b0;
}
.footer-column ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.footer-column ul li {
  margin-bottom: 0.5rem;
}
.footer-column ul li a {
  color: #b0b0b0;
  text-decoration: none;
  transition: color 0.3s ease;
}
.footer-column ul li a:hover {
  color: #ff8c15;
}
.footer-bottom {
  border-top: 1px solid #333;
  padding-top: 1.5rem;
  text-align: center;
}
.footer-bottom p {
  margin: 0;
  font-size: 0.85rem;
  color: #888;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
}
.service-card {
  background: #1e232a;
  padding: 1rem;
  border-radius: 8px;
  text-align: center;
}
.service-card .service-logo {
  max-width: 80px;
  max-height: 80px;
  width: auto;
  height: auto;
  margin-bottom: 0.5rem;
  object-fit: contain;
  display: block;
  margin-left: auto;
  margin-right: auto;
}
.service-card .status-green {
  color: #4caf50;
  font-family: 'Orbitron', sans-serif;
  font-size: 1.2rem;
  text-shadow: 0 0 10px #4caf50, 0 0 20px #4caf50;
  letter-spacing: 2px;
}
.service-card .status-red {
  color: #f44336;
  font-family: 'Orbitron', sans-serif;
  font-size: 1.2rem;
  text-shadow: 0 0 10px #f44336, 0 0 20px #f44336;
  letter-spacing: 2px;
}
.chat-name {
  color: #5fa38d;
  font-family: 'Montserrat', sans-serif;
  font-size: 2.5rem;
  font-weight: bold;
  letter-spacing: 3px;
  text-align: center;
  margin-bottom: 15px;
  text-decoration: none;
}

/* Gallery styles */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}
.gallery-grid img {
  width: 100%;
  height: auto;
  border-radius: 4px;
}

/* Article styles */
.article-card {
  background: #222;
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}
.article-date {
  color: #888;
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
}
.article-card h2 {
  color: #ff8c15;
  margin-bottom: 1rem;
  font-size: 1.5rem;
}
.article-content {
  color: #f0f0f0;
  line-height: 1.6;
  margin-bottom: 1rem;
}
.article-content h1, .article-content h2, .article-content h3 {
  color: #ff8c15;
  text-align: left;
}
.article-content p {
  margin-bottom: 1rem;
}
.article-content ul, .article-content ol {
  margin-left: 2rem;
  margin-bottom: 1rem;
}
.article-content a {
  color: #4caf50;
  text-decoration: underline;
}
.article-source {
  text-align: right;
}
.article-source a {
  color: #ff8c15;
  text-decoration: none;
}
.article-source a:hover {
  text-decoration: underline;
}

/* Responsive adjustments - version corrigée pour portrait et paysage */
@media (max-width: 768px), (max-height: 500px) and (orientation: landscape) {
  /* Body sans padding-top - le header en fixed se superpose */
  body {
    padding-top: 0;
    padding-bottom: 0;
  }
  
  header {
    position: fixed;
    left: 0;
    right: 0;
    top: 0;
    z-index: 1003;
  }
  
  main {
    max-width: 100%;
    width: 100%;
    padding: 1rem;
    box-sizing: border-box;
    min-height: calc(100vh - 36px);
  }
  
  /* Services en grille adaptative */
  .services-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.8rem;
  }
  
  /* Footer en colonne unique */
  .footer-grid {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 1rem;
  }
  .footer-column h3 {
    text-align: center;
  }
  .footer-column ul {
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  
  /* Galerie optimisée pour les petites hauteurs */
  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 8px;
  }
  
  /* Titres centrés */
  main h1, main h2, main h3, main h4, main h5, main h6 {
    text-align: center;
  }
  
  /* Articles adaptatifs */
  .article-card {
    max-width: 100%;
    padding: 1rem;
  }
  
  .article-content ul, .article-content ol {
    margin-left: 0.5rem;
  }
  
  /* Logo de la marque redimensionné */
  .nav-brand .brand-logo {
    height: 35px;
    max-height: 40px;
  }
  
  .nav-brand .brand-link {
    font-size: 1.2rem;
  }
  
  /* Footer non visible au chargement - apparaît au scroll */
  footer {
    margin-top: 0;
    padding: 1.5rem 1rem;
  }
  
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  /* Navigation mobile avec padding ajusté pour le header réduit */
  .nav-links {
    padding: 45px 20px 40px 20px;
  }
}