/* Basic reset */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Variables */
body {
    --primary-color: #000066;
    --text-light: #ffffff;
    --text-dark: #333333;
    --border-color: #dddddd;
    --background-light: #f4f4f4;
    --background-dark: rgba(0, 0, 0, 0.9);
    
    font-family: Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--background-light);
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

/* Header styles */
header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background-color: var(--primary-color);
    color: var(--text-light);
    border-radius: 5px;
}

header img {
    max-width: 220px;
    margin-bottom: 10px;
}

h1, h2, h3 {
    margin-bottom: 10px;
}

/* Loading indicator */
#loading {
    text-align: center;
    padding: 20px;
    font-size: 18px;
}

/* Boat selection */
#boat-selection {
    margin-bottom: 20px;
}

.selection-container {
    position: relative;
}

select {
    width: 100%;
    padding: 10px;
    margin-top: 5px;
    border-radius: 5px;
    border: 1px solid var(--border-color);
    font-size: 16px;
}

/* Thumbnails */
#thumbnails-container {
    margin-top: 20px;
}

#thumbnails {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
    margin-top: 20px;
}

.thumbnail {
    cursor: pointer;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    overflow: hidden;
    transition: transform 0.3s;
    background-color: #fff;
    position: relative;
}

.thumbnail:hover {
    transform: scale(1.05);
}

.thumbnail img {
    width: 100%;
    height: auto;
    display: block;
}

.thumbnail-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 3px 5px;
    font-size: 12px;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Image viewer */
#image-viewer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--background-dark);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

#image-container {
    max-width: 90%;
    max-height: 80%;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

/* Allow overflow when zoomed on desktop */
#image-container.desktop-zoom-active {
    overflow: visible !important;
}

/* Ensure container allows zoomed content to overflow on desktop */
@media (min-width: 768px) {
    body.draggable-active #image-container {
        overflow: visible !important;
    }
}

/* BUY button styling */
.buy-button {
    position: absolute;
    bottom: 10px;
    left: 10px;
    z-index: 50;
    background-color: #ff4400;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 15px;
    cursor: pointer;
    font-weight: bold;
    font-size: 16px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.5);
    transition: all 0.2s ease;
}

.buy-button:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0,0,0,0.5);
}

/* Make sure the button stays visible in both portrait and landscape */
@media (orientation: landscape) {
    .buy-button {
        font-size: 14px;
        padding: 6px 12px;
    }
}

/* For smaller screens, adjust size */
@media (max-width: 768px) {
    .buy-button {
        font-size: 14px;
        padding: 6px 12px;
    }
}

/* Phone-specific landscape adjustments */
@media (orientation: landscape) and (max-height: 500px) {
    .buy-button {
        font-size: 12px;
        padding: 4px 8px;
        bottom: 5px;
        left: 5px;
    }
}

#current-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    cursor: pointer;
}

.navigation {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 90%;
    margin-bottom: 20px;
    color: white;
    position: relative;
}

#prev-image, #next-image {
    background-color: rgba(255, 255, 255, 0.3);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
}

#prev-image {
    left: 20px;
}

#next-image {
    right: 20px;
}

#back-to-thumbnails {
    margin-top: 20px;
    padding: 10px 20px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.hidden {
    display: none !important;
}

#current-image-info {
    color: white;
    font-size: 16px;
    text-align: center;
    background-color: rgba(0, 0, 0, 0.7);
    padding: 8px 15px;
    border-radius: 5px;
    position: absolute;
    bottom: 60px; /* Position at bottom instead of top */
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;
    max-width: 80%;
    white-space: normal; /* Allow text to wrap */
    word-break: break-word;
}

/* Navigation hints - hide by default on mobile */
.nav-hint {
    margin-top: 5px;
    font-size: 14px;
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
    background-color: rgba(0, 0, 0, 0.5);
    padding: 8px;
    border-radius: 5px;
    max-width: 80%;
    margin-left: auto;
    margin-right: auto;
    display: none; /* Hide by default, will be shown only on desktop */
}

