﻿/* Address Modal - Slide Up Animation & Blur Backdrop */

/* Remove Bootstrap's default backdrop completely */
.modal-backdrop {
    display: none !important;
}

/* Modal positioning and slide-up animation */
.address-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1055 !important;
    overflow: hidden;
    outline: 0;
    pointer-events: none;
    /* Use visibility + opacity instead of display:none for animation */
    visibility: hidden;
    opacity: 0;
    transition: visibility 0s 0.3s, opacity 0.3s ease;
}

    .address-modal.show {
        pointer-events: auto;
        visibility: visible;
        opacity: 1;
        transition: visibility 0s 0s, opacity 0.3s ease;
    }

    /* Custom backdrop with blur - only behind the modal */
    .address-modal::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        opacity: 0;
        transition: opacity 0.3s ease;
        pointer-events: none;
        z-index: -1;
    }

    .address-modal.show::before {
        opacity: 1;
        pointer-events: auto;
    }

    .address-modal .modal-dialog {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        margin: 0;
        max-width: 100%;
        width: 100%;
        transform: translateY(100%);
        transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
        pointer-events: auto;
        will-change: transform;
    }

    .address-modal.show .modal-dialog {
        transform: translateY(0);
    }

/* Address Modal Content - NO blur on content */
.address-modal-content {
    background-color: #343B33;
    color: #ffffff;
    border-radius: 20px 20px 0 0;
    border: none;
    height: 70vh;
    max-height: 70vh;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Modal Header */
.address-modal-header {
    background-color: #343B33;
    border-bottom: none;
    padding: 1.5rem;
    border-radius: 20px 20px 0 0;
    flex-shrink: 0;
}

    .address-modal-header .modal-title {
        color: #ffffff;
        font-size: 1rem;
        font-weight: 700;
        letter-spacing: 0.5px;
        text-transform: uppercase;
    }

    .address-modal-header .btn-close {
        filter: brightness(0) invert(1);
        opacity: 0.8;
        background-color: transparent;
    }

        .address-modal-header .btn-close:hover {
            opacity: 1;
        }

/* Modal Body */
.address-modal-body {
    background-color: #343B33;
    padding: 1.5rem;
    overflow-y: auto;
    overflow-x: hidden;
    max-height: calc(70vh - 90px);
    flex: 1;
}

    /* Custom Scrollbar for Modal Body */
    .address-modal-body::-webkit-scrollbar {
        width: 6px;
    }

    .address-modal-body::-webkit-scrollbar-track {
        background: rgba(255, 255, 255, 0.05);
        border-radius: 3px;
    }

    .address-modal-body::-webkit-scrollbar-thumb {
        background: rgba(212, 165, 116, 0.5);
        border-radius: 3px;
    }

        .address-modal-body::-webkit-scrollbar-thumb:hover {
            background: rgba(212, 165, 116, 0.7);
        }

/* Address List Styles */
.address-list-container {
    margin-bottom: 1.5rem;
}

.address-modal-card {
    background-color: #484F47;
    border-radius: 12px;
    margin-bottom: 1rem;
    padding: 1rem 1.25rem;
    transition: all 0.2s ease;
    position: relative;
    cursor: pointer;
}

    .address-modal-card:hover {
        background-color: #8C9276;
        transform: translateX(2px);
    }

.address-modal-card-selected {
    border: 2px solid #D2C9B9;
    background-color: #8C9276;
}

.address-modal-radio {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

    .address-modal-radio:checked ~ .address-modal-card-label .address-modal-check {
        opacity: 1;
    }

.address-modal-card-label {
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    margin: 0;
}

.address-modal-icon {
    background-color: rgba(212, 165, 116, 0.2);
    border-radius: 8px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #D2C9B9;
    font-size: 1rem;
    flex-shrink: 0;
}

.address-modal-info {
    flex: 1;
}

.address-modal-street {
    font-weight: 600;
    font-size: 0.9375rem;
    color: #ffffff;
    margin-bottom: 0.25rem;
}

.address-modal-city {
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.6);
}

.address-modal-check {
    opacity: 0;
    transition: opacity 0.2s ease;
    color: #D2C9B9;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.no-addresses-message {
    text-align: center;
    padding: 3rem 1rem;
    color: rgba(255, 255, 255, 0.5);
}

    .no-addresses-message i {
        font-size: 3rem;
        display: block;
    }

/* Address Form Styles */
.address-modal-form-group {
    margin-bottom: 1.25rem;
}

.address-modal-form-label {
    display: block;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.8125rem;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.address-modal-form-control {
    width: 100%;
    padding: 0.875rem 1rem;
    background-color: #484F47;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #ffffff;
    font-size: 0.9375rem;
    transition: all 0.2s ease;
}

    .address-modal-form-control:focus {
        outline: none;
        border-color: #D2C9B9;
        background-color: #343B33;
        box-shadow: 0 0 0 3px rgba(212, 165, 116, 0.1);
    }

    .address-modal-form-control::placeholder {
        color: rgba(255, 255, 255, 0.3);
    }

.address-modal-form-check {
    display: flex;
    align-items: center;
    padding: 1rem;
    background-color: rgba(212, 165, 116, 0.15);
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

    .address-modal-form-check:hover {
        background-color: rgba(212, 165, 116, 0.2);
    }

.address-modal-form-check-input {
    width: 20px;
    height: 20px;
    margin-right: 0.75rem;
    cursor: pointer;
    accent-color: #D2C9B9;
}

.address-modal-form-check-label {
    flex: 1;
    cursor: pointer;
    margin: 0;
    color: #ffffff;
    font-size: 0.9375rem;
    display: flex;
    align-items: center;
}

    .address-modal-form-check-label i {
        color: #D2C9B9;
    }

/* Button Styles */
.btn-address-primary {
    background-color: #D2C9B9;
    border: none;
    color: #343B33;
    padding: 1rem 1.5rem;
    border-radius: 25px;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.2s ease;
}

    .btn-address-primary:hover {
        background-color: #c89860;
        color: #343B33;
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(212, 165, 116, 0.3);
    }

    .btn-address-primary:active {
        transform: translateY(0);
    }

.btn-address-secondary {
    background-color: transparent;
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    padding: 0.875rem 1.5rem;
    border-radius: 25px;
    font-weight: 600;
    font-size: 0.9375rem;
    transition: all 0.2s ease;
}

    .btn-address-secondary:hover {
        background-color: rgba(255, 255, 255, 0.1);
        border-color: rgba(255, 255, 255, 0.3);
        color: #ffffff;
    }

/* Responsive Design */
@media (min-width: 768px) {
    .address-modal .modal-dialog {
        max-width: 600px;
        left: 50%;
        right: auto;
        transform: translate(-50%, 100%);
    }

    .address-modal.show .modal-dialog {
        transform: translate(-50%, 0);
    }
}

/* Prevent body scroll when modal is open */
body.modal-open {
    overflow: hidden;
}

/* Google Places Autocomplete z-index fix */
.pac-container {
    z-index: 1060 !important;
    background-color: #484F47;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    margin-top: 4px;
}

.pac-item {
    padding: 10px 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    cursor: pointer;
    color: #ffffff;
}

    .pac-item:first-child {
        border-top: none;
    }

    .pac-item:hover {
        background-color: #4a5d5e;
    }

.pac-item-query {
    color: #ffffff;
    font-size: 0.9375rem;
}

.pac-matched {
    color: #D2C9B9;
    font-weight: 600;
}

.pac-icon {
    display: none;
}

.pac-item-query .pac-matched {
    color: #D2C9B9;
}

input[readonly] {
    background-color: #8C9276 !important;
    color: #484F47;
}
