/* WorldMap Modal Responsive Styles */

#worldMapModal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: auto;
}

.worldmap-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 20px;
    max-width: 1200px;
    width: 100%;
    max-height: 95vh;
    overflow-y: auto;
}

.worldmap-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.worldmap-header-left {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.worldmap-header-right {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.worldmap-title {
    color: #ffd700;
    font-size: 1.5em;
    font-weight: bold;
}

.worldmap-main {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.worldmap-sidebar-left {
    flex-shrink: 0;
}

/* Minimap responsive scaling */
#minimapContainer {
    transform-origin: top left;
}

.worldmap-center {
    display: flex;
    flex-direction: column;
    gap: 15px;
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

/* Grid wrapper for responsive scaling */
.worldmap-grid-wrapper {
    display: flex;
    justify-content: center;
    overflow: hidden;
}

#worldMapModalGrid {
    transform-origin: center center;
}

.worldmap-sidebar-right {
    flex-shrink: 0;
    width: 200px;
}

.worldmap-exit-btn {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    border: none;
    border-radius: 8px;
    padding: 10px 20px;
    color: #fff;
    font-weight: bold;
    cursor: pointer;
}

.worldmap-exit-btn:hover {
    background: linear-gradient(135deg, #ff5f52, #d94639);
}

/* Responsivo - Telas medias */
@media (max-width: 1024px) {
    .worldmap-main {
        flex-direction: column;
    }

    .worldmap-sidebar-left,
    .worldmap-sidebar-right {
        width: 100%;
        flex-shrink: 1;
    }

    .worldmap-sidebar-left {
        order: 2;
    }

    .worldmap-center {
        order: 1;
    }

    .worldmap-sidebar-right {
        order: 3;
    }

    #worldMapModalGrid {
        transform: scale(0.85);
    }

    .worldmap-grid-wrapper {
        margin: -20px 0;
    }

    /* Scale minimap */
    .worldmap-sidebar-left {
        transform: scale(0.7);
        transform-origin: top left;
        margin-right: -150px;
        margin-bottom: -150px;
    }
}

/* Responsivo - Telas pequenas */
@media (max-width: 768px) {
    .worldmap-container {
        padding: 10px;
        padding-top: 60px;
    }

    .worldmap-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .worldmap-header-left {
        width: 100%;
    }

    .worldmap-header-right {
        width: 100%;
        justify-content: flex-start;
    }

    .worldmap-exit-btn {
        position: fixed;
        top: 10px;
        right: 10px;
        z-index: 1000000;
        padding: 8px 16px;
    }

    #worldMapModalGrid {
        transform: scale(0.7);
    }

    .worldmap-grid-wrapper {
        margin: -40px 0;
    }

    /* Scale minimap further */
    .worldmap-sidebar-left {
        transform: scale(0.55);
        transform-origin: top center;
        margin-bottom: -225px;
        margin-right: 0;
    }
}

/* Responsivo - Telas muito pequenas */
@media (max-width: 480px) {
    .worldmap-container {
        padding: 8px;
        padding-top: 55px;
    }

    .worldmap-title {
        font-size: 1.2em;
    }

    .worldmap-header-left {
        gap: 10px;
    }

    .worldmap-header-right {
        flex-direction: column;
        align-items: stretch;
    }

    .worldmap-header-right > * {
        width: 100%;
        text-align: center;
    }

    .worldmap-exit-btn {
        position: fixed;
        top: 8px;
        right: 8px;
    }

    #worldMapModalGrid {
        transform: scale(0.55);
    }

    .worldmap-grid-wrapper {
        margin: -60px 0;
    }

    /* Scale minimap for mobile */
    .worldmap-sidebar-left {
        transform: scale(0.45);
        transform-origin: top center;
        margin-bottom: -275px;
    }
}