/* Show navigation hints only on desktop devices */
body.is-desktop .nav-hint {
    display: block;
}

/* Split info for landscape mode */
#boat-name {
    display: none;
    position: absolute;
    left: 10px;
    top: 10px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 12px;
    z-index: 30;
    max-width: 50%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#image-number {
    display: none;
    position: absolute;
    left: 10px;
    bottom: 10px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 12px;
    z-index: 30;
}

#image-count {
    display: none;
    position: absolute;
    right: 10px;
    bottom: 10px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 12px;
    z-index: 30;
}

#fullscreen-toggle {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: 2px solid white;
    border-radius: 5px;
    padding: 8px 15px;
    cursor: pointer;
    z-index: 50;
    font-size: 14px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

/* Image hover effects */
.image-hover-left, .image-hover-right {
    position: absolute;
    top: 0;
    height: 100%;
    width: 33.33%;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.image-hover-left {
    left: 0;
    background: linear-gradient(to right, rgba(0,0,0,0.3), rgba(0,0,0,0));
}

.image-hover-right {
    right: 0;
    background: linear-gradient(to left, rgba(0,0,0,0.3), rgba(0,0,0,0));
}

#image-container:hover .image-hover-left,
#image-container:hover .image-hover-right {
    opacity: 1;
}

/* Footer */
footer {
    text-align: center;
    margin-top: 50px;
    padding: 20px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 5px;
}

/* No results message */
.no-results {
    text-align: center;
    padding: 20px;
    font-size: 16px;
    font-style: italic;
    color: #777;
}

/* Responsive design */
@media (max-width: 768px) {
    #thumbnails {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
    
    body {
        padding: 10px;
    }
    
    header {
        padding: 15px 10px;
    }
    
    #image-container {
        max-width: 95%;
        max-height: 70%;
    }

    .navigation {
        width: 95%;
    }

    #current-image-info {
        font-size: 14px;
        max-width: 60%;
    }
}

/* Landscape mode optimizations */
@media (orientation: landscape) {
    #image-viewer {
        padding: 0;
    }
    
    #image-container {
        max-width: 95%;
        max-height: 90vh;
    }
    
    #current-image {
        max-height: 90vh;
    }
    
    .navigation {
        position: absolute;
        top: 50%;
        width: 100%;
        margin: 0;
        z-index: 20;
    }
    
    /* Hide the main image info in landscape */
    #current-image-info {
        display: none !important;
    }
    
    /* Show split info in landscape */
    #boat-name, #image-number, #image-count {
        display: block !important;
    }
    
    #back-to-thumbnails {
        position: absolute;
        bottom: 15px;
        left: 50%;
        transform: translateX(-50%);
        margin: 0;
        z-index: 15;
    }
}

/* Phone-specific landscape adjustments */
@media (orientation: landscape) and (max-height: 500px) {
    #boat-name {
        font-size: 10px;
        padding: 3px 6px;
        top: 5px;
        left: 5px;
        max-width: 40%;
    }
    
    #image-number {
        font-size: 10px;
        padding: 3px 6px;
        bottom: 5px;
        left: 5px;
    }
    
    #image-count {
        font-size: 10px;
        padding: 3px 6px;
        bottom: 5px;
        right: 5px;
    }
    
    #fullscreen-toggle {
        font-size: 12px;
        padding: 4px 8px;
        top: 5px;
        right: 5px;
    }
    
    #prev-image, #next-image {
        width: 30px;
        height: 30px;
    }
    
    #back-to-thumbnails {
        font-size: 12px;
        padding: 5px 10px;
        bottom: 5px;
    }
}

/* Portrait mode - specific styling */
@media (orientation: portrait) {
    #current-image-info {
        display: block !important;
    }
    
    #boat-name, #image-number, #image-count {
        display: none !important;
    }
}
/* Enhanced styling for the photo viewer interface */

