html,
body {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow: hidden;
    background-color: #040217;
}

/* Grid System */

.w-100 {
    width: 100%;
}

.text-center {
    text-align: center;
}

/* Row: wraps columns and resets side margins for gutters */
.row {
    display: flex;
    flex-wrap: wrap;
    margin-right: -15px;
    margin-left: -15px;
}

/* All columns get horizontal padding as gutter */
[class^="col-"] {
    padding-right: 15px;
    padding-left: 15px;
    box-sizing: border-box;
}

/* 12-column flex grid: flex-basis & max-width = (n/12*100)% */
.col-1 {
    flex: 0 0 8.3333%;
    max-width: 8.3333%;
}

.col-2 {
    flex: 0 0 16.6667%;
    max-width: 16.6667%;
}

.col-3 {
    flex: 0 0 25.0000%;
    max-width: 25.0000%;
}

.col-4 {
    flex: 0 0 33.3333%;
    max-width: 33.3333%;
}

.col-5 {
    flex: 0 0 41.6667%;
    max-width: 41.6667%;
}

.col-6 {
    flex: 0 0 50.0000%;
    max-width: 50.0000%;
}

.col-7 {
    flex: 0 0 58.3333%;
    max-width: 58.3333%;
}

.col-8 {
    flex: 0 0 66.6667%;
    max-width: 66.6667%;
}

.col-9 {
    flex: 0 0 75.0000%;
    max-width: 75.0000%;
}

.col-10 {
    flex: 0 0 83.3333%;
    max-width: 83.3333%;
}

.col-11 {
    flex: 0 0 91.6667%;
    max-width: 91.6667%;
}

.col-12 {
    flex: 0 0 100.0000%;
    max-width: 100.0000%;
}

/* Optional: utility to clear floats / end row if not using flex */
.clearfix::after {
    content: "";
    display: table;
    clear: both;
}

#map-container {
    width: 100vw;
    height: 100vh;
    position: relative;
    overflow: hidden;
    cursor: grab;
}

#map {
    position: absolute;
    top: 0;
    left: 0;
    transform-origin: top left;
}

.marker {
    position: absolute;
    width: 32px;
    height: 32px;
    transform: translate(-50%, -50%);
    cursor: pointer;
}

#info-card {
    position: absolute;
    pointer-events: none;
    background: rgba(0, 0, 0, 0.9);
    border: 1px solid #d7b54c;
    padding: 5px 20px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    color: antiquewhite;
}

.hidden {
    display: none;
}

#map-image {
    /* tarayıcı varsayılan sürükleme/no-selection ayarları */
    user-select: none;
    -webkit-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    user-drag: none;

    /* fare olayları doğrudan parent’a gitsin */
    pointer-events: none;
}

.marker {
    position: absolute;
    width: 32px;
    height: 32px;
    transform: translate(-50%, -50%);
    cursor: pointer;
    pointer-events: auto;
    /* inline SVG içindeki şekiller için */
}

.marker {
    position: absolute;
    width: 32px;
    height: auto;
    /* artık yükseklik svg’ye göre ayarlanacak */
    transform: translate(-50%, -50%);
    pointer-events: auto;
    text-align: center;
    /* label ortalansın */
    font-size: 12px;
    line-height: 1.2;
    font-family: sans-serif;
    color: #222;
}

.marker-label {
    display: block;
    margin-top: 4px;
    white-space: nowrap;
    pointer-events: none;
    position: absolute;
    top: 21px;
    font-size: 7px;
    text-align: center;
    width: auto;
    font-family: serif;
    background: rgba(0, 0, 0, 0.25);
    color: #fff;
    padding: 2px 4px;
    margin-left: -2px;
    box-sizing: border-box;
    min-width: 100%;
}

/* .marker-label {
    text-shadow: 0 0 2px rgba(255, 255, 255, 0.8);
} */

/* Modal overlay */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

/* Gizli modal */
.hidden {
    display: none;
}

/* Modal içeriği */
.modal-content {
    background: #222222;
    color: antiquewhite;
    padding: 20px;
    border-radius: 6px;
    width: 1200px;
    max-width: 90%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    position: relative;
}

/* Kapatma butonu */
.modal-close {
    position: absolute;
    top: 8px;
    right: 12px;
    font-size: 24px;
    cursor: pointer;
    user-select: none;
}

#modal-flag {
    border: 4px double #d7b54c;
}

/* Subsettlement styling & fade */
.subsettlement {
    position: absolute;
    width: 24px;
    height: 24px;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.subsettlement.visible {
    opacity: 1;
    pointer-events: auto;
}

.subsettlement svg {
    width: 16px;
    height: 16px;
}

.subsettlement .marker-label {
    margin-left: 3px;
    zoom: 0.7;
    top: 14px;
    left: -10px;
    margin-top: 6px;
}

.flag {
    position: absolute;
    width: 5%;
    /* top: 65px;
    right: 25px; */
    margin-left: -70px;
}

.modal-story {
    border: 1px solid #d7b54c;
    padding: 1rem 1rem;
    max-height: 10vh;
    overflow-y: scroll;
    font-size: 1.25rem;
    margin-top: 1.75rem;
}

.modal-story::before {
    content: "Quest Line";
    font-size: 1rem;
    position: absolute;
    margin-top: -31px;
    background: #222222;
    padding: 5px 15px;
}

/* 1. Z-Index Layering 
   Ensures markers are always clickable and above the map background.
   We give standard markers a higher index so they sit on top of lines/paths if you add them later.
*/
.marker {
    z-index: 20; 
    transition: opacity 0.2s ease; /* Adds a smooth fade if you switch to opacity-based hiding later */
}

.subsettlement {
    z-index: 15; /* Subsettlements sit just below main markers */
}

/* 2. Overlap Logic Helper
   The JS hides the parent using inline styles (display: none), but this class 
   helps debug or handle it if you switch logic. 
   It ensures that if the parent is hidden, it doesn't block mouse events.
*/
.marker.has-overlap[style*="display: none"] {
    pointer-events: none !important;
}

/* 3. Subsettlement Visibility Override
   Ensures that when the 'visible' class is added, it definitely appears.
   We add !important to opacity to override any potential conflicts.
*/
.subsettlement.visible {
    opacity: 1 !important;
    pointer-events: auto !important;
    z-index: 25; /* When visible and zoomed in, bring it above other passive elements */
}
