/* =================================================
   TABLE OF CONTENTS
   =================================================
   1. Common Elements & Base Styles
   2. Map Container Structure
   3. Map Toggle Button
   4. Quicklist Panel
   5. Lightbox Styles
   6. Attraction Content
   7. Featured Tours
   8. Responsive Styles
   ================================================= */

/* =================================================
   1. Common Elements & Base Styles
   ================================================= */
.loading {
    text-align: center;
    padding: 40px;
    font-size: 18px;
}

.loading:after {
    content: ".";
    animation: dots 1s steps(5, end) infinite;
}

@keyframes dots {
    0%, 20% {
        color: rgba(0, 0, 0, 0);
        text-shadow: .25em 0 0 rgba(0, 0, 0, 0), .5em 0 0 rgba(0, 0, 0, 0);
    }
    40% {
        color: black;
        text-shadow: .25em 0 0 rgba(0, 0, 0, 0), .5em 0 0 rgba(0, 0, 0, 0);
    }
    60% {
        text-shadow: .25em 0 0 black, .5em 0 0 rgba(0, 0, 0, 0);
    }
    80%, 100% {
        text-shadow: .25em 0 0 black, .5em 0 0 black;
    }
}

/* =================================================
   2. Map Container Structure
   ================================================= */
/* Map loading overlay */
.map-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.9);
    z-index: 999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.map-loading-overlay .spinner {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #09a149;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Master container */
.map-master {
    margin-bottom: 30px;
    border: 1px solid #eee;
    border-radius: 4px;
    overflow: hidden;
}

.map-master.link-only, 
body.post-type-archive-attraction .map-master {
    margin-bottom: 0 !important;
}

/* Map header */
.map-header {
    padding: 15px 20px;
    background-color: #09a149;
    color: white;
    border-bottom: 1px solid #078039;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.map-header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 800px;
    margin: 0 auto;
}

.map-header h3 {
    margin: 0;
    padding: 0;
    font-size: 18px;
    color: white;
    display: flex;
    align-items: center;
}

/* Map icon for the heading - white line style */
.map-header h3:before {
    content: "";
    display: inline-block;
    margin-right: 10px;
    width: 22px;
    height: 22px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z'%3E%3C/path%3E%3Ccircle cx='12' cy='10' r='3'%3E%3C/circle%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

/* Map wrapper */
.map-wrapper {
    position: relative;
    width: 100%;
}

/* Map header view button */
.map-view-button {
    display: inline-block;
    padding: 8px 15px;
    background-color: #09a149;
    color: white !important;
    text-decoration: none;
    border-radius: 4px;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

.map-view-button:hover {
    background-color: #078039;
    color: white;
}

/* =================================================
   3. Map Toggle Button
   ================================================= */
.map-toggle {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 10px 8px 15px;
    background-color: rgba(255, 255, 255, 0.9);
    color: #09a149;
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s ease;
}

.map-toggle:hover {
    background-color: white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.toggle-icon {
    display: inline-block;
    width: 24px;
    height: 24px;
}

.toggle-icon svg {
    width: 100%;
    height: 100%;
    transition: transform 0.3s ease;
}

.toggle-icon.up svg {
    transform: rotate(180deg);
}

.toggle-icon.down svg {
    transform: rotate(0deg);
}

.toggle-icon.right svg {
    transform: rotate(-90deg);
}

/* =================================================
   4. Quicklist Panel
   ================================================= */
/* Styling for attraction short description in quicklist */
.attraction-short-description {
    color: #6b7280;
    font-size: 0.875rem;
    margin-left: 5px;
}

/* Quicklist toggle button */
.quicklist-toggle {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 1000;
    padding: 8px 15px;
    background-color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    box-shadow: 0 2px 3px rgba(0, 0, 0, 0.2);
}

.quicklist-toggle:hover {
    background-color: #f5f5f5;
}

/* Quicklist overlay */
.quicklist-overlay {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /*background-color: rgba(255, 255, 255, 0.95);*/
    background-color:#efefef;
    z-index: 1001;
    overflow-y: auto;
    border: 1px solid #ccc;
}

.quicklist-panel {
    padding: 20px 10px;
    position: relative;
    height: 100%;
    box-sizing: border-box;
    /*background-color:#efefef;*/
}

.quicklist-panel > h3 {
    margin-top: 0;
    text-align: center;
}

#close-quicklist {
    display: none;
}

.close-quicklist {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10000;
    width: 36px;
    height: 36px;
    font-size: 24px;
    line-height: 32px;
    text-align: center;
    background-color: #fff;
    border: none;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 2px 3px rgba(0, 0, 0, 0.2);
    padding: 0;
}

/* Quicklist items */
.attractions-quicklist {
    list-style: none;
    padding: 0;
    margin: 20px auto !important;
    max-width: 800px;
}

.quicklist-item {
    padding: 14px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom:#ccc 1px solid;
}

.quicklist-item:nth-child(odd) {
    background-color: #fff;
}

.quicklist-item:nth-child(even) {
    background-color: #f7f7f7;
}

.attraction-name {
    flex: 1;
    font-weight: bold;
}

.quicklist-buttons {
    display: flex;
    gap: 10px;
}

.info-button, 
.view-map-button {
    padding: 5px 10px;
    border: 1px solid #ccc;
    /*background-color: #f5f5f5;*/
    background-color: #fff;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
}

.info-button:hover, 
.view-map-button:hover {
    background-color: #e5e5e5;
}

.info-icon:before {
    content: "ℹ️";
}

.map-icon:before {
    content: "📍";
}

/* =================================================
   5. Lightbox Styles
   ================================================= */
.attractions-lightbox {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.8);
}

.lightbox-content {
    position: relative;
    background-color: #fff;
    margin: 0 10px;
    padding: 20px;
    width: calc(100% - 20px);
    max-height: 90vh;
    overflow-y: auto;
    box-sizing: border-box;
    /* Top margin will be calculated dynamically with JavaScript */
}

.close-lightbox {
    position: absolute;
    top: 10px;
    right: 20px;
    color: #333;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10001;
}

.close-lightbox:hover {
    color: #000;
}

/* =================================================
   6. Attraction Content
   ================================================= */
/* Main layout */
.attraction-top-content {
    display: flex;
    flex-direction: column;
}

.attraction-content-first {
    width: 100%;
    margin-bottom: 20px;
}

.attraction-content-first h2 {
    margin-top: 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.attraction-content-first img {
    width: 100%;
    height: auto;
    display: block;
}

.attraction-details {
    width: 100%;
}

/* Attraction Buttons */
.attraction-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}

.attraction-button {
    display: inline-block;
    padding: 10px 15px;
    border-radius: 4px;
    color: white !important;
    font-size:17px;
    text-decoration: none;
    text-align: center;
    transition: opacity 0.3s ease;
}

.attraction-button:hover {
    opacity: 0.9;
    color: white;
}

.viator-button {
    background-color: #346a6c;
}

.getyourguide-button {
    background-color: #f53;
}

/* =================================================
   7. Featured Tours
   ================================================= */
.featured-tours {
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.featured-tours h3 {
    margin-top: 0;
}

.featured-tours ul {
    list-style: none;
    padding-left: 0;
}

.featured-tours li {
    margin-bottom: 10px;
}

/* Tours Grid Layout */
.tours-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.tour-item {
    display: flex;
    align-items: center;
    border: 1px solid #eee;
    border-radius: 5px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.tour-thumbnail {
    width: 150px;
    flex-shrink: 0;
}

.tour-thumbnail img {
    width: 100%;
    height: 150px;
    object-fit: cover;
}

.tour-item-content {
    padding: 15px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.tour-item h4 {
    margin: 0 0 10px 0;
    font-size: 18px;
}

.tour-excerpt {
    color: #666;
    font-size: 14px;
}

.tour-item:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* =================================================
   8. Responsive Styles
   ================================================= */
/* Medium screens */
@media (min-width: 500px) {
    .tours-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Tablet and desktop */
@media (min-width: 768px) {
    .lightbox-content {
        margin: 0 25px;
        width: calc(100% - 50px);
    }
    
    .attraction-top-content {
        flex-direction: row;
        gap: 30px;
    }
    
    .attraction-content-first {
        width: 58%;
        margin-bottom: 0;
    }
    
    .attraction-details {
        width: 42%;
    }
    
    .tours-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Mobile specific */
@media (max-width: 767px) {
    .attraction-button {
        flex: 1 0 100%;
        margin-bottom: 10px;
    }
    
    .quicklist-item {
        flex-direction: column;
        align-items: stretch;
    }

    .attraction-name {
        width: 100%;
        margin-bottom: 10px;
    }

    .quicklist-buttons {
        display: flex;
        justify-content: flex-start;
        gap: 10px;
    }

    .info-button, 
    .view-map-button {
        width: auto;
        margin: 0;
    }
}

/* Large screens */
@media (min-width: 1450px) {
    .lightbox-content {
        max-width: 1400px;
        margin-left: auto;
        margin-right: auto;
    }
}