/* General Popup Styles */
.popup {
    display: flex;
    justify-content: center;
    align-items: center;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.4);
}

/* Button Popup Styles */
.button-popup {
    position: absolute;
    top: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: 5px;
    padding: 10px 15px;
    text-align: center;
    font-size: 14px;
    display: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    width: 100%;
    box-sizing: border-box;
    z-index: 1000;
}

.button-popup::before,
.button-popup::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    border: 10px solid transparent;
}

.button-popup::before {
    border-bottom-color: #f5c6cb;
    transform: translateX(-50%);
}

.button-popup::after {
    border-bottom-color: #f8d7da;
    transform: translateX(-50%) translateY(1px);
}

/* Contact Form Modal Styles */
.contact-form-modal {
    background-color: #fefefe;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 350px;
    border-radius: 5px;
    position: relative;
    z-index: 1001;
}

.contact-form-modal h2 {
    font-size: 18px;
    line-height: 122%;
    margin: 0 0 15px;
    font-weight: 700;
    color: #303030;
    font-family: "Lato", Arial, Helvetica, sans-serif;
}

.contact-form-modal form {
    display: flex;
    flex-direction: column;
}

.contact-form-modal .form-field {
    margin-bottom: 15px;
}

.contact-form-modal .field-header {
    display: block;
    margin-bottom: 5px;
    font-size: 14px;
    font-weight: 700;
    color: #676767;
    line-height: 110%;
    font-family: "Lato", Arial, Helvetica, sans-serif;
}

.contact-form-modal input,
.contact-form-modal textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 14px;
    margin-bottom: 10px;
}

.contact-form-modal textarea {
    height: 100px;
    resize: vertical;
}

.contact-form-modal button[type="submit"] {
    width: 100%;
    background-color: #0056b3;
    border: none;
    color: white;
    padding: 10px 15px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 16px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.contact-form-modal button[type="submit"]:hover {
    background-color: #003d82;
}

/* Close Button Styles */
.close-popup {
    font-size: 28px !important;
    font-weight: bold !important;
    cursor: pointer !important;
    background: none !important;
    border: none !important;
    position: absolute !important;
    scale: 2 !important;
    right: 25px !important;
    top: 18px !important;
    padding: 0 !important;
    line-height: 1 !important;
    z-index: 1000 !important;
    color: #676767 !important;
}

.close-popup:hover,
.close-popup:focus {
    color: #000 !important;
    text-decoration: none !important;
    cursor: pointer !important;
}

#contact-seller-popup {
    z-index: 1000;
}

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

.contact-close {
    margin: 15px;
    border-width: 0;
    display: block;
    right: 0;
    top: 0;
    position: absolute;
}

/* Utility Classes */
.hidden {
    display: none;
}

.visuallyhidden {
    border: 0;
    clip: rect(0 0 0 0);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
}

/* Error Message Styles */
.message-error {
    color: #721c24;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    padding: 10px;
    margin-bottom: 10px;
    border-radius: 5px;
}

/* Yacht Details Popup Styles */
.yacht-details-modal {
    background-color: #fff;
    padding: 20px;
    border-radius: 5px;
    width: 90%;
    max-width: 1000px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.yacht-details-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    margin-right: 40px;
}

.yacht-details-header h2 {
    font-size: 24px;
    margin: 0;
    font-family: "Roboto";
}

.yacht-price {
    font-size: 20px;
    font-weight: bold;
    color: #0056b3;
    font-family: "Roboto";
}

.yacht-images {
    position: relative;
    margin-bottom: 20px;
    width: 100%;
}

.main-image {
    width: 100%;
    height: 100%;
    overflow: hidden;
    margin-bottom: 10px;
    position: relative;
}

.main-image img {
    object-fit: scale-down;
}

.thumbnail-carousel {
    width: 100%;
    overflow-x: auto;
    margin-bottom: 20px;
}

.thumbnail-images {
    display: flex;
    gap: 10px;
    padding-bottom: 10px; /* Space for scrollbar */
}

