/**
 * Unified Header and Footer Styles
 * Used by header.js and footer.js components
 */

/* ================== HEADER STYLES ================== */
/* Mobile-first approach */

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #004080;
  padding: 0.875rem 1rem;
  color: white;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  min-height: 60px;
  box-sizing: border-box;
}

/* Header avec bannière gouvernementale */
.government-header ~ header {
  position: fixed;
  top: auto;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.logo img {
  height: 32px;
  width: auto;
  object-fit: contain;
}

.logo h1 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0;
  white-space: nowrap;
}

.nav-menu {
  display: none;
  align-items: center;
  list-style: none;
  gap: 1.5rem;
  margin: 0;
  padding: 0;
  flex: 1;
  justify-content: flex-end;
}

.nav-links,
.action-links {
  display: flex;
  align-items: center;
  gap: 1rem;
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}

.nav-links li,
.action-links li {
  list-style: none;
}

.nav-links a,
.action-links a {
  color: white;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: color 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
}

.nav-links a:hover,
.action-links a:hover {
  color: #009E60;
}

.cta-button {
  background-color: #009E60;
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 50px;
  transition: background-color 0.3s ease;
  font-size: 0.875rem;
}

.cta-button:hover {
  background-color: #007a47;
  color: white;
}

.login-button {
  padding: 0.5rem 0.875rem;
  border: 1px solid white;
  border-radius: 50px !important;
  transition: background-color 0.3s ease;
  font-size: 0.875rem;
}

.logout-button {
  border-radius: 50px !important;
  padding: 0.5rem 0.875rem;
  font-size: 0.875rem;
}

.login-button:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: white;
}

/* Hamburger Menu */
.hamburger {
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  flex-shrink: 0;
}

.hamburger div {
  width: 24px;
  height: 3px;
  background-color: white;
  border-radius: 3px;
  transition: all 0.3s ease;
}

.hamburger:hover div {
  background-color: #009E60;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Sidebar */
.sidebar {
  position: fixed;
  top: 0;
  right: -100%;
  width: 280px;
  max-width: 85vw;
  height: 100vh;
  background-color: #004080;
  color: white;
  transition: right 0.3s ease;
  z-index: 1001;
  padding: 1.5rem 1rem;
  box-shadow: -2px 0 10px rgba(0, 0, 0, 0.2);
  overflow-y: auto;
}

.sidebar.active {
  right: 0;
}

.sidebar ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar li {
  margin-bottom: 0.75rem;
}

.sidebar a {
  color: white;
  text-decoration: none;
  font-size: 1rem;
  display: block;
  padding: 0.625rem;
  border-radius: 5px;
  transition: background-color 0.3s ease;
}

.sidebar a:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.close-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 1.75rem;
  color: white;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  line-height: 1;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.close-btn:hover {
  color: #009E60;
}

/* User/Admin Info in Header */
.user-info,
.admin-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: white;
}

