/**
 * Parcel Lockers Styles
 * Styles for popup modals and summary displays
 */

/* FANCourier Popup Styles */
#fancourier-locker-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 10000;
    display: none;
    animation: parcel-locker-overlay-in 0.2s ease-out;
}

#fancourier-locker-popup-inner {
    position: relative;
    width: 90%;
    max-width: 1200px;
    height: 85%;
    max-height: 800px;
    margin: 2.5% auto;
    background: #fff;
    padding: 0;
    border-radius: 12px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: parcel-locker-modal-in 0.25s ease-out;
}

#fancourier-locker-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
}

#fancourier-locker-popup-header .popup-title {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 8px;
}

#fancourier-locker-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: transparent;
    color: #6b7280;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    z-index: 10001;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

#fancourier-locker-close:hover {
    background: #f3f4f6;
    color: #1f2937;
}

#fancourier-locker-widget-container {
    width: 100%;
    flex: 1;
    overflow: auto;
}

@keyframes parcel-locker-overlay-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes parcel-locker-modal-in {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Parcel Locker Summary Box */
.parcel-locker-summary-box {
    cursor: pointer;
    border: 2px solid #3182ce;
    background: #f9f9f9;
    padding: 12px;
    margin-top: 12px;
    display: flex;
    align-items: center;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.parcel-locker-summary-box:hover {
    background: #f0f0f0;
    border-color: #2563eb;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Disabled Place Order Button */
button.parcel-locker-disabled,
input.parcel-locker-disabled {
    opacity: 0.6 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
    position: relative;
}

button.parcel-locker-disabled::after,
input.parcel-locker-disabled::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.3);
    cursor: not-allowed;
}

/* Notice/Tooltip for Place Order Button */
.parcel-locker-place-order-notice {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    margin-bottom: 12px;
    background: #fff3cd;
    border: 2px solid #ffc107;
    border-radius: 6px;
    color: #856404;
    font-size: 14px;
    line-height: 1.5;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    animation: parcel-locker-notice-fade-in 0.3s ease-in;
    position: relative;
    width: 100%;
    box-sizing: border-box;
    transition: background-color 0.2s ease;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
}

.parcel-locker-place-order-notice:hover,
.parcel-locker-place-order-notice:active {
    background: #ffe69c !important;
    border-color: #ffb300;
}

.parcel-locker-place-order-notice:active {
    transform: scale(0.98);
}

.parcel-locker-place-order-notice .parcel-locker-notice-icon {
    font-size: 18px;
    flex-shrink: 0;
    line-height: 1;
}

.parcel-locker-place-order-notice .parcel-locker-notice-text {
    flex: 1;
    font-weight: 500;
}

@keyframes parcel-locker-notice-fade-in {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    #fancourier-locker-popup-inner {
        width: 95%;
        height: 90%;
        margin: 2.5% auto;
    }

    #fancourier-locker-popup-header {
        padding: 12px 16px;
    }

    .parcel-locker-summary-box {
        padding: 10px;
        font-size: 14px;
    }

    .parcel-locker-place-order-notice {
        padding: 10px 12px;
        font-size: 13px;
        margin-bottom: 10px;
        touch-action: manipulation;
    }

    .parcel-locker-place-order-notice .parcel-locker-notice-icon {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    #fancourier-locker-popup-inner {
        width: 100%;
        height: 100%;
        margin: 0;
        border-radius: 0;
    }

    #fancourier-locker-popup-header {
        padding: 10px 14px;
    }

    .parcel-locker-place-order-notice {
        padding: 10px;
        font-size: 12px;
        gap: 6px;
    }

    .parcel-locker-place-order-notice .parcel-locker-notice-icon {
        font-size: 14px;
    }
}

/* Blocks Checkout Compatibility */
.wc-block-components-checkout-place-order-button ~ .parcel-locker-place-order-notice,
.place-order ~ .parcel-locker-place-order-notice {
    margin-bottom: 16px;
}

/* Ensure notice doesn't break layout */
.parcel-locker-place-order-notice {
    max-width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Select Pickup Point Button Wrapper */
.parcel-locker-select-btn-wrapper {
    margin: 12px 0 0 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Select Pickup Point Button */
.parcel-locker-select-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    margin: 0;
    background: #5271ff;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    box-shadow: 0 1px 3px rgba(82, 113, 255, 0.3);
    flex-shrink: 0;
}

.parcel-locker-select-btn:hover {
    background: #4461eb;
    box-shadow: 0 2px 8px rgba(82, 113, 255, 0.35);
    transform: translateY(-1px);
}

.parcel-locker-select-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 3px rgba(82, 113, 255, 0.3);
}

.parcel-locker-select-btn__icon {
    font-size: 14px;
    line-height: 1;
}

.parcel-locker-select-btn__text {
    line-height: 1;
    white-space: nowrap;
}

.parcel-locker-select-btn-hint {
    font-size: 12px;
    color: #64748b;
    line-height: 1.4;
    flex: 1;
    min-width: 0;
}

/* Container styling when needs selection */
.rf-option-container.parcel-locker-needs-selection {
    border-color: #5271ff !important;
    position: relative;
}

.rf-option-container.parcel-locker-needs-selection::after {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: #5271ff;
    border-radius: 3px 0 0 3px;
}

/* Make parcel locker containers appear clickable */
.rf-option-container[data-parcel-locker="true"].is-selected {
    cursor: pointer !important;
    transition: all 0.2s ease;
}

.rf-option-container[data-parcel-locker="true"].is-selected:hover {
    background: #f9f9f9;
}

/* Mobile responsive styles */
@media (max-width: 768px) {
    .parcel-locker-select-btn-wrapper {
        padding: 10px 12px;
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .parcel-locker-select-btn {
        width: 100%;
        justify-content: center;
        padding: 12px 16px;
        font-size: 14px;
    }

    .parcel-locker-select-btn__icon {
        font-size: 16px;
    }

    .parcel-locker-select-btn-hint {
        text-align: center;
    }
}

