/* Address Modal Overlay */
.arkflux-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Modal Container */
.arkflux-modal {
    background: white;
    border-radius: 8px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* Close Button */
.arkflux-modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    color: #999;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}

.arkflux-modal-close:hover {
    color: #333;
}

/* Modal Title */
.arkflux-modal h2 {
    margin: 0 0 20px 0;
    font-size: 24px;
    color: #333;
}

/* Form Elements */
.arkflux-modal form {
    display: flex;
    flex-direction: column;
}

.arkflux-modal label {
    margin-bottom: 5px;
    font-weight: 600;
    color: #555;
    font-size: 14px;
}

.arkflux-modal input[type="text"],
.arkflux-modal select {
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.arkflux-modal select {
    min-height: 40px;
}

.arkflux-modal input[type="text"]:focus,
.arkflux-modal select:focus {
    outline: none;
    border-color: #e0e0e0;
}

/* Buttons */
.arkflux-modal .button,
.arkflux-modal button.button {
    background-color: #0070e0;
    color: white;
    padding: 12px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: background-color 0.2s;
    margin-top: 10px;
}

.arkflux-modal .button:hover,
.arkflux-modal button.button:hover {
    background-color: #005bb5;
}

.arkflux-modal .button:disabled,
.arkflux-modal button.button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

div#address-finder {
    margin-top: 10px;
}

/* Find Address Button */
#find-address-btn {
    margin-bottom: 15px;
}

/* Address Results Section */
#address-results {
    margin-bottom: 15px;
}

#address-select {
    width: 100%;
}

/* Error Messages */
#address-error {
    padding: 10px;
    background-color: #ffebee;
    border-left: 4px solid #f44336;
    border-radius: 4px;
    font-size: 14px;
}

/* Manual Entry Link */
.arkflux-modal a {
    color: #0070e0;
    text-decoration: none;
    font-size: 14px;
}

.arkflux-modal a:hover {
    text-decoration: underline;
}

/* Address Fields Section */
.address-fields {
    margin-top: 15px;
    grid-template-columns: 1fr;
    gap: 0;
}

.address-fields[style*="display: grid"],
.address-fields[style*="display:grid"] {
    display: grid !important;
}

.address-fields label {
    margin-bottom: 5px;
    margin-top: 0;
    grid-column: 1;
}

.address-fields input[type="text"],
.address-fields select {
    margin-bottom: 15px;
    grid-column: 1;
}

/* Selected Address Display */
.selected-address {
    background-color: #f5f5f5;
    padding: 15px;
    border-radius: 4px;
    border-left: 4px solid #0070e0;
    margin-top: 10px;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
}

/* Address Finder Display Area */
#address-finder-display {
    margin-top: 10px;
}

/* AddressNow / Royal Mail Dropdown Styling */
.pcaautocomplete {
    font-family: 'Lato', sans-serif !important;
    background: white !important;
    border: 1px solid #ddd !important;
    border-radius: 4px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
    z-index: 10000 !important;
}

.pcalist {
    background: white !important;
}

.pcaitem {
    font-family: 'Lato', sans-serif !important;
    background: white !important;
    padding: 10px 12px !important;
    border-bottom: 1px solid #f0f0f0 !important;
    cursor: pointer !important;
    font-size: 14px !important;
    color: #333 !important;
    transition: background-color 0.2s !important;
    overflow-x: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    max-width: 471px;
}

.pcaitem.pcalastitem {
    border-bottom: none !important;
}

.pcaitem:hover,
.pcaitem.pcaselected {
    background: #f5f5f5 !important;
}

.pcaheader {
    background: white !important;
    border-bottom: 1px solid #e0e0e0 !important;
}

.pcamessage {
    font-family: 'Lato', sans-serif !important;
    font-size: 13px !important;
    color: #666 !important;
}

/* Responsive Design */
@media (max-width: 600px) {
    .arkflux-modal {
        padding: 20px;
        width: 95%;
    }
    
    .arkflux-modal h2 {
        font-size: 20px;
    }

    .pcaitem {
        max-width: 362px;
    }
}
