/* Global Presence Section
-------------------------------------------------- */
.map-section {
    width: 100%;
    max-width: 1920px;
    position: relative;
    margin: 0 auto;
    margin-top: var(--spacing-xxxl);
    padding: 2rem 1rem;
    overflow: hidden;
}

.map-content {
    width: 100%;
    max-width: 1473px;
    margin: 0 auto;
    text-align: center;
}

.map-title {
    font-size: var(--font-size-hero); /* 48px */
    line-height: var(--line-height-heading);
    margin-bottom: var(--spacing-xl);
    color: #018F47;
    text-align: center;
    max-width: 785px;
    margin: 0 auto 2rem;
}

.map-description, .map-description-2 {
    font-size: var(--font-size-xxxxl); /* 32px */
    line-height: var(--line-height-text);
    margin-bottom: var(--spacing-lg);
    color: #181818;
    max-width: 930px;
    margin: 0 auto 0.5rem;
    text-align: center;
}

.map-description-2 {
    margin-top: 1.25rem;
}

.map-container {
    position: relative;
    width: 100%;
    max-width: 1371px;
    aspect-ratio: 1371/675;
    margin: 2rem auto 0;
}

.world-map {
    position: relative;
    width: 100%;
    height: 100%;
    z-index: 1; /* Base layer */
    overflow: visible;
}

/* Default style for SVG paths */
.world-map path {
    fill: #d3d3d3;
    transition: fill 0.3s ease, transform 0.5s ease-in, 0.8s ease-out;
}

