
body{
    /* padding-left: 250px; */
    /* font-family: 'Atkinson Hyperlegible', sans-serif !important; */
    font-family: var(--main-font) !important;
}

.booking-container{
    padding: 20px;
    width: 100%;
    overflow-y: scroll;
    height: 100vh;
}

.booking-container::-webkit-scrollbar {
    display: none;
}

/* Booking form fields container */
#booking-form-fields {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 20px;
    width: 100%;
}

/* Form field wrappers */
#establishment-field,
#class-level-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

#establishment-label,
#class-level-label {
    display: block;
    color: var(--text-0);
    font-size: 14px;
    margin-bottom: 5px;
}

/* Input search wrapper */
#establishment-code-container {
    position: relative;
    width: 100%;
}

#establishment-search-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: var(--bg-1);
    border: 1px solid var(--text-3);
    border-radius: 8px;
    overflow: hidden;
    transition: border-color 0.2s ease;
}

#establishment-search-wrapper:focus-within {
    border-color: var(--vitta-green);
    box-shadow: 0 0 0 2px rgba(36, 160, 104, 0.1);
}

#establishment-search-wrapper.error {
    border-color: #dc3545;
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.15);
    animation: shake 0.3s ease-in-out;
}

#search-establishment-code {
    flex: 1;
    padding: 12px 15px;
    background: none;
    border: none;
    outline: none;
    color: var(--text-0);
    font-size: 14px;
}

#search-establishment-code::placeholder {
    color: var(--text-2);
}

#establishment-search-button {
    background: var(--vitta-green);
    height: 100%;
    padding: 12px 20px;
    color: white;
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

#establishment-search-button:hover {
    background-color: #1E7E5D;
}

/* Dropdown results */
#establishment-code-dropdown {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    right: 0;
    background-color: var(--bg-0);
    color: var(--text-0);
    border: 1px solid var(--text-3);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    max-height: 300px;
    overflow-y: auto;
    display: none;
}

#establishment-code-dropdown::-webkit-scrollbar {
    width: 8px;
}

#establishment-code-dropdown::-webkit-scrollbar-track {
    background: var(--bg-1);
    border-radius: 4px;
}

#establishment-code-dropdown::-webkit-scrollbar-thumb {
    background: var(--text-3);
    border-radius: 4px;
}

#establishment-code-dropdown::-webkit-scrollbar-thumb:hover {
    background: var(--text-2);
}

/* Dropdown option */
.establishment-dropdown-option {
    padding: 12px 15px;
    cursor: pointer;
    border-bottom: 1px solid var(--bg-2);
    transition: background-color 0.15s ease;
}

.establishment-dropdown-option:last-child {
    border-bottom: none;
}

.establishment-dropdown-option:hover {
    background-color: var(--bg-2);
}

.establishment-option-name {
    margin-bottom: 4px;
    color: var(--text-0);
}

.establishment-option-details {
    font-size: 0.85em;
    color: var(--text-2);
}

#establishment-no-results {
    padding: 15px;
    text-align: center;
    color: var(--text-2);
}

.establishment-dropdown-loader {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 15px;
    color: var(--text-2);
    min-height: 60px;
}

.loader-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid var(--text-3);
    border-top-color: var(--vitta-green, #24A068);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Class level select */
#class-level-select {
    width: 100%;
    padding: 12px 15px;
    background-color: var(--bg-1);
    border: 1px solid var(--text-3);
    border-radius: 8px;
    color: var(--text-0);
    font-size: 14px;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

#class-level-select:focus {
    outline: none;
    border-color: var(--vitta-green);
    box-shadow: 0 0 0 2px rgba(36, 160, 104, 0.1);
}

#class-level-select.error {
    border-color: #dc3545;
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.15);
    animation: shake 0.3s ease-in-out;
}

#class-level-select option {
    background-color: var(--bg-0);
    color: var(--text-0);
}

/* Messages d'erreur */
.error-message {
    color: #dc3545;
    font-size: 13px;
    margin-top: 5px;
    padding: 5px 0;
    display: flex;
    align-items: center;
    gap: 5px;
}

.error-message::before {
    content: "⚠";
    font-size: 14px;
}

/* Animation de shake pour les erreurs */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

/* Legacy autocomplete styles - kept for compatibility */
#autocomplete-container{
    display: flex;
    flex-direction: column;
    margin: 20px;
    gap: 10px;
}

#autocomplete-search-input{
    position: relative;
}

#search-institution{
    padding: 5px;
    width: 300px;
}

#search-institution-dropdown{
    position: absolute;
    background-color: var(--bg-0);
    color: var(--text-0);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    top: -100%;
    left: 0;
    padding: 10px;
    border-radius: 5px;
    width: 100%;
    display: none;
    border: solid 1px var(--text-3);
}

