/* =========================================================
   RESET & BASE
   ========================================================= */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: Arial, sans-serif;
  background-color: white;
}

html, body {
  overflow-x: hidden;
}

/* =========================================================
   TOP MENU (MENU HORIZONTAL FIXE)
   ========================================================= */
.main-menu {
  background-image: url("../images/degHD.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;

  min-height: 70px;
  height: auto;
  width: 100%;
  max-width: 100vw;
  box-sizing: border-box;

  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 20px;
  padding: 0 10px;

  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 150;

  flex-wrap: nowrap; /* empêche le retour à la ligne avant burger */
  justify-content: flex-start; /* logo + menu à gauche */
}

html.lang-ar body.lang-ar .main-menu {
  background-image: url("../images/degHG.jpg");
}

.logo-div {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px; 
  height: 70px;
  flex-shrink: 0; /* empêcher le logo de rétrécir */
}

.opac-logo {
  height: 55px; /* réduit pour tenir sur une ligne */
}

.btn-main {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-left: 10px; /* petite marge entre logo et boutons */
}

/* =========================================================
   BURGER MENU (MOBILE)
   ========================================================= */
.burger {
  display: none;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  padding: 10px;
  transition: transform 0.3s ease;
  margin-left: auto;
}

.burger.active {
  transform: rotate(90deg);
}

/* =========================================================
   BOUTONS
   ========================================================= */
.button {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 20px;
  padding: 10px 20px;
  min-width: 150px;
  height: 52px;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  border-radius: 4px;
  border: none;
  background-color: transparent;
  box-shadow: 0 4px 8px rgba(11, 11, 11, 0.7);
}

.button:hover {
  background-image: url("../images/DegHG.jpg");
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
}

.btn-icon {
  width: 40px;
  height: 40px;
  object-fit: cover;
}

/* =========================================================
   LAYOUT PRINCIPAL (CONTENEUR IFRAME)
   ========================================================= */
.main-body {
  display: flex;
  flex-direction: row;
  width: 100%;
  margin-top: calc(var(--menu-height, 70px) + 0px);
}

.content-frame {
  flex-grow: 1;
  width: 100%;
  height: calc(100vh - 70px);
  border: none;
}

/* =========================================================
   MESSAGE BOX (ALERTES)
   ========================================================= */
.msgBox {
  display: none;
  position: fixed;
  top: 30px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 20px;
  border-radius: 8px;
  color: white;
  font-size: 16px;
  font-weight: bold;
  font-family: Arial, sans-serif;
  box-shadow: 0 4px 8px rgba(11, 11, 11, 0.7);
  z-index: 1000;
}

.msg-success { background: #2f8532; }
.msg-error { background: #dc1406; }
.msg-warning { background: #ff9800; }
.msg-info { background: #224adb; }

/* =========================================================
   RESPONSIVE
   ========================================================= */

/* ----- Tablettes / petits laptops ----- */
@media (max-width: 1024px) {
  .button {
    min-width: 120px;
    font-size: 16px;
    gap: 12px;
  }

  .btn-icon {
    width: 32px;
    height: 32px;
  }
}

/* ----- Tablettes ----- */
@media (max-width: 768px) {
  .burger {
    display: flex;
  }

  .btn-main {
    display: none;
    flex-direction: column;
    flex-wrap: nowrap;
    width: calc(100vw - 20px);
    max-width: 280px;
    position: absolute;
    top: 60px;
    left: 50%;
    min-width: 200px;
    background-color: white;
    padding: 10px;
    border-radius: 4px;
    transform: translateX(-50%);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    z-index: 200;
  }

  .btn-main.show {
    display: flex;
  }

  .btn-main .button {
    width: 100%;
    text-align: left;
    margin: 5px 0;
  }

  .main-body {
    margin-top: 60px;
    position: relative;
  }

  .content-frame {
    height: calc(100vh - 60px);
  }

  .opac-logo {
    height: 50px; /* logo réduit tablette */
  }
}

/* ----- Mobile ----- */
@media (max-width: 480px) {
  .main-menu {
    flex-wrap: nowrap;
    justify-content: flex-start; /* logo + menu boutons alignés à gauche */
    align-items: center;
  }

  .logo-div {
    justify-content: flex-start;
    padding: 5px 10px;
  }

  .opac-logo {
    height: 40px; /* logo réduit mobile */
  }

  .btn-main {
    margin-left: 5px; /* petit espace logo → boutons */
  }

  .main-body {
    margin-top: 0;
  }

  .content-frame {
    height: calc(100vh - 140px);
  }
}
