/* ====== POSTCODE LOOKUP FRONTEND STYLES ====== */

.pl-lookup-wrapper {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
}

.pl-lookup-form {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    padding: 8px;
    background: white;
}

.pl-lookup-form input[type="text"] {
    flex: 1;
    padding: 14px 18px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.pl-lookup-form input[type="text"]:focus {
    border-color: #3b82f6;
    outline: none;
}

.pl-lookup-form button {
    padding: 14px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.pl-lookup-form button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.pl-lookup-form button:active {
    transform: translateY(0);
}

/* ====== RESULT STYLES ====== */
.pl-result {
    animation: fadeIn 0.4s ease;
    position: relative;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.pl-loading {
    text-align: center;
    padding: 40px;
    color: #64748b;
    font-size: 20px;
    background-color: #FFFFFF;
}

.pl-loading::after {
    content: '...';
    animation: dots 1.5s infinite;
}

@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

.pl-property-card {
    background: white;
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    border: 2px solid #e2e8f0;
}

.pl-property-card h3 {
    margin: 0 0 20px;
    font-size: 30px;
    color: #1e293b;
    font-weight: 700;
}

.pl-property-details {
    background: #f8fafc;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.pl-property-details p {
    margin: 12px 0;
    font-size: 20px;
    color: #475569;
    line-height: 1.6;
}

.pl-property-details strong {
    font-size: 20px;
    color: #1e293b;
    display: inline-block;
    min-width: 140px;
    font-weight: 600;
}

.pl-property-images {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
    margin-top: 20px;
}

.pl-property-images img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 10px;
    border: 2px solid #e2e8f0;
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
}

.pl-property-images img:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.pl-no-result {
    text-align: center;
    padding: 60px 20px;
    /* background: #fef2f2; */
    border: 2px solid #0CBFDE;
    border-radius: 12px;
    color: #991b1b;
    font-size: 20px;
}

.pl-error {
    text-align: center;
    padding: 60px 20px;
    /* background: #fef2f2; */
    border: 2px solid #0CBFDE;
    border-radius: 12px;
    color: #991b1b;
    font-size: 16px;
}

/* ====== RESPONSIVE ====== */
@media (max-width: 768px) {
    .pl-lookup-wrapper {
        padding: 15px;
    }
    
    .pl-lookup-form {
        flex-direction: column;
        gap: 8px;
    }
    
    .pl-lookup-form button {
        width: 100%;
    }
    
    .pl-property-card {
        padding: 24px;
    }
    
    .pl-property-card h3 {
        font-size: 20px;
    }
    
    .pl-property-details {
        padding: 15px;
    }
    
    .pl-property-details strong {
        padding: 15px;
        display: block;
        margin-bottom: 4px;
    }
    
    .pl-property-images {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
}

/* ====== LAYOUT SIDE (Version 2) ====== */

/* Khi dùng layout=side, wrapper mở rộng để chứa cả 2 cột */
.pl-layout-side {
    max-width: 1200px;
    display: flex;
    gap: 32px;
    align-items: flex-start;
}

/* Form giữ nguyên style, chỉ thu nhỏ max-width về đúng cột trái */
.pl-layout-side .pl-lookup-form {
    max-width: 480px;
    flex: 0 0 480px;
    margin-bottom: 0;
}

/* Container 2 cột bên dưới form */
.pl-side-container {
    display: contents;
}

/* Cột trái: chiếm đúng bằng chiều rộng form để căn thẳng */
.pl-side-left {
    display: none;
}

/* Cột phải: phần kết quả */
.pl-side-right {
    flex: 1;
    z-index: 9999 !important;
    position: relative;
    top: -162px;
    min-width: 70%;
}

/* Responsive: trên mobile thì xếp dọc lại như version 1 */
@media (max-width: 768px) {
    .pl-layout-side {
        max-width: 600px;
        flex-direction: column;
        gap: 0;
    }

    .pl-layout-side .pl-lookup-form {
        max-width: 100%;
        flex: 1 1 auto;
        margin-bottom: 0;
    }

    .pl-side-left {
        display: none;
    }

    /* Quan trọng: reset display:contents để container hoạt động bình thường */
    .pl-layout-side .pl-side-container {
        display: block;
        width: 100%;
    }

    .pl-side-right {
        width: 100%;
        /* Reset hoàn toàn các giá trị desktop */
        position: static !important;
        top: auto !important;
        min-width: unset !important;
        margin-top: 24px;
    }
}

.pl-close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    max-width: 32px;
    height: 32px;
    cursor: pointer;
    z-index: 10;
    background: transparent;
    border: none;
    font-size: 24px;
    color: #64748b;
    line-height: 5px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s, transform 0.2s;
}

.pl-close-btn:hover {
    color: #1e293b;
    transform: scale(1.1);
}

.pl-close-btn:active {
    transform: scale(0.95);
}