/* Popup styling */
.popup {
    position: fixed !important; /* Force fixed positioning */
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background-color: rgba(0, 0, 0, 0.7);
    display: none;
    z-index: 9999; /* Increased z-index to ensure it's above everything */
}

.popup.active,
.popup[style*="display: block"] {
    display: flex !important; /* Force flex display when active or shown */
    justify-content: center !important;
    align-items: center !important;
}

/* Popup Overlay Styles */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.popup-content {
    background-color: white;
    border-radius: 8px;
    max-width: 90%;
    max-height: 90%;
    overflow-y: auto;
    padding: 20px;
    position: relative;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

/* Ensure the popup is always on top */
#tour-details-popup.popup {
    z-index: 9998;
}

/* Make sure this doesn't override wizard-specific styles */
.popup-content {
    background-color: white;
    padding: 20px;
    border-radius: 5px;
    width: 80%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative !important;
    margin: auto !important; /* Center horizontally */
    top: auto !important; /* Override any top positioning */
    left: auto !important; /* Override any left positioning */
    transform: none !important; /* Override any transforms */
}

/* Ensure this doesn't apply to wizard */
.popup-content:not(.wizard) {
    /* Any styles that should only apply to non-wizard popups */
}

.close-popup {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 24px;
    cursor: pointer;
}

/* Additional styling for the form inside the popup */
#tour-details-content h3 {
    margin-top: 0;
    color: #2c3e50;
}

#booking-form .form-group {
    margin-bottom: 15px;
}

#booking-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

#booking-form input,
#booking-form select,
#booking-form textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

#booking-form .submit-button {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.3s;
}

#booking-form .submit-button:hover {
    background-color: #2980b9;
}



.close-popup:hover,
.close-popup:focus {
    color: #333;
    text-decoration: none;
}

/* Stili per i dettagli del tour */
.tour-details-header {
    display: flex;
    margin-bottom: 20px;
    gap: 20px;
}

.tour-details-header img {
    width: 300px;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
}

/* Add styling for the formatted description */
.tour-full-description {
    line-height: 1.6;
    margin-bottom: 25px;
    color: #333;
}

.tour-full-description p {
    margin-bottom: 15px;
}

.tour-full-description strong, 
.tour-full-description b {
    color: #000;
    font-weight: 600;
}

.tour-full-description h3, 
.tour-full-description h4 {
    margin-top: 20px;
    margin-bottom: 10px;
    color: #333;
    font-weight: 600;
}

.tour-full-description ul {
    margin: 15px 0 15px 20px;
    padding-left: 0;
}

.tour-full-description li {
    margin-bottom: 8px;
    list-style-type: disc;
}

/* Styling for the tour details section */
.tour-details-body {
    padding: 5px 0 20px 0;
}

/* Style for specific elements in the tour description */
.tour-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 10px;
    color: #666;
}

.tour-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Highlight important information */
.nota-importante {
    background-color: #f8f8f8;
    border-left: 4px solid #4CAF50;
    padding: 10px 15px;
    margin: 20px 0;
}

/* Style for section titles in the description */
.section-title {
    font-weight: 600;
    color: #333;
    margin-top: 20px;
    margin-bottom: 10px;
    font-size: 1.1em;
}

.tour-highlights {
    background-color: #f9f9f9;
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
}

.tour-highlights h4 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #333;
}

.tour-highlights ul {
    margin: 0;
    padding-left: 20px;
}

.tour-highlights li {
    margin-bottom: 8px;
}

.tour-details-footer {
    text-align: center;
    margin-top: 20px;
}

/* Stili per i pulsanti nelle tessere dei tour */
.tour-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 15px;
}

.details-button {
    display: inline-block;
    padding: 8px 15px;
    background-color: #f5f5f5;
    color: #333;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 600;
    transition: background-color 0.3s;
}

.details-button:hover {
    background-color: #e0e0e0;
}

/* Stile per il tour selezionato */
.tour-card.selected {
    border: 2px solid #4CAF50;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.2);
}

@media (max-width: 768px) {
    .popup-content {
        width: calc(100vw - 24px);
        max-width: calc(100vw - 24px);
        padding: 16px;
        box-sizing: border-box;
    }

    .tour-details-header {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }

    .tour-details-header img {
        width: 100%;
        max-width: 100%;
        height: auto;
    }

    .tour-details-header > div {
        width: 100%;
        min-width: 0;
    }

    .tour-meta {
        width: 100%;
        gap: 10px;
    }

    .tour-meta span {
        min-width: 0;
        flex-wrap: wrap;
    }
}
