/*
GENERAL RULE: 
Most of the modals are sliding into the screen from the right, but on small
devices they are centered. The modals are full height and the content is scrollable.
*/
@import url('colors.css');


/*GENERAL RIGHT MODAL*/
.modal.right .modal-dialog-slide {
    position: fixed;
    right: 0;
    top: 0;
    bottom: 0;
    width: 40vw !important; /* Ensures modal takes 50% of screen width */
    max-width: 50vw; /* Ensures consistency */
    height: 100vh; /* Full viewport height */
    margin: 0;
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
    display: flex;
    flex-direction: column; /* Makes modal content fill available space */
}

.modal.right.show .modal-dialog-slide {
    transform: translateX(0);
}

.modal-dialog-slide .modal-content {
    height: 100vh; /* Ensures full height */
    display: flex;
    flex-direction: column; /* Enables footer to stay at the bottom */
    border-radius: 0;
}

/* Modal header and footer styling */
.modal-header, .modal-footer {
    padding: 20px;
    flex-shrink: 0; /* Prevents shrinking */
}

/* Ensures table does not overflow */
.modal-body {
    flex-grow: 1; /* Allows body to take remaining space */
    overflow: auto; /* Enables scrolling inside the modal */
    padding: 20px;
}

/* Ensures the table stays within modal boundaries */
.modal-body .table-responsive {
    max-height: calc(100vh - 150px); /* Adjust based on header/footer height */
    overflow-y: auto; /* Enables vertical scrolling */
}

/* Adjust the modal's close button */
.modal-header .close {
    margin: -10px -10px 0 0;
    padding: 0;
}

/*RECORDBOOK*/
.modal.right .modal-dialog-slide.recordBook{
    position: relative;
    height: 100vh;
    width: 80vw !important;
    max-width: 100vw !important;
    margin: auto;
    transform: none;
    transition: transform 0.3s ease-in-out;
    display: flex;
    flex-direction: column; 
}

.ec.ec-day-grid.ec-month-view{
    height:55em;
}
/*list view*/
#recordTable tr td{
    padding: 15px;
    font-size: 0.9rem;
    color: var(--grey300);
    border-bottom: 1px solid #e5e7eb;
}
/* Alternating row colors */
table tr:nth-child(even) {
    background-color: #f9fafb;
}

td.date-column {
    background-color: var(--white);
}

table tr:nth-child(odd) {
    background-color: var(--white);
}
table tr:hover {
    background-color: #f1f5f9; /* Light grey-blue color */
    transition: background-color 0.3s ease; /* Smooth transition effect */
}
/*Date Modal*/
.recordbookButtonsContainer{
    text-align: right;
    width:50%;
    margin-right:16px;
}
#footerRecordbook .recordbookButtonsContainer button{
    min-width: 7em;
}
#attach-new-ticket,
#add-new-resource,
#add-new-entry {
    min-width: 12.5em;
    margin-left: 0.5em;
    margin-right: 0.5em;
    margin-bottom:0.5em;
}
.attached-items {
    background-color: var(--white);
    color: var(--grey300);
    border: solid 1px var(--grey300);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    width: 100%;
}
.attached-items i {
    margin-right: 8px;

}
#record-ticket-id a {
    color: var(--grey300);
    text-decoration: none;
    background-color: transparent;
}
#record-ticket-id:hover {
    transform: scale(1.2);
}
.recordbook-filament-title {
    width: 100%;
    padding:10px;
    border: 1px solid var(--grey200); /*TODO: change color coding*/
    background-color: var(--grey100);
    transition: border 0.3s ease;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}
