/* ========== OUR TRAVELS STYLES ========== */

/* Travels Header */
.travels-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.travels-header h2 {
    font-size: 3rem;
    font-weight: 300;
    letter-spacing: -0.03em;
    color: #2d5f4f;
}

/* Legend */
.travels-legend {
    background: white;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 2rem;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.legend-color {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.legend-item span {
    font-size: 0.9rem;
    color: var(--text-dark);
    font-weight: 400;
}

/* Map Container */
.travels-map-container {
    background: white;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    min-height: 500px;
    position: relative;
    overflow: hidden;
}

/* Map Controls */
.map-controls {
    position: absolute;
    top: 30px;
    right: 30px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 100;
}

.map-control-btn {
    width: 40px;
    height: 40px;
    background: white;
    border: 1px solid #5B9BD5;
    border-radius: 8px;
    color: #5B9BD5;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Lato', sans-serif;
    font-weight: 400;
}

.map-control-btn:hover {
    background: #e8f3fb;
    color: #5B9BD5;
    border-color: #5B9BD5;
}

/* Map Viewport */
.map-viewport {
    width: 100%;
    height: 500px;
    background: #f8f9fa;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    cursor: grab;
    touch-action: none;
}

.map-viewport:active {
    cursor: grabbing;
}

/* World Map SVG */
.world-map {
    width: 100%;
    height: 100%;
    display: block;
}

.world-map path {
    /* fill is controlled by fill attribute, NOT CSS */
    stroke: white;
    stroke-width: 0.5;
    transition: opacity 0.2s ease, fill 0.3s ease;
    cursor: pointer;
}

.world-map path:hover {
    opacity: 0.8;
}

/* Country Modal */
.country-modal-content {
    max-width: 450px;
    max-height: 90vh;
    padding: 32px !important;
    border-radius: 16px;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
}

/* Custom scrollbar for country modal */
.country-modal-content::-webkit-scrollbar {
    width: 8px;
}

.country-modal-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.country-modal-content::-webkit-scrollbar-thumb {
    background: #c5aef0;
    border-radius: 10px;
}

.country-modal-content::-webkit-scrollbar-thumb:hover {
    background: #b491de;
}

.country-modal-content .close {
    position: sticky;
    top: 0;
    align-self: flex-end;
    right: 0;
    margin: -10px -10px 10px auto;
    font-size: 28px;
    font-weight: 300;
    color: #999;
    cursor: pointer;
    transition: color 0.2s ease;
    line-height: 1;
    border: none;
    background: white;
    z-index: 10;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.country-modal-content .close:hover {
    color: var(--text-dark);
}

.country-modal-content h2 {
    margin: 0 0 24px 0;
    font-size: 1.5rem;
    font-weight: 400;
    color: #2d5f4f;
    padding-right: 30px;
}

/* Section styling */
.wishlist-section {
    padding-bottom: 24px;
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 24px;
}

/* Section headers (if added in HTML) */
.section-header {
    font-size: 14px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.wishlist-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.wishlist-checkbox-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    margin-bottom: 0;
    padding: 4px 0;
}

.wishlist-checkbox-label input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

/* Custom Checkbox Styling - Modern */
.custom-checkbox {
    position: relative;
    width: 20px;
    height: 20px;
    border: 2px solid #e0e0e0;
    border-radius: 4px;
    background: white;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.wishlist-checkbox-label:hover .custom-checkbox {
    border-color: var(--lavender-floral);
}

.wishlist-checkbox-label input[type="checkbox"]:checked + .custom-checkbox {
    background: var(--lavender-floral);
    border-color: var(--lavender-floral);
}

.wishlist-checkbox-label input[type="checkbox"]:checked + .custom-checkbox::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 2px;
    width: 4px;
    height: 9px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-text {
    font-size: 0.9375rem;
    color: var(--text-dark);
    user-select: none;
    font-weight: 400;
}

/* Visit Builder Section */
#visitBuilderSection {
    margin-bottom: 24px;
}

.visit-builder-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.visit-builder {
    background: transparent;
    padding: 0;
    border-radius: 0;
    display: grid;
    grid-template-columns: 2fr 1.5fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

.visit-input {
    height: 48px;
    padding: 0 16px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    font-family: 'Lato', sans-serif;
    background: white;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.visit-input:hover {
    border-color: #c0c0c0;
}

.visit-input:focus {
    outline: none;
    border-color: #5B9BD5;
    box-shadow: 0 0 0 3px rgba(91, 155, 213, 0.1);
}

.add-visit-btn {
    width: 100%;
    padding: 12px 20px;
    background: var(--lavender-floral);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 500;
    font-family: 'Lato', sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
}

.add-visit-btn:hover {
    background: var(--rose-pompadour);
    transform: translateY(-1px);
}

/* Visits List */
.visits-list {
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.visit-item {
    background: #f0f7fc;
    border-left: 3px solid #5B9BD5;
    border-radius: 8px;
    padding: 8px 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
}

.visit-item:hover {
    border-left-color: #4a8bc2;
    box-shadow: 0 2px 8px rgba(91, 155, 213, 0.15);
}

.visit-item-text {
    font-size: 0.9rem;
    color: var(--text-dark);
}

.visit-person-sagar {
    color: #9370db;
    font-weight: 500;
}

.visit-person-lilly {
    color: #9370db;
    font-weight: 500;
}

.visit-person-together {
    color: var(--rose-pompadour);
    font-weight: 500;
}

.remove-visit-btn {
    background: transparent;
    border: none;
    color: #999;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0 8px;
    transition: color 0.2s ease;
}

.remove-visit-btn:hover {
    color: var(--rose-pompadour);
}

/* Save Button */
.save-country-btn {
    width: 100%;
    height: 48px;
    padding: 0 20px;
    background: #2d5f4f;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    font-family: 'Lato', sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 24px;
    box-shadow: 0 2px 8px rgba(45, 95, 79, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.save-country-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(45, 95, 79, 0.3);
    background: #234a3d;
}

.save-country-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Tooltip */
.country-tooltip {
    position: fixed;
    background: white;
    border-radius: 8px;
    padding: 12px 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    pointer-events: none;
    z-index: 10000;
    max-width: 250px;
    display: none;
}

.country-tooltip.visible {
    display: block;
}

.tooltip-country-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 4px;
}

.tooltip-status {
    font-size: 0.8rem;
    text-transform: uppercase;
    font-weight: 500;
    margin-bottom: 8px;
}

.tooltip-status.together {
    color: #eb7093;
}

.tooltip-status.sagar {
    color: #c5aef0;
}

.tooltip-status.lilly {
    color: #9370db;
}

.tooltip-status.both {
    color: #b491de;
}

.tooltip-status.wishlist {
    color: #FFE5D9;
}

.tooltip-visits {
    font-size: 0.85rem;
    color: #666;
    line-height: 1.6;
}

.tooltip-visit {
    margin-bottom: 2px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .travels-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 1rem;
        margin-bottom: 1.5rem;
    }

    .travels-header h2 {
        font-size: 2rem;
    }

    .travels-legend {
        flex-direction: column;
        gap: 12px;
        padding: 15px;
    }

    .travels-map-container {
        padding: 15px;
        min-height: 300px;
    }

    .map-viewport {
        height: 300px;
    }

    /* Show zoom buttons on mobile but smaller */
    .map-controls {
        top: 20px;
        right: 20px;
        gap: 6px;
    }

    .map-control-btn {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }

    .visit-builder {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .country-modal-content {
        margin: 10px;
        padding: 24px !important;
        max-height: calc(100vh - 20px); /* Ensure it fits on mobile screens */
    }

    .wishlist-section {
        padding-bottom: 20px;
        margin-bottom: 20px;
    }
}

@media (max-width: 400px) {
    .visit-builder {
        padding: 0;
    }

    .country-modal-content {
        padding: 20px !important;
    }
}

/* Country Colors - Using fill attribute for SVG paths */
.country {
    transition: opacity 0.2s ease, fill 0.3s ease;
}

.country:hover {
    opacity: 0.8;
}

.country-group {
    cursor: pointer;
}

.country-group:hover .country {
    opacity: 0.8;
}
