/* Reset simple */
/* * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #f5f5f5;
    color: #333;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
} */

/* .header {
    background: #1c1f3b;
    color: #fff;
    padding: 1rem 1.5rem;
    text-align: center;
}*/

.main-container {
    flex: 1;
    padding: 1rem;
    position: relative;
    max-width: 1440px;
    margin: 0 auto;
}

/* **************** */
.carousel-track {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    grid-auto-rows: 240px;
	margin-bottom: 140px;
}

/* .carousel-track {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
} */

.gallery-item {
  display: flex;
  justify-content: center;
  align-items: center;
 /*  background: #353535 url("https://picsum.photos/id/564/1200/800") center /
    cover no-repeat; */
  font-size: 3rem;
  color: #fff;
  box-shadow:
    rgba(3, 8, 20, 0.1) 0px 0.15rem 0.5rem,
    rgba(2, 8, 20, 0.1) 0px 0.075rem 0.175rem;
  height: 100%;
  width: 100%;
  border-radius: 4px;
  transition: all 500ms;
  overflow: hidden;
  padding: 0;
  margin: 0;
}

/* .gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    box-shadow: var(--shadow);
    transition: var(--transition);
    background-color: var(--card-bg);
} */

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

/* .gallery-img {
    width: auto;
    height: 100%;
    object-fit: fill;
} */

/*.gallery-img {
    width: 100%;
    height: auto;
    object-fit: cover;
     width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
    transition: var(--transition); 
}*/

.gallery-item:hover .gallery-img {
    transform: scale(1.05);
}

.image-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
    padding: 15px;
    color: white;
    transform: translateY(100%);
    transition: var(--transition);
}

.gallery-item:hover .image-overlay {
    transform: translateY(0);
}

.image-title {
    font-size: 1rem;
    margin-bottom: 5px;
}

.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: var(--text-light);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
    margin-bottom: 10px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}


/* Carrousel */

 .carousel-section h2 {
    margin-bottom: 1rem;
    text-align: center;
}

.carousel-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.carousel-viewport {
    overflow: hidden;
    flex: 1;
}

/* .carousel-track {
    display: flex;
    transition: transform 0.3s ease;
} */

/* 6 vignettes par "page" sur grand écran => largeur = 1/6 */
.carousel-item {
    width: calc(100% / 6);
    padding: 0.25rem;
}

.carousel-item-inner {
    background: #fff;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
}

.carousel-img-wrapper {
    width: 100%;
    padding-top: 75%; /* ratio 4/3 */
    position: relative;
    background: #ddd;
}

.carousel-img-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.carousel-text {
  /* overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap; */
  overflow: auto;
  overflow-wrap: break-word;
  padding: 0.5rem;
  font-size: 0.8rem;
  color: black;
}

/* Navigation boutons */
.nav-btn {
    background: #1c1f3b;
    color: #fff;
    border: none;
    border-radius: 999px;
    width: 36px;
    height: 36px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
}
.nav-btn:disabled {
    opacity: 0.3;
    cursor: default;
}

/* Bouton + flottant centré en bas */
.add-btn {
    position: fixed;
    left: 50%;
    bottom: 5.2rem;
    transform: translateX(-50%);
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: none;
    background: #1c87c9;
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(0,0,0,0.3);
    z-index: 20;
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 50;
}

.modal-overlay.active {
    display: flex;
}

#msgModal {
    background: #fff;
    border-radius: 8px;
    padding: 1rem 1.2rem 1.5rem;
    max-width: 500px;
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 0.5rem;
    right: 0.7rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
}

#msgModal h2 {
    margin-bottom: 0.8rem;
}

#msgModal h3 {
    margin: 0.8rem 0 0.4rem;
}

/* Formulaire */
.form-group {
    margin-bottom: 0.7rem;
}
.form-group label {
    font-size: 0.9rem;
    display: block;
    margin-bottom: 0.25rem;
}
.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    border-radius: 4px;
    border: 1px solid #c2c2c2;
    padding: 0.4rem;
    font-size: 0.9rem;
}

#takePhoto {
    text-align: center;
    font-size: 36px;
    cursor: pointer;
}

#photo-button {
	display: block;
	text-align: center;
}

.radio-group {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    font-size: 0.9rem;
}

.form-actions {
    margin-top: 0.8rem;
    text-align: right;
}

.radio-group input {
    width: 10%;
    vertical-align: text-bottom;
}

.form-actions button {
    padding: 0.5rem 1rem;
    border-radius: 4px;
    border: none;
    background: #1c87c9;;
    color: #fff;
    cursor: pointer;
}

/* Vidéo et canvas */
#video, #msgCanvas {
    display:inline-block;
	position: relative;
	left: 50%;
	transform: translateX(-50%);
	width: 100%;
    height: 178px; /*150px;*/
    border-radius: 6px;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
    background: #000;
    margin-bottom: 0.5rem;
}

/* Utilitaires */
.hidden {
    display: none !important;
}

/* Responsive */

@media (max-width: 1024px) {
    /* tablette : 4 par page */
    .carousel-item {
        width: calc(100% / 4);
    }
}

@media (max-width: 650px) {
    /* mobile : 2 par page */
    .carousel-track {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }

    .carousel-wrapper {
        gap: 0.25rem;
    }

    .nav-btn {
        width: 30px;
        height: 30px;
    }

    .carousel-item {
        width: calc(100% / 2);
    }

    .add-btn {
        width: 56px;
        height: 56px;
        font-size: 1.8rem;
    }
	
	.modal-close {
		top: 1.2rem;
		right: 0.7rem;
	}
}
