/* Main calculator container */
.solar-calculator {
    position: relative;
    margin: 0 0 3rem 0;
    background: #FFFEFF;
    border-radius: 1rem;
    box-shadow: 0.3125rem 0.3125rem 1.9rem rgb(82 116 138 / 15%);  
}

.solar-calculator.initial-loading .time-relation-container,
.solar-calculator.initial-loading #dst-toggle-container,
.solar-calculator.initial-loading #time-meridian,
.solar-calculator.initial-loading #auxiliary-meridian {
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

/* Loading indicator for timezone API */
.solar-calculator.timezone-loading::after {
    content: "";
    position: absolute;
    bottom: 10px;
    right: 10px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid rgba(118, 35, 20, 0.2);
    border-top-color: #762314;
    animation: spin 1s infinite linear;
    z-index: 11;
    pointer-events: none;
}

@keyframes blink-caret {
    from, to { border-color: transparent }
    50% { border-color: #762314 }
}

/* Progressive enhancement for time displays */
#solar-time.loading {
    position: relative;
}

#solar-time.loading::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -5px;
    height: 3px;
    width: 50px;
    background: linear-gradient(to right, #762314, transparent);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { opacity: 0.3; width: 50px; }
    50% { opacity: 1; width: 100px; }
    100% { opacity: 0.3; width: 50px; }
}

.solar-calculator.loading::before {
    content: "";
    position: absolute;
    width: 40px;
    height: 40px;
    top: 50%;
    left: 50%;
    margin-top: -20px;
    margin-left: -20px;
    border-radius: 50%;
    border: 3px solid rgba(118, 35, 20, 0.2);
    border-top-color: #762314;
    animation: spin 1s infinite linear;
    z-index: 11;
    pointer-events: none;
}

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

/* Location prompt container styling */
#location-prompt-container {
    position: absolute;
    top: calc(50% + 20px);
    left: 50%;
    transform: translate(-50%, 0);
    text-align: center;
    width: 80%;
    max-width: 300px;
    background: rgba(255, 255, 255, 0.95);
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    z-index: 10;
    color: #3a556c;
    font-size: 14px;
    text-wrap: balance;
    line-height: 1.4;
    border: 1px solid rgba(118, 35, 20, 0.2);
    transition: opacity 0.3s ease-out, transform 0.3s ease-out;
}

#location-prompt-container.hidden {
    opacity: 0;
    transform: translate(-50%, 10px);
    pointer-events: none;
}

#location-access-link {
    color: #762314;
    text-decoration: underline;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.2s ease;
}

#location-access-link:hover {
    color: #8f2b18;
}

/* Animation for the prompt appearance */
@keyframes promptFadeIn {
    from { 
        opacity: 0; 
        transform: translate(-50%, -10px);
    }
    to { 
        opacity: 1; 
        transform: translate(-50%, 0);
    }
}

#location-prompt-container.showing {
    animation: promptFadeIn 0.5s ease-out;
}

#location-search:disabled {
    background-color: #f9f9f9;
    color: #888;
    cursor: wait;
}

.gmt-label {
    font-size: 10px;
    position: absolute;
    bottom: 0;
    transform: translateX(-50%);
    color: rgba(70, 70, 70, 0.8);
    font-family: 'Open Sans', sans-serif;
    font-weight: 300;
    text-shadow: 0 0 1px rgba(255, 255, 255, 0.7), 0 0 2px rgba(255, 255, 255, 0.5);
    white-space: nowrap;
    pointer-events: none;
}

.deviation-track {
    position: relative;
    height: 5px;
    overflow: hidden;
    background: linear-gradient(to right, 
        #FF7070 0%,     /* Dark Red */
        #FFADAD 20%,    /* Red */
        #ff9500 33%,    /* Orange */
        #F0F000 42%,    /* Yellow */
        #55B45B 50%,    /* Green - Center */
        #ffff00 58%,    /* Yellow */
        #ff9500 67%,    /* Orange */
        #FFADAD 80%,    /* Red */
        #FF7070 100%    /* Dark Red */
    );
}

/* Pulse animation for location marker during initial load */
#location-marker.loading {
    animation: marker-pulse 2s infinite;
}