.recordbook-filament-title.service {
    background-color: var(--ec-eventbluealpha);
}
.recordbook-filament-title.customer {
    background-color: var(--ec-eventgreenalpha);
}
.recordbook-filament-title:disabled {
    cursor:not-allowed;
}
.recordbook-filament-title.service:read-only {
    cursor:default;
}
.filament-entry-title {
    margin-bottom: 0.5em;
    width:100%
}
.recordbook-filament-description {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    background-color: var(--white);
    transition: border 0.3s ease;
    border-bottom-right-radius: 8px;
    border-bottom-left-radius: 8px;
    resize:none;
    overflow:auto;
    height:fit-content;
    max-height:8em;
}
.recordbook-filament-description.service {
    background-color: var(--ec-eventbluealpha);
}
.recordbook-filament-description.customer {
    background-color: var(--ec-eventgreenalpha);
}
.recordbook-filament-description:focus {
    border-color:var(--grey300)
}
.recordbook-filament-description:disabled {
    cursor:not-allowed;
}
.recordbook-filament-description.service:read-only {
    cursor:default;
}
#entryDivider {
    position: relative;
    left: 50%;
    transform: translateX(-50%);
    color: black;
}
.ticket-select {
    border: 1px solid #e2e8f0;
    border-radius: 5px;
    padding: 10px;
    font-size: 0.875rem;
    color: #4a5568;
    width: 100%;
    height:fit-content;
    width: fit-content

}
.ticketContent {
    max-height:20em;
    overflow-y:scroll;
}
/*Distinta articoli spare parts*/
.modal.bottom .modal-dialog-slide{
    position: fixed;
    right: 0;
    top: 0;
    bottom: 0;
    width: 40vw !important; /* Ensures modal takes 50% of screen width */
    max-width: 50vw; /* Ensures consistency */
    height: 100vh; /* Full viewport height */
    margin: 0;
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
    display: flex;
    flex-direction: column; /* Makes modal content fill available space */
}
.modal.bottom.show .modal-dialog-slide {
    transform: translateX(0);
}
.modal.bottom .modal-content {
    border: none;
}
.modal.bottom.show .modal-header {
    display: none;
}
.modal.bottom .modal-body,
.modal.bottom .modal-body .table.container{
    padding:0;
}
.table {
    margin-top:0 !important;
    max-width:100%;
    width:100%;
}
.table .thead-dark th{
    color: var(--black);
    background-color: var(--orange100);
    border:none;
}
/*Ticket Modal*/
#recordbook-frame {
	width: 100%;
	max-height: 20em;
	min-width: 260px;
	height: fit-content;
	background:white;
	margin:auto;
}
#recordbook-frame p{
	margin-bottom:0px;
}
#recordbook-frame .content {
	overflow: auto;	position: relative;
}
#recordbook-frame .content .messages {
	height: 100%;
	min-height: calc(100% - 85px);
	max-height: calc(100% - 85px);
	overflow-y: scroll;
	overflow-x: hidden;
}
#recordbook-frame .content.withButtons .messages {
	height: auto;
	min-height: calc(100% - 135px); 
	max-height: calc(100% - 135px);
	overflow-y: scroll;
	overflow-x: hidden;
}
#recordbook-frame .content .message-buttons {
	display: none;
	background: #F5F5F5;
}

#recordbook-frame .content.withButtons .message-buttons {
	display: flex;
	align-items: center;
	justify-content: space-between;
	height:100px;
	overflow-y: hidden;
	overflow-x: hidden;
}
#recordbook-frame .content .messages ul li {
	clear: both;
	float: left;
	margin: 15px 15px 5px 15px;
	width: calc(100% - 25px);
	font-size: 0.9em;
}
#recordbook-frame .content .messages ul li:nth-last-child(1) {
	margin-bottom: 20px;
}
#recordbook-frame .content .messages ul li.sent img {
	margin: 6px 8px 0 0;
	float: right;
}
#recordbook-frame .content .messages ul li.sent p a,
#recordbook-frame .content .messages ul li.sent p {
	background:  var(--grey100);
	color: var(--black);
	float: right;
}
#recordbook-frame .content .messages ul li.replies img {
	float: left;
	margin: 6px 0 0 8px;
}
#recordbook-frame .content .messages ul li.replies p {
	background:  var(--white);
	float: left;
}
#recordbook-frame .content .messages ul li img {
	width: 22px;
	border-radius: 50%;
	float: left;
}
#recordbook-frame .content .messages ul li p {
	display: inline-block;
	padding: 10px 15px;
	border-radius: 20px;
	line-height: 130%;
} 
/*CART MODAL*/
#modalCart .modal-dialog {
    max-width: 100vw !important;
    width:90vw !important;
}

#chatbotGuideModal.show{
    display:flex !important;
    justify-content: center;
    
}
#chatbotGuideModal .chatbot-guide-modal-dialog{
    max-width: 70%;
    
}

/* 🖥️ XL devices (1200px - 1399px) */
@media (max-width: 1399.98px) {
   
    /*Recordbook*/
    .modal.right .modal-dialog-slide.recordBook{
        position: relative !important;
        height: 100vh;
        max-height:100vh;
        width: 100vw !important;
        top:auto !important;
        margin: auto;
        transform: none;
        transform: none !important;
        transition: transform 0.3s ease-in-out;
        display: flex;
        flex-direction: column; 
    }

    /*Distinta articoli spare parts*/
    .modal.bottom .modal-dialog-slide{
        position: fixed;
        right: 0;
        left: 0;
        bottom: 0;
        top:auto !important;
        width: 100vw !important; /* Ensures modal takes 50% of screen width */
        max-width: 100vw; /* Ensures consistency */
        height: 50vh; /* Full viewport height */
        margin: 0;
        transform: translateY(100%);
        transition: transform 0.3s ease-in-out;
        display: flex;
        flex-direction: column; /* Makes modal content fill available space */  
        overflow:scroll;
    }
    .modal.bottom.show .modal-dialog-slide {
        transform: translateY(0);
    }
    .modal.bottom .modal-content {
        border: none;
    }
    .modal.bottom.show .modal-header {
        display: none;
    }
    .modal.bottom .modal-body,
    .modal.bottom .modal-body .table.container{
        padding:0;
    }
    .table {
        margin-top:0 !important;
        max-width:100%;
        width:100%;
    }
    .table .thead-dark th{
        color: var(--black);
        background-color: var(--orange100);
        border:none;
    }
}

