﻿
@keyframes slideIn {
    from {
        transform: translate(-50%, -45%);
        opacity: 0;
    }

    to {
        transform: translate(-50%, -50%);
        opacity: 1;
    }
}

/* Modal Container */
.port-modal {
    display: none;
    height: auto;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    /*transform: translate(120%, -30%);*/
    width: 330px;
    z-index: 9999;
}

/* Modal Header - Hidden by default */
.port-modal-header {
    display: none;
    padding: 20px 24px;
    border-bottom: 1px solid #e5e5e5;
    justify-content: space-between;
    align-items: center;
    background: white;
    border-radius: 16px 16px 0 0;
}

.port-modal-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.port-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #666;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s;
    line-height: 1;
}

    .port-modal-close:hover {
        background-color: #f5f5f5;
    }

/* Modal Content */
.port-modal-content {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    padding: 20px 30px;
    /*max-height: 400px;*/
    align-self: start;
    gap: 25px;
    overflow-y: auto;
}

/* Modal Footer - Hidden by default */
.port-modal-footer {
    display: none;
    padding: 20px 24px;
    /*border-top: 1px solid #e5e5e5;*/
    background: white;
    border-radius: 0 0 16px 16px;
}

.port-modal-footer-btn {
    width: 100%;
    height: 50px;
    border-radius: 8px;
    border: 1px solid #D9BB16;
    background: #FFDE00;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: background-color 0.2s;
}

    .port-modal-footer-btn:hover {
        background: #f0d000;
    }

.port-option {
    padding: 16px 24px;
    cursor: pointer;
    transition: background-color 0.2s;
    border-bottom: 1px solid var(--UI-gray-10, #E6E6E6);
    font-size: 15px;
    color: #333;
}

    .port-option:last-child {
        border-bottom: none;           
    }

    .port-option:hover {
        background-color: #f8f9fa;
    }

    .port-option:active {
        background-color: #e9ecef;
    }

    .port-option.no-results {
        text-align: center;
        color: #999;
        cursor: default;
    }

        .port-option.no-results:hover {
            background-color: transparent;
        }
/* New wrapper and positioning classes */

/* Wrapper for inputs and modal */
.port-inputs-wrapper {
    position: relative;
    display: flex;
    align-items: self-start;
    gap: 10px;
}

/* Home page specific modal positioning */
.port-modal-home {
    position: absolute;
    margin-top: 8px;
    display: none;
    width: 330px;
    height:auto;
    z-index: 9999;
}

    /* Position below departure (left side) */
    .port-modal-home.show-departure {
        top:85%;
        left: 0;
        display: block;
    }

    /* Position below arrival (right side) */
    .port-modal-home.show-arrival {
        top:85%;        
        left: 52%;        
        display: block;
    }

/* Mobile responsive  */
@media (max-width: 991px) {
    .port-modal-home.show-departure,
    .port-modal-home.show-arrival {
        position: fixed;
        top: 0;
        left: 0;
        right: auto;
        transform: none;
        margin-top: 0;
        width: 100%;
        height: 100vh;
        display: flex !important;
    }
}
@media (max-width: 1199px) {
    .port-modal-home.show-departure,
    .port-modal-home.show-arrival,
    .port-modal {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
    }

    .port-inputs-wrapper {
        flex-direction: column;
    }
} 

@media (max-width: 991px) {
    .port-modal-home,
    .port-modal {
        width: 100%;
        height: 100vh;
        padding: 0;
        top: 0;
        left: 0;
        transform: none;
        flex-direction: column;
    }

        /* Show as flex only when modal has 'block' display */
        .port-modal[style*="display: block"] {
            display: flex !important;
        }

    /* Show header and footer on mobile */
    .port-modal-header {
        display: flex;
        flex-shrink: 0;
    }

    .port-modal-footer {
        display: block;
        flex-shrink: 0;
    }

    .port-modal-content {
        border-radius: 0;
        flex: 1;
        min-height: 0;
        max-height:none;
        overflow-y: auto;
        padding: 10px 20px;
        box-shadow: none;
    }

    .port-option {
        padding: 16px 24px;
    }

        .port-option:last-child {
            border-bottom: 1px solid var(--UI-gray-10, #E6E6E6);
        }

    
}