#validate-reservation-check{
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
    gap: 10px;
    margin: 10px;
}

#validate-reservation-check label{
    margin: 0;
}

.search-institution-option{
    width: 100%;  /* Assurez-vous que la largeur est définie */
    white-space: nowrap;  /* Empêche le texte de passer à la ligne */
    overflow: hidden;  /* Cache le texte qui dépasse */
    text-overflow: ellipsis;
    padding: 5px;
}

.search-institution-option:hover{
    background-color: var(--bg-3);
    border-radius: 5px;
    cursor: pointer;
}




#map{
    height: 400px;
    width: 100%;
    max-width: 600px;
    border-radius: 8px;
    overflow: hidden;
    margin-top: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}
.booking-container > div{
    margin-bottom: 20px;
}

.calendar-control{
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: flex-start;
    margin: 10px;
}

.calendar-wrapper{
    overflow: scroll;
}

.calendar-wrapper::-webkit-scrollbar {
    display: none;
}



.hidden-booked-slots{
    display: none;
}

.robot-wrapper {
    display: flex;
    justify-content: space-around;
    align-items: center; /* Align items in the middle for better vertical alignment */
    padding: 15px;
    border: solid 1px var(--text-3); /* More contrast for the border */
    border-radius: 10px;
    margin: 0 auto 20px; /* Simplified margin settings */
    background: var(--bg-0);
    box-shadow: 0px 0px 5px var(--bg-4), 
               5px 5px 15px var(--bg-5);
    color: var(--text-0); 
}

.robot-wrapper-booked{
    justify-content: flex-start;
    flex-shrink: 0;
    overflow: hidden;
    background: linear-gradient(90deg, var(--bg-0), var(--vitta-green));
    background-size: 300% 300%;
    animation: gradient-scroll 5s linear infinite;
    cursor: pointer;
}

@keyframes gradient-scroll {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.robot-wrapper-slot{
    display: flex;
    width: 100%;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start; /* Align items in the middle for better vertical alignment */
    padding: 15px;
    border: solid 1px var(--text-3); /* More contrast for the border */
    border-radius: 10px;
    margin: 0 auto 20px; /* Simplified margin settings */
    background: var(--bg-0);
    box-shadow: 0px 0px 5px var(--bg-4), 
               5px 5px 15px var(--bg-5);
    color: var(--text-0); 
}

.robot-slot-header{
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
    width: 100%;
}

/* Focused items styling to highlight active elements, important for accessibility */
.robot-wrapper:focus-within {
    outline: 3px solid #005A9C; /* High contrast outline for keyboard navigation */
    outline-offset: 2px;
}


.robot-wrapper-booked:hover{
    border: solid 1px #24A068;
}

/* Booking action buttons */
.booking-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--bg-3);
    justify-content: flex-end;
}

.booking-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 15px;
    border: none;
    border-radius: 5px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.booking-edit-btn {
    background-color: #3EA9F5;
    color: white;
}

.booking-edit-btn:hover {
    background-color: #2E7EBD;
}

.booking-delete-btn {
    background-color: #dc3545;
    color: white;
}

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

.booking-action-btn i {
    font-size: 14px;
}

a{
    text-decoration: none;
    color: black;
}

a:hover{
    text-decoration: none;
    color: black;

}

#prepare-slot-buttons{
    display: flex !important;
    /* flex-direction: column; */
    justify-content: center !important;
    align-items: center !important;
    gap: 10px !important;
}

#search-map {
    cursor: pointer;
    transition: all 0.3s;
    color: white;
    background-color: #24A068;
    border: none;
    border-radius: 5px;
    height: 35px;
    width: 100px;
}



#search-map:hover {
    background-color: #1E7E5D;
    transition: all 0.3s;
}

#prepare-slot-buttons button{
    cursor: pointer;
    transition: all 0.3s;
    color: white;
    border: none;
    border-radius: 3px;
    height: 35px;
    font-weight: bold;
    /* width: 100px; */
}

#bookButton{
    background-color: #24A068;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
}

#cancelButton{
    background-color: #808080;
}

#bookButton:hover{
    background-color: #1E7E5D;
    transition: all 0.3s;
}

.prepare-slot-robot-name{
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
}

#slot-robot-container {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    width: 100%;
}

.slot-robot-container-wrapper{
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 10px;
}

#slot-robot-container > div {
    white-space: nowrap;
    flex-shrink: 1;
    overflow: hidden;
    min-width: 0;
}

#slot-establishment, .name-establishment {
    max-width: 350px;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
    font-weight: bold;
    
}