.user-details,
.admin-details {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.user-name,
.admin-name {
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}

.user-role,
.admin-role {
  font-size: 0.75rem;
  font-weight: 400;
  opacity: 0.9;
  color: #b3d9ff;
  line-height: 1;
}

.admin-role {
  color: #ffd700;
}

.user-info i,
.admin-info i {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.admin-info i.fa-user-shield {
  color: #ffd700;
}

/* Government Banner */
.government-header {
  background: linear-gradient(135deg, #001a33 0%, #004080 100%);
  padding: 0.75rem 1rem;
  width: 100%;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1001;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  margin-bottom: 0;
  box-sizing: border-box;
  display: block;
}

/* Le header sera positionné par JavaScript quand la bannière est présente */

/* Sur mobile, ajuster la hauteur */
@media (max-width: 768px) {
  .government-header {
    padding: 0.5rem 0.75rem;
  }
  
  .government-info {
    font-size: 0.9rem;
  }
  
  .republic-title {
    font-size: 0.875rem;
  }
  
  .ministry-title {
    font-size: 0.75rem;
  }
  
  .program-title {
    font-size: 0.6875rem;
  }
  
  /* Header ajusté dynamiquement par JS */
}

.government-info {
  text-align: center;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
  display: block;
}

.government-info h1,
.government-info h2,
.government-info h3 {
  margin: 0.25rem 0;
  line-height: 1.4;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.republic-title {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 0.25rem 0;
  padding: 0;
  color: #ffffff;
  letter-spacing: 1px;
  text-transform: uppercase;
  white-space: nowrap;
}

.ministry-title {
  font-size: 0.8125rem;
  font-weight: 600;
  margin: 0 0 0.25rem 0;
  padding: 0;
  color: #e6f3ff;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.program-title {
  font-size: 0.75rem;
  font-weight: 500;
  margin: 0;
  padding: 0;
  color: #b3d9ff;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

@media (max-width: 768px) {
  .republic-title,
  .ministry-title,
  .program-title {
    white-space: normal;
    font-size: clamp(0.65rem, 2vw, 0.875rem);
  }
}

.user-info .fa-user,
.admin-info .fa-user {
  font-size: 1.25rem;
  margin-right: 0;
  flex-shrink: 0;
}

.logout-button {
  background-color: rgba(255, 255, 255, 0.1);
  border: 1px solid white;
}

.logout-button:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

.whatsapp-groups-btn {
  color: #25D366;
}

.whatsapp-groups-btn:hover {
  color: #128C7E;
}

/* ================== FOOTER STYLES ================== */
/* Mobile-first approach */

footer {
  background: #004080;
  color: white;
  padding: 1.5rem 1rem;
  margin-top: 2rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  position: relative;
  z-index: 10;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  text-align: center;
}

.footer-section {
  margin-bottom: 1rem;
}

.footer-section h4 {
  color: #009E60;
  margin-bottom: 0.75rem;
  font-size: 1rem;
  font-weight: 600;
}

.footer-section p {
  margin-bottom: 0.5rem;
  font-size: 0.8125rem;
  line-height: 1.5;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.footer-section i {
  width: 16px;
  text-align: center;
  flex-shrink: 0;
}

/* Icon color specific styles */
.footer-section .fa-phone-alt {
  color: #009E60;
  margin-right: 0.5rem;
}

.footer-section .fa-whatsapp {
  color: #25D366;
  margin-right: 0.5rem;
}

.footer-section .fa-clock,
.footer-section .fa-envelope,
.footer-section .fa-home,
.footer-section .fa-info-circle,
.footer-section .fa-question-circle {
  margin-right: 0.5rem;
}

.footer-section a {
  color: inherit;
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-section a:hover {
  color: #009E60;
}

.footer-bottom {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
}

.footer-bottom p {
  margin: 0;
  font-size: 0.6875rem;
  color: rgba(255, 255, 255, 0.8);
  padding: 0;
}

/* ================== RESPONSIVE ================== */

/* Tablet and up */
@media screen and (min-width: 600px) {
  header {
    padding: 1rem 1.5rem;
  }

  .logo {
    gap: 0.625rem;
  }

  .logo img {
    height: 36px;
  }

  .logo h1 {
    font-size: 1.375rem;
  }

  .nav-links a,
  .action-links a {
    font-size: 0.9375rem;
  }

  .cta-button,
  .login-button,
  .logout-button {
    font-size: 0.9375rem;
  }

  .sidebar {
    width: 320px;
    padding: 2rem 1.5rem;
  }

  .sidebar a {
    font-size: 1.0625rem;
    padding: 0.75rem;
  }

  .user-name,
  .admin-name {
    font-size: 1.0625rem;
    max-width: 200px;
  }

  .user-info .fa-user,
  .admin-info .fa-user {
    font-size: 1.375rem;
  }

  footer {
    padding: 1.75rem 1.25rem;
  }

  .footer-content {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.75rem;
    text-align: left;
  }

  .footer-section {
    text-align: left;
  }

  .footer-section p {
    justify-content: flex-start;
  }
}

/* Desktop */
@media screen and (min-width: 768px) {
  header {
    padding: 1rem 2rem;
  }

  .nav-menu {
    display: flex;
  }

  .hamburger {
    display: none;
  }

  .logo img {
    height: 40px;
  }

  .logo h1 {
    font-size: 1.5rem;
  }

  .nav-links,
  .action-links {
    gap: 1.25rem;
  }

  .nav-links a,
  .action-links a {
    font-size: 1rem;
  }

  .cta-button {
    padding: 0.5rem 1.25rem;
    font-size: 1rem;
  }

  .login-button {
    padding: 0.5rem 1rem;
    font-size: 1rem;
  }

  .user-name,
  .admin-name {
    font-size: 1.125rem;
    max-width: 250px;
  }

  .user-info .fa-user,
  .admin-info .fa-user {
    font-size: 1.5rem;
  }

  footer {
    padding: 2rem 1.25rem;
  }

  .footer-content {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 2rem;
  }

  .footer-section h4 {
    font-size: 1.125rem;
    margin-bottom: 0.9375rem;
  }

  .footer-section p {
    font-size: 0.875rem;
  }
}

/* Large Desktop */
@media screen and (min-width: 1024px) {
  .nav-links,
  .action-links {
    gap: 1.5rem;
  }

  .user-name,
  .admin-name {
    max-width: 300px;
  }
}