/* 🖥️ Large devices (992px - 1199px) */
@media (max-width: 1199.98px) {
    
    /*Recordbook*/
    .modal.right .modal-dialog-slide.recordBook{
        position: relative;
        height: 100vh;
        width: 100vw !important;
        margin: auto;
        transform: none;
        transform: none !important;
        transition: transform 0.3s ease-in-out;
        display: flex;
        flex-direction: column; 
    }
}

/* 💻 Medium devices (768px - 991px) */
@media (max-width: 991.98px) {
    .modal.right .modal-dialog-slide {
        width: 45vw !important; /* Ensures modal takes 50% of screen width */
        max-width:90vw; /* Ensures consistency */
    }

    /*Recordbook*/
    .modal.right .modal-dialog-slide.recordBook{
        position: relative;
        height: 100vh;
        width: 100vw !important;
        margin: auto;
        transform: none;
        transform: none !important;
        transition: transform 0.3s ease-in-out;
        display: flex;
        flex-direction: column; 
    }
    #recordbookButtonsContainer{
        width:70%
    }
}

/* 📱 Small devices (576px - 767px) */
@media (max-width: 767.98px) {
    .modal.right .modal-dialog-slide {
        width: 70vw !important; /* Ensures modal takes 50% of screen width */
        max-width:90vw; /* Ensures consistency */
    }

    /*Recordbook*/
    .modal.right .modal-dialog-slide.recordBook{
        position: relative;
        height: 100vh;
        width: 100vw !important;
        top:0;
        margin: auto;
        transform: none;
        transform: none !important;
        transition: transform 0.3s ease-in-out;
        display: flex;
        flex-direction: column; 
    }
    #recordbookButtonsContainer{
        width:40%
    }

    
}

/* 🌐 Extra small devices (less than 576px) */
@media (max-width: 575.98px) {
    .modal.right .modal-dialog-slide {
        position: relative; /* overrides fixed */
        width: 80vw !important; /* Ensures modal takes 50% of screen width */
        max-width:90vw; /* Ensures consistency */
        height: fit-content; /* Full viewport height */
        margin: auto;
        top: 4.375rem;
        transform: none !important;
        transition: transform 0.3s ease-in-out;
        display: flex;
        flex-direction: column; /* Makes modal content fill available space */
    }

    #submitImage,
    #submitVideo {
        margin-top: 0.5em;
    }

    /*Recordbook*/
    .modal.right .modal-dialog-slide.recordBook{
        position: relative;
        height: 100vh;
        width: 100vw !important;
        top:0;
        margin: auto;
        transform: none;
        transform: none !important;
        transition: transform 0.3s ease-in-out;
        display: flex;
        flex-direction: column; 
    }
    
    /*CART MODAL*/
    #modalCart .modal-dialog {
        max-width: 100vw !important;
        width: 95% !important;
    }

    /*CHATBOT GUIDE*/
    #chatbotGuideModal .chatbot-guide-modal-dialog{
        max-width: 90%;
        width:90%;
        
    }
    
}

/* 🌐 Extra small devices (less than 480px) */
@media (max-width: 480.98px) {
    /*Ticket Modal*/
    .modal.right .modal-dialog-slide {
        position: relative; /* overrides fixed */
        width: 80vw !important; /* Ensures modal takes 50% of screen width */
        max-width:90vw; /* Ensures consistency */
        height: fit-content; /* Full viewport height */
        margin: auto;
        top: 4.375rem;
        transform: none !important;
        transition: transform 0.3s ease-in-out;
        display: flex;
        flex-direction: column; /* Makes modal content fill available space */
    }
    
    #submitImage,
    #submitVideo {
        margin-top: 0.5em;
    }

    /*Recordbook*/
    .modal.right .modal-dialog-slide.recordBook{
        position: relative;
        height: 100vh;
        top:0;
        width: 100vw !important;
        margin: auto;
        transform: none;
        transform: none !important;
        transition: transform 0.3s ease-in-out;
        display: flex;
        flex-direction: column; 
    }
    #recordbookButtonsContainer{
        text-align: right;
        width:50%;
        margin-right:1em;
    }

    



}
