/* Common Styles for Prasadhana App */
:root {
  --main-orange: #ff9933;
  --main-teal: #006666;
}

@font-face {
  font-family: 'Bonkers';
  src: url('/appli/font/Bonkers.ttf') format('truetype');
  font-weight: bold;
  font-style: normal;
}
@font-face {
  font-family: 'Morpheus';
  src: url('/appli/font/MORPHEUS.TTF') format('truetype');
  font-weight: normal;
  font-style: normal;
}
@font-face {
  font-family: 'Century Gothic';
  src: url('/appli/font/GOTHIC.TTF') format('truetype');
  font-weight: normal;
  font-style: normal;
}
@font-face {
  font-family: 'StonyIsland';
  src: url('/appli/font/Stony.TTF') format('truetype');
  font-weight: normal;
  font-style: normal;
}
:root {
  --font-content: 'Century Gothic', Arial, sans-serif;
  --font-title: 'Morpheus', serif;
  --font-link-bold: 'Bonkers', Arial, sans-serif;
}

body {
  font-family: var(--font-content);
  background: #fff;
  color: var(--main-teal);
  margin: 0;
  padding: 0;
}

/* Improve tap targets and spacing for touch devices */
.button, button {
  -webkit-tap-highlight-color: rgba(0,0,0,0.12);
}

h1, h2, h3, h4, h5 {
  font-family: var(--font-title);
  color: var(--main-orange);
  margin-top: 0.5em;
}

a, .bold {
  font-family: var(--font-link-bold);
  color: var(--main-teal);
  font-weight: bold;
  text-decoration: none;
}

a:hover {
  color: var(--main-orange);
}

.button, button {
  background: var(--main-orange);
  color: var(--main-teal);
  border: none;
  border-radius: 6px;
  padding: 0.6em 1.2em;
  font-family: var(--font-content);
  cursor: pointer;
  margin: 0.3em;
  transition: background 0.2s;
  box-shadow: 0 1px 0 rgba(0,0,0,0.06);
}

.button:hover, button:hover {
  background: var(--main-teal);
}

.tarifDiv{
  padding:12px;
  margin:5px;
  border: 2px solid var(--main-teal);
  border-radius: 10px;
}

.modal {
  background: #fff;
  border: 2px solid var(--main-teal);
  border-radius: 10px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.12);
  padding: 1.5em;
  max-width: 520px;
  margin: 2em auto;
  position: relative;
}

input, select, textarea {
  font-family: var(--font-content);
  border: 1px solid var(--main-teal);
  border-radius: 6px;
  padding: 0.8em;
  margin-bottom: 1em;
  width: 100%;
  box-sizing: border-box;
}

.error-zone, .success-zone {
  background: #ffe5d0;
  color: var(--main-teal);
  border: 1px solid var(--main-orange);
  border-radius: 4px;
  padding: 0.5em;
  margin-bottom: 1em;
  font-size: 1em;
}

#errorModal.modal {
 z-index: 1000000 !important; /* valeur supérieure à toutes les autres modales */
}


.success-zone {
  background: #d0ffe5;
  color: var(--main-orange);
  border: 1px solid var(--main-teal);
}

@media (max-width: 600px) {
  body {
    padding: 0.5em;
    font-size: 1em;
  }
  h1, h2, h3, h4, h5 {
    font-size: 1.3em;
    margin-top: 0.3em;
  }
  .main-links {
    display: flex;
    flex-direction: column;
    gap: 0.6em;
    align-items: stretch;
    margin: 1em 0;
    padding: 0 0.5em;
  }
  .main-links a,
  .main-links button {
    width: 100%;
    font-size: 1.05em;
    padding: 1em 0.6em;
    box-sizing: border-box;
    margin: 0.2em 0;
    border-radius: 8px;
  }

  /* Place icon above label inside main-links buttons */
  .main-links .button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.45em;
    text-align: center;
    padding-top: 0.9em; /* a bit more space on top for the icon */
    padding-bottom: 0.9em;
  }
  .main-links .button img {
    display: block;
    /* Show a normal, larger responsive image (not an icon) */
    width: auto;
    max-width: 90%;
    height: auto;
    max-height: 120px; /* allow a larger visual image */
    object-fit: cover;
    border-radius: 6px; /* subtle rounding */
    margin: 0;
  }

  /* Full screen modals for mobile: easier to interact and scroll */
  .modal {
    position: fixed;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    margin: 0;
    max-width: none;
    height: 100vh;
    overflow-y: auto;
    border-radius: 0;
    padding: 1.2em;
    background: #fff;
    z-index: 1000;
  }

  input, select, textarea {
    font-size: 1.05em;
    padding: 0.9em;
  }

  .button {
    min-height: 30px;
  }

  img {
    max-width: 100%;
    height: auto;
  }
}

