/* ====================================================
   GALERIES PAGE - STYLES MINIMALISTES
   ==================================================== */

/* Galeries Grid */
.galeries-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 25px;
  padding: 60px 30px;
  max-width: 1400px;
  margin: 0 auto;
}

.galery-item {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  background: white;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  cursor: pointer;
  aspect-ratio: 4/3;
}

.galery-item:hover {
  transform: scale(1.03);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.galery-item-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.galery-item:hover .galery-item-img {
  transform: scale(1.05);
}

/* Lightbox */
.glightbox {
  text-decoration: none;
}

.photo-lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.95);
}

.lightbox-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  cursor: pointer;
}

.lightbox-container {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.lightbox-img {
  max-width: 100%;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.lightbox-close {
  position: absolute;
  top: -40px;
  right: 0;
  background: none;
  border: none;
  color: white;
  font-size: 30px;
  cursor: pointer;
  padding: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s;
  z-index: 10001;
}

.lightbox-close:hover {
  transform: scale(1.2);
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  font-size: 50px;
  cursor: pointer;
  padding: 10px 20px;
  border-radius: 5px;
  transition: all 0.3s;
  z-index: 10001;
}

.lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.4);
  transform: translateY(-50%) scale(1.1);
}

.lightbox-prev {
  left: 20px;
}

.lightbox-next {
  right: 20px;
}

.lightbox-counter {
  position: absolute;
  bottom: -40px;
  left: 50%;
  transform: translateX(-50%);
  color: white;
  font-size: 14px;
  white-space: nowrap;
}

@media (max-width: 768px) {
  .lightbox-nav {
    font-size: 35px;
    padding: 8px 15px;
  }

  .lightbox-prev {
    left: 10px;
  }

  .lightbox-next {
    right: 10px;
  }

  .lightbox-close {
    top: -35px;
    font-size: 25px;
  }

  .lightbox-counter {
    bottom: -35px;
    font-size: 12px;
  }
}

@media (max-width: 480px) {
  .lightbox-close {
    top: 10px;
    right: 10px;
  }

  .lightbox-nav {
    font-size: 28px;
    padding: 6px 10px;
  }

  .lightbox-counter {
    bottom: 10px;
    left: 10px;
    transform: none;
  }
}

/* Admin Access Link (discreet) */
.admin-access {
  text-align: right;
  padding-top: 15px;
}

.admin-access a {
  color: rgba(255, 255, 255, 0.5) !important;
  font-size: 11px;
  text-decoration: none;
  transition: color 0.3s ease;
}

.admin-access a:hover {
  color: rgba(255, 255, 255, 0.8) !important;
}

/* Admin Modal Styles */
.modal-content {
  border-radius: 10px;
}

.modal-header {
  background-color: var(--accent-color);
  color: white;
}

.modal-header .btn-close {
  filter: brightness(0) invert(1);
}

.modal-title {
  font-weight: 700;
}

#password-form {
  padding: 20px;
  background-color: #ffffff;
  border-radius: 8px;
  border: 1px solid #e0e0e0;
  border-left: 4px solid var(--accent-color);
}

#admin-panel h6 {
  color: var(--accent-color);
  font-weight: 700;
  margin-bottom: 15px;
}

/* Upload Form */
#upload-form {
  background: #ffffff;
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 20px;
  border: 1px solid #e0e0e0;
}

#upload-form .form-label {
  font-weight: 600;
  color: #333;
}

#upload-form .form-control {
  border-radius: 5px;
  border-color: #ddd;
}

#upload-form .form-control:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 0.2rem rgba(75, 138, 48, 0.25);
}

#upload-form .btn-success {
  background-color: var(--accent-color);
  border-color: var(--accent-color);
  font-weight: 600;
}

#upload-form .btn-success:hover {
  background-color: #3e6b24;
  border-color: #3e6b24;
}

/* Photos List */
.list-group-item {
  border-radius: 5px;
  margin-bottom: 10px;
  padding: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.photo-info {
  flex: 1;
}

.photo-info h6 {
  margin: 0 0 5px 0;
  color: var(--accent-color);
  font-weight: 600;
}

.photo-info small {
  display: block;
  color: #666;
  margin-top: 3px;
}

.delete-btn {
  background-color: #dc3545;
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 12px;
  transition: background-color 0.3s;
}

.delete-btn:hover {
  background-color: #c82333;
}

/* Video Badge */
.video-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background-color: rgba(75, 138, 48, 0.9);
  color: white;
  padding: 8px 12px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 600;
  z-index: 100;
}

/* Video in Lightbox */
.lightbox-video {
  max-width: 100%;
  max-height: 85vh;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

/* Responsive for Large Desktop (1201px+) */
@media (min-width: 1201px) {
  .galeries-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    padding: 60px 40px;
  }
}

/* Responsive for Desktop/Tablet (993px - 1200px) */
@media (max-width: 1200px) and (min-width: 993px) {
  .galeries-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    padding: 50px 30px;
  }

  .lightbox-nav {
    font-size: 45px;
    padding: 10px 18px;
  }

  .lightbox-close {
    font-size: 28px;
  }
}

/* Responsive for Tablet (769px - 992px) */
@media (max-width: 992px) {
  .galeries-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
    padding: 40px 25px;
  }

  .galery-item {
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.06);
  }

  .lightbox-nav {
    font-size: 40px;
    padding: 9px 16px;
  }

  .lightbox-close {
    top: -35px;
    font-size: 26px;
  }

  .lightbox-counter {
    bottom: -35px;
    font-size: 13px;
  }

  .list-group-item {
    flex-wrap: wrap;
    gap: 10px;
  }

  .photo-preview-container {
    flex-shrink: 0;
  }

  .delete-btn {
    align-self: flex-end;
  }
}

