/* Styles généraux */
body {
    font: normal normal normal 20px/1.4em 'chelsea market', fantasy;
    display: grid;
    grid-template-rows: auto auto 1fr auto;
    min-height: 100vh;
    margin: 0;
    padding: 0
}

.flex-col {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.flex-row {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
}

main {
    position: relative; /* Nécessaire pour le positionnement absolu du pseudo-élément */
    overflow-y: hidden;
    overflow-x: hidden;
    padding: 0;
    /* On retire les propriétés de background du main */
}

main::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: -1;

    /* Propriétés du background */
    background-image: url(../images/img_base/font.png);
    background-attachment: fixed;
    background-position: center;
    background-repeat: repeat;
    background-size: contain;

    opacity: 0.5;


}

/* Header */
header {
    background-color: #1d4568;
    color: white;
    padding: 20px;
    text-align: center
}

header img {
    width: 200px
}

/* Navigation */
nav {
    align-items: center;
    background-color: #264b7a;
    display: flex;
    justify-content: center;
    overflow: hidden;
    text-align: center
}

nav a, .current-page {
    color: white;
    display: inline-block;
    padding: 14px 20px;
    text-decoration: none;

}

nav a:hover, .current-page:hover {
    background-color: #1a3b60;
    cursor: pointer;
}

nav > span {
    align-items: center;
    display: flex;
    justify-content: center;
    width: 50px
}

/*souligne la page en cours*/
.page {
    text-decoration: underline
}

.panier {
    width: 50px
}

.panier-container {
    margin-top: 10px;
    text-align: center;
    position: relative;
}

#panier-bulle {
    position: absolute; /* Keep as absolute */
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%); /* Centers the element */
    /* You may need to adjust z-index to ensure it's above the image */
    z-index: 1; /* Or a higher value if needed */
}

/* Section principale */

.lien_s {
    text-decoration: none
}

.main-section {
    padding: 50px;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.main-section h1 {
    color: #1d4568;
    font-size: 2.5em
}

/* Icones */
.icons {
    display: flex;
    justify-content: space-between;
    margin: 30px 90px;
    width: 70vw;
    /*90vw quand boutique */
}

.icons div {
    margin: 0 15px;
    text-align: center
}

.icons img {
    display: block;
    height: 100px;
    margin: 0 auto 10px;
    width: 100px
}

/* Contenu texte */
.content p {
    line-height: 1.6;
    margin: 20px 0
}

.content hr {
    border-top: 1px solid #ccc;
    border: 0;
    margin: 30px auto;
    width: 80%
}


/* Footer */
footer {
    background-color: #1d4568;
    color: white;
    padding: 20px;
    position: relative;
    text-align: center
}

footer img {
    margin: 0 10px;
    width: 24px
}

footer a {
    color: white;
    text-decoration: none
}

button {
    background: linear-gradient(to bottom, #66ccff, #3399ff);
    border-radius: 10px;
    border: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    color: white;
    cursor: pointer;
    display: inline-block;
    font-size: 16px;
    padding: 10px 20px;
    text-align: center;
    text-decoration: none;
    transition: background 0.3s ease
}

button:hover {
    background: linear-gradient(to bottom, #3399ff, #0066cc)
}

#img_accueil {
    width: 592px
}

#ndpart {
    align-items: center;
    display: flex;
    gap: 50px;
    justify-content: center
}

#menu-toggle,
#menu-close {
    display: none
}

#menu-items {
    display: flex;
    flex-direction: row
}

textarea {
    max-height: 30vh;
    max-width: 75vw;
    min-height: 50px;
    min-width: 10vw
}

/* Style pour le toaster */
#toast {
    background-color: hsl(218, 40%, 81%);
    border-radius: 5px;
    box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.2);
    color: white;
    font-size: 14px;
    left: 50%;
    padding: 10px 20px;
    position: fixed;
    top: 20px;
    transform: translateX(-50%);
    transition: opacity 0.5s ease, visibility 0.5s ease;
    visibility: hidden;
    z-index: 1000
}