/* Header styling */
header {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    background: linear-gradient(to right, #000033, #000066);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 25px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    position: relative;
    text-align: left; /* Override the center alignment */
}

/* Logo styling */
header img#logo {
    max-width: 140px;
    margin-right: 20px;
    margin-bottom: 0;
}

/* Event title styling */
header h2#event-title {
    color: white;
    font-size: 22px;
    margin: 0;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
    font-weight: bold;
    flex-grow: 1;
    text-align: center;
    padding: 10px 15px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 5px;
    background-color: rgba(0, 0, 0, 0.2);
}

/* Add photographer tagline */
header::after {
    content: "Sailing images by Tim Wright";
    position: absolute;
    bottom: -8px;
    right: 15px;
    font-size: 12px;
    color: #f0f0f0;
    background-color: rgba(0, 0, 102, 0.7);
    padding: 2px 8px;
    border-radius: 3px;
    font-style: italic;
}

/* Body background */
body {
    background-color: #f0f0f0;
    background-image: linear-gradient(to bottom, #f0f0f0, #e0e0e0);
    min-height: 100vh;
}

/* Boat selection styling */
#boat-selection {
    margin-bottom: 25px;
    background-color: rgba(240, 240, 240, 0.6);
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#boat-selection label {
    display: block;
    margin-bottom: 10px;
    font-weight: bold;
    color: #000066;
    font-size: 16px;
}

.selection-container {
    display: flex;
    justify-content: center;
}

/* Make the dropdown more prominent */
select#boat-selector {
    width: 80%;
    max-width: 500px;
    padding: 12px;
    border: 2px solid #000066;
    border-radius: 6px;
    font-size: 16px;
    background-color: #f8f8f8;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

select#boat-selector:hover {
    border-color: #ff4400;
    background-color: #ffffff;
}

select#boat-selector:focus {
    outline: none;
    border-color: #ff4400;
    box-shadow: 0 0 0 3px rgba(255, 68, 0, 0.2);
}

/* Thumbnails container */
#thumbnails-container {
    background-color: rgba(240, 240, 240, 0.5);
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#selected-boat-name {
    color: #000066;
    border-bottom: 2px solid #ff4400;
    padding-bottom: 8px;
    margin-bottom: 15px;
}

/* Improve thumbnails appearance */
.thumbnail {
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.thumbnail:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Responsive adjustments */
@media (max-width: 600px) {
    header {
        flex-direction: column;
        text-align: center;
    }
    
    header img#logo {
        margin-right: 0;
        margin-bottom: 10px;
    }
    
    header h2#event-title {
        font-size: 18px;
    }
    
    header::after {
        position: static;
        display: block;
        margin-top: 10px;
    }
    
    select#boat-selector {
        width: 90%;
    }
}

/* Add this to your styles.css file to fix the navigation button position in portrait mode */

/* Navigation position adjustments for portrait mode */
@media (orientation: portrait) {
    /* Move navigation below the image in portrait mode */
    .navigation {
        position: relative;
        margin-top: 60px;
        margin-bottom: 5px;
        width: 100%;
    }
    
    #image-container {
        margin-top: 10px;
        margin-bottom: 0;
        order: 1; /* Change the order to put image first */
    }
    
    .navigation {
        order: 2; /* Change the order to put navigation second */
    }
    
    #back-to-thumbnails {
        order: 3; /* Change the order to put back button third */
    }
    
    /* Adjust the image viewer flex direction to make ordering work */
    #image-viewer {
        display: flex;
        flex-direction: column;
    }
    
    /* Adjust alignment and spacing */
    #current-image-info {
        bottom: 60px;
        top: auto;
    }
    
    /* Prevent navigation buttons from floating too far to sides on small screens */
    #prev-image {
        left: 20px;
    }
    
    #next-image {
        right: 20px;
    }
}