.thumbnail-images img {
    flex: 0 0 auto;
    width: 80px;
    height: 60px;
    object-fit: cover;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

.thumbnail-images img:hover,
.thumbnail-images img.active {
    opacity: 1;
    border: 2px solid #0056b3;
}

/* Styling the scrollbar */
.thumbnail-carousel::-webkit-scrollbar {
    height: 8px;
}

.thumbnail-carousel::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.thumbnail-carousel::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.thumbnail-carousel::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    font-size: 24px;
    padding: 10px 15px;
    cursor: pointer;
    transition: background-color 0.3s;
    z-index: 2;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.carousel-nav.prev {
    left: 10px;
}

.carousel-nav.next {
    right: 10px;
}

.carousel-nav:hover {
    background-color: rgba(0, 0, 0, 0.7);
}

.carousel-nav i {
    font-size: 20px;
}

.thumbnail-gallery {
    display: flex;
    gap: 10px;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 10px;
}

.thumbnail-container {
    flex: 0 0 auto;
    width: 120px;
    height: 80px;
    position: relative;
    background-color: #f0f0f0;
    overflow: hidden;
}

.thumbnail-container .spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-top: 2px solid #0056b3;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.thumbnail-container img {
    width: 100%;
    height: 100%;
    object-fit: fill;
    cursor: pointer;
    transition: opacity 0.3s ease;
    opacity: 0;
}

.thumbnail-container img.error {
    opacity: 0.5;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

.thumbnail-container img.active {
    border: 2px solid #0056b3;
}

.thumbnail-container img:hover {
    opacity: 0.8;
}

.yacht-info {
    margin-bottom: 20px;
}

.yacht-info-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-top: 10px;
}

.yacht-info-icons {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.yacht-details-modal .request-info-btn {
    background-color: #0056b3;
    color: white;
    border: none;
    padding: 10px 20px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 16px;
    margin: 4px 2px;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.yacht-details-modal .request-info-btn:hover {
    background-color: #003d82;
}

.yacht-info-icons span {
    display: flex;
    align-items: center;
    font-size: 14px;
    color: #333;
}

.yacht-info-icons i {
    font-size: 18px;
    margin-right: 8px;
    color: #0056b3;
}

/* Tooltip styles */
.yacht-info-icons span {
    position: relative;
}

.yacht-info-icons span::before {
    content: attr(title);
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #333;
    color: #fff;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.yacht-info-icons span:hover::before {
    opacity: 1;
    visibility: visible;
}

.yacht-info-icons span:last-child {
    white-space: nowrap;
}

.yacht-details-accordion {
    border: 1px solid #e0e0e0;
    border-radius: 5px;
}

.accordion-item {
    border-bottom: 1px solid #e0e0e0;
}

.accordion-item:last-child {
    border-bottom: none;
}

.accordion-header {
    border-style: none !important;
    cursor: pointer;
    padding: 18px;
    width: 100%;
    text-align: left;
    border: none;
    outline: none;
    transition: 0.4s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.accordion-header:hover {
    background-color: #e0e0e0;
}

.accordion-header.active {
    background-color: #e0e0e0;
}

.accordion-content {
    padding: 0 18px;
    background-color: white;
    display: none;
    overflow: hidden;
}

/* Spinner styles */
.spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Error image style */
img.error {
    opacity: 0.5;
}

.error-message {
    color: #721c24;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    padding: 10px;
    border-radius: 5px;
    text-align: center;
}

.image-slider-container {
    width: 100%;
    padding: 10px 0;
    position: relative;
}

.image-slider {
    -webkit-appearance: none;
    width: 100%;
    height: 5px;
    border-radius: 5px;
    background: #d3d3d3;
    outline: none;
    opacity: 0.7;
    transition: opacity .2s;
}

.image-slider:hover {
    opacity: 1;
}

.image-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 30px; /* Increased width */
    height: 15px; /* Decreased height */
    background: rgba(0, 86, 179, 0.5);
    cursor: pointer;
    border-radius: 15px; /* Rounded corners */
    position: relative;
}

.image-slider::-moz-range-thumb {
    width: 30px; /* Increased width */
    height: 15px; /* Decreased height */
    background: rgba(0, 86, 179, 0.5);
    cursor: pointer;
    border-radius: 15px; /* Rounded corners */
    position: relative;
}

/* FontAwesome chevron icon */
.image-slider::-webkit-slider-thumb::before,
.image-slider::-moz-range-thumb::before {
    content: '\f054'; /* FontAwesome chevron-right icon */
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 10px;
}

/* Faded circle behind the chevron */
.image-slider::-webkit-slider-thumb::after,
.image-slider::-moz-range-thumb::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 25px;
    height: 25px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    z-index: -1;
}

.accordion-header .fa-chevron-down {
    transition: transform 0.3s ease;
    margin-left: 10px;
}

.accordion-header.active .fa-chevron-down {
    transform: rotate(180deg);
}

#fullscreen-image-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    display: none;
    z-index: 1100;
}

.fullscreen-image-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    height: 90%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.fullscreen-image-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.main-image img {
    cursor: pointer;
}

.fullscreen-close {
    position: absolute;
    top: 20px;
    right: 20px;
    color: #fff;
    font-size: 30px;
    cursor: pointer;
    z-index: 1101;
}