.calendar-header{
    padding: 20px;
}

.booking-element{
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    gap: 5px;
}

.booking-element div{
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 5px;
}



.robot-container{
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    margin-right: 10px;
    width: 200px;
    height: 100%;
    gap: 25px;
}


.robot-title{
    display: flex;
    justify-content: center;
    align-items: center;
}

.robot-image-calendar{
    width: 50px;
    height: 50px;
    margin-right: 10px;
    border-radius: 50%;
    border: 1px solid #b5b5b5;
    background-color: white;
    overflow: hidden;
    flex-shrink: 0;
}

.robot-image-calendar img{
    width: 100%;
    height: 100%;
    object-fit: contain;
}

#previousWeek, #nextWeek {
    /* background-color: #f5f5f5; */
    border: none;
    cursor: pointer;
    width: 80px;
    height: 40px;
}

.day {
    display: flex;
    flex-direction: column;
    gap: 5px;
    /* padding: 10px; */
    margin: 5px;
    height: 100%;
    justify-content: center;
    align-items: center;
}

.day-date{
    /* position: sticky;
    top: 0px; */
    width: 85px;
    height: 100%;
    background-color: var(--bg-0);
    font-size: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    color: var(--main-color);
}

.button-select-week{
    margin-top: 20px;
    cursor: pointer;
    transition: all 0.3s;
}

.button-select-week:hover{
    color: #0748aa;
    transition: all 0.3s;
}

.expand-button{
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    gap: 5px;
    font-size: 14px;
    transition: all 0.3s;
}

.expand-button:hover{
    color: #3EA9F5;
    transition: all 0.3s;
}

.calendar-element{
    height: 225px;
    overflow-x: scroll;
    overflow-y: hidden;
}

.calendar-element::-webkit-scrollbar {
    display: none;
}

.expanded{
    height: 100%;
    overflow-y: auto;
}

.day-container {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
}

.day-container::-webkit-scrollbar {
    display: none;
}

.day-container button {
    background-color: var(--bg-2);
    border: solid 1px var(--text-3);
    border-radius: 2px;
    border: none;
    cursor: pointer;
    width: 85px;
    height: 30px;
    color: var(--text-0);
}

.day-container button:hover {
    cursor: not-allowed;
}

.slot {
    margin: 5px;
    padding: 5px;
}

.day-container .slot-booked-owned{
    background-color: #24A068;
    border-radius: 2px;
    color: white;
    font-size: 12px;
}

.day-container .slot-booked-owned:hover{
    background-color: #1E7E5D;
    cursor: pointer;
}

.day-container .slot-booked-blocked{
    background-color: #ff8d36;
    border-radius: 2px;
    color: white;
    font-size: 12px;
}

.day-container .slot-booked-blocked:hover{
    background-color: #e67300;
    cursor: not-allowed;
}

.day-container .slot-free{
    background-color: #3EA9F5;
    border-radius: 1px;
    /* color: var(--text-0); */
    color: white;
    font-size: 12px;
}

.day-container .slot-free:hover{
    background-color: #2E7EBD;
    cursor: pointer;
}


.theme-dark .robot-wrapper {
    background: var(--bg-5);
    color: #E0E0E0;
}

.theme-dark .robot-wrapper:focus-within {
    outline: 3px solid #AAD1E6;
}

.theme-dark .contrast-high .robot-wrapper{
    border: solid 3px var(--text-0);
    box-shadow: none;
}

@media screen and (max-width: 960px){
    #slot-robot-container{
        flex-direction: column;
        gap: 10px;
    }
}

@media screen and (max-width: 768px) {
    .robot-wrapper {
        flex-direction: column;
        justify-content: flex-start;
        align-items: flex-start;
        gap: 10px;
        padding: 10px;
    }

    .robot-wrapper .calendar-wrapper{
        overflow-x: scroll;
        width: 100%;
    }

    .prepare-slot-robot-name{
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        width: 100%;
    }
}

@media screen and (max-width: 640px) {
    #slot-robot-container {
        flex-direction: column;
        align-items: flex-start;
    }

    .slot-robot-container-wrapper{
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    #search-institution{
        width: 100%;
    }
    #search-institution-element span{
        display: none;
    }

    #booking-form-fields {
        padding: 15px;
        gap: 15px;
    }

    #establishment-search-text {
        display: none;
    }

    #establishment-search-button {
        padding: 12px 15px;
    }

    #map {
        width: 100% !important;
        height: 300px !important;
    }

    /* Booking action buttons responsive */
    .booking-actions {
        justify-content: center;
        flex-wrap: wrap;
    }

    .booking-action-btn span {
        display: inline;
    }
}