/* Styling for improved Add to Cart dialog */

/* Update the purchase modal in cart.js */
#purchase-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

#purchase-container {
    background-color: white;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

#purchase-header {
    background: linear-gradient(to right, #000066, #000099);
    color: white;
    padding: 18px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

#purchase-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: bold;
}

#close-purchase {
    background: none;
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s;
}

#close-purchase:hover {
    opacity: 1;
}

/* Product description area */
#purchase-description {
    padding: 15px 20px;
    background-color: #f8f8f8;
    border-bottom: 1px solid #eaeaea;
}

#purchase-description p {
    margin: 0 0 10px;
    line-height: 1.5;
    color: #333;
}

/* Options styling */
#purchase-options {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

#add-single {
    padding: 14px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    background-color: #000066;
    color: white;
    transition: all 0.2s;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

#add-single:hover {
    background-color: #0000aa;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

#add-all {
    padding: 14px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    background-color: #4CAF50;
    color: white;
    transition: all 0.2s;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

#add-all:hover {
    background-color: #3d9140;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Responsive adjustments */
@media (max-width: 600px) {
    #purchase-header h2 {
        font-size: 20px;
    }
    
    #purchase-options {
        padding: 15px;
    }
    
    #add-single, #add-all {
        padding: 12px;
        font-size: 16px;
    }
}

/* Add these styles to your styles.css file */

/* Adjust purchase modal for landscape mode */
@media (orientation: landscape) {
    /* Make the purchase modal scrollable in landscape */
    #purchase-container {
        max-height: 85vh; /* Slightly smaller to ensure it fits */
        overflow-y: auto; /* Enable vertical scrolling */
    }
    
    /* Compact the text slightly */
    #purchase-description p {
        margin-bottom: 5px;
        font-size: 14px;
    }
    
    /* Make buttons more compact in landscape */
    #purchase-options {
        padding: 15px;
        gap: 10px;
    }
    
    #add-single, #add-all {
        padding: 10px;
        font-size: 16px;
    }
    
    /* Ensure the modal is centered with enough space */
    #purchase-modal {
        padding: 10px;
    }
}

/* Extra optimization for very short screens (iPhone in landscape, etc.) */
@media (orientation: landscape) and (max-height: 450px) {
    #purchase-container {
        max-height: 95vh; /* Use more vertical space */
    }
    
    #purchase-header {
        padding: 10px 15px;
    }
    
    #purchase-header h2 {
        font-size: 18px;
    }
    
    #purchase-description {
        padding: 10px 15px;
    }
    
    #purchase-description p {
        font-size: 13px;
        margin-bottom: 3px;
    }
    
    #purchase-options {
        padding: 10px;
        gap: 8px;
    }
    
    #add-single, #add-all {
        padding: 8px;
        font-size: 14px;
    }
}
/* Make "Back to Thumbnails" button larger in portrait mode and on computers */
@media (orientation: portrait) {
    #back-to-thumbnails {
        padding: 15px 30px;     /* Increase padding */
        font-size: 18px;        /* Larger font */
        font-weight: bold;      /* Make text bolder */
        width: 80%;             /* Make button wider */
        max-width: 350px;       /* But not too wide */
        margin: 20px auto;      /* Center the button with margin auto */
        border-radius: 8px;     /* Slightly rounded corners */
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3); /* Add shadow for depth */
        display: block;         /* Make it a block element */
        /* This combination of display:block and margin:auto will center it */
    }
}