/* Larger hit targets for non-hover devices */
@media (hover: none) {
  .button, button {
    padding: 0.9em 1.2em;
    font-size: 1.05em;
  }
}

/* Reset password form styles (used by /appli/account/reset_password.php) */
.reset-wrapper {
  display: flex;
  justify-content: center;
}
.reset-container {
  max-width: 480px;
  width: 100%;
  margin: 2.2em auto;
  padding: 1.6em;
  border: 1px solid #e6e6e6;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  box-sizing: border-box;
}
.reset-container h2 { margin-top: 0; color: var(--main-teal); font-size: 1.25rem; text-align: center; }
.reset-container label { display: block; margin-bottom: 0.9em; font-size: 1rem; color: #333; }
.reset-container input[type="password"] { width: 100%; padding: 1.05em; font-size: 1.05rem; border: 1px solid #ccc; border-radius: 8px; box-sizing: border-box; }
.reset-container .button { width: 100%; padding: 1.05em; font-size: 1.05rem; margin-top: 0.8em; border-radius: 8px; }
@media (max-width: 900px) {
  .reset-container { max-width: 86vw; margin: 1.6em auto; }
}
@media (max-width: 420px) {
  .reset-container { max-width: 94vw; margin: 0.8em; padding: 1em; }
  .reset-container h2 { font-size: 1.15rem; }
  .reset-container input[type="password"] { font-size: 1.1rem; padding: 1em; }
  .reset-container .button { font-size: 1.1rem; padding: 1em; }
}

/* Admin page container: constrain width on large screens and center */
.page-container {
  max-width: 1200px; /* prevents full-width stretching on wide Windows displays */
  margin: 0 auto;
  padding: 1em 1.2em;
  box-sizing: border-box;
}

/* Ensure slots list and slot items don't stretch past navigation/buttons */
.slots-list, #slots-list-content {
  overflow: hidden;
  max-width: 100%;
}

/* Within the slots HTML (loaded via AJAX) ensure slot rows wrap and buttons stay visible */
.slot-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.1em;
  flex-wrap: wrap; /* allow stacking on narrow widths */
}
.slot-row .slot-title {
  flex: 1 1 45%;
  min-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
    white-space: normal; /* allow multiple lines for title/schedule/free */
}
.slot-row .slot-actions {
  flex: 0 0 auto;
  display: flex;
  gap: 0.4em;
  align-items: center;
}
  .slot-row .slot-title .title { font-weight: bold; font-size: 1.05em; margin-bottom: 0.25em; }
  .slot-row .slot-title .schedule { color: rgba(0,0,0,0.6); margin-bottom: 0.35em; }
  .slot-row .slot-title .free { color: var(--main-teal); font-weight: 600; }

/* If buttons overflow, allow them to wrap onto next line but remain visible */
.slot-row .slot-actions .button {
  white-space: nowrap;
}

@media (min-width: 1201px) {
  .page-container { padding-left: 2em; padding-right: 2em; }
}

/* Mini toast notifications used by admin/manage pages */
.mini-toast { transition: opacity 0.35s ease; opacity: 1; }
.mini-toast.info { background: #25A4CA; }
.mini-toast.error { background: #d9534f; }
