/* Variables de couleurs */
:root {
    --primary-color: #3498db; /* Bleu */
    --primary-dark: #2980b9;
    --secondary-color: #f1c40f; /* Jaune */
    --accent-color: #e74c3c; /* Rouge */
    --background-light: #ecf0f1; /* Gris clair */
    --text-color: #2c3e50; /* Gris foncé */
    --box-shadow-color: rgba(0,0,0,0.1);
    --border-color: #ddd;
}

/* Styles généraux du corps et du conteneur principal */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--background-light);
    color: var(--text-color);
    line-height: 1.6;
    margin: 0;
    padding: 20px;
    display: flex;
    justify-content: center;
}

.container {
    max-width: 1000px;
    width: 100%;
    background: #fff;
    padding: 20px 40px; /* Plus de padding pour un effet aéré */
    border-radius: 12px;
    box-shadow: 0 4px 20px var(--box-shadow-color);
    box-sizing: border-box;
}

/* Styles pour les titres et les sections */
h1, h2 {
    color: var(--text-color);
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 10px;
    text-align: center;
    font-weight: 500;
}

/* Styles du logo */
.logo {
    display: block;
    margin: 0 auto 20px;
    max-width: 100%; /* Le logo s'ajuste à la largeur du conteneur */
    height: auto;
}

/* Styles du formulaire */
input[type="text"],
input[type="password"],
input[type="file"],
select {
    width: 100%;
    padding: 12px;
    margin: 8px 0;
    box-sizing: border-box;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 30px;
    transition: border-color 0.3s ease-in-out;
}

input[type="text"]:focus, select:focus {
    border-color: var(--primary-color);
    outline: none;
}

button {
    background-color: var(--primary-color);
    color: white;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 60px;
    margin-right: 10px;
    transition: background-color 0.3s ease-in-out, transform 0.2s ease-in-out;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}
button2 {
    background-color: var(--primary-color);
    color: white;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 20px;
    margin-right: 10px;
    transition: background-color 0.3s ease-in-out, transform 0.2s ease-in-out;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

/* Centrer le bouton "Soumettre une photo" */
#toggle-form-btn {
    display: block;
    margin: 20px auto;
}

button:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(0,0,0,0.15);
}

/* Style spécifique pour le bouton d'édition (sur la page admin.php) */
.btn-edit {
    background-color: var(--secondary-color);
    color: white;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    transition: background-color 0.3s ease-in-out, transform 0.2s ease-in-out;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.btn-edit:hover {
    background-color: #d8ad1d;
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(0,0,0,0.15);
}

/* Styles des messages d'information et d'erreur */
.message {
    padding: 12px;
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    border-radius: 8px;
    margin-bottom: 20px;
    font-weight: bold;
}

.message.error {
    background-color: #f8d7da;
    color: #721c24;
    border-color: #f5c6cb;
}

/* Styles pour la grille d'images */
.image-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.image-item {
    background: #fff;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 2px 8px var(--box-shadow-color);
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
}

.image-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.2);
}

.image-item a {
    cursor: pointer;
    display: block;
    width: 100%;
}

.image-item img {
    margin-bottom: 10px;
    border-radius: 6px;
    width: 100%;
    height: 250px; /* Hauteur fixe pour les miniatures */
    object-fit: cover;
    display: block;
}

.image-item h3, .image-item p {
    margin: 5px 0 0;
}

/* Styles pour la lightbox (zoom) */
.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.lightbox-image {
    max-width: 90%;
    max-height: 90%;
    border: 8px solid white;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    object-fit: contain;
}

/* Styles pour le modal/popup du formulaire */
.modal {
    position: fixed;
    z-index: 1001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.6);
    display: none;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: #fff;
    margin: 15% auto;
    padding: 30px;
    border: 1px solid #888;
	font-size: 30px;
    width: 90%;
    max-width: 800px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    position: relative;
    animation-name: animatetop;
    animation-duration: 0.4s;
}

@keyframes animatetop {
    from {top: -300px; opacity: 0}
    to {top: 0; opacity: 1}
}

.close-btn {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
}

.close-btn:hover,
.close-btn:focus {
    color: #000;
    text-decoration: none;
    cursor: pointer;
}

/* Media Queries pour le Responsive Design */
@media (max-width: 900px) {
    body {
        padding: 10px;
    }
    
    .container {
        padding: 10px 20px;
    }

    h1, h2 {
        font-size: 24px;
        text-align: left;
    }
    
    .logo {
        max-width: 120px; /* Ajuster la taille du logo sur mobile si nécessaire */
    }

    .image-grid {
        grid-template-columns: 1fr;
    }

    .image-item img {
        height: auto;
        width: 100%;
    }

    button, input[type="text"], input[type="password"], input[type="file"], select {
        font-size: 14px;
        padding: 10px;
    }

    .modal-content {
        width: 95%;
        margin: 5% auto;
        padding: 20px;
    }

    .image-item h3, .image-item p {
        margin: 5px 0 5px;
    }
    
    .btn-edit {
        display: block;
        width: 100%;
        margin: 10px 0 0;
    }
}