@import url("style.css");

/*********************************************/
/****************** Admin *********************/
/*********************************************/
body {
  margin: 0;
  padding: 0;
}

.login-page {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 100vh;
  background-color: #f5f5f5;
  font-size: 2rem;
}
/* Formulaire de connexion */
.login-page h1 {
  margin-bottom: 30px;
  text-align: center;
  font-size: 5rem;
}

.login-page .admin-form {
  width: 100%;
  max-width: 510px;
  padding: 30px;
}

.login-page .admin-form label {
  margin-top: 15px;
  margin-bottom: 8px;
  font-size: 3rem;
}

.login-page .admin-form input {
  margin-bottom: 15px;
  font-size: 3rem;
}

.login-page .admin-form button {
  margin-top: 10px;
  font-size: 3rem;
}

.login-page p {
  text-align: center;
  margin-top: 15px;
}

/****** Header admin ******/
.admin-header {
  background-color: #fff;
  border-bottom: 2px solid #929292;
  padding: 20px 0;
  text-align: center;
}

.admin-header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.admin-header h1 {
  font-size: 2.5rem;
  margin: 0;
  color: #000;
}

.admin-header p {
  margin: 0;
  color: #666;
  font-size: 1.2rem;
}

/****** Navigation admin ******/
.admin-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #fff;
  border-bottom: 1px solid #ddd;
  padding: 0 20px;
  gap: 0;
}

.admin-nav a {
  padding: 12px 20px;
  font-size: 1.3rem;
  color: #000;
  border-bottom: 3px solid transparent;
  position: relative;
}

.admin-nav a:hover {
  background-color: #f0f0f0;
  border-bottom-color: #929292;
}

.admin-nav a.active {
  border-bottom-color: #000;
  font-weight: bold;
}

.admin-nav a.logout {
  margin-left: auto;
  background: #a33;
  color: #fff;
  padding: 8px 16px;
  border-radius: 4px;
  font-size: 1.3rem;
  cursor: pointer;
  font-family: "Montserrat", sans-serif;
}

.admin-nav a.logout:hover {
  background: #922;
  border-bottom-color: transparent;
}

/****** Contenu ******/
.admin-content {
  margin: 50px auto;
  padding: 0 20px;
}

.admin-content h1 {
  font-size: 4rem;
  margin: 0 0 20px 0;
}

.admin-content h2 {
  font-size: 3rem;
}

.admin-section {
  display: flex;
  flex-direction: column;
  width: 100%;
  gap: 20px;
}

/****** Footer admin ******/
.admin-footer {
  text-align: center;
  padding: 30px 20px;
  color: #999;
  font-size: 1.1rem;
  border-top: 1px solid #ddd;
  margin-top: 60px;
}

