/* global.css - Styles globaux du site */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden; /* Empêche le scroll horizontal sur toute la page */
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #f5f5f5;
  padding-top: 70px;
  overflow-x: hidden; /* Empêche le scroll horizontal */
}

#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ============================================
   NAVIGATION
   ============================================ */
.main-nav {
  background-color: #2c3e50;
  color: white;
  padding: 1rem 0;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
}

.nav-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-brand a {
  color: white;
  text-decoration: none;
  font-size: 1.5rem;
  font-weight: bold;
}

.nav-links {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.nav-link {
  color: white;
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  transition: background-color 0.3s;
  cursor: pointer;
}

.nav-link:hover {
  background-color: #34495e;
}

/* Login button in navigation */
.login-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.2rem !important;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 50px;
  transition: all 0.3s ease;
}

.login-btn:hover {
  background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.login-btn svg {
  fill: white;
}

/* User button in navigation */
.user-btn {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 1.2rem !important;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 50px;
  transition: all 0.3s ease;
  cursor: pointer;
}

.user-btn:hover {
  background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.user-btn svg {
  fill: white;
}

.user-name {
  color: white;
  font-weight: 500;
}

/* Dropdown navigation */
.nav-dropdown {
  position: relative;
}

.dropdown-arrow {
  font-size: 0.7em;
  margin-left: 0.3rem;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background-color: #34495e;
  min-width: 200px;
  border-radius: 4px;
  margin-top: 0.5rem;
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
}

.dropdown-menu.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-item {
  display: block;
  color: white;
  text-decoration: none;
  padding: 0.75rem 1rem;
  transition: background-color 0.3s;
}

.dropdown-item:hover {
  background-color: #2c3e50;
}

.dropdown-item:first-child {
  border-radius: 4px 4px 0 0;
}

.dropdown-item:last-child {
  border-radius: 0 0 4px 4px;
}

/* User dropdown menu */
.user-dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.5rem;
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  min-width: 280px;
  z-index: 1000;
  overflow: hidden;
  animation: slideDown 0.2s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* User info card in dropdown */
.user-info {
  padding: 1.2rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.user-info strong {
  display: block;
  font-size: 1.1rem;
  margin-bottom: 0.3rem;
}

.user-info small {
  display: block;
  opacity: 0.9;
  font-size: 0.85rem;
}

.user-role-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-top: 0.5rem;
  backdrop-filter: blur(10px);
}

/* Dropdown divider */
.dropdown-divider {
  height: 1px;
  background: #e1e8ed;
  margin: 0;
}

/* Dropdown links */
.user-dropdown-menu a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1.2rem;
  color: #2c3e50;
  text-decoration: none;
  transition: all 0.2s ease;
}

.user-dropdown-menu a:hover {
  background: #f8f9fa;
}

.user-dropdown-menu a svg {
  width: 18px;
  height: 18px;
  fill: #667eea;
  flex-shrink: 0;
}

/* Logout item */
.logout-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.875rem 1.2rem;
  background: none;
  border: none;
  color: #e74c3c;
  font-family: inherit;
  font-size: 1rem;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
}

.logout-item:hover {
  background: #fee;
}

.logout-item svg {
  width: 18px;
  height: 18px;
  fill: #e74c3c;
  flex-shrink: 0;
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.main-content {
  flex: 1;
  width: 100%;
  min-height: calc(100vh - 70px - 300px); /* 70px navbar, 300px footer estimé */
}

/* ============================================
   FOOTER
   ============================================ */
.main-footer {
  background-color: #2c3e50;
  color: white;
  padding: 3rem 0 0;
  margin-top: auto;
}

.footer-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-section h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: #3498db;
}

.footer-section h4 {
  font-size: 1.1rem;
  margin-bottom: 1rem;
  color: #ecf0f1;
  font-weight: 600;
}

.footer-section p {
  margin: 0.5rem 0;
  color: #bdc3c7;
  line-height: 1.6;
}

.footer-section ul {
  list-style: none;
  padding: 0;
}

.footer-section ul li {
  margin: 0.5rem 0;
}

.footer-section a {
  color: #bdc3c7;
  text-decoration: none;
  transition: color 0.3s;
}

