@import url('https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100..900;1,100..900&display=swap');

body {

    margin:0;
    padding:0;
    font-family: "Montserrat", sans-serif;
    font-optical-sizing: auto;
    background-color: #f2efea;
    width: 100svw;
    overflow-x: hidden;
}

a {
    
    color:inherit;

}

input {

    width: 100%;
    padding:15px;
    box-sizing: border-box;
    border: none;
    font-family: inherit;
    font-size:18px;
    border-radius:5px;
    border:1px solid #ccc;
    
}

input:focus {

    outline: none;

}

button {

    background-color: #8c5a32;
    color:white;
    border:none;
    font-family: inherit;
    padding:15px;
    box-sizing: border-box;
    width: 100%;
    font-size:18px;

}

select {

    width: 100%;
    padding:15px;
    box-sizing: border-box;
    border: none;
    font-family: inherit;
    font-size:18px;
    border-radius:5px;
    border:1px solid #ccc;

} 

textarea {

    width: 100%;
    padding:15px;
    box-sizing: border-box;
    border: none;
    font-family: inherit;
    font-size:18px;
    border: 1px solid #ccc;
    border-radius:5px;

}

textarea:focus {

    outline: none;

}

a {

    text-decoration: none;
    color: inherit;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: #8c5a32; /* bleu-gris foncé */
    color: white;
    height: 100vh;
    position: fixed;
    top: 0; left: 0;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px;
    margin-bottom: 30px;
    border-bottom: 1px solid #7e512dff;
}

.sidebar-header h1 {
    font-size: 18px;
    margin: 0;
}

.sidebar ul {
    list-style: none;
    padding: 10px;
    margin: 0;
    flex-grow: 1;
}

.sidebar ul li {
    margin: 10px 0;
}

.sidebar ul li a {
    color: white;
    text-decoration: none;
    padding: 10px;
    display: block;
    border-radius: 6px;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap:5px;
}

.sidebar ul li a:hover, .sidebar ul li a.active {
    background: #7e512dff;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid #7e512dff;
}

.sidebar-footer a {
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Décale le contenu principal */
.main-content {
    margin-left: 280px;
    padding: 20px;
    padding-right:40px;
    width: calc(100% - 280px);
    box-sizing: border-box;
}

@media (max-width: 768px) {
    .sidebar {
        position: absolute;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        width: 100%;
    }

    .toggle-btn {
        position: fixed;
        top: 15px;
        left: 15px;
        background: #1e293b;
        border: none;
        color: white;
        padding: 10px;
        border-radius: 6px;
        cursor: pointer;
        z-index: 10000;
    }
}

main {

    width: min(100%, 1600px);
    margin: 0 auto;
    box-sizing: border-box;
    margin-top:30px;
    padding-left:20px;
    padding-right:20px;
    box-sizing: border-box;
    min-height:100svh;

}

.btn-menu {

    display: none;

}

.mobile-menu {

    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100dvh;
    background-color: #8c5a32;
    z-index: 9999;
    padding: 40px 20px;
    box-sizing: border-box;

}

@media (max-width: 1050px) {

    .btn-menu {

        display: flex;
        background-color: transparent;
        width: fit-content;
        padding:0;

    }

    .nav-ul, .nav-btn {
        display: none;
    }

    .mobile-menu {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100dvh;
        background-color: #8c5a32;
        z-index: 9999;
        padding: 20px;
        padding-top:0;
        box-sizing: border-box;
        display: flex;
        flex-direction: column;
        align-items: start;
        justify-content: space-between;
    }

    .mobile-menu ul {
        list-style: none;
        padding: 0;
        margin: 0;
        display: flex;
        flex-direction: column;
        gap: 30px;
        font-size:18px;
    }

    .mobile-menu ul li a,
    .mobile-menu ul li button {
        font-size: 20px;
        color: white;
        text-decoration: none;
        background: none;
        border: none;
        text-align: left;
        cursor: pointer;
    }

    .mobile-menu ul li button:hover,
    .mobile-menu ul li a:hover {
        text-decoration: underline;
    }

}

@media (max-width: 575px) {

    .nav-btn {
        display: none;
    }

}

/* Form */

.form-step { display: none; }
.form-step.active { display: block; }

.form-navigation button {
    padding: 10px 20px;
    border-radius: 5px;
}

.prev {

    margin-right: 10px;

}

.step-indicator {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: #ccc;
    color: white;
    text-align: center;
    line-height: 30px;
    font-weight: bold;
}

.step-indicator.active {
    background-color: #8c5a32;
}

.step-line {
    flex-grow: 1;
    height: 2px;
    background-color: #ccc;
    margin: 0 10px;
    transition: background-color 0.3s ease;
}

.step-line.active {
    background-color: #8c5a32;
}

.step-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}