/*apparition du message de lien copié */
#toast.show {
    opacity: 1;
    visibility: visible
}

.alert {
    color: red;
    font-size: xx-large;
    background: BLACK;
    margin: 5px;
    padding: 10px;
}

/* Responsive styles */
@media (max-width: 1200px) {

    /* Body */
    body {
        font-size: 16px
    }

    /* Header */
    header {
        padding: 15px
    }

    header img {
        width: 150px
    }

    /* Navigation */
    #menu-toggle {
        background: none;
        border: none;
        color: white;
        cursor: pointer;
        display: block;
        font-size: 24px;
        margin: 10px
    }

    #menu-items {
        background-color: #264b7a;
        display: none;
        flex-direction: column;
        left: 0;
        padding: 10px 0;
        position: absolute;
        top: 50px;
        width: 100%;
        z-index: 1000
    }

    /* Format téléphone disposition des items */
    #menu-items.show {
        display: flex
    }

    nav a {
        border-bottom: 1px solid #1a3b60;
        color: white;
        padding: 10px 15px;
        text-align: center
    }

    nav > span {
        width: 40px
    }

    .panier-container {
        margin-top: 10px;
        text-align: center;
        position: relative;
    }

    #panier-bulle {
        position: absolute; /* Keep as absolute */
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%); /* Centers the element */
        /* You may need to adjust z-index to ensure it's above the image */
        z-index: 1; /* Or a higher value if needed */
    }

    .panier {
        width: 40px
    }

    .nombre-articles-panier {
        background-color: red;
        border-radius: 50%;
        color: white;
        font-size: 14px;
        left: 10px;
        padding: 2px 6px;
        position: relative;
        top: -10px
    }

    /* Section principale */
    .main-section {
        padding: 20px
    }

    .main-section h1 {
        font-size: 2em
    }

    #img_accueil {
        max-width: 90vw
    }

    /* Icones */
    .icons {
        flex-direction: column;
        flex-wrap: wrap;
        margin: 20px auto
    }

    .icons div {
        margin: 10px 0
    }

    .icons img {
        height: 80px;
        width: 80px
    }

    /* Contenu */
    .content p {
        margin: 15px 0
    }

    .content hr {
        width: 90%
    }

    /* Footer */
    footer {
        padding: 15px
    }

    footer img {
        width: 20px
    }

    /* Boutons */
    button {
        font-size: 14px;
        padding: 8px 15px
    }

    /* Deuxième partie */
    #ndpart {
        flex-direction: column;
        gap: 20px
    }

    #menu-close {
        /* Masqué par défaut */

        align-self: flex-end;
        background: none;
        border: none;
        color: white;
        cursor: pointer;
        display: none;
        font-size: 24px;
        margin: 10px;
    }

    #menu-items.show #menu-close {
        /* Affiché seulement lorsque le menu est ouvert */
        display: block;
    }
}


/* MODAL */


/* styles/modals.css */
/* Style de base pour les modals */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(3px);
    animation: fadeIn 0.3s ease-out;
}

.modal-content {
    background-color: #f8f9fa;
    margin: 10% auto;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 500px;
    border: 1px solid #dee2e6;
    position: relative;
    animation: slideDown 0.3s ease-out;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Animation d'entrée */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Titre des modals */
.modal-content h2 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.5rem;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 10px;
}

