﻿.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: flex-start; /* Changed from center to flex-start */
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding: 20px; /* Added padding around the overlay */
    overflow-y: auto; /* Enable scrolling */
}

    .popup-overlay.active {
        opacity: 1;
        visibility: visible;
    }

.popup-content {
    background: white;
    padding: 2rem;
    border-radius: 20px;
    width: 100%;
    max-width: 500px;
    position: relative;
    transform: scale(0.7);
    opacity: 0;
    transition: all 0.3s ease;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    margin: 40px auto; /* Added margin top and bottom */
}

.popup-overlay.active .popup-content {
    transform: scale(1);
    opacity: 1;
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 30px;
    height: 30px;
    border: none;
    background: #f3f4f6;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 1000; /* Ensure button stays on top */
}

    .close-btn:hover {
        background: #e5e7eb;
        transform: rotate(90deg);
    }

    .close-btn::before,
    .close-btn::after {
        content: '';
        position: absolute;
        width: 15px;
        height: 2px;
        background: #4b5563;
    }

    .close-btn::before {
        transform: rotate(45deg);
    }

    .close-btn::after {
        transform: rotate(-45deg);
    }

/* Form Styles */
.booking-form h2 {
    color: #1f2937;
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.form-group {
    margin-bottom: 1.5rem;
}

    .form-group label {
        display: block;
        margin-bottom: 0.5rem;
        color: #4b5563;
        font-size: 0.9rem;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        width: 100%;
        padding: 0.75rem;
        border: 1px solid #e5e7eb;
        border-radius: 8px;
        font-size: 1rem;
        transition: all 0.3s ease;
        background: #f9fafb;
    }

        .form-group input:focus,
        .form-group select:focus,
        .form-group textarea:focus {
            outline: none;
            border-color: #3b82f6;
            box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
            background: white;
        }

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.submit-btn {
    width: 100%;
    padding: 0.75rem;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1rem;
}

    .submit-btn:hover {
        background: #2563eb;
        transform: translateY(-2px);
    }

/* Room Preview */
.room-preview {
    margin: -2rem -2rem 2rem -2rem;
    padding: 1.5rem;
    background: #f3f4f6;
    border-radius: 20px 20px 0 0;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.room-image {
    width: 100px;
    height: 70px;
    border-radius: 8px;
    object-fit: cover;
}

.room-info h3 {
    color: #1f2937;
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.room-price {
    color: #6b7280;
    font-size: 0.9rem;
}

/* Mobile Styles */
@media (max-width: 640px) {
    .popup-overlay {
        padding: 10px; /* Reduced padding for mobile */
        align-items: center; /* Center on mobile */
    }

    .popup-content {
        margin: 10px auto; /* Reduced margin for mobile */
        max-height: 82vh; /* Maximum height on mobile */
        overflow-y: auto; /* Enable scrolling within the popup */
        padding: 1.5rem; /* Slightly reduced padding */
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .room-preview {
        margin: -1.5rem -1.5rem 1.5rem -1.5rem;
        padding: 1rem;
    }

    /* Smooth scrolling for iOS */
    .popup-content {
        -webkit-overflow-scrolling: touch;
    }

    /* Ensure form elements are properly spaced */
    .form-group {
        margin-bottom: 1rem;
    }

        /* Make inputs easier to tap */
        .form-group input,
        .form-group select {
            min-height: 44px; /* Better touch targets */
        }
}

/* Open Popup Button */
.open-popup-btn {
    padding: 1rem 2rem;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
}

    .open-popup-btn:hover {
        background: #2563eb;
    }