/*********************************************/
/****************** Formulaires ***************/
/*********************************************/
.admin-form {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 10px;
  margin: 5px 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.admin-form fieldset {
  border: none;
  padding: 0;
}

.admin-form label {
  display: block;
  margin-bottom: 8px;
  font-size: 1.3rem;
  font-weight: 600;
  color: #333;
}

.admin-form input[type="text"],
.admin-form input[type="password"],
.admin-form input[type="file"],
.admin-form textarea {
  width: 100%;
  padding: 10px 12px;
  margin-bottom: 5px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-family: "Montserrat", sans-serif;
  font-size: 1.3rem;
  box-sizing: border-box;
}

.admin-form input[type="number"] {
  width: 100%;
  padding: 10px 12px;
  margin-bottom: 20px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-family: "Montserrat", sans-serif;
  font-size: 1.3rem;
  box-sizing: border-box;
}

.admin-form input[type="text"]:focus,
.admin-form input[type="password"]:focus,
.admin-form input[type="file"]:focus,
.admin-form input[type="number"]:focus,
.admin-form textarea:focus {
  outline: none;
  border-color: #929292;
  box-shadow: 0 0 0 2px rgba(146, 146, 146, 0.1);
}

.admin-form textarea {
  resize: vertical;
  min-height: 120px;
}

.admin-form button,
.horaire-form button {
  background: #000;
  color: #fff;
  border: none;
  padding: 12px 32px;
  border-radius: 4px;
  font-family: "Montserrat", sans-serif;
  font-size: 1.3rem;
  cursor: pointer;
}

.admin-form button:hover {
  background: #333;
  transform: translateY(-2px);
}

.admin-form button:active {
  transform: translateY(0);
}

.admin-form button.secondary {
  background: #999;
  margin-left: 10px;
}

.admin-form button.secondary:hover {
  background: #777;
}

.admin-form button.delete {
  background: #a33;
}

.admin-form button.delete:hover {
  background: #922;
}

.add-button {
  background: #000;
  color: #fff;
  border: none;
  padding: 12px 32px;
  border-radius: 4px;
  font-family: "Montserrat", sans-serif;
  font-size: 1.3rem;
  cursor: pointer;
}

.add-button:hover {
  background: #333;
  transform: translateY(-2px);
}

/*********************************************/
/****************** Alertes *******************/
/*********************************************/
.alert-success {
  background: #e6f4ea;
  color: #1e5b2f;
  border: 4px solid #1e5b2f;
  padding: 15px 20px;
  border-radius: 4px;
  margin-bottom: 25px;
  font-size: 1.3rem;
}

.alert-error {
  background: #fbe7e7;
  color: #a33;
  border: 4px solid #a33;
  padding: 15px 20px;
  border-radius: 4px;
  margin-bottom: 25px;
  font-size: 1.3rem;
}

.alert-warning {
  background: #fff3cd;
  color: #856404;
  border-left: 4px solid #856404;
  padding: 15px 20px;
  border-radius: 4px;
  margin-bottom: 25px;
  font-size: 1.3rem;
}

/*********************************************/
/****************** Tables ********************/
/*********************************************/
.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  margin: 20px 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.admin-table th,
.admin-table td {
  padding: 15px;
  text-align: left;
  border-bottom: 1px solid #eee;
  font-size: 1.3rem;
}

.admin-table th {
  background-color: #f9f9f9;
  border-bottom: 2px solid #929292;
  font-family: "Potra", sans-serif;
  font-weight: normal;
  color: #333;
}

.admin-table tbody tr:hover {
  background-color: #f5f5f5;
}

.admin-table img {
  width: 70px;
  height: 70px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid #ddd;
}

.admin-table .actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.admin-table .actions a,
.admin-table .actions button {
  font-size: 1.2rem;
  padding: 6px 12px;
  border-radius: 3px;
  text-decoration: none;
  cursor: pointer;
  border: none;
}

.admin-table .actions .edit {
  background: #f0f0f0;
  color: #000;
}

.admin-table .actions .edit:hover {
  background: #929292;
  color: #fff;
}

.admin-table .actions .delete {
  background: #fbe7e7;
  color: #a33;
}

.admin-table .actions .delete:hover {
  background: #a33;
  color: #fff;
}

.admin-table .actions .view {
  background: #e6f4ea;
  color: #1e5b2f;
}

.admin-table .actions .view:hover {
  background: #1e5b2f;
  color: #fff;
}

/*********************************************/
/************** Upload Media ******************/
/*********************************************/
.admin-media-preview {
  background: #f9f9f9;
  border: 2px dashed #ccc;
  border-radius: 4px;
  padding: 30px;
  text-align: center;
  margin-bottom: 25px;
}

.admin-media-preview:hover {
  border-color: #929292;
  background: #f0f0f0;
}

.admin-media-preview video,
.admin-media-preview img {
  max-width: 100%;
  max-height: 300px;
  border-radius: 4px;
  margin: 15px 0;
}

.admin-file-input {
  position: relative;
  overflow: hidden;
  display: inline-block;
}

.admin-file-input input[type="file"] {
  position: absolute;
  left: -9999px;
}

/*********************************************/
/************** Cards *************************/
/*********************************************/
.admin-card {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  padding: 25px;
  margin-bottom: 25px;
  width: 100%;
  display: flex;
  flex-direction: column;
}

.admin-card h3 {
  margin-top: 0;
}

.admin-card h3 span {
  background-color: #f9f9f9;
  padding-left: 0px;
  padding-right: 15px;
}

.admin-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin: 30px 0;
}

/*********************************************/
/************** Collone *********************/
/*********************************************/

.col {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  gap: 20px;
  align-items: stretch;
}

.col .admin-card .admin-form {
  flex: 1;
}

/*********************************************/
/************** Admin Team *********************/
/*********************************************/

.team figure {
  position: relative;
  /* RETIRE width: 25%; */
  flex: 0 0 calc(25% - 8px); /* ← Change ça */
  padding: 8px;
}

.team figure img {
  width: 100%;
  height: auto;
  display: block;
}

.team-header {
  margin-bottom: 30px;
}

.team-header button {
  background: #000;
  color: #fff;
  border: none;
  padding: 12px 32px;
  border-radius: 4px;
  font-family: "Montserrat", sans-serif;
  font-size: 1.3rem;
  cursor: pointer;
}

.team-header button:hover {
  background: #333;
  transform: translateY(-2px);
}

