/* General body and container styling for background and layout */
body {
    font-family: 'Inter', sans-serif;
    background-color: #363636; /* Dark background from El Nacional website */
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    overflow-y: auto; /* Allow vertical scrolling if content overflows */
}
.container {
    background-color: #F8F8F8; /* Light background from El Nacional website */
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    width: 100%;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 20px;
    color: #363636; /* Dark text color for contrast */
}

/* Table grid and individual table styling */
.table-grid {
    display: grid;
    grid-template-columns: 1fr; /* Default: single column for small screens */
    gap: 20px;
    margin-top: 30px;
    padding: 20px;
}
/* Media query for medium screens and up: two columns */
@media (min-width: 768px) { /* Tailwind's 'md' breakpoint */
    .table-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.table-image-container {
    position: relative;
    width: 150px; /* Fixed width for each table image container */
    height: 150px; /* Fixed height for each table image container */
    margin: auto; /* Center tables within grid cells */
    border: 4px solid transparent; /* Transparent border by default */
    border-radius: 15px; /* Rounded corners for the container */
    cursor: pointer;
    transition: all 0.3s ease; /* Smooth transitions for hover/selection */
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden; /* Ensures image fits within the rounded rounded corners */
}
.table-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Image covers the container, cropping if necessary */
    border-radius: 10px; /* Slightly more rounded corners for the image itself */
}
.table-image-container.selected {
    border-color: #B4914C; /* Gold border when a table is selected */
    box-shadow: 0 0 0 4px #E3C279; /* Lighter gold glow effect */
    transform: scale(1.05); /* Slightly enlarge selected table */
}
.table-image-container:hover {
    transform: scale(1.05); /* Enlarge on hover */
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2); /* Shadow on hover */
}
.table-label {
    position: absolute;
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(54, 54, 54, 0.7); /* Semi-transparent dark background for label */
    color: white;
    padding: 4px 8px;
    border-radius: 5px;
    font-size: 0.9rem;
}

/* Form group styling */
.form-group {
    margin-bottom: 20px;
    text-align: left;
}
.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #363636;
}
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="date"],
.form-group select { /* Added select for diners dropdown */
    width: 100%;
    padding: 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 1rem;
    box-sizing: border-box; /* Include padding and border in the element's total width and height */
    background-color: white;
    color: #363636;
}
.form-group input[type="checkbox"] {
    margin-right: 10px;
    transform: scale(1.2); /* Slightly larger checkboxes */
    accent-color: #B4914C; /* Gold accent color for checkboxes */
}

/* QR Code section styling */
/* REMOVED .qr-code-section */

/* Button styling */
.button {
    padding: 12px 25px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    margin-top: 15px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    text-transform: uppercase; /* Uppercase text for buttons */
}
.button-primary {
    background-color: #B4914C; /* Gold primary button color */
    color: #ffffff;
}
.button-primary:hover {
    background-color: #E3C279; /* Lighter gold on hover */
    transform: translateY(-2px); /* Slight lift effect */
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2); /* Larger shadow on hover */
}
.button-secondary {
    background-color: #6b7280; /* Dark grey for secondary buttons */
    color: #ffffff;
}
.button-secondary:hover {
    background-color: #4b5563; /* Even darker grey on hover */
    transform: translateY(-2px);
}
.button-back {
    background-color: #D32F2F; /* Darker red for back buttons */
    color: #ffffff;
}
.button-back:hover {
    background-color: #B71C1C; /* Even darker red on hover */
    transform: translateY(-2px);
}

/* Confirmation message styling */
.confirmation-message {
    margin-top: 30px;
    padding: 20px;
    background-color: #fffde7; /* Light yellow background */
    border-radius: 10px;
    border: 2px solid #E3C279; /* Gold border */
}
.confirmation-message h2 {
    font-size: 2.5rem;
    color: #B4914C; /* Gold for confirmation title */
    margin-bottom: 10px;
}
.confirmation-message p {
    font-size: 1.2rem;
    color: #363636;
    margin-top: 10px;
}
.confirmation-message .code {
    font-size: 2rem;
    font-weight: bold;
    color: #D97706; /* Orange for the reservation code */
    letter-spacing: 2px;
    margin-top: 10px;
}

