/**
 * Seasonax Interactive Affiliate Map - Frontend Styles
 * SVG ViewBox-based implementation with geographic coordinates
 */

.seasonax-interactive-affiliate-map {
    width: 100%;
    margin: 0 auto;
    position: relative;
}

.seasonax-map-container {
    position: relative;
    background: #0d141c;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    max-height: 90vh;
}

.seasonax-map-viewport {
    width: 100%;
    height: 100%;
    overflow: hidden;
    position: relative;
}

.seasonax-world-map {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.seasonax-world-map svg {
    display: block;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* Zoom Controls */
.seasonax-map-controls {
    position: absolute;
    top: 120px;
    right: 120px;
    display: flex;
    flex-direction: row;
    gap: 10px;
    z-index: 10;
}

.seasonax-map-inner-container {
	position: absolute;
	width: calc(100% - 200px);
	height: calc(100% - 200px);
	pointer-events: none;
	border: 1px solid #fff;
	z-index: 999999999;
	top: 0;
	left: 0;
	margin: 100px;
	border-radius: 10px;
}

.seasonax-zoom-btn {
    width: 30px;
    height: 30px;
    background: #888F95;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    padding: 0;
}

.seasonax-zoom-btn:hover {
    background: #0CABC2;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.seasonax-zoom-btn svg {
    width: 10px;
    height: 10px;
}

.seasonax-zoom-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Info Display */
.seasonax-map-info {
    position: absolute;
    top: 20px;
    left: 20px;
    background: rgba(255, 255, 255, 0.95);
    padding: 10px 15px;
    border-radius: 6px;
    font-size: 13px;
    color: #666;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    z-index: 10;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.seasonax-map-info .separator {
    margin: 0 8px;
    color: #ddd;
}



.affiliate-pin.small-pin .affiliate-pin-circle {
	font-size: 14px;
	width: 23px;
	height: 23px;
	border-width: 2px;
	line-height: 13px;
}

.seasonax-map-info [data-zoom],
.seasonax-map-info [data-coords] {
    font-weight: 600;
    color: #333;
}

.seasonax-map-info .zoom-level,
.seasonax-map-info .coordinates {
    display: inline-block;
}

/* Region Title Display */
.seasonax-region-title {
    position: absolute;
    top: 120px;
    left: 120px;
    z-index: 10;
    font-size: 24px;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Region Navigation Buttons */
.seasonax-region-nav {
    position: absolute;
    bottom: 120px;
    left: 120px;
    display: flex;
    gap: 10px;
    z-index: 10;
    justify-content: flex-start;
    flex-wrap: wrap;
}

.region-btn {
background: rgba(120, 120, 130, 0.8);
  color: #24292E;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 18px;
  line-height:1;
  font-weight: 600;
  cursor: pointer;
  height:41px;
  transition: all 0.2s ease;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  background: #AFBAC4;
}

.region-btn:hover {
	background: rgba(23, 162, 184, 0.9);
	color: #fff;
}

.region-btn.active {
    background: rgba(23, 162, 184, 0.9);
    color: #fff;
}

/* Responsive */
@media (max-width: 768px) {

    .region-btn {
        padding: 5px 10px;
    }

    .seasonax-map-container {
        border-radius: 4px;
    }

    .seasonax-map-controls {
        top: 10px;
        right: 10px;
        gap: 8px;
    }

    .seasonax-zoom-btn {
        width: 30px;
        height: 30px;
    }

    .seasonax-zoom-btn svg {
        width: 18px;
        height: 18px;
    }

    .seasonax-map-info {
        top: 10px;
        left: 10px;
        font-size: 11px;
        padding: 8px 12px;
    }
}

@media (max-width: 480px) {
    .seasonax-map-container {
        border-radius: 0;
    }

    .seasonax-zoom-btn {
        width: 30px;
        height: 30px;
    }

    .seasonax-map-controls {
        top: 11%;
        right: 8%;
    }

    .seasonax-map-info {
        left: 8%;
        top: 11%;
    }

    .seasonax-zoom-btn svg {
        width: 14px;
        height: 14px;
    }

    .seasonax-map-info {
        font-size: 10px;
        padding: 6px 10px;
    }
}

/* Alignment Support for Block Editor */
.alignwide .seasonax-map-container {
    max-width: 100%;
}

.alignfull .seasonax-map-container {
    border-radius: 0;
    max-height: none;
    height: 70vh;
}

/* Loading State */
.seasonax-map-container.loading {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* SVG Path Styling */
.seasonax-world-map svg path {
    transition: fill 0.2s ease;
}

.seasonax-world-map svg path:hover {
    fill: rgba(52, 152, 219, 0.3);
}

/* Print Styles */
@media print {
    .seasonax-map-controls,
    .seasonax-map-info {
        display: none;
    }
    
    .seasonax-map-container {
        box-shadow: none;
        border: 1px solid #ddd;
        height: auto;
        max-height: none;
    }
}

/* Affiliate Pins */
.affiliate-pins-container {
    pointer-events: none;
}

.affiliate-pin {
    will-change: transform;
}

.affiliate-pin-multiple:hover {
	background: #0cabc2;
}

.affiliate-pin-circle {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: #24292e;
	display: flex;
	align-items: center;
	justify-content: center;
	border: 3px solid #888F95;
	overflow: hidden;
	transition: all 0.1s linear;
}

.affiliate-pin-multiple {
	background: #24292e;
	color: white;
	font-weight: bold;
	font-size: 20px;
}

.affiliate-count {
	margin-top: -2px;
}

.affiliate-pin-single img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.affiliate-pin-no-image {
    background: #888F95;
    color: white;
    font-weight: bold;
    font-size: 18px;
    text-transform: uppercase;
}

/* Affiliates Popup */
.affiliates-popup {
    animation: popupFadeIn 0.3s ease;
}

@keyframes popupFadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -45%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

.affiliates-popup-header {
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.affiliates-popup-header h3 {
    margin: 0;
    font-size: 20px;
    color: #333;
    font-weight: 600;
}

.affiliates-popup-close {
  border: none;
  font-size: 32px;
  color: #fff;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s ease;
  line-height: 1;
  border-radius: 50%;
  background: #888f95;
}

.affiliates-popup-close:hover {
    background: #0cabc2;
    color: #fff;
}

.affiliates-popup-content {
    padding: 0 20px 20px 20px;
    overflow-y: auto;
    max-height: calc(80vh - 80px);
}

.affiliate-item {
	display: flex;
	align-items: center;
	gap: 20px;
	text-decoration: none;
	color: inherit;
	margin-bottom: 15px;
	padding: 0;
	justify-content: space-between;
}

.affiliate-item:last-child {
    margin-bottom: 0;
}

.affiliate-item-meta {
	display: flex;
	gap: 20px;
	align-items: center;
}


.affiliate-item img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 50%;
    flex-shrink: 0;
}

.affiliate-info {
	display: flex;
	justify-content: center;
	align-content: center;
	font-size: 18px;
	font-weight: 600;
	height: 32px;
}

.affiliate-info p {
    margin: 0;
    font-size: 14px;
    color: #666;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Responsive Pins & Popup */
@media (max-width: 768px) {

    .seasonax-region-nav {
        top: 105%;
        left: 7%;
    }

    .affiliate-pin-circle {
        width: 32px;
        height: 32px;
        border-width: 2px;
    }

    .affiliate-pin-multiple {
        font-size: 14px;
    }

    .affiliate-pin-no-image {
        font-size: 16px;
    }

    .affiliates-popup {
        max-width: 95%;
    }

    .affiliates-popup-header {
        padding: 16px;
    }

    .affiliates-popup-header h3 {
        font-size: 18px;
    }

    .affiliate-item {
        gap: 12px;
    }

}

@media (max-width: 480px) {
    .affiliate-pin-circle {
        width: 28px;
        height: 28px;
    }

    .affiliate-pin-multiple {
        font-size: 12px;
    }

    .affiliates-popup-content {
        padding: 12px;
    }
}



@media(max-width:1024px) {

    .seasonax-map-info {
        left: 7%;
        top: 10%;
    }

    .seasonax-map-inner-container {
        width: calc(100% - 100px);
        height: calc(100% - 100px);
        margin: 50px;
    }

    .seasonax-map-container {
        height: auto;
    }

    .seasonax-map-controls {
        top: 10%;
        right: 7%;
    }

    .seasonax-region-nav {
        bottom: 10%;
        left: 7%;
    }
    
    .seasonax-region-title {
        top: 10%;
        left: 7%;
        font-size: 22px;
    }

}

@media(max-width:768px) {
    .seasonax-map-inner-container {
        width: calc(100% - 50px);
        height: calc(100% - 50px);
        margin: 25px;
    }

    .seasonax-map-controls {
        top: 7%;
        right: 6%;
    }

}

@media(max-width:560px) {

    .seasonax-world-map {
        height:700px;
    }

    .seasonax-world-map svg {
        transform: matrix(2, 0, 0, 2, 0, 0);
    }

    .seasonax-map-controls {
        top: 25px;
        right: 25px;
    }

    .seasonax-map-viewport svg {
        width: 100%;
        height:100%;
    }

    .seasonax-map-container {
        background: #0a1016;
        padding: 100px 0;
    }

    .seasonax-map-container {
        padding: 20px 0;
    }

    .seasonax-region-nav {
        bottom: 25px;
        left: 25px;
        top: unset;
    }

    .seasonax-map-info {
        left: 25px;
        top: 25px;
        display: none !important; /* Hide zoom/coordinates info on mobile */
    }
    
    .seasonax-region-title {
        top: 25px;
        left: 25px;
        font-size: 18px;
    }
    
.seasonax-map-inner-container {
	width: calc(100% - 20px);
	height: calc(100% - 20px);
	margin: 10px;
}

.seasonax-map-container::after {
	content: '';
	width: 35%;
	height: 85%;
	background: transparent;
	position: absolute;
	left: 0;
	top: 0;
}

}