.step-line {
    flex-grow: 1;
    height: 2px;
    background-color: #ccc;
    margin: auto 5px;
}

#progressBar {
    align-items: center;
}
#progressBar span { margin-left: 10px; margin-right: 5px; }

@media (max-width: 650px) {

    #progressBar {
        display: none !important;
    }

}

@media (max-width: 600px) {

    .step-header {

        flex-wrap:wrap;
        gap:20px !important;
        
    }

    .step-header div {

        width: 100%;
        
    }

    .step-header button {

        width: 100%;

    }

}

.dropzone {
    border: 1px solid #ccc;
    padding: 40px;
    border-radius: 10px;
    background-color: #f9f9f9;
    margin-top: 30px;
    box-sizing: border-box;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.dropzone.empty {
    min-height: 480px;
    justify-content: center;
    text-align: center;
}

.dropzone-content {
    text-align: center;
}

.preview-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
}

.preview-item {
    position: relative;
    width: 120px;
    height: 120px;
}

.preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #ccc;
}

.remove-btn {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ff4d4d;
    border: none;
    color: white;
    font-size: 14px;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
}


#generateBtn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
.loader {
    font-size: 14px;
}

.preview-add {
    align-items: center;
    justify-content: center;
    flex-direction: column;
    width: 120px;
    height: 120px;
    border: 1px dashed #888;
    border-radius: 6px;
    cursor: pointer;
    text-align: center;
    gap: 5px;
}

.preview-add input {
    display: none;
}

.preview-add span {
    font-size: 14px;
    color: #666;
}

.form-col-wrapper {
    display: flex;
    gap: 20px;
    margin-top:30px;
}

.form-col {

    width: 50%;

}

@media (max-width: 650px) {

    .form-col-wrapper {
        flex-direction: column;
    }

    .form-col {
        width: 100%;
    }

}