/* Utility class to hide elements */
.hidden {
    display: none;
}

/* Button group for side-by-side buttons */
.button-group {
    display: flex;
    flex-direction: column; /* Stack buttons vertically by default */
    gap: 15px; /* Space between buttons */
    justify-content: center;
    margin-top: 15px;
}
.button-group .button {
    flex-grow: 1; /* Buttons expand to fill available space */
    margin-top: 0; /* Override default button margin-top */
}
/* For larger screens, arrange buttons side-by-side */
@media (min-width: 640px) { /* Tailwind's 'sm' breakpoint */
    .button-group {
        flex-direction: row;
    }
}


/* Phone input group with custom select */
.phone-input-group {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative; /* Needed for absolute positioning of custom dropdown */
    flex-wrap: wrap; /* Allow items to wrap onto the next line on small screens */
}
.phone-input-group input[type="text"] {
    flex-grow: 1; /* Phone number input takes available space */
    min-width: 120px; /* Ensure it doesn't get too narrow */
}

/* WhatsApp specific options styling */
.whatsapp-options {
    margin-top: 10px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 10px;
    background-color: #f9fafb;
}
.whatsapp-options .flex {
    margin-bottom: 8px;
}
.whatsapp-options .flex:last-child {
    margin-bottom: 0;
}

/* Confirmation message for sending status */
#sendingConfirmationMessage {
    margin-top: 15px;
    color: #10B981; /* Green color for success status */
    font-weight: 600;
}

/* Custom Dropdown for Country Codes */
.custom-select-wrapper {
    position: relative;
    flex-shrink: 0; /* Prevent shrinking below content */
    width: 120px; /* Fixed width for the custom select dropdown on larger screens */
    min-width: 90px; /* Minimum width for very small screens */
    max-width: 120px; /* Max width on larger screens */
}
@media (max-width: 400px) { /* Adjust for very small phone screens if necessary */
    .custom-select-wrapper {
        width: 100%; /* Take full width if wrapped */
        max-width: none;
    }
}

.custom-select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background-color: white;
    cursor: pointer;
    font-size: 1rem;
    color: #363636;
    user-select: none; /* Prevent text selection on click */
}

.custom-options {
    display: none; /* Hidden by default */
    position: absolute;
    top: 100%; /* Position right below the trigger */
    left: 0;
    right: 0;
    background-color: white;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    max-height: 200px; /* Max height before scrolling */
    overflow-y: auto; /* Enable vertical scrolling */
    z-index: 10; /* Ensure dropdown appears above other elements */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-top: 5px; /* Small gap between trigger and options */
}

.custom-options.open {
    display: block; /* Show when open class is present */
}

.custom-option {
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 10px; /* Space between flag and code */
    cursor: pointer;
    font-size: 0.9rem;
    color: #363636;
}

.custom-option:hover {
    background-color: #f3f4f6; /* Light grey background on hover */
}

.custom-option.selected {
    background-color: #e0f2f7; /* Light blue for selected option */
    font-weight: 600;
}

.custom-option .flag-emoji {
    font-size: 1.2rem; /* Size for flag emojis */
    line-height: 1; /* Align emoji vertically */
}

/* Modal for messages (replaces alert/confirm) */
.modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 100; /* Sit on top */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
    background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: #fefefe;
    margin: auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 500px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.modal-content h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: #363636;
}

.modal-content p {
    margin-bottom: 20px;
    color: #555;
}

.modal-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.modal-buttons button {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.3s ease;
}

.modal-buttons .ok-button {
    background-color: #B4914C;
    color: white;
}

.modal-buttons .ok-button:hover {
    background-color: #E3C279;
}