/* Pulse animation for location marker during initial load */
#location-marker.loading {
    animation: marker-pulse 2s infinite;
}

@keyframes marker-pulse {
    0% { r: 0.8; stroke-width: 0.4; }
    50% { r: 1.2; stroke-width: 0.6; }
    100% { r: 0.8; stroke-width: 0.4; }
}

/* Styling for the location access link */
.location-link {
    color: #762314;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.2s ease;
}

.location-link:hover {
    color: #8f2b18;
    text-decoration: underline;
    cursor: pointer;
}

@keyframes marker-pulse {
    0% { r: 0.8; stroke-width: 0.4; }
    50% { r: 1.2; stroke-width: 0.6; }
    100% { r: 0.8; stroke-width: 0.4; }
}

/* Map transitions */
#map-container-svg {
    transition: all 0.5s ease-in-out;
}

/* Meridian line entrance animation */
#time-meridian.animate-in {
    stroke-dasharray: 5, 100;
    animation: dash 1.5s linear forwards;
}

@keyframes dash {
    to {
        stroke-dasharray: 5, 3;
    }
}

/* Animation for meridian line dashes */
@keyframes dash-movement {
    from {
      stroke-dashoffset: -6;
    }
    to {
      stroke-dashoffset: 0; /* This should be the sum of the dash and gap values in stroke-dasharray */
    }
  }
  
  /* Apply animation to the meridian line */
  #time-meridian {
    animation: dash-movement 8s linear infinite;
  }
  
  /* Apply the same animation to the auxiliary meridian line when it's visible */
  #auxiliary-meridian {
    animation: dash-movement 8s linear infinite;
  }

.solar-calculator.initial-loading .time-relation-container,
.solar-calculator.initial-loading #dst-toggle-container,
.solar-calculator.initial-loading #time-meridian,
.solar-calculator.initial-loading #auxiliary-meridian {
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.dst-toggle-wrapper {
    position: absolute;
    top: 2em;
    right: 2em;
    z-index: 10; /* Ensure it's above the map */
    transition: opacity 0.8s ease-in-out;
}

/* Adjust the DST toggle container styling when used in the map */  
.local-date {
    color: #666;
    font-size: 14px;
    text-align: center;
    margin-top: 5px;
}

.solar-calculator-input {
    padding: 0.1rem 2rem;
    margin: 0 0 2rem 0;
    background: #FFFEFF;
    border-radius: 8px;
    box-shadow: 0.3125rem 0.3125rem 1.9rem rgb(82 116 138 / 15%);  
}

/* DST Toggle Switch Styles with Clickable Container */
.dst-toggle-container {
    padding: 8px 12px;
    border-radius: 4px;
    box-shadow: 0 0 .45rem rgb(82 116 138 / 15%); 
    cursor: pointer;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px; /* Space between elements */
    background: #FFFEFF;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    outline: none;
}

.dst-icon {
    display: flex;
    align-items: center;
}

.dst-icon svg {
    width: 14px;
    height: 14px;
    stroke: #3a556c; /* Match the winter blue color */
}

/* Style for the DST label */
.dst-label {
    font-family: 'Poppins', Arial, Helvetica, sans-serif;
    font-size: .8em;
    text-transform: uppercase;
    font-weight: 500;
    vertical-align: middle;
    padding: 0 .2em;
    color: #3a556c; /* Match the winter blue color */
}

.dst-toggle {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 24px;
    pointer-events: none; /* Make sure clicks go through to container */
}

.dst-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.dst-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #3a556c;
    transition: .4s ease-in-out;
    border-radius: 24px;
    pointer-events: none;
}

/* Circle thumb with snowflake icon */
.dst-slider::before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    background-position: center;
    background-repeat: no-repeat;
    background-size: 12px 12px;
    transition: .4s ease-in-out;
    border-radius: 50%;
    pointer-events: none;
}

/* Change to summer orange when checked */
input:checked + .dst-slider {
    background-color: #762314; /* Summer orange */
}