.dashboard-container { width: min(1600px,100%); margin:auto; padding:20px; box-sizing:border-box; }
.card { background:#fff; border:1px solid #ccc; border-radius:8px; padding:15px; transition:box-shadow .2s; box-sizing:border-box; }
.card:hover { box-shadow:0 4px 12px rgba(0,0,0,0.1); }
.full-width { width:100%; }
.grid-2 { display:grid; grid-template-columns:repeat(2,1fr); gap:20px; }

@media(max-width:800px){ .grid-2{grid-template-columns:1fr;} }

    /* Grille responsive */
    .annonces-grid {
      display: grid;
      gap: 20px;
      grid-template-columns: repeat(3, 1fr);
    }
    @media (max-width:1000px){ .annonces-grid{grid-template-columns:repeat(2,1fr);} }
    @media (max-width:650px){ .annonces-grid{grid-template-columns:1fr;} }

    .annonce-card {
      border:1px solid #ccc;
      padding:15px;
      border-radius:8px;
      box-sizing:border-box;
      cursor:pointer;
      background:#fff;
      transition:box-shadow .2s;
    }
    .annonce-card:hover {
      box-shadow:0 4px 12px rgba(0,0,0,0.1);
    }
    .annonce-card img {
      width:100%;
      aspect-ratio:1;
      object-fit:cover;
      border-radius:5px;
      margin-bottom:10px;
    }
    .annonce-card h3 {margin:0 0 10px;font-size:1.1em;}
    .annonce-card p      {font-size:.9em;margin:0 0 10px;white-space:pre-wrap;}
    .annonce-card .price,
    .annonce-card .duration {font-size:.95em;margin-top:5px;}

    /* Modal overlay & container */
    .modal-overlay{position:fixed;top:0;left:0;width:100%;height:100%;background:rgba(0,0,0,0.7);display:flex;align-items:center;justify-content:center;z-index:10000;}
    .modal-container{background:#fff;border-radius:6px;padding:20px;max-width:700px;max-height:90%; width: 90%; overflow-y:auto;position:relative;box-shadow:0 4px 12px rgba(0,0,0,0.3); box-sizing:border-box;}
    .modal-close{position:absolute;top:15px;right:15px;background:transparent;border:none;font-size:24px;cursor:pointer; color:black; width:fit-content; z-index:9999; padding:0;} 
    .modal-content img{width:100%;object-fit:cover;border-radius:5px;margin-bottom:15px;}
    .modal-content h3{margin-top:0;}
    .modal-content p{white-space:pre-wrap;}

    /* Pagination */
    .pagination {display:flex; list-style:none; gap:8px; padding:0; margin:20px 0; justify-content:center;}
    .pagination a {
      display:block; padding:8px 12px; border:1px solid #ccc; border-radius:4px;
      text-decoration:none; color:#333;
    }
    .pagination .active a {
      background:#0064d2; color:#fff; border-color:#0064d2;
    }
    .pagination a:hover {background:#e8e8e8;}
    
    /* Formulaire recherche & filtres */
    .filters {display:flex; gap:10px; margin:20px 0;}
    @media (max-width: 850px) { .filters {flex-direction:column; gap:10px;} .filters input, .filters select, .filters button {width:100% !important;} }
    .carousel {
      position: relative;
      overflow: hidden;
      margin-bottom: 15px;
    }
    .carousel-track {
      display: flex;
      transition: transform 0.3s ease;
    }
    .carousel-slide {
      min-width: 100%;
      box-sizing: border-box;
    }
    .carousel-slide img {
      width: 100%;
      display: block;
      border-radius: 5px;
      object-fit: cover;
    }
    .carousel-button {
      position: absolute;
      top: 50%;
      transform: translateY(-50%);
      background: rgba(255,255,255,0.7);
      border: none;
      font-size: 1.5em;
      padding: 0 10px;
      cursor: pointer;
      border-radius: 50%;
      z-index: 10;
    }
    .carousel-button.prev { left: 10px; width:fit-content; color:black; }
    .carousel-button.next { right: 10px; width: fit-content; color:black; }

    .login-container {

        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        height: 100vh;
        gap: 50px;
        padding-top: 15vh;
        box-sizing: border-box;
        padding: 20px;
        padding-bottom: 30px;

    }

    .logs-table {

        width: 100%;
        border-collapse: collapse;
    }

    .logs-table tr:nth-child(even) {
        background-color: #f2f2f2;
    }

    .logs-table th {

        border-bottom: 1px solid #ccc;

    }

    .logs-table th, .logs-table td {
        padding: 12px;
        text-align: left;
    }

    /* Formulaire d'édition d'annonce */

    .photo-grid {
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        gap: 10px;
        width: 100%;
    }

    .photo-slot {
        background: #f5f5f5;
        border: 1px solid #ccc;
        aspect-ratio: 1/1;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 32px;
        cursor: pointer;
        border-radius: 6px;
        position: relative;
        overflow: hidden;
        transition: transform 0.15s ease, background 0.15s ease;
    }

    .photo-slot:hover {
        background-color: #e8e8e8;
    }

    .photo-slot img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .delete-btn {
        position: absolute;
        top: 4px;
        right: 4px;
        background: rgba(0, 0, 0, 0.6);
        color: #fff;
        border: none;
        border-radius: 50%;
        width: 24px;
        height: 24px;
        font-size: 16px;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .photo-index {
        position: absolute;
        top: 4px;
        left: 4px;
        background: rgba(255,255,255,0.8);
        border-radius: 3px;
        padding: 2px 4px;
        font-size: 12px;
        font-weight: bold;
        color: #333;
    }

    .photo-slot.dragging {
        opacity: 0.5;
        transform: scale(0.95);
    }

    .photo-slot.drag-over {
        outline: 3px dashed #007bff;
    }

    @media (max-width: 600px) {
        .photo-grid {
            grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        }
    }

    .form-grid { display:flex; gap:20px; flex-wrap:wrap; margin-bottom:20px; }
    .form-col-left { flex:0 0 50%; min-width:300px; }
    .form-col-right { flex:1; min-width:300px; }
    .form-col-left label, .form-col-right label { display:block; margin-top:10px; font-size:16px; }
    .form-col-left input, .form-col-left textarea, .form-col-right input, .form-col-right select { width:100%; margin-top:10px; padding:12px; border-radius:5px; border:1px solid #ccc; font-size:16px; box-sizing:border-box; }
    @media (max-width:750px) { .form-grid { flex-direction:column; gap:0; } }