.footer-section a:hover {
  color: #3498db;
}

.footer-bottom {
  background-color: #1a252f;
  padding: 1.5rem 0;
  text-align: center;
  border-top: 1px solid #34495e;
}

.footer-bottom p {
  margin: 0;
  color: #95a5a6;
  font-size: 0.9rem;
}

/* ============================================
   COMPOSANTS RÉUTILISABLES
   ============================================ */

/* Section Title */
.section-title {
  font-size: 2.5rem;
  color: #2c3e50;
  text-align: center;
  margin-bottom: 1rem;
  position: relative;
  padding-bottom: 1rem;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 4px;
  background: linear-gradient(90deg, #667eea, #764ba2);
  border-radius: 2px;
}

.section-subtitle {
  text-align: center;
  color: #666;
  font-size: 1.1rem;
  margin-bottom: 3rem;
}

/* Cartes d'information */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.info-card {
  background: white;
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.info-card h3, .info-card h4 {
  color: #2c3e50;
  margin-bottom: 0.75rem;
  font-size: 1.2rem;
}

.info-card p {
  color: #666;
  line-height: 1.6;
}

.info-card ul {
  list-style: none;
  padding-left: 0;
}

.info-card ul li {
  padding: 0.3rem 0;
  border-bottom: 1px solid #ddd;
}

.info-card ul li:last-child {
  border-bottom: none;
}

/* Grille de dashboards */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.dashboard-card {
  background: white;
  border: 2px solid #3498db;
  padding: 1.5rem;
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  transition: all 0.3s;
}

.dashboard-card:not(.disabled):hover {
  background: #3498db;
  color: white;
  transform: translateY(-5px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.dashboard-card.disabled {
  border-color: #bdc3c7;
  opacity: 0.6;
  cursor: not-allowed;
}

/* Lien retour */
.back-link {
  display: inline-block;
  color: #3498db;
  text-decoration: none;
  margin-bottom: 1rem;
  transition: color 0.3s;
}

.back-link:hover {
  color: #2980b9;
}

/* ============================================
   404 PAGE
   ============================================ */
.not-found-container {
  min-height: calc(100vh - 70px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.not-found-content {
  background: white;
  padding: 3rem;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  text-align: center;
  max-width: 600px;
  width: 100%;
  animation: fadeInUp 0.6s ease;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.error-code {
  font-size: 8rem;
  font-weight: bold;
  color: #667eea;
  margin: 0;
  line-height: 1;
}

.error-title {
  font-size: 2rem;
  color: #2c3e50;
  margin: 1rem 0;
}

.error-message {
  font-size: 1.1rem;
  color: #7f8c8d;
  margin-bottom: 2rem;
}

.error-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.error-actions .btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.3s ease;
}

.error-actions .btn-primary {
  background-color: #3498db;
  color: white;
}

.error-actions .btn-primary:hover {
  background-color: #2980b9;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.error-actions .btn-secondary {
  background-color: #95a5a6;
  color: white;
}

.error-actions .btn-secondary:hover {
  background-color: #7f8c8d;
  transform: translateY(-2px);
}

.error-links {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid #ecf0f1;
}

.error-links p {
  color: #7f8c8d;
  margin-bottom: 1rem;
}

.error-links ul {
  list-style: none;
  padding: 0;
}

.error-links li {
  margin: 0.5rem 0;
}

.error-links a {
  color: #3498db;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s;
}

.error-links a:hover {
  color: #2980b9;
  text-decoration: underline;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 768px) {
  .nav-links {
    gap: 1rem;
  }
  
  .nav-link {
    padding: 0.5rem;
    font-size: 0.9rem;
  }

  .not-found-content {
    padding: 2rem 1.5rem;
  }

  .error-code {
    font-size: 5rem;
  }

  .error-title {
    font-size: 1.5rem;
  }

  .error-actions {
    flex-direction: column;
  }

  .error-actions .btn {
    width: 100%;
    justify-content: center;
  }

  /* Footer responsive */
  .footer-container {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 0 1rem;
  }

  .main-footer {
    padding: 2rem 0 0;
  }

  .footer-section {
    text-align: center;
  }
}