/* Move the circle and change to sun icon when checked */
input:checked + .dst-slider::before {
    transform: translateX(16px);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* equation of time Calculator Styles */
.eot-calculator {
    margin: 2rem 0;
    padding: 1.5rem 2rem;
    background: #FFFEFF;
    border-radius: 1rem;
    box-shadow: 0.3125rem 0.3125rem 1.9rem rgb(82 116 138 / 15%);
}

.eot-calculator h3 {
    margin-top: 0.25em;
    font-weight: 700;
}

.eot-description {
    margin-bottom: 1.5rem;
}

.eot-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.eot-date-picker {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.eot-date-picker label {
    font-weight: 500;
    color: #3a556c;
}

.eot-date-input {
    padding: 0.5rem 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.2s ease;
}

.eot-date-input:focus {
    outline: none;
    border-color: #762314;
    box-shadow: 0 0 0 2px rgba(118, 35, 20, 0.2);
}

.eot-slider-container {
    position: relative;
    margin: 1.5rem 0 0.5rem;
}

.eot-slider-labels {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.8rem;
    color: #5D656C;
}

.eot-slider-with-curve {
    position: relative;
    width: 100%;
    height: 60px;
    margin-bottom: 0.5rem;
    touch-action: pan-y; /* Allow only vertical scrolling on touch devices */
    -ms-touch-action: pan-y;
}

.eot-curve-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none; /* Ensure clicks go through to the slider */
}

#eot-curve {
    width: 100%;
    height: 100%;
    display: block;
    overflow: visible; /* Allow elements to display outside bounds if needed */
}

.eot-slider {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    transform: translateY(-50%);
    z-index: 2;
    -webkit-appearance: none;
    appearance: none;
    height: 3px;
    border-radius: 5px;
    background: transparent;
    outline: none;
    cursor: pointer;
    margin: 0;
    padding: 0;
    /* Ensure track is positioned absolutely at center to line up with the curve */
    pointer-events: auto;
}

.eot-slider::-webkit-slider-runnable-track {
    width: 100%;
    height: 3px;
    cursor: pointer;
    background: transparent;
    border-radius: 3px;
}

.eot-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #762314;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 0 2px rgba(0, 0, 0, 0.3);
    z-index: 3;
    margin-top: -6.5px; /* Half the height of the thumb minus half the height of the track */
}

.eot-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #762314;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 0 2px rgba(0, 0, 0, 0.3);
    z-index: 3;
}

/* Add hover effect for the thumb */
.eot-slider:hover::-webkit-slider-thumb {
    transform: scale(1.1);
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.4);
}

.eot-slider:hover::-moz-range-thumb {
    transform: scale(1.1);
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.4);
}

.eot-result {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.5rem;
    border-radius: 0.5rem;
}

.eot-value-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.eot-label {
    font-weight: 600;
    color: #3a556c;
}

.eot-value {
    font-size: 1.2rem;
    font-weight: 700;
    font-family: 'Poppins', sans-serif;
    color: #762314;
}

.eot-explanation {
    color: #5D656C;
    font-style: italic;
    font-size: 0.95rem;
    line-height: 1.4;
    min-height: 2.8em; /* Reserve space for two lines of text */
    display: flex;
    align-items: center; /* This will vertically center single-line content */
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .eot-calculator {
        padding: 1rem;
    }

    .eot-calculator h3 {
    margin-top: 0.5em;
    }
    
    .eot-slider-labels {
        font-size: 0.7rem;
    }
    
    .eot-curve-container {
        height: 60px; /* Keep consistent with desktop */
    }
    
    .eot-value {
        font-size: 1.1rem;
    }
    
    .eot-explanation {
        font-size: 0.9rem;
    }
    
    /* Ensure the month names don't overlap */
    .eot-slider-labels {
        display: grid;
        grid-template-columns: repeat(12, 1fr);
        gap: 2px;
        text-align: center;
    }
    
    .eot-slider-labels span {
        font-size: 0.65rem;
    }
}

/* Very small screens */
@media (max-width: 480px) {
    .eot-slider-labels span {
        font-size: 0.6rem;
    }
    
    .eot-calculator h3 {
        font-size: 1.2rem;
    }
    
    .eot-description {
        font-size: 0.9rem;
    }
}

/* Location input container styles */
.location-input-container {
    position: relative;
}