/* Boutons admin sur les figures */
.team figure .admin-actions {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  justify-content: space-between;
  width: 92%;
  z-index: 10;
  padding: 5px;
  border-radius: 0 0 4px 4px;
  opacity: 0;
  transition: opacity 0.3s;
}

.team figure:hover .admin-actions {
  opacity: 1;
}

.team figure .admin-actions button {
  padding: 6px 12px;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  font-size: 1.2rem;
  transition: all 0.2s;
}

.team figure .admin-actions .edit {
  background: #ecbe8a;
  color: #000;
}

.team figure .admin-actions .edit:hover {
  background: #929292;
  color: #fff;
}

.team figure .admin-actions .delete {
  background: #df9f9f;
  color: #a33;
}

.team figure .admin-actions .delete:hover {
  background: #a33;
  color: #fff;
}

/* Modal */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 10000;
  align-items: center;
  justify-content: center;
}

.modal-overlay.active {
  display: flex;
}

.modal-content {
  background: #fff;
  padding: 30px;
  border-radius: 4px;
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-content h2 {
  margin-top: 0;
  font-family: "Potra", sans-serif;
  font-size: 2.2rem;
}

.photo-preview {
  margin-bottom: 15px;
  text-align: center;
}

.photo-preview img {
  max-width: 200px;
  max-height: 200px;
  border-radius: 4px;
  border: 1px solid #ddd;
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 25px;
}

.modal-actions button {
  flex: 1;
  padding: 12px;
  border: none;
  border-radius: 4px;
  font-family: "Montserrat", sans-serif;
  font-size: 1.3rem;
  cursor: pointer;
  transition: all 0.2s;
}

.modal-actions .save {
  background: #000;
  color: #fff;
}

.modal-actions .save:hover {
  background: #333;
  transform: translateY(-2px);
}

.modal-actions .cancel {
  background: #999;
  color: #fff;
}

.modal-actions .cancel:hover {
  background: #777;
  transform: translateY(-2px);
}

.modal-actions .delete {
  background: #a33;
  color: #fff;
}

.modal-actions .delete:hover {
  background: #922;
  transform: translateY(-2px);
}

.team-spacer {
  width: 25%;
  padding: 8px;
}

/* ===== HORAIRES ===== */
.admin-horaires {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.horaire-card {
  border: 2px solid #ddd;
  border-radius: 8px;
  padding: 1.5rem;
  background: #f9f9f9;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.horaire-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group label {
  font-weight: bold;
  color: #555;
}

.form-group input[type="time"] {
  padding: 0.75rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 1.5rem;
}

.btn-primary {
  background: #007bff;
  color: white;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
  transition: background 0.3s;
}

.btn-primary:hover {
  background: #0056b3;
}

.horaire-preview {
  margin-top: 1rem;
  padding: 1rem;
  background: white;
  border-left: 4px solid #28a745;
  border-radius: 4px;
  color: #555;
  font-size: larger;
}

/*********************************************/
/***************** Dashboard *****************/
/*********************************************/
.dashboard-section {
  margin-top: 40px;
  padding: 20px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}

.stat-card {
  background: #f9f9f9;
  border-radius: 8px;
  border: 2px solid #e0e0e0;
  padding: 10px;
}

.stat-number {
  font-size: 2rem;
  font-weight: bold;
}

.stat-card h3::after {
  display: none;
}

.devices-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.device-card {
  display: flex;
  flex-direction: column;
  text-align: center;
  padding: 20px;
  background: #f9f9f9;
  border-radius: 8px;
  border: 2px solid #e0e0e0;
}

.stat-content h3 span {
  padding: 0 15px;
}

.device-emoji {
  font-size: 40px;
  margin-bottom: 10px;
}

.device-card h3 {
  margin: 10px 0 5px 0;
}

.device-nombre {
  font-weight: bold;
  color: #333;
  margin: 15px 0 5px 0;
}

.device-pourcentage {
  color: #667eea;
  font-weight: bold;
  margin: 5px 0;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: #e0e0e0;
  border-radius: 4px;
  margin-top: 10px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #667eea, #764ba2);
  transition: width 0.3s ease;
}

.section-list {
  list-style: none;
  padding: 0;
  margin-top: 15px;
}

.section-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px;
  border-bottom: 1px solid #e0e0e0;
  background: #f9f9f9;
  margin-bottom: 5px;
  border-radius: 4px;
}

.section-item:last-child {
  border-bottom: none;
}

.section-name {
  font-size: 1.5rem;
  font-weight: bold;
  color: #333;
}

.section-visites {
  background: #667eea;
  color: white;
  padding: 5px 15px;
  border-radius: 20px;
  font-size: 14px;
}