.world-map path:hover {
    fill: url(#gradient-hover);
    transform: scale(1.01);
    transform-origin: center center; /* Scale from the center of each path */
    filter: drop-shadow(0 0 5px #8DCF4F);
}


/* Add to your existing map section CSS */
.map-markers {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
}

/* Update the marker-dot class */
.marker-dot {
    position: relative;
    width: 16px;
    height: 16px;
    background-color: #018F47;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Add outer circle */
.marker-dot::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid #018F47;
    border-radius: 50%;
}

/* Update marker line */
.marker-line {
    transform-origin: left;
    transform: scaleX(0);
    animation: drawLine 1s ease-out forwards;
    height: 3px;
    background-color: #018F47;
}

/* Adjust country marker layout */
.country-marker {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 10px; /* Add space between flag and country name */
    transition: transform 0.3s ease; /* Add transition for smooth scaling */
    transform-origin: center; /* Set transform origin to center */
    z-index: 1; /* Default z-index */
}

/* Add hover effect for the entire marker */
.country-marker:hover {
    transform: scale(1.2); /* Scale up by 20% on hover */
    z-index: 10; /* Bring hovered marker to front */
}

/* Update the flag and text hover effects */
.flag-icon {
    width: 50px;
    height: 30px;
    object-fit: contain;
    transition: transform 0.3s ease;
    transform-origin: center;
    margin: 0 5px;
}

.country-name {
    color: #C6C6C6;
    font-size: 20px;
    text-transform: uppercase;
    white-space: nowrap;
    margin: 0 5px;
    transition: color 0.3s ease; /* Add transition for color change */
}

/* Update hover effects for marker components */
.country-marker:hover .country-name {
    color: #018F47; /* Change text color on hover */
}

.country-marker:hover .marker-dot {
    background-color: #018F47; /* Brighten the dot on hover */
    box-shadow: 0 0 10px rgba(1, 143, 71, 0.5); /* Add glow effect */
}

.country-marker:hover .marker-line {
    background-color: #018F47; /* Brighten the line on hover */
}

/* Optional: Add a subtle glow effect to the entire marker on hover */
.country-marker:hover::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: rgba(1, 143, 71, 0.1);
    border-radius: 20px;
    filter: blur(10px);
    z-index: -1;
}




/* Position each country marker */
.usa-marker {
    top: 40%;
    left: 0%;
    flex-direction: row; /* Flag on left, text on right */
}

.estonia-marker {
    top: 22%;
    left: 31%;
    flex-direction: row; /* Flag on left, text on right */
}

.austria-marker {
    top: 33%;
    left: 27%;
    flex-direction: row; /* Flag on left, text on right */
}

.israel-marker {
    top: 42.8%;
    left: 31.5%;
    flex-direction: row; /* Flag on left, text on right */
}

.taiwan-marker {
    top: 48%;
    left: 80.5%;
    flex-direction: row-reverse; /* Flag on right, text on left */
}

.philippines-marker {
    top: 55%;
    left: 81%;
    flex-direction: row-reverse; /* Flag on right, text on left */
}

/* Marker line directions */
.usa-marker .marker-line,
.estonia-marker .marker-line,
.austria-marker .marker-line,
.israel-marker .marker-line {
    transform-origin: left;
    animation: drawLine 1s ease-out forwards;
}

.taiwan-marker .marker-line,
.philippines-marker .marker-line {
    transform-origin: right;
    animation: drawLineReverse 1s ease-out forwards;
}

/* Marker line widths */
.israel-marker .marker-line {
    width: 170px;
}
.austria-marker .marker-line {
    width: 140px;
}
.estonia-marker .marker-line {
    width: 110px;
}

/* Add reverse keyframes if not present */
@keyframes drawLineReverse {
    from {
        transform: scaleX(0);
    }
    to {
        transform: scaleX(1);
    }
}

/* Map Section Animations */
@keyframes fadeInMap {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes pulseMarker {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.8;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes drawLine {
    from {
        transform: scaleX(0);
    }
    to {
        transform: scaleX(1);
    }
}

@keyframes slideInText {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Optional: Add a floating animation to the entire map */
@keyframes floatMap {
    0% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
    100% {
        transform: translateY(0);
    }
}

.map-container {
    animation: fadeInMap 1s ease-out, floatMap 6s ease-in-out infinite;
}

.marker-dot {
    animation: pulseMarker 2s infinite;
}

.marker-line {
    transform-origin: left;
    transform: scaleX(0);
    animation: drawLine 1s ease-out forwards;
    height: 3px;
    background-color: #018F47;
}

.country-name {
    animation: slideInText 0.5s ease-out forwards;
    opacity: 0;
}

/* Stagger the animations for each country */
.usa-marker .country-name { animation-delay: 0.2s; }
.estonia-marker .country-name { animation-delay: 0.4s; }
.austria-marker .country-name { animation-delay: 0.6s; }
.israel-marker .country-name { animation-delay: 0.8s; }
.taiwan-marker .country-name { animation-delay: 1s; }
.philippines-marker .country-name { animation-delay: 1.2s; }

.usa-marker .marker-line { animation-delay: 0.2s; }
.estonia-marker .marker-line { animation-delay: 0.4s; }
.austria-marker .marker-line { animation-delay: 0.6s; }
.israel-marker .marker-line { animation-delay: 0.8s; }
.taiwan-marker .marker-line { animation-delay: 1s; }
.philippines-marker .marker-line { animation-delay: 1.2s; }

/* Add hover effects */
.country-marker:hover .marker-dot {
    animation: pulseMarker 1s infinite;
}

.country-marker:hover .country-name {
    color: #018F47;
    transition: color 0.3s ease;
}

/* Update marker line styles for all countries */
.usa-marker .marker-line { 
    width: 100px;
    transform-origin: left;
    transform: scaleX(0);
    animation: drawLine 1s ease-out forwards 0.2s;
}

.estonia-marker .marker-line { 
    width: 110px;
    transform-origin: left;
    transform: scaleX(0);
    animation: drawLine 1s ease-out forwards 0.4s;
}

.austria-marker .marker-line { 
    width: 140px;
    transform-origin: left;
    transform: scaleX(0);
    animation: drawLine 1s ease-out forwards 0.6s;
}

.israel-marker .marker-line { 
    width: 170px;
    transform-origin: left;
    transform: scaleX(0);
    animation: drawLine 1s ease-out forwards 0.8s;
}

.taiwan-marker .marker-line { 
    width: 50px;
    transform-origin: right; /* Changed to right for Asian countries */
    transform: scaleX(0);
    animation: drawLine 1s ease-out forwards 1s;
}

.philippines-marker .marker-line { 
    width: 50px;
    transform-origin: right; /* Changed to right for Asian countries */
    transform: scaleX(0);
    animation: drawLine 1s ease-out forwards 1.2s;
}



/* Add this keyframe for right-aligned lines */
@keyframes drawLineReverse {
    from {
        transform: scaleX(0);
    }
    to {
        transform: scaleX(1);
    }
}

/* Apply reverse animation to Asian countries */
.taiwan-marker .marker-line,
.philippines-marker .marker-line {
    animation-name: drawLineReverse;
}

/* Add this near the top with other global styles */
a {
    text-decoration: none;
}

/* Optional: Add a ripple effect around the dot */
.marker-dot::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px; /* Match dot size */
    height: 16px; /* Match dot size */
    background: rgba(1, 142, 71, 0.3); /* Semi-transparent version of dot color */
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: ripple 2s ease-out infinite;
}

@keyframes ripple {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(3);
        opacity: 0;
    }
}

/* Responsive adjustments */
/* Add to your media queries */
@media screen and (min-width: 577px) and (max-width: 768px) {
    .map-content {
        padding: 1.5rem 0;
    }
}

/* =========================
   Desktop (Default >1440px)
   ========================= */
.map-title {
    font-size: clamp(32px, 4vw, 48px);
}
.map-description, .map-description-2 {
    font-size: clamp(18px, 2.5vw, 28px);
}
.country-name {
    font-size: 20px;
}
.flag-icon {
    width: 50px;
    height: 30px;
}
.map-container {
    max-width: 1371px;
    aspect-ratio: 1371/675;
}

/* =========================
   1440px Laptop Breakpoint
   ========================= */
@media screen and (max-width: 1440px) {
    .map-title {
        font-size: 40px;
    }
    .map-description, .map-description-2 {
        font-size: 22px;
    }
    .country-name {
        font-size: 18px;
    }
    .flag-icon {
        width: 44px;
        height: 26px;
    }
    .map-container {
        max-width: 1100px;
        aspect-ratio: 1371/675;
    }

    /* Map markers */
     /* Map adjustment */
    .usa-marker         { top: 40%; left: -3%; }
    .estonia-marker     { top: 22%; left: 27%; }
    .austria-marker     { top: 33%; left: 22%; }
    .israel-marker      { top: 42%; left: 23%; }
    .taiwan-marker      { top: 48%; left: 80.5%; }
    .philippines-marker { top: 55%; left: 81%; }
   
}

/* =========================
   1280px Laptop Breakpoint
   ========================= */
@media screen  and (min-width: 1281px) and  (max-width: 1440px) {

    .map-description, .map-description-2 {
        font-size: var(--font-size-xxl);
        width: 70%;
    }

    
    /* Map adjustment */
    .usa-marker         { top: 40%; left: -5%; }
    .estonia-marker     { top: 22%; left: 27%; }
    .austria-marker     { top: 33%; left: 21%; }
    .israel-marker      { top: 42%; left: 26%; }
    .taiwan-marker      { top: 48%; left: 80.5%; }
    .philippines-marker { top: 55%; left: 81%; }
    
}



@media screen and (min-width: 1025px)  and (max-width: 1280px) {
    .map-title {
        font-size: var(--font-size-xxxxl);
        width: 50%;
    }
    .map-description, .map-description-2 {
        font-size: var(--font-size-xl);
        width: 60%;
    }
    .country-name {
        font-size: 16px;
    }
    .flag-icon {
        width: 38px;
        height: 22px;
    }
    .map-container {
        max-width: 900px;
        aspect-ratio: 1371/675;
    }

    /* Map adjustment */
    .usa-marker         { top: 40%; left: -8%; }
    .estonia-marker     { top: 22%; left: 25%; }
    .austria-marker     { top: 33%; left: 20%; }
    .israel-marker      { top: 42%; left: 29%; }
    .taiwan-marker      { top: 48%; left: 80.5%; }
    .philippines-marker { top: 55%; left: 81%; }
   
    /* Map Marker line */
    
    .usa-marker .marker-line { width: 100px; }
    .estonia-marker .marker-line { width: 80px; }
    .austria-marker .marker-line { width: 100px; }
    .israel-marker .marker-line { width: 100px; }
    .taiwan-marker .marker-line { width: 50px;}
    .philippines-marker .marker-line { width: 50px;}

}

/* =========================
   Tablet (769px–1024px)
   ========================= */
@media screen and (min-width: 769px) and (max-width: 1024px) {
    .map-title {
        font-size: var(--font-size-xxxxl);
        width: 70%;
    }
    .map-description, .map-description-2 {
        font-size: var(--font-size-xl);
        width: 75%;
    }
    .country-name {
        font-size: 15px;
        color: #018F47;
    }
    .flag-icon {
        width: 32px;
        height: 20px;
    }
    .map-container {
        max-width: 700px;
        aspect-ratio: 1371/675;
    }
    .map-content {
        padding: 2rem 0;
    }
    /* Hide marker lines, show flag, name, dot */
    .country-marker .marker-line {
        display: none !important;
    }
    .country-marker {
        flex-direction: row !important;
        align-items: center;
        gap: 0.2em;
    }
    .country-marker .country-name {
        display: inline;
        order: 1;
        margin: 0 var(--spacing-xs);
    }
    .country-marker .marker-dot {
        order: 2;
    }

    /* Map adjustment */
    .usa-marker         { top: 40%; left: 1%; }
    .estonia-marker     { top: 22%; left: 35%; }
    .austria-marker     { top: 33%; left: 32%; }
    .israel-marker      { top: 42%; left: 40%; }
    .taiwan-marker      { top: 48%; left: 80.5%; }
    .philippines-marker { top: 55%; left: 81%; }
}

/* =========================
   Small Tablet (577px–768px)
   ========================= */
@media screen and (min-width: 577px) and (max-width: 768px) {
      .map-title {
        font-size: var(--font-size-xxxl);
        width: 60%;
    }
    .map-description, .map-description-2 {
        font-size: var(--font-size-lg);
        width: 65%;
    }
    .country-name {
        font-size: 14px;
        color: #018F47;
    }
    .flag-icon {
        width: 28px;
        height: 16px;
    }
    .map-container {
        max-width: 500px;
        aspect-ratio: 1371/675;
    }
    .map-content {
        padding: 1.5rem 0;
    }
    /* Hide marker lines, show flag, name, dot */
    .country-marker .marker-line {
        display: none !important;
    }
    .country-marker {
        flex-direction: row !important;
        align-items: center;
        gap: 0.2em;
    }
    .country-marker .country-name {
        display: inline;
        order: 1;
        margin: 0 var(--spacing-xs);
    }
    .country-marker .marker-dot {
        order: 2;
    }

     /* Map adjustment */
    .usa-marker         { top: 40%; left: -3%; }
    .estonia-marker     { top: 22%; left: 28%; }
    .austria-marker     { top: 33%; left: 24%; }
    .israel-marker      { top: 40%; left: 34%; }
    .taiwan-marker      { top: 48%; left: 80.5%; }
    .philippines-marker { top: 55%; left: 81%; }
   
}

/* =========================
   Mobile (≤576px)
   ========================= */
@media screen and (max-width: 576px) {
      .map-title {
        font-size: var(--font-size-xxxl);
        width: 80%;
    }
    .map-description, .map-description-2 {
        font-size: var(--font-size-lg);
        width: 75%;
    }
    .country-name {
        display: none !important;
    }
    .flag-icon {
        width: 22px;
        height: 12px;
    }
    .map-container {
        max-width: 100%;
        aspect-ratio: auto;
    }
    .country-marker {
        flex-direction: row !important;
        align-items: center;
        gap: var(--spacing-xs);
    }
    .country-marker .marker-line {
        display: none !important;
    }
    .country-marker .flag-icon {
        order: 0;
    }
    .country-marker .marker-dot {
        order: 1;
    }
}

/* =========================
   Marker Layout (Desktop)
   ========================= */
.country-marker.dot-right {
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
}
.country-marker.dot-right .flag-icon { order: 0; margin-right: var(--spacing-xs);}
.country-marker.dot-right .country-name { order: 1; margin-right: var(--spacing-xs);}
.country-marker.dot-right .marker-line { order: 2; margin-right: var(--spacing-xs);}
.country-marker.dot-right .marker-dot { order: 3; }

.country-marker.dot-left {
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
}
.country-marker.dot-left .marker-dot { order: 0; margin-right: var(--spacing-xs);}
.country-marker.dot-left .marker-line { order: 1; margin-right: var(--spacing-xs);}
.country-marker.dot-left .country-name { order: 2; margin-right: var(--spacing-xs);}
.country-marker.dot-left .flag-icon { order: 3; }

/* Responsive for Mobile: hide line, adjust order */
@media screen and (max-width: 576px) {
    .country-marker {
        flex-direction: row !important;
        justify-content: flex-start;
        align-items: center;
        gap: var(--spacing-xs);
    }
    .country-marker .marker-line {
        display: none !important;
    }
    .country-marker.dot-right .flag-icon {
        order: 0;
        margin-right: var(--spacing-xs);
    }
    .country-marker.dot-right .country-name {
        order: 1;
        margin-right: var(--spacing-xs);
    }
    .country-marker.dot-right .marker-dot {
        order: 2;
    }
    .country-marker.dot-left .marker-dot {
        order: 0;
        margin-right: var(--spacing-xs);
    }
    .country-marker.dot-left .country-name {
        order: 1;
        margin-right: var(--spacing-xs);
    }
    .country-marker.dot-left .flag-icon {
        order: 2;
    }
}

.marker-label {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

/* Tablet: flag, name, dot (no line) */
@media screen and (min-width: 577px) and (max-width: 1024px) {
    .country-marker {
        flex-direction: row !important;
        align-items: center;
        gap: 0.2em;
    }
    .country-marker .flag-icon {
        width: 32px;
        height: 20px;
    }
    .country-marker .marker-line {
        display: none !important;
    }
    .country-marker .country-name {
        order: 1;
        display: inline;
        margin: 0 var(--spacing-xs);
    }
    .country-marker .marker-dot {
        order: 2;
    }
}

/* Mobile: flag, dot (no name, no line) */
@media screen and (max-width: 576px) {
    .map-title {
        font-size: var(--font-size-xl);
    }

    .map-description, .map-description-2 {
        font-size: var(--font-size-sm);
    }

    .country-marker {
        flex-direction: row !important;
        align-items: center;
        gap: var(--spacing-xs);
    }
    .country-marker .marker-line {
        display: none !important;
    }
    .country-marker .country-name {
        display: none !important;
    }
    .country-marker .flag-icon {
        order: 0;
    }
    .country-marker .marker-dot {
        order: 1;
    }

      /* Map adjustment */
    .usa-marker         { top: 40%; left: 1%; }
    .estonia-marker     { top: 22%; left: 42%; }
    .austria-marker     { top: 33%; left: 37%; }
    .israel-marker      { top: 41%; left: 45%; }
    .taiwan-marker      { top: 48%; left: 80.5%; }
    .philippines-marker { top: 55%; left: 81%; }
}