/* Make button MUCH larger on computers */
@media (min-width: 768px) {
    #back-to-thumbnails {
        padding: 18px 40px;     /* Much larger padding */
        font-size: 20px;        /* Much larger font */
        font-weight: bold;      /* Bold text */
        min-width: 350px;       /* Wider minimum width */
        border-radius: 8px;     /* Rounded corners */
        box-shadow: 0 5px 10px rgba(0, 0, 0, 0.3); /* Prominent shadow */
        transition: background-color 0.2s, box-shadow 0.2s; /* Only transition these properties */
        display: block;         /* Make it a block element */
        margin-left: auto;      /* Center horizontally */
        margin-right: auto;     /* Center horizontally */
        margin-top: 20px;       /* Space above */
        margin-bottom: 20px;    /* Space below */
        text-align: center;     /* Center the text */
    }
    
    #back-to-thumbnails:hover {
        background-color: #000099; /* Slightly lighter blue on hover */
        box-shadow: 0 7px 14px rgba(0, 0, 0, 0.4); /* Enhanced shadow on hover */
    }
}

/* Keep button small on phones in landscape mode */
@media (orientation: landscape) and (max-height: 500px) {
    #back-to-thumbnails {
        padding: 5px 10px;      /* Original small padding */
        font-size: 12px;        /* Small font */
        width: auto;            /* Auto width */
        min-width: unset;       /* Remove any minimum width */
        max-width: unset;       /* Remove any maximum width */
        margin: 5px auto;       /* Center with small margin */
        box-shadow: none;       /* No shadow */
        display: block;         /* Ensure it's a block */
    }
}

/* Hide the boat selection dropdown */
#boat-selection {
    display: none !important;
}

/* Add this to your styles.css file */

/* Hide the original back button when our enhanced one is active */
#image-viewer.hidden #enhanced-back-button {
    display: none !important;
}

/* Make the original back button invisible but keep its space in the layout */
#back-to-thumbnails.enhanced-back-active {
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
}

/* Update thumbnail grid for consistent sizing - with reduced gap */
#thumbnails {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 5px; /* Reduced from 10px to 5px */
    margin-top: 20px;
}

/* Make thumbnails square containers */
.thumbnail {
    cursor: pointer;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    overflow: hidden;
    transition: transform 0.3s;
    background-color: #fff;
    position: relative;
    aspect-ratio: 1 / 1; /* Creates a square container */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2px; /* Added minimal padding */
}

/* For browsers that don't support aspect-ratio (fallback) */
@supports not (aspect-ratio: 1 / 1) {
    .thumbnail::before {
        content: "";
        display: block;
        padding-top: 100%;
    }
    
    .thumbnail {
        position: relative;
    }
}

.thumbnail:hover {
    transform: scale(1.05);
}

/* Configure images to fit within the square container - with less padding */
.thumbnail img {
    max-width: 98%; /* Increased from 95% to 98% */
    max-height: 98%; /* Increased from 95% to 98% */
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

/* For older browsers without object-fit support */
@supports not (object-fit: contain) {
    .thumbnail img {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        margin: auto;
    }
}

/* Keep the thumbnail info at the bottom */
.thumbnail-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 3px 5px;
    font-size: 12px;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Add these rules to the end of your styles.css file */

/* Hide hover zones when image is zoomed */
#current-image.draggable ~ .image-hover-left,
#current-image.draggable ~ .image-hover-right {
    opacity: 0 !important;
    pointer-events: none !important;
    visibility: hidden !important;
}

/* Alternative approach using body class */
body.draggable-active .image-hover-left,
body.draggable-active .image-hover-right {
    opacity: 0 !important;
    pointer-events: none !important;
    visibility: hidden !important;
}

/* Hide hover zones in fullscreen mode when zoomed */
:fullscreen #current-image.draggable ~ .image-hover-left,
:fullscreen #current-image.draggable ~ .image-hover-right,
:-webkit-full-screen #current-image.draggable ~ .image-hover-left,
:-webkit-full-screen #current-image.draggable ~ .image-hover-right,
:-moz-full-screen #current-image.draggable ~ .image-hover-left,
:-moz-full-screen #current-image.draggable ~ .image-hover-right,
:-ms-fullscreen #current-image.draggable ~ .image-hover-left,
:-ms-fullscreen #current-image.draggable ~ .image-hover-right {
    display: none !important;
}

