
/* === THEME VARIABLES === */
/* Light theme defaults */
:root{
  --bg: white;
  --text: #ccc;
  --muted: #333;
  --border: #aaa;
  --card: #eee;
  --primary: #444;
  --primary-contrast: #fff;
  --accent: #111;
  --accent-contrast: #007bff;
  --success: red;
  --warning: #bbb;
  --danger: #2e7d32;
  --link: #c62828;
  --link-visited: #e0e0e0;
  --shadow: #d5d5d5;
  --input-bg: #000;
}

/* Dark theme overrides */
.theme-dark{
  --bg: #121417;
  --text: #333333;
  --muted: #cccccc;
  --border: #555555;
  --card: #111111;
  --primary: #bbbbbb;
  --primary-contrast: #000000;
  --accent: #eeeeee;
  --accent-contrast: #007bff;
  --success: #1a1f24;
  --warning: #444444;
  --danger: #2e7d32;
  --link: #c62828;
  --link-visited: #1f1f1f;
  --shadow: #2a2a2a;
  --input-bg: #ffffff;
}


/* Apply variables to base elements */
html, body {
  background: var(--bg, #ffffff);
  color: var(--text, #111111);
}
a { color: var(--link, var(--primary, #0d6efd)); }
a:visited { color: var(--link-visited, #6f42c1); }
hr { border-color: var(--border, rgba(0,0,0,.15)); }
input, select, textarea {
  background: var(--input-bg, var(--card, #ffffff));
  color: var(--text, #111111);
  border-color: var(--border, rgba(0,0,0,.2));
}
.card, .panel, .container, .box {
  background: var(--card, #ffffff);
  color: var(--text, #111111);
  border-color: var(--border, rgba(0,0,0,.12));
}
.btn, button, [role="button"] {
  background: var(--primary, #0d6efd);
  color: var(--primary-contrast, #ffffff);
  border-color: var(--primary, #0d6efd);
}
.alert-success{ background: var(--success, #d1e7dd); color: #0f5132; }
.alert-warning{ background: var(--warning, #fff3cd); color: #664d03; }
.alert-danger{  background: var(--danger, #f8d7da); color: #842029; }


/* === ORIGINAL (with variables) === */
.timbrage-section {
  overflow-y: auto;
  overflow-x: hidden;
  width: 100%;
  max-width: 368px;
  margin: 0 auto;
  padding: 10px;
  flex: 1 1 auto; /* Allow to grow and shrink as needed */
  min-height: 0;  /* IMPORTANT: allows flex containers to scroll correctly */
}

.timbrage-header {
  width: 100%;
  overflow: hidden; /* contains the floats */
  border-bottom: 1px solid var(--muted);
  box-sizing: border-box;
}

.timbrage-header .title {
  float: left;
  font-weight: bold;
  font-size: 1.1rem;
  color: var(--border);
  white-space: nowrap;
}

.timbrage-header .date {
  float: right;
  font-size: 0.95rem;
  color: var(--border);
  white-space: nowrap;
}

.timbrage-entry {
  display: flex;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--primary);
}

.timbrage-entry .icon {
  font-family: 'Material Icons';
  font-size: 24px;
  margin-right: 12px;
  color: var(--text);
}

.timbrage-entry .info {
  flex-grow: 1;
}

.timbrage-entry .label {
  font-weight: bold;
  color: var(--primary-contrast);
}

.timbrage-entry .detail {
  font-size: 0.85rem;
  color: var(--warning);
}

.icon-button {
  background-color: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  margin-right: 12px;
}

.icon-button .material-icons {
  font-size: 24px;
  color: var(--text);
}

.icon-button:hover .material-icons {
  color: var(--primary-contrast);
}

html, body {
  background-color: var(--accent);
  color: var(--card);
  font-family: 'Segoe UI', sans-serif;
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden; /* prevent double scrollbars */
}

#Form_Main {
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.presence-label {
  color: var(--bg);
  font-size: 1.1rem;
  display: flex;
  align-items: left;
}

.user-label {
  color: var(--bg);
  font-size: 1.1rem;
  display: flex;
  align-items: right;
}

.correction-titre-label {
  color: var(--bg);
  font-size: 1.4rem;
  display: flex;
  align-items: left;
}

.correction-text-label {
  color: var(--bg);
  font-size: 1.1rem;
  display: flex;
  align-items: left;
}

.presence-button {
  border-radius: 12px;
  padding: 16px;
  width: 120px;
  height: 120px;
  text-align: left;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: var(--bg);
  font-family: sans-serif;
}

.presence-button .icon {
  font-family: 'Material Icons';
  font-size: 24px;
}

.presence-button .label {
  font-weight: bold;
  font-size: 1.1rem;
}

.presence-button .sub {
  font-size: 0.9rem;
  opacity: 0.85;
}

.presence-button.active {
  background-color: var(--danger); /* green */
  cursor: pointer;
}

.presence-button.inactive {
  background-color: var(--muted);
  opacity: 0.6;
  cursor: default;
  pointer-events: none;
}

.presence-button.fin-active {
  background-color: var(--link); /* var(--success) */
  cursor: pointer;
}

/* === Container for layout tiles/buttons === */
.tile-container {
  display: grid;
  grid-template-columns: repeat(2, 110px);  /* 2 buttons per row */
  grid-gap: 5px;                           /* spacing between buttons */
  justify-content: center;                 /* center the whole grid */
  padding: 20px;
}

/* === Make .presence-button responsive === */
.presence-button {
  width: 100%;
  max-width: 160px;
  height: auto;
  aspect-ratio: 1 / 1;
  box-sizing: border-box;
}

/* === Optional: Force full width on very small screens === */
@media (max-width: 600px) {
  .presence-button {
    width: 100%;
    max-width: none;
    margin: 0 auto;
  }
}

.div-entete {
  overflow-y: hidden;
  overflow-x: hidden;
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
  padding: 10px;
  flex: 1 1 auto; /* Allow to grow and shrink as needed */
  min-height: 0;  /* IMPORTANT: allows flex containers to scroll correctly */
}

.toast-top-center {
  top: 0px !important;
}

#main {
  margin-top: 0;
  padding-top: 0;
}

.responsive-pagecontrol {
  width: 485;  /* Fixed width for normal screens */
  max-width: 100%; /* Ensure it never exceeds screen */
  margin: 0 auto;  /* Center horizontally */
}

.page-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  min-height: 0;
  background-color: var(--accent);
}

.custom-tabs {
  display: flex !important;
  flex-direction: row !important;
  justify-content: center !important;
  align-items: center;
  list-style: none;
  margin: 20px auto;     /* <--- This centers the UL itself */
  padding: 0;
  gap: 10px;
  border-bottom: 2px solid var(--text);
  width: fit-content;    /* <--- Prevents UL from stretching full width */
}

/* Each tab (LI item) */
.custom-tabs .nav-item {
  display: inline-block;
  margin: 0;
}

/* Tab link (anchor inside LI) */
.custom-tabs .nav-link {
  display: inline-block;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  background-color: var(--link-visited);
  border: 1px solid var(--text);
  border-bottom: none;
  border-radius: 0.25rem 0.25rem 0 0;
  text-align: center;
  text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease;
  color: var(--input-bg);
}

/* Hover effect */
.custom-tabs .nav-link:hover {
  background-color: var(--shadow);
  color: var(--input-bg);
}

/* Active tab */
.custom-tabs .nav-link.active {
  background-color: var(--accent-contrast);
  color: white;
  border-color: var(--accent-contrast);
  font-weight: bold;
}

/* Prevent clipping of tab headers by the page control container */
.custom-tabs {
  margin-top: -1px; /* pulls it on top of border */
  z-index: 10;
  position: relative;
}

/* Prevent parent containers from hiding overflow */
.WebPageControl_Main {
  overflow: visible !important;
}


#Form_Main {
  max-width: 100%;
  overflow-x: hidden;
}

.custom-tabs {
  max-width: 100%;
  overflow-x: auto;
}

.fullpage-flex {
  display: flex;
  flex-direction: column;
  height: 100vh;     /* full viewport height */
  width: 100vw;
}

.page-content-scrollable {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.timbrage-section {
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1 1 auto;
  min-height: 0;
}

.recap-line {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 0.95rem;
}

.recap-caption {
  text-align: left;
  color: var(--border);
}

.recap-value {
  text-align: right;
  color: var(--card);
  font-weight: bold;
  min-width: 60px;
}

.presence-button .icon.crossed {
  position: relative;
  display: inline-block;
}

.presence-button .icon.crossed::after {
  content: '';
  position: absolute;
  top: 15px;
  left: 2px;
  width: 20px;
  height: 2px;
  background-color: crimson; /* softer than pure var(--success) */
  transform: rotate(45deg);
  border-radius: 1px;
}

#WebHTMLDiv_RecapTitre {
 gap: 16px; /* or 24px for more spacing */
}

.logout-button {
  position: absolute;
  right: 8px;
  top: 7px;
  background-color: --bg;
  color: var(--card);                         /* Default text + icon color */
  border: 1px solid #555;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  max-width: 200px;                    /* Max width constraint */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  gap: 6px;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.logout-button:hover {
  background-color: var(--primary);
  color: var(--bg);
  border-color: #777;
}

.logout-button .material-icons {
  color: inherit;                     /* icon takes parent's color */
  font-size: 18px;
}

.responsive-input {
  font-size: clamp(16px, 2.5vw, 18px); /* ensures minimum 16px */
  line-height: 1.4;
  min-height: 2.0em;         /* Make sure field fits font */
  padding: 0.375rem 0.75rem; /* Bootstrap defaults */
  box-sizing: border-box;
  width: 100%;
}

.login-form-container {
  max-width: 312px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}

#divHeader {
  display: flex;
  justify-content: flex-end;  /* content sticks to the right */
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 0 8px;
  box-sizing: border-box;
}

/* Fix centrage login après rotation */
#WebPageControl_Main_Identification > div {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
}
