/**
 * Visit Värmland Map Frontend Styles
 */

/* Import Noto Sans from Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans:ital,wght@0,100..900;1,100..900&display=swap');

/* Base typography - only for WordPress block */
.wp-block-visitvarmland-map.vvm-map-container,
.wp-block-visitvarmland-map.vvm-map-container *,
.wp-block-visitvarmland-map .vvm-modal,
.wp-block-visitvarmland-map .vvm-modal * {
	font-family: 'Noto Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Embed version - inherit typography from parent */
.vvm-map-container,
.vvm-map-container *,
.vvm-modal,
.vvm-modal * {
	font-family: inherit;
}

/* Kartcontainer */
.vvm-map-container {
    position: relative;
    margin: 1.25rem 0;
}

.vvm-map {
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 0.25rem;
	outline: none;
}

/* --- Logotyper uppe till vänster --- */
.vvm-map-logos {
    position: absolute;
    top: 1.5rem;
    left: 1.5rem;
    z-index: 1001;
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    pointer-events: none;
}
.vvm-map-logos a {
    text-decoration: none;
    display: block;
    transition: transform 0.2s ease;
}

.vvm-map-logos a:hover {
    transform: scale(1.05);
}

.vvm-logo {
    background: #fff;
    border-radius: 0.5rem;
    box-shadow: 0 0.125rem 0.5rem rgba(0,0,0,0.08);
    padding: 0.75rem;
    width: 4.6875rem;
    height: auto;
    pointer-events: auto;
    display: block;
}
.vvm-logo-trafik {
    width: 4.6875rem;
    margin-top: 0.125rem;
}

/* --- Filterknappar längst ner --- */
.vvm-map-filters {
    position: absolute;
    left: 50%;
    bottom: 1rem;
    transform: translateX(-50%);
    display: flex;
    gap: .75rem;
    z-index: 1001;
    background: none;
}
.vvm-filter-btn {
	font-family: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0.5rem 1rem;
	border-radius: 3.875rem;
    background-color: #ffffff;
    border: 1px solid #ebd699;
	color: #011d31;
    outline: none;
	display: flex;
	justify-content: center;
	align-items: center;
	white-space: nowrap;
	cursor: pointer;
	transition: all 0.2s ease;
}

/* WordPress block specific - use Noto Sans for filter buttons */
.wp-block-visitvarmland-map .vvm-filter-btn {
	font-family: 'Noto Sans', serif;
}
.vvm-filter-btn.active,
.vvm-filter-btn:focus {
    background-color: #ebd699;
    border-color: #ebd699;
    color: #222;
}
.vvm-filter-btn:hover:not(.active) {
    background-color: #f8f8f8;
    border-color: #f8f8f8;
}

/* Ta bort gammal kontroll-styling */
.vvm-map-controls,
.vvm-category-filter,
.vvm-season-selector {
    display: none !important;
}

/* Popup-stilar */
.vvm-popup {
    min-width: 13.75rem;
    max-width: 20rem;
    background: #fff;
    border-radius: 1rem;
    box-shadow: 0 0.25rem 1.5rem rgba(0,0,0,0.13);
    padding: 0 0 0.75rem 0;
    position: relative;
    text-align: center;
    overflow: visible;
}
.vvm-popup-image-wrap {
    width: 100%;
    height: 8.75rem;
    overflow: hidden;
    border-radius: 1rem 1rem 0 0;
    background: #f4f4f4;
    display: flex;
    align-items: center;
    justify-content: center;
}
.vvm-popup-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.vvm-popup h3 {
	margin: .75rem 1rem 0;
	font-size: 0.875rem;
    color: #222;
    font-weight: 700;
	text-align: left;
}

.vvm-popup h3 a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #222;
    text-decoration: none;
}

.vvm-popup h3 a svg {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
}
.vvm-popup-arrow {
    position: absolute;
    left: 50%;
    bottom: -0.75rem;
    transform: translateX(-50%);
    width: 2.25rem;
    height: 1.125rem;
    overflow: visible;
}
.vvm-popup-arrow::after {
    content: '';
    display: block;
    width: 2.25rem;
    height: 1.125rem;
    background: transparent;
    clip-path: polygon(50% 100%, 0 0, 100% 0);
    background: #fff;
    box-shadow: 0 0.25rem 0.75rem rgba(0,0,0,0.08);
}

.vvm-popup p {
    margin: 0.3125rem 0;
    font-size: 0.875rem;
    line-height: 1.4;
}

.vvm-popup strong {
    font-weight: 600;
}

.vvm-popup a {
    color: #292929;
    text-decoration: none;
}

/* Filter button text variants */
.vvm-btn-text-short {
	display: none;
}

.vvm-btn-text-full {
	display: inline;
}

/* Responsiv design */
@media (max-width: 768px) {
    .vvm-map { height: 25rem; }
    .vvm-map-logos { top: 0.625rem; left: 0.625rem; }
    .vvm-logo { width: 5rem; padding: 0.5rem; }
    .vvm-map-filters { bottom: 0.75rem; gap: 0.5rem; }
    .vvm-filter-btn { font-size: 0.6875rem; padding: 0.375rem 0.75rem; }
    .vvm-modal-btn-container,
    .vvm-modal-buttons { bottom: 0.75rem; right: 0.625rem; }
    
    /* Visa kort text på mobil */
    .vvm-btn-text-short {
        display: inline;
    }
    
    .vvm-btn-text-full {
        display: none;
    }
}

@media (max-width: 600px) {
    .vvm-modal { padding: 1.875rem 1.25rem; width: 95%; }
    .vvm-modal-title { font-size: 1.25rem; }
    .vvm-modal-content { font-size: 0.9375rem; }
}

