/* ========================================
   Header Property Search Modal Styles
   ======================================== */

/* Modal Overlay */
.property-search-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(8px);
    z-index: 99999;
    overflow-y: auto;
    padding: 1.5rem;
}

.property-search-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Modal Content Container */
.property-search-modal-content {
    background: white;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    position: relative;
    animation: modalSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    flex-direction: column;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Modal Header */
.property-search-modal-header {
    padding: 2rem 2rem 1.5rem;
    background: linear-gradient(135deg, #154D71 0%, #0F3A54 100%);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.property-search-modal-header h3 {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 700;
    color: white;
}

/* Close Button */
.property-search-modal-close {
    background: #ef4444;
    border: none;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    color: white;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
    font-size: 32px;
    font-weight: 300;
    line-height: 1;
    font-family: Arial, sans-serif;
}

.property-search-modal-close:hover {
    background: #dc2626;
    transform: rotate(90deg) scale(1.15);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.5);
}

/* Modal Body */
.property-search-modal-body {
    padding: 2rem;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.property-search-modal-body .form-group {
    margin-bottom: 1.5rem;
}

.property-search-modal-body .form-group label {
    display: block;
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
}

.property-search-modal-body .form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.property-search-modal-body .form-control:focus {
    outline: none;
    border-color: #154D71;
    box-shadow: 0 0 0 3px rgba(21, 77, 113, 0.1);
}

/* Keyword Search Input with Icon */
.keyword-search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.keyword-search-icon {
    position: absolute;
    left: 16px;
    color: #334155;
    pointer-events: none;
    z-index: 1;
}

[dir="rtl"] .keyword-search-icon {
    left: auto;
    right: 16px;
}

.keyword-input {
    padding-left: 48px !important;
}

[dir="rtl"] .keyword-input {
    padding-left: 16px !important;
    padding-right: 48px !important;
}

.keyword-input:focus + .keyword-search-icon,
.keyword-search-wrapper:focus-within .keyword-search-icon {
    color: #154D71;
}

/* Form Row (Two columns) */
.property-search-modal-body .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* Modal Footer */
.property-search-modal-footer {
    padding: 1.5rem 2rem 2rem;
    background: white;
    display: flex;
    gap: 0.75rem;
    justify-content: stretch;
    position: sticky;
    bottom: 0;
    border-top: 1px solid #e2e8f0;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.08);
    flex-shrink: 0;
}

.property-search-modal-footer .btn-primary {
    background: #154D71;
    color: white;
    border: none;
    padding: 16px 32px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 1.125rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(21, 77, 113, 0.4);
    width: 100%;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.property-search-modal-footer .btn-primary:hover {
    background: #1C6EA4;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(28, 110, 164, 0.5);
}

.property-search-modal-footer .btn-primary:active {
    transform: translateY(0);
}

.property-search-modal-footer .btn-primary svg {
    flex-shrink: 0;
}

/* ======================================
   Mobile Responsive Styles
   ====================================== */

@media (max-width: 639px) {
    .property-search-modal {
        padding: 0;
        align-items: flex-end;
    }

    .property-search-modal-content {
        max-height: 95vh;
        height: 95vh;
        border-radius: 20px 20px 0 0;
        animation: modalSlideUp 0.3s ease-out;
    }

    @keyframes modalSlideUp {
        from {
            transform: translateY(100%);
        }
        to {
            transform: translateY(0);
        }
    }

    .property-search-modal-header {
        padding: 1.5rem 1.5rem;
        border-radius: 20px 20px 0 0;
        position: relative;
    }

    .property-search-modal-header::before {
        content: '';
        position: absolute;
        top: 8px;
        left: 50%;
        transform: translateX(-50%);
        width: 40px;
        height: 4px;
        background: rgba(255, 255, 255, 0.3);
        border-radius: 2px;
    }

    .property-search-modal-header h3 {
        font-size: 1.375rem;
    }

    .property-search-modal-close {
        width: 36px;
        height: 36px;
        font-size: 24px;
    }

    .property-search-modal-body {
        padding: 1.5rem;
    }

    .property-search-modal-body .form-row {
        grid-template-columns: 1fr;
    }

    .property-search-modal-footer {
        padding: 1.25rem 1.5rem 1.5rem;
    }

    .property-search-modal-footer .btn-primary {
        padding: 14px 24px;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .property-search-modal-header h3 {
        font-size: 1.25rem;
    }

    .property-search-modal-body .form-group {
        margin-bottom: 1.25rem;
    }

    .property-search-modal-body .form-group label {
        font-size: 0.875rem;
        margin-bottom: 0.5rem;
    }

    .property-search-modal-body .form-control {
        padding: 10px 14px;
        font-size: 0.938rem;
    }
}