/* Search box styles */
.search-box {
    position: relative;
    display: flex;
    padding: 1.5rem 2rem;
    gap: .5rem;
    border-top: 4px solid #fae3df;
}

.search-box input {
    flex: 1;
    padding: .75em .25em .75em .75em;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.search-box input:focus {
    outline: none;
    border-color: #762314;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-box input:hover:not(:focus) {
    border-color: #cecece;
}

.search-box div {
    padding: 8px 8px;
    border-radius: 4px;
    background: #FFFEFF;
    cursor: pointer;
    line-height: 1;
    align-content: center;
}

.search-box button {
    padding: 8px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #FFFEFF;
    cursor: pointer;
    font-size: 16px;
}

.search-box button:hover {
    background: #f5f5f5;
}

/* Search results styles - CRITICAL for visibility */
#search-results, 
.search-results {
    position: absolute;
    width: calc(100% - 4rem); /* Match container width minus padding */
    max-height: 240px;
    overflow-y: auto;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-top: 0;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    z-index: 9999 !important; /* Ensure it appears above other elements */
    left: 2rem; /* Match container padding */
    top: calc(100% - 1.5rem); /* Position relative to container */
    opacity: 1;
    transition: opacity 0.2s ease;
    display: none; /* Hidden by default, JavaScript will show it */
}

.search-result-item {
    padding: 10px 15px;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s;
    cursor: pointer;
}

#search-results.showing {
    animation: fadeIn 0.2s ease-out;
    display: block !important;
}

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

.search-result-item:hover {
    background-color: #f5f7fa;
}

/* Animation for search results */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

#search-results.showing {
    animation: fadeIn 0.2s ease-out;
    display: block !important;
}

/* Search loading indicator */
.search-loading-indicator {
    position: absolute;
    right: 65px; /* Adjusted to account for buttons */
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    border: 2px solid rgba(118, 35, 20, 0.2);
    border-top-color: #762314;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    pointer-events: none;
    z-index: 10;
}

/* Current location display */
.current-location-container {
    display: flex;
    align-items: center;
    margin-top: 1.75rem;
}

.location-light-icon {
    margin-right: 3px;
    max-height: 100%;
}

.current-location {
    text-align: left;
    font-size: 1rem;
    color: #666;
    font-weight: 300;
}

/* Time display layout */
.time-display {
    display: grid;
    grid-template-columns: 1fr 1.4fr;
    font-weight: 300;
}

/* Add these styles to solar-time.css */
.time-relation-container {
    color: #666;
    margin-top: 1rem;
    min-height: 4.5em; /* Accommodate three rows */
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
}

.time-relation-row {
    display: flex;
    align-items: center;
    line-height: 1.5;
    margin-bottom: 0.05em;
}

.time-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    margin-right: 8px;
}

.time-label {
    min-width: 100px;
    font-weight: 300;
}

#solar-time-display,
#local-time-display {
    letter-spacing: .03em;
    font-weight: 300;
}

#time-difference {
    letter-spacing: .05em;
    font-weight: 700;
}

#timezone-display {
    margin-left: 6px;
    font-size: 0.9em;
}

/* Map styling */
.map-display {
    position: relative;
    border-top-right-radius: 1rem;
    overflow: hidden;
    /* Remove existing mask-image properties */
    mask-image: none;
    -webkit-mask-image: none;
}

/* Apply custom SVG as a background image */
.map-display::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 25%; /* Control the width of the curved area */
    height: 100%;
    background-image: url('../../images/curve-separator.svg'); /* Save the SVG separately */
    background-size: 100% 100%;
    background-repeat: no-repeat;
    pointer-events: none;
    z-index: 5;
}

.map-container {
    position: relative;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    background-color: #f8f9fa;
}

#world-map-container {
    position: relative;
    width: 100%;
    display: block;
}

#map-container-svg {
    width: 100%;
    height: auto;
    display: block;
    transition: all 0.8s ease-in-out;
}

/* Map elements transitions for smooth animations */
#time-meridian {
    transition: x1 0.8s ease-in-out, x2 0.8s ease-in-out;
}