@media (max-width: 500px) {
    .vvm-popup { min-width: 10rem; max-width: 98vw; }
    .vvm-popup-image-wrap { height: 5.625rem; }
    .vvm-popup-arrow { width: 1.5rem; height: 0.75rem; }
}

/* Leaflet-anpassningar */
.leaflet-popup-content-wrapper {
    border-radius: 0.5rem;
}

.leaflet-popup-content {
    margin: 0.9375rem;
}

/* Laddningsindikator */
.vvm-map-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.9);
    padding: 1.25rem;
    border-radius: 0.25rem;
    box-shadow: 0 0.125rem 0.625rem rgba(0,0,0,0.1);
    z-index: 1000;
}

.vvm-map-loading::after {
    content: 'Laddar destinationer...';
    display: block;
    text-align: center;
    color: #666;
}

/* Ta bort standard Leaflet-stilar för popup-wrapper och tip */
.vvm-map .leaflet-popup-content-wrapper {
    background: none;
    border: none;
    box-shadow: none;
    padding: 0;
}

.vvm-map .leaflet-popup-tip-container {
    display: none;
}

/* Ta bort tidigare marker-färger */
.vvm-marker-eat,
.vvm-marker-stay,
.vvm-marker-do {
    background: none !important;
}

/* Modal-knapp container och knappar */
.vvm-modal-btn-container,
.vvm-modal-buttons {
    position: absolute;
    bottom: 1rem;
    right: 0.625rem;
    z-index: 1001;
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.vvm-modal-btn {
    width: 2.125rem;
    height: 2.125rem;
    line-height: 2.125rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(0,0,0,0.3);
    border-radius: 0.25rem;
    background: #fff;
    color: #333;
    box-shadow: 0 0.0625rem 0.3125rem rgba(0,0,0,0.15);
}

.vvm-modal-btn:hover {
    background-color: #f4f4f4;
}

.vvm-modal-btn svg {
    width: 1.25rem;
    height: 1.25rem;
}

/* Modal overlay */
.vvm-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.25rem;
}

/* Modal container */
.vvm-modal {
    background: #fff;
    border-radius: 0.75rem;
    box-shadow: 0 0.625rem 2.5rem rgba(0, 0, 0, 0.15);
    max-width: 31.25rem;
    width: 90%;
    max-height: 70%;
    overflow-y: auto;
    position: relative;
    padding: 2.5rem;
}

/* Modal close button */
.vvm-modal-close {
    position: absolute;
    top: 0.9375rem;
    right: 0.9375rem;
    width: 2rem;
    height: 2rem;
    background: #f4f4f4;
    border-radius: 50%;
    font-size: 1.25rem;
    line-height: 1;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
	outline: none;
}

.vvm-modal-close:hover {
    background: #e0e0e0;
    color: #333;
}

/* Modal title */
.vvm-modal-title {
    margin: 0 0 1.25rem 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: #222;
    line-height: 1.3;
}

/* Modal content */
.vvm-modal-content {
    font-size: 1rem;
    line-height: 1.6;
    color: #444;
}

.vvm-modal-content p {
    margin: 0 0 0.9375rem 0;
}

.vvm-modal-content p:last-child {
    margin-bottom: 0;
}

/* Embed modal styles */
.vvm-embed-code {
	width: 100%;
	height: 7.5rem;
	font-family: monospace;
	font-size: 0.8125rem;
	padding: 0.625rem;
	border: 1px solid #ddd;
	border-radius: 0.25rem;
	background: #f5f5f5;
	resize: vertical;
	box-sizing: border-box;
}

.vvm-copy-btn {
	margin-top: 0.625rem;
	padding: 0.5rem 1.25rem;
	background: #EAD69E;
	color: #000;
	font-weight: 600;
	border-radius: 0.25rem;
	font-size: 0.875rem;
}

.vvm-copy-btn:hover {
	background: #000000;
	color: #fff;
}

.vvm-copy-btn:active {
	transform: translateY(0.0625rem);
}

/* Förhindra scrollning när modal är öppen */
body.vvm-modal-open {
	overflow: hidden;
}

/* Hide Leaflet attribution */
.leaflet-control-attribution {
	display: none !important;
}

/* Custom Leaflet popup close button */
.leaflet-popup-close-button {
	width: 1.5rem !important;
	height: 1.5rem !important;
	font-size: 0 !important;
	background: url('../images/close-icon.svg') no-repeat center center !important;
	background-size: 1.25rem 1.25rem !important;
	color: #666 !important;
	border-radius: 50% !important;
	top: 0.25rem !important;
	right: 0.25rem !important;
	padding: 0 !important;
	border: none !important;
	transition: all 0.2s ease !important;
}

.leaflet-popup-close-button:hover {
	background-color: #f0f0f0 !important;
	color: #333 !important;
	transform: scale(1.1) !important;
}

.leaflet-popup-close-button:focus {
	outline: 2px solid #4A90E2 !important;
	outline-offset: 0.125rem !important;
}

/* Förbättrad fokussynlighet och interaktiva element */
.vvm-modal-btn:focus,
.vvm-modal-close:focus,
.vvm-copy-btn:focus,
.vvm-filter-btn:focus {
	outline: 2px solid #005fcc;
	outline-offset: 0.125rem;
}

/* Gemensamma button-stilar */
.vvm-filter-btn,
.vvm-modal-btn,
.vvm-copy-btn,
.vvm-modal-close {
	cursor: pointer;
	border: none;
	transition: all 0.2s;
}