/* Responsive for Small Tablet/Large Mobile (577px - 768px) */
@media (max-width: 768px) {
  .galeries {
    margin-top: 70px;
  }

  .galeries-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    padding: 35px 15px;
  }

  .galery-item {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  }

  .galery-item:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  }

  .lightbox-container {
    max-width: 95vw;
    max-height: 85vh;
  }

  .lightbox-img {
    max-height: 80vh;
  }

  .lightbox-video {
    max-height: 80vh;
  }

  .lightbox-nav {
    font-size: 36px;
    padding: 8px 14px;
  }

  .lightbox-prev {
    left: 12px;
  }

  .lightbox-next {
    right: 12px;
  }

  .lightbox-close {
    top: -32px;
    right: -5px;
    font-size: 24px;
  }

  .lightbox-counter {
    bottom: -32px;
    font-size: 12px;
  }

  #password-form {
    padding: 15px;
    font-size: 14px;
  }

  #upload-form {
    padding: 15px;
  }

  .modal-body {
    padding: 15px;
  }

  .list-group-item {
    padding: 10px;
    flex-direction: column;
    align-items: flex-start;
  }

  .photo-preview-container {
    width: 100%;
    margin-bottom: 8px;
  }

  .photo-thumbnail {
    width: 50px;
    height: 50px;
  }

  .delete-btn {
    width: 100%;
    padding: 8px 10px;
  }
}

/* Responsive for Mobile Phones (420px - 576px) */
@media (max-width: 576px) {
  .galeries {
    margin-top: 65px;
  }

  .galeries-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
    padding: 25px 10px;
  }

  .galery-item {
    aspect-ratio: 4/3;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
  }

  .galery-item:hover {
    transform: scale(1.015);
  }

  .lightbox-close {
    top: 12px;
    right: 12px;
    font-size: 22px;
    position: fixed;
  }

  .lightbox-nav {
    font-size: 32px;
    padding: 6px 12px;
  }

  .lightbox-prev {
    left: 8px;
  }

  .lightbox-next {
    right: 8px;
  }

  .lightbox-counter {
    position: fixed;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 11px;
  }

  .lightbox-container {
    max-width: 100vw;
    max-height: 90vh;
  }

  .lightbox-img,
  .lightbox-video {
    max-height: 75vh;
  }

  #password-form {
    padding: 12px;
    font-size: 13px;
    border-left: 3px solid var(--accent-color);
  }

  #upload-form {
    padding: 12px;
    margin-bottom: 15px;
  }

  #upload-form .form-label {
    font-size: 13px;
    margin-bottom: 5px;
  }

  .modal-body {
    padding: 12px;
  }

  .modal-title {
    font-size: 18px;
  }

  .list-group-item {
    padding: 8px;
    gap: 8px;
  }

  .photo-thumbnail {
    width: 45px;
    height: 45px;
    flex-shrink: 0;
  }

  .photo-info h6 {
    font-size: 13px;
    margin: 0;
  }

  .delete-btn {
    width: 100%;
    padding: 6px 8px;
    font-size: 11px;
  }

  .video-badge {
    top: 6px;
    right: 6px;
    padding: 5px 10px;
    font-size: 10px;
  }
}

/* Responsive for Small Mobile (<420px) */
@media (max-width: 420px) {
  .galeries {
    margin-top: 60px;
    padding: 0 !important;
  }

  .galeries-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    padding: 15px 8px;
    max-width: 100%;
  }

  .galery-item {
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
  }

  .galery-item:hover {
    transform: scale(1.01);
  }

  .lightbox-close {
    top: 10px;
    right: 10px;
    font-size: 20px;
  }

  .lightbox-nav {
    font-size: 28px;
    padding: 5px 10px;
  }

  .photo-lightbox {
    background: rgba(0, 0, 0, 0.98);
  }

  .lightbox-counter {
    font-size: 10px;
    bottom: 10px;
  }

  .modal {
    --bs-modal-margin: 10px;
  }

  .modal-dialog {
    max-width: calc(100vw - 20px);
  }

  .modal-content {
    border-radius: 8px;
  }

  #password-form,
  #upload-form {
    padding: 10px;
    font-size: 12px;
  }

  #upload-form .form-label {
    font-size: 12px;
  }

  .photo-thumbnail {
    width: 40px;
    height: 40px;
  }

  .photo-info h6 {
    font-size: 12px;
  }

  .delete-btn {
    padding: 5px 8px;
    font-size: 10px;
  }

  .video-badge {
    padding: 4px 8px;
    font-size: 9px;
  }
}

/* Page Body - Élimination des espaces blancs */
html, body {
  margin: 0 !important;
  padding: 0 !important;
  height: 100%;
  overflow-x: hidden;
  background-color: #444444 !important;
}

.galeries-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  margin: 0 !important;
  padding: 0 !important;
  background-color: #444444 !important;
}

.galeries-page .main {
  flex: 1 0 auto;
  margin: 0;
  padding: 0;
  background-color: #444444 !important;
}

/* Galeries Section */
.galeries {
  background-color: #444444;
  padding: 0 !important;
  margin-top: 80px;
  margin-bottom: 0 !important;
}

/* Footer sans blanc en dessous */
#footer {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
  flex-shrink: 0;
}

.footer-top {
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
}

.copyright {
  padding-bottom: 30px !important;
  margin-bottom: 0 !important;
}

/* Prévisualisation photos admin */
.photo-thumbnail {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 5px;
  margin-right: 10px;
}

.photo-preview-container {
  display: flex;
  align-items: center;
}