#location-marker {
    background-color: #762314;
    border-radius: 50%;
    border: 1px solid #fff;
    transition: cx 0.8s ease-in-out, cy 0.8s ease-in-out;
}

/* Time display styling */
#time-relation {
    font-weight: 500;
}

.time-block {
    color: #762314;
    padding: 1rem 1rem 0.5rem 3rem;
    min-height: 1.2em; /* Fixed height to prevent layout shifts */
    border-radius: 1em;
}

.time-block h1 {
    font-size: 2em; 
    margin: .4em 0 .8em 0;
}

#solar-time {
    font-family: 'Poppins', sans-serif;
    color: #26373c;
    font-size: 3em;
    font-weight: 700;
    transition: all 0.5s ease-in-out;
}

#local-time {
    transition: all 0.3s ease-in-out;
}

#local-date {
    color: #666;
}

/* Styles for interactive map */
.map-interactive {
    cursor: grab;
}

.map-interactive.dragging {
    cursor: grabbing !important;
}

#map-container-svg {
    cursor: grab;
    touch-action: none; /* Prevent browser's default touch actions */
}

#map-container-svg:active {
    cursor: grabbing;
}

/* Make sure the background rect captures all events */
#map-background {
    fill: transparent !important;
    cursor: grab;
}

#map-background:active {
    cursor: grabbing;
}

/* Position map containers relative for absolute positioning */
.map-container, .map-display, .deviation-block {
    position: relative;
}

/* Timezone highlight rectangles */
.timezone-highlight {
    pointer-events: none;
    transition: opacity 0.3s ease;
}

/* Viewport labels container */
#viewport-timezone-labels {
    position: absolute !important;
    bottom: 10px !important;
    left: 0 !important;
    right: 0 !important;
    height: 12px !important;
    pointer-events: none !important;
    z-index: 100 !important;
    overflow: visible !important;
}

/* Container for the location hint */
.location-hint {
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    width: 60%; /* More comfortable width but not full-width */
    max-width: 500px; /* Upper limit for very wide screens */
    min-width: 300px; /* Ensure it doesn't get too narrow */
    padding: 12px 40px 12px 20px; /* More padding on right for close button */
    background-color: #ffffff;
    border-radius: 6px;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.15);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    color: #3a556c;
    z-index: 100;
    text-align: center;
    transition: all 0.3s ease;
    border: 1px solid rgba(118, 35, 20, 0.1);
    opacity: 1;
    pointer-events: auto;
    white-space: nowrap; /* Keep on single line on desktop */
}

/* Add triangle indicator pointing to search box */
.location-hint::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid #ffffff;
    filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.06));
}

/* Animation for appearing */
.location-hint.showing {
    animation: hintFadeIn 0.5s ease-out;
}

/* Hidden state */
.location-hint.hidden {
    opacity: 0;
    transform: translate(-50%, -10px);
    pointer-events: none;
}

/* Fade-in animation */
@keyframes hintFadeIn {
    from { 
        opacity: 0; 
        transform: translate(-50%, -10px);
    }
    to { 
        opacity: 1; 
        transform: translateX(-50%);
    }
}

/* Close button */
.hint-close-button {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    border-radius: 5%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    cursor: pointer;
    color: #762314;
    padding: 0;
    line-height: 1;
    transition: background-color 0.2s, color 0.2s;
}

.hint-close-button:hover {
    background-color: #e0e0e0;
    color: #333;
}

/* Make sure parent container has position for proper hint positioning */
.location-input-container {
    position: relative;
}

/* Media queries for different device sizes */
@media screen and (max-width: 768px) {
    .location-hint {
        width: 80%;
        max-width: 400px;
        min-width: 250px;
        white-space: normal; /* Allow wrapping on smaller screens */
        top: -20px; /* More space for potential two lines */
        padding: 10px 36px 10px 15px;
        font-size: 13px;
    }
    
    .hint-close-button {
        width: 22px;
        height: 22px;
        font-size: 14px;
        right: 8px;
    }
}

/* Small mobile screens */
@media screen and (max-width: 480px) {
    .location-hint {
        width: 90%;
        min-width: 200px;
        font-size: 12px;
        padding: 8px 30px 8px 12px;
    }
    
    .hint-close-button {
        width: 20px;
        height: 20px;
        font-size: 12px;
        right: 6px;
    }
}