/* Champs de formulaire */
.modal-content input[type="text"] {
    width: 100%;
    padding: 12px 15px;
    margin: 10px 0;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.modal-content input[type="text"]:focus {
    border-color: #4e73df;
    outline: none;
    box-shadow: 0 0 0 3px rgba(78, 115, 223, 0.1);
}

/* Boutons */
.modal-content div {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
    flex-direction: column;
    width: 90%;
    align-items: center;
}

.modal-content button {
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.modal-content button.close {
    background-color: #e9ecef;
    color: #495057;
}

.modal-content button.close:hover {
    background-color: #dee2e6;
}

.modal-content button#confirm-create,
.modal-content button#confirm-rename {
    background-color: #4e73df;
    color: white;
}

.modal-content button#confirm-create:hover,
.modal-content button#confirm-rename:hover {
    background-color: #3a56b0;
    transform: translateY(-1px);
}

/* Bouton de fermeture */
.modal-content .close {
    position: absolute;
    right: 15px;
    top: 15px;
    font-size: 1.5rem;
    font-weight: bold;
    color: #6c757d;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.modal-content .close:hover {
    color: #495057;
}

/* Responsive */
@media (max-width: 768px) {
    .modal-content {
        margin: 20% auto;
        width: 85%;
    }
}

@media (max-width: 480px) {
    .modal-content {
        padding: 15px;
    }

    .modal-content h2 {
        font-size: 1.3rem;
    }

    .modal-content input[type="text"] {
        padding: 10px 12px;
    }
}

/* ===== FULL VIEW STYLES ===== */
.carousel-full-view {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.close-full-view {
    position: absolute;
    top: 20px;
    right: 20px;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    z-index: 2001;
}

.full-view-content {
    width: 100%;
    height: calc(100% - 40px);
    overflow: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 20px;
    box-sizing: border-box;
}

.full-view-content img {
    max-width: 90%;
    max-height: 80vh;
    object-fit: contain;
}

.full-view-content iframe {
    width: 80%;
    height: 60vh;
    border: none;
}

/* ===== PAGINATION STYLES ===== */
.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin: 20px 0;
    padding: 10px;
}

.pagination-controls button {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.pagination-controls button:disabled {
    background-color: #95a5a6;
    cursor: not-allowed;
}

.pagination-controls button:hover:not(:disabled) {
    background-color: #2980b9;
}

#pageInfo {
    font-weight: 600;
    color: #2c3e50;
}

/* ===== TRAVAUX LIST STYLES ===== */
.travaux-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 2rem;
}

.travaux-item {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s;
}

.travaux-item:hover {
    transform: translateY(-5px);
}

.carousel-preview {
    position: relative;
    margin: 1rem 0;
    cursor: pointer;
    min-height: 200px;
    overflow: hidden;
}

.carousel-preview img,
.carousel-preview iframe {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.more-items,
.more-buttons {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 12px;
}

.buttons-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 1rem 0;
    position: relative;
    min-height: 60px;
}

.button-preview {
    flex: 1 0 calc(50% - 10px);
    min-width: 0;
    padding: 10px;
    font-size: 12px;
    background: #f8f9fa;
    border-radius: 4px;
}

#createur {
    text-align: end
}

#NomCreateur {
    color: black !important;
    text-decoration: underline;
}

/* ===== LIGHTBOX ===== */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.lightbox-content {
    max-width: 90%;
    max-height: 90%;
    position: relative;
}

.lightbox-content img,
.lightbox-content iframe {
    max-width: 100%;
    height: 80vh;
    display: block;
    margin: 0 auto;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.close-lightbox {
    position: absolute;
    top: 2rem;
    right: 2.5rem;
    color: white;
    font-size: 3rem;
    cursor: pointer;
    transition: transform 0.3s;
}

.close-lightbox:hover {
    transform: rotate(90deg);
}

.message-success {
    padding: 15px;
    margin: 1.5rem 0;
    border-radius: 8px;
    text-align: center;
    background-color: #d5f5e3;
    color: #27ae60;
    border: 1px solid #2ecc71;
}

.message-error {
    padding: 15px;
    margin: 1.5rem 0;
    border-radius: 8px;
    text-align: center;
    background-color: #fadbd8;
    color: #e74c3c;
    border: 1px solid #e74c3c;
}