/* WhatsApp button container */
#whatsapp-container {
    margin: 5px 0 15px 0;
    text-align: center;
    padding: 5px;
}

/* WhatsApp button styling */
#whatsapp-join-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #25D366;
    color: white;
    padding: 8px 15px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: bold;
    font-size: 14px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
    max-width: 250px;
    width: auto;
}

#whatsapp-join-button:hover {
    background-color: #128C7E;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

#whatsapp-join-button svg {
    margin-right: 8px;
    flex-shrink: 0;
}

/* Responsive adjustments */
@media (max-width: 480px) {
    #whatsapp-join-button {
        padding: 6px 12px;
        font-size: 13px;
        width: auto;
        max-width: 220px;
    }
    
    #whatsapp-join-button svg {
        width: 16px;
        height: 16px;
    }
}

/* Ensure button doesn't appear in fullscreen or image viewer */
#image-viewer:not(.hidden) ~ #thumbnails-container #whatsapp-container,
:fullscreen #whatsapp-container,
:-webkit-full-screen #whatsapp-container,
:-moz-full-screen #whatsapp-container,
:-ms-fullscreen #whatsapp-container {
    display: none !important;
}

.share-boat-btn {
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 5px 10px;
    margin-left: 10px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
    transition: background-color 0.2s;
}

.share-boat-btn:hover {
    background-color: #45a049;
}

.share-boat-btn svg {
    width: 16px;
    height: 16px;
}

/* Hide initially until a boat is selected */
#share-boat-button.hidden {
    display: none;
}
/* Style for the last viewed thumbnail */
.thumbnail-last-viewed {
    background-color: rgba(255, 220, 0, 0.2); /* Soft yellow background */
    box-shadow: 0 0 8px rgba(255, 165, 0, 0.6); /* Subtle orange glow */
    transform: scale(1.02); /* Very slightly larger */
    position: relative;
    z-index: 10; /* Ensure it appears above other thumbnails */
    transition: background-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
}

/* Add a subtle pulse animation on initial display */
@keyframes highlight-pulse {
    0% { box-shadow: 0 0 5px rgba(255, 165, 0, 0.4); }
    50% { box-shadow: 0 0 12px rgba(255, 165, 0, 0.8); }
    100% { box-shadow: 0 0 5px rgba(255, 165, 0, 0.4); }
}

/* Apply the animation only when first highlighted */
.thumbnail-last-viewed {
    animation: highlight-pulse 1.5s ease-in-out;
}

/* Hover effect adjustment for the highlighted thumbnail */
.thumbnail-last-viewed:hover {
    transform: scale(1.05); /* Slightly enhance the hover scale */
    background-color: rgba(255, 220, 0, 0.3); /* Deeper yellow on hover */
}
/* Final fix for favorite thumbnails highlighting */
.favorite-item.thumbnail-last-viewed {
    background-color: rgba(255, 220, 0, 0.2) !important; /* Keep the same color */
    box-shadow: 0 0 8px rgba(255, 165, 0, 0.6) !important; 
    transform: scale(1.02) !important;
}

/* Target only the inner container that holds the image */
.favorite-item.thumbnail-last-viewed > div:first-of-type {
    background-color: rgba(255, 220, 0, 0.2) !important; 
}

/* EXPLICITLY preserve the specific elements */
.favorite-item.thumbnail-last-viewed .thumbnail-info {
    background-color: rgba(0, 0, 0, 0.7) !important;
}

/* For the event code badge (blue box in top left) */
.favorite-item.thumbnail-last-viewed [id^="six"] {
    background-color: #3B82F6 !important; /* Blue background */
    color: white !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* For the remove button (X in circle) */
.favorite-item.thumbnail-last-viewed .remove-favorite-btn {
    background-color: rgba(0, 0, 0, 0.5) !important; /* Original semi-transparent background */
    color: white !important;
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}