/* Fix for mobile/touch devices to have grabbing cursor */
@media (hover: none) {
    .map-interactive,
    #map-container-svg,
    #map-background {
        cursor: move; /* Fallback for browsers that don't support grab */
    }
}

/* Responsive design */
@media (max-width: 1200px) {
    .time-block h1 {
        font-size: 1.5em;
        margin: .4em 0;
    }
}

@media (max-width: 1024px) {
    .search-results,
    #search-results {
        max-width: 80%;
    }
}

@media (max-width: 960px) {
    .time-display {
        grid-template-columns: 1fr;
    }

    .time-block {
        padding: 0.5rem 2rem 1rem 2rem;
    }

    .time-block h1 {
        font-size: 1.65em;
    }

    .dst-toggle-wrapper {
        top: 1em;
    }

    #solar-time {
        font-size: 2.8em;
        padding-top: .25em;
    }

    .map-display::before {
        width: 100%;
        margin: -1px 0 0 0;
        background-image: url('../../images/separator-mobile.svg'); /* Mobile version */
    }
    
    /* Ensure the time-block has position context for absolute positioning */
    .time-block {
        position: relative;
    }

    #location-prompt-container {
        /* Position directly in the middle */
        top: 50%;
        transform: translate(-50%, -50%);
        /* Increase visibility for mobile */
        background: rgba(255, 255, 255, 0.98);
        width: 90%;
        max-width: 260px;
        font-size: 13px;
        padding: 8px;
        /* Add additional styling for better visibility on map */
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
        border: 1px solid rgba(118, 35, 20, 0.3);
    }
    
    /* Adjust the animation for centered position */
    @keyframes promptFadeIn {
        from { 
            opacity: 0; 
            transform: translate(-50%, -45%);
        }
        to { 
            opacity: 1; 
            transform: translate(-50%, -50%);
        }
    }
    
    /* Make the link more tappable on mobile */
    #location-access-link {
        padding: 2px 0;
        display: inline-block;
    }
}

@media (max-width: 768px) {
    .scale-markers {
        padding: 0 10px;
    }

    .gmt-label {
        font-size: 8px;
    }

    .timezone-label,
    .fixed-timezone-label {
        font-size: 4px;

    }

    .time-relation-container {
        margin-top: 1rem; 
    }

    .solar-calculator {
        margin: 1rem 0 2.5rem 0;
    }
    
    #search-results,
    .search-results {
        width: calc(100% - 4rem);
        left: 2rem;
    }

    #location-prompt-container {
        width: 90%;
        max-width: 280px;
        font-size: 13px;
        padding: 8px;
    }
}

@media (max-width: 576px) {    
    .deviation-block {
        margin-top: .5rem;
    }

    header, .header-wrapper {
        height: 4em !important; 
        min-height: 4em !important;
        transform: none !important;
        transition: background-color 0.2s ease !important;
        will-change: background-color;
    }
    
    .header-content {
        height: 4em !important;
        min-height: 4em !important;
    }
    
    .dst-toggle-wrapper {
        top: unset;
        margin-top: -.25rem;
    }
    
    .dst-toggle-container {
        border: 1px solid #ddd;
        box-shadow: none;
        padding: 4px 6px 4px 8px;
        display: flex !important;
        gap: 4px;
        flex-direction: row;
        justify-content: flex-start;
        transform-origin: right center;
    }
    
    .dst-toggle {
        width: 30px;
        height: 18px;
    }
    
    .dst-slider::before {
        height: 12px;
        width: 12px;
        left: 3px;
        bottom: 3px;
        background-size: 8px 8px;
    }
    
    input:checked + .dst-slider::before {
        transform: translateX(12px);
    }
    
    .dst-label {
        font-size: 0.65em;
        padding: 0 0.1em;
        /* Change the label to show "DST" instead of "Daylight saving time" on small screens */
    }

    input:checked + .dst-slider::before {
        transform: translateX(14px);
    }
    
    #search-results,
    .search-results {
        width: calc(100% - 3rem);
        left: 1.5rem;
    }
}