/* Global Branches Map Section - 3D Globe */
.ourBranchesMap {
    position: relative;
    width: 100%;
    min-height: 100vh;
    /* background: linear-gradient(135deg, #0c1a2d 0%, #1a3a5f 100%); */
    overflow: hidden;
}

.globe-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* Improve canvas rendering */
.globe-container canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}



/* Optional: Show grab cursor when not hovering marker */
#globeContainer canvas {
    cursor: grab;
}

#globeContainer canvas:active {
    cursor: grabbing;
}


/* When the globe has the 'marker-hover' class, show pointer cursor */
.globe-container.marker-hover canvas {
    cursor: pointer !important;
}



.map-title-section {
    position: absolute;
    top: 150px;
    left: 100px;
    right: 0;
    z-index: 20;
    /* text-align: center; */
    pointer-events: none;
}

.map-title {
    color: #fff;
    font-size: 5rem;
    font-weight: 700;
    margin-bottom: 0px;
    opacity: 0;
    transform: translateY(-30px);
    animation: titleAppear 1s ease forwards 0.5s;
    text-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.map-subtitle {
    color: #4fc3f7;
    font-size: 1.8rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    opacity: 0;
    transform: translateY(20px);
    animation: subtitleAppear 1s ease forwards 0.8s;
}

@keyframes titleAppear {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes subtitleAppear {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Controls */
.globe-controls {
    position: absolute;
    bottom: 40px;
    right: 40px;
    z-index: 20;
    display: flex;
    gap: 15px;
}

.control-btn {
    width: 50px;
    height: 50px;
    background: rgba(12, 26, 45, 0.9);
    border: 2px solid rgba(79, 195, 247, 0.3);
    border-radius: 50%;
    color: #4fc3f7;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.control-btn:hover {
    background: rgba(79, 195, 247, 0.2);
    border-color: rgba(79, 195, 247, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(79, 195, 247, 0.2);
}

/* Branch Info Panel */
.branch-info-panel {
    position: absolute;
    top: 50%;
    right: 20%;
    transform: translateY(-50%) translateX(100px);
    width: 35%;
    background: rgba(18, 29, 86, 0.9);
    border-radius: 20px;
    padding: 30px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    /* border: 2px solid rgba(79, 195, 247, 0.3); */
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    z-index: 30;
}

.branch-info-panel.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateX(0);
}

.branch-info-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: -10px;
}

.branch-flag {
    width: 50px;
    height: 35px;
    border-radius: 8px;
    overflow: hidden;
    margin-top: -40px;
    /* border: 2px solid rgba(255, 255, 255, 0.2); */
}

.branch-flag img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.branch-country {
    color: #fff;
    font-size: 2.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: -5px;
}

.branch-region {
    color: #4fc3f7;
    font-size: 1.2rem;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.branch-image-container {
    position: relative;
    width: 100%;
    height: 280px;
    border-radius: 15px;
    overflow: hidden;
    margin-bottom: 25px;
}

.branch-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.branch-info-panel:hover .branch-image {
    transform: scale(1.05);
}

.branch-image-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, transparent 100%);
    padding: 20px;
    transform: translateY(10px);
    opacity: 0;
    transition: all 0.3s ease;
    color: white;
}

.branch-image-overlay h4 {
    font-size: 1.4rem;
    float: right;
}

.branch-info-panel:hover .branch-image-overlay {
    transform: translateY(0);
    opacity: 1;
}

.branch-stats {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.branch-stat {
    flex: 1;
    text-align: center;
    padding: 10px;
    /* background: rgba(79, 195, 247, 0.1); */
    border-radius: 10px;
    border: 1px solid rgba(79, 195, 247, 0.1);
}

.stat-value {
    color: #4fc3f7;
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.stat-label {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.branch-description {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.6rem;
    line-height: 1.6;
    margin-bottom: 25px;
}

.branch-contacts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px;
    /* margin-bottom: 20px; */
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.6rem;
}

.contact-item i {
    color: #4fc3f7;
    font-size: 1.6rem;
}

.branch-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: black;
    text-decoration: none;
    font-weight: 300;
    padding: 5px 50px;
    /* background: rgba(79, 195, 247, 0.1); */
    background: white;
    margin-bottom: 20px;
    border-radius: 30px;
    /* border: 2px solid rgba(79, 195, 247, 0.3); */
    transition: all 0.3s ease;
    float: right;
}

.branch-link:hover {
    /* background: rgba(79, 195, 247, 0.2); */
    /* border-color: rgba(79, 195, 247, 0.5); */
    color: rgba(18, 29, 86, 0.8);
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(79, 195, 247, 0.05);
}

/* Close Button */
.close-branch-info {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 30px;
    height: 30px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border: none;
    color: #fff;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.close-branch-info:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

/* Legend */
.map-legend {
    position: absolute;
    bottom: 40px;
    left: 40px;
    background: rgba(12, 26, 45, 0.9);
    padding: 20px;
    border-radius: 15px;
    border: 1px solid rgba(79, 195, 247, 0.3);
    backdrop-filter: blur(10px);
    z-index: 20;
    animation: fadeInUp 1s ease forwards 1s;
    opacity: 0;
    transform: translateY(20px);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.legend-item:last-child {
    margin-bottom: 0;
}

.legend-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.legend-text {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    font-weight: 500;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}



/* Loading */
.globe-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #4fc3f7;
    font-size: 1.2rem;
    z-index: 10;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .branch-info-panel {
        width: 350px;
        right: 20px;

    }
}

@media (max-width: 992px) {
    .ourBranchesMap {
        height: auto;
        min-height: 600px;
    }

    .map-title {
        font-size: 2.5rem;
    }

    .branch-info-panel {
        position: relative;
        top: auto;
        right: auto;
        transform: none;
        width: 90%;
        max-width: 500px;
        margin: 40px auto;
    }

    .branch-info-panel.active {
        transform: none;
    }

    .globe-markers {
        /* display: none; */
    }
}

@media (max-width: 768px) {
    .map-title {
        font-size: 3rem;
    }

    .map-subtitle {
        font-size: 1rem;
    }

    .branch-contacts {
        grid-template-columns: 1fr;
    }

    .map-legend {
        bottom: 20px;
        left: 20px;
        right: 20px;
        padding: 15px;
    }

    .globe-controls {
        bottom: 20px;
        right: 20px;
    }
}

.branch-info-panel.active~.globe-container {
    /* Optional: Add a subtle shadow or effect when panel is active */
    filter: brightness(0.95);
    transition: filter 0.5s ease;
}

/* Responsive adjustment */
@media (min-width: 991px) and (max-width: 1300px) {
    .branch-info-panel.active~.globe-container {
        /* On mobile, don't move globe as panel is full width */
        filter: none;

    }

    .branch-image-container {
        height: 200px;
    }


    .map-title-section {
        top: 50px;
    }


    .globe-markers {
        top: 20% !important;
        left: 70px;
    }

    .map-title {
        font-size: 4rem;
    }

    .map-subtitle {
        font-size: 1.5rem;
    }
}



/* markers */
.globe-markers {
    position: absolute;
    top: 25%;
    left: 70px;
    transform: translateY(-50%);
    /* background: rgba(12, 26, 45, 0.9); */
    padding: 30px;
    /* border-radius: 15px; */
    /* border: 1px solid rgba(79, 195, 247, 0.3); */
    backdrop-filter: blur(2px);
    z-index: 20;
    max-width: 300px;
    animation: fadeInUp 1s ease forwards 1.2s;
    opacity: 0;
    transform: translateY(-50%) translateX(-20px);
}

.markers-title {
    color: #4fc3f7;
    font-size: 2rem;
    margin-bottom: 10px;
    font-weight: 600;
}


.markers-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    margin-bottom: 8px;
    color: rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease;
    padding: 4px 8px;
    border-radius: 6px;
    cursor: pointer;
}

.markers-item:hover {
    background: rgba(79, 195, 247, 0.1);
    transform: translateX(5px);
    color: #4fc3f7;
}

.markers-item.active {
    background: rgba(79, 195, 247, 0);
    /* transform: translateX(5px); */
    color: #4fc3f7;
    transform: translateX(10px);
    font-weight: 600;
    font-size: 21px;
}

.markers-item:last-child {
    margin-bottom: 0;
}

.marker-flag {
    width: 22px;
    height: 15px;
    border-radius: 4px;
    overflow: hidden;
}