/* css/maps.css */

/* Override body background for cosmic background pages */
body {
    background-color: transparent !important;
    background-image: none !important;
}

/* === PAGE ELEMENT ANIMATIONS - DOMINO EFFECT === */
/* All header elements start hidden and animate in with domino effect */
#main-nav,
.page-container,
.map-controls {
    opacity: 0;
    transform: translateY(1.25rem);
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1), transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

#main-nav.visible,
.page-container.visible,
.map-controls.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Page header has its own fade-in animation */
.page-header {
    opacity: 0;
    transform: translateY(1.25rem);
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1), transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.page-header.visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- Page Layout & Header --- */
.page-container {
    max-width: 87.5rem;
    margin: 0 auto;
    padding: 2rem;
}

.page-header {
    text-align: center;
    margin-bottom: 3rem;
    padding: 3rem 2rem; /* Increased padding */
    background-color: #0d1117; /* Darker base */
    border: 1px solid #30363d;
    border-radius: 1rem; /* Slightly larger radius */
    position: relative;
    overflow: hidden;
    /* Add a subtle background pattern */
    background-image: linear-gradient(rgba(22, 27, 34, 0.95), rgba(22, 27, 34, 0.95)), url("https://www.transparenttextures.com/patterns/cubes.png");
    box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.2);
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.page-header:hover {
    border-color: #484f58;
    box-shadow: 0 0.75rem 2.5rem rgba(0, 0, 0, 0.3);
}

/* Add a "shine" effect */
.page-header::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0) 60%);
    transform: rotate(30deg);
    transition: opacity 0.6s ease-in-out;
    opacity: 0;
    pointer-events: none;
}

.page-header:hover::after {
    opacity: 1;
}


.page-header h1 {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 5rem; /* Larger font size */
    margin-bottom: 0.5rem;
    color: #ffffff;
    text-shadow: 0 0 0.9375rem rgba(47, 129, 247, 0.6), 0 0 1.5625rem rgba(47, 129, 247, 0.4); /* Enhanced glow */
    position: relative;
    z-index: 1;
    letter-spacing: 0.0938rem; /* Added letter spacing */
}

.page-header p {
    font-size: 1.3rem; /* Slightly larger */
    color: #a1aab4;
    max-width: 43.75rem; /* Wider max-width */
    margin: 0 auto;
    position: relative;
    z-index: 1;
    font-weight: 400; /* Lighter font weight */
}

/* --- Controls (Filters, Search, etc.) --- */
.map-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    align-items: center;
    margin-bottom: 2.5rem;
}

.filter-group {
    display: flex;
    gap: 0.5rem;
    background-color: rgba(13, 17, 23, 0.7);
    padding: 0.5rem;
    border-radius: 0.5rem;
    border: 1px solid #30363d;
    backdrop-filter: blur(0.3125rem);
}

.filter-btn {
    background-color: transparent;
    border: 1px solid transparent;
    color: #8b949e;
    padding: 0.5rem 1rem;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    background-color: rgba(47, 129, 247, 0.2);
    border-color: rgba(47, 129, 247, 0.5);
    color: #c9d1d9;
}

.filter-btn.active {
    background-color: #2f81f7;
    color: white;
    border-color: #2f81f7;
    box-shadow: 0 0 0.9375rem rgba(47, 129, 247, 0.4);
}

.search-input, #sort-select {
    padding: 0.75rem 1rem;
    background-color: #0d1117;
    border: 1px solid #30363d;
    border-radius: 0.375rem;
    color: #c9d1d9;
    font-size: 1rem;
    min-width: 15.625rem;
    transition: all 0.3s ease;
}

.search-input:focus, #sort-select:focus {
    outline: none;
    border-color: #2f81f7;
    box-shadow: 0 0 0 0.25rem rgba(47, 129, 247, 0.2);
    background-color: #161b22;
}

/* --- Layout Toggle --- */
.layout-toggle {
    display: flex;
    background-color: #161b22;
    border: 1px solid #30363d;
    border-radius: 0.375rem;
    margin-left: auto; /* Pushes it to the right */
}
.layout-btn {
    background: none;
    border: none;
    color: #8b949e;
    padding: 0.5rem;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}
.layout-btn svg {
    width: 1.25rem;
    height: 1.25rem;
    display: block;
}
.layout-btn:hover {
    color: #c9d1d9;
}
.layout-btn.active {
    background-color: #2f81f7;
    color: white;
}
.layout-btn:first-child { border-radius: 0.3125rem 0 0 0.3125rem; }
.layout-btn:last-child { border-radius: 0 0.3125rem 0.3125rem 0; }

/* --- Map Grid & Cards (Default Grid View) --- */
.maps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(21.25rem, 1fr)); /* Slightly wider cards */
    gap: 1.75rem; /* Increased gap */
}

.map-card {
    position: relative;
    border-radius: 1rem; /* Match header radius */
    overflow: hidden;
    color: white;
    text-decoration: none;
    aspect-ratio: 16 / 9;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    transform: translateY(0); /* Start at neutral position */
    opacity: 0;
    animation: card-fade-in 0.5s forwards;
    border: 1px solid #30363d;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    background-color: #161b22;
    padding: 0;
    cursor: pointer;
    box-shadow: 0 0.25rem 1.25rem rgba(0, 0, 0, 0.25);
}

/* Add a subtle shine effect container */
.map-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -150%; /* Start off-screen */
    width: 80%;
    height: 100%;
    background: linear-gradient(to right, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.1) 50%, rgba(255, 255, 255, 0) 100%);
    transform: skewX(-25deg);
    transition: left 0.7s ease-in-out;
    z-index: 4;
    pointer-events: none;
}

.map-card:hover::before {
    left: 150%; /* Move across the card */
}


.map-card:hover {
    transform: translateY(-0.5rem) scale(1.03); /* More pronounced lift */
    border-color: #2f81f7;
    box-shadow: 0 0.625rem 2.5rem rgba(0, 0, 0, 0.5), 0 0 1.5625rem rgba(47, 129, 247, 0.4);
}

.map-card-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94); /* Smoother zoom */
}

.map-card:hover .map-card-bg {
    transform: scale(1.15); /* Slightly more zoom */
}

.map-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.95) 10%, rgba(0,0,0,0.7) 45%, transparent 100%);
    z-index: 2;
    transition: background 0.3s ease;
}

.map-card:hover .map-card-overlay {
    background: linear-gradient(to top, rgba(0,0,0,0.98) 20%, rgba(0,0,0,0.75) 50%, transparent 100%);
}


.map-card-info {
    position: relative;
    z-index: 3;
    padding: 1.25rem; /* Increased padding */
    text-shadow: 0 0.125rem 0.3125rem rgba(0,0,0,0.5);
}

.map-card-gamemode {
    display: inline-block;
    background-color: rgba(47, 129, 247, 0.8); /* Use theme blue */
    backdrop-filter: blur(0.3125rem);
    border: 1px solid rgba(47, 129, 247, 0.9);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 2rem;
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.0313rem;
}

.map-card-info h3 {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 2.5rem; /* Larger title */
    margin: 0 0 0.25rem 0;
    line-height: 1.1;
}

.map-card-info p {
    margin: 0;
    font-size: 1.05rem; /* Slightly larger */
    color: #b8c1ca; /* Lighter text color */
}

.map-card-badge {
    position: absolute;
    top: 0.9375rem;
    right: 0.9375rem;
    z-index: 4;
    padding: 0.4rem 0.8rem;
    border-radius: 0.375rem;
    font-size: 0.85rem;
    font-weight: bold;
    text-transform: uppercase;
    box-shadow: 0 0.125rem 0.625rem rgba(0,0,0,0.3);
}

.new-badge {
    background-color: #e3b341; /* Gold color for 'New' */
    color: #1a1a1a;
}

.updated-badge {
    background-color: #2f81f7; /* Blue color for 'Updated' */
    color: #ffffff;
}

@keyframes card-fade-in {
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* --- List View Styles --- */
.maps-grid.list-view {
    grid-template-columns: 1fr; /* Single column */
    gap: 1rem;
}
.maps-grid.list-view .map-card {
    display: flex;
    flex-direction: row;
    aspect-ratio: unset;
    height: 7.5rem;
    align-items: center;
}
.maps-grid.list-view .map-card-bg {
    position: relative;
    width: 12.5rem;
    height: 100%;
    flex-shrink: 0;
}
.maps-grid.list-view .map-card-overlay {
    display: none; /* Not needed in list view */
}
.maps-grid.list-view .map-card-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}
.maps-grid.list-view .map-card-badge {
    position: relative;
    top: auto;
    right: auto;
    margin-left: 1rem;
    order: 3; /* Move badge to the end */
}

/* --- Loader & Empty State --- */
.loader {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 5rem;
    color: #8b949e;
    font-size: 1.2rem;
    font-weight: 500;
}

.empty-state {
    grid-column: 1 / -1; /* Span full width */
    text-align: center;
    padding: 4rem 2rem;
    background-color: #0d1117;
    border-radius: 0.5rem;
    border: 1px dashed #30363d;
}

.empty-state p {
    color: #8b949e;
    font-size: 1.1rem;
}

/* --- Modal Styles --- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay:not(.hidden) {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background-color: #0d1117;
    border: 1px solid #30363d;
    border-radius: 0.5rem;
    width: 90%;
    max-width: 50rem;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    padding: 2rem;
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.modal-overlay:not(.hidden) .modal-content {
    transform: scale(1);
}

.modal-close-btn {
    position: absolute;
    top: 0.625rem;
    right: 0.9375rem;
    background: none;
    border: none;
    color: #8b949e;
    font-size: 2.5rem;
    cursor: pointer;
}

/* Modal Content Body Styles */
#modal-content-body .modal-header {
    text-align: center;
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid transparent; /* Remove the solid border */
    background: linear-gradient(to right, #161b22, #0d1117, #161b22); /* Subtle gradient */
    padding-top: 1rem;
    position: relative;
}

#modal-content-body .modal-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 5%;
    width: 90%;
    height: 1px;
    background: linear-gradient(to right, transparent, #2f81f7, transparent);
}


#modal-content-body .modal-map-name {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 3.5rem;
    margin: 0;
    color: #ffffff;
    text-shadow: 0 0 0.5rem rgba(47, 129, 247, 0.4);
}

#modal-content-body .modal-map-location {
    font-size: 1.1rem;
    color: #a1aab4;
    margin-top: 0;
    text-transform: uppercase;
    letter-spacing: 0.0313rem;
}

#modal-content-body .modal-section h4 {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.5rem;
    color: #2f81f7;
    margin-bottom: 0.5rem;
}

/* --- Interactive Map Styles --- */
.interactive-map-container {
    position: relative;
    width: 100%;
    margin-top: 1rem;
}

.interactive-map-container img {
    width: 100%;
    border-radius: 0.375rem;
    border: 1px solid #30363d;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(47, 129, 247, 0.7);
    }
    70% {
        box-shadow: 0 0 0 0.625rem rgba(47, 129, 247, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(47, 129, 247, 0);
    }
}

.callout-point {
    position: absolute;
    width: 1.25rem;
    height: 1.25rem;
    background-color: #f0f6fc;
    border-radius: 50%;
    border: 0.1875rem solid #2f81f7;
    transform: translate(-50%, -50%);
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: pulse 2s infinite;
}

.callout-point:hover {
    transform: translate(-50%, -50%) scale(1.2);
    box-shadow: 0 0 1.25rem rgba(47, 129, 247, 0.8);
    animation: none; /* Pause animation on hover */
}

.callout-tooltip {
    position: absolute;
    bottom: 120%; /* Position above the point */
    left: 50%;
    transform: translateX(-50%);
    background-color: #161b22;
    color: #f0f6fc;
    padding: 0.75rem 1rem;
    border-radius: 0.375rem;
    border: 1px solid #30363d;
    box-shadow: 0 0.25rem 0.75rem rgba(0,0,0,0.5);
    width: 15.625rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    pointer-events: none;
    z-index: 10;
}

.callout-tooltip h5 {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
    color: #2f81f7;
}

.callout-tooltip p {
    margin: 0;
    font-size: 0.9rem;
    color: #8b949e;
}

.callout-point:hover .callout-tooltip {
    opacity: 1;
    visibility: visible;
}


/* --- Recommended Heroes Styles --- */
.modal-heroes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(5rem, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.hero-token {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    text-decoration: none;
    color: #c9d1d9;
    transition: transform 0.3s ease, color 0.3s ease;
    position: relative;
}

.hero-token:hover {
    transform: scale(1.05);
    color: white;
}

.hero-token:hover img {
    border-color: #2f81f7;
    box-shadow: 0 0 0.9375rem rgba(47, 129, 247, 0.6);
}

.hero-token:hover span {
    text-shadow: 0 0 0.3125rem rgba(255, 255, 255, 0.7);
}


.hero-token img {
    width: 4.375rem;
    height: 4.375rem;
    border-radius: 50%;
    border: 0.1875rem solid #30363d;
    background-color: #161b22;
    margin-bottom: 0.75rem;
    object-fit: cover;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.hero-token span {
    font-size: 0.8rem;
    font-weight: 600;
}
/* Append this to css/maps.css */

/* --- Modal Tab Styles --- */
.modal-tabs {
    display: flex;
    border-bottom: 1px solid #30363d;
    margin-bottom: 1.5rem;
    gap: 0.5rem;
}

.tab-btn {
    background: none;
    border: none;
    color: #8b949e;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    border-bottom: 0.1875rem solid transparent;
    transition: all 0.3s ease;
    position: relative;
}

.tab-btn::after {
    content: '';
    position: absolute;
    bottom: -0.125rem;
    left: 0;
    width: 100%;
    height: 0.1875rem;
    background-color: #2f81f7;
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 0.3s ease;
}


.tab-btn:hover {
    color: #f0f6fc;
}

.tab-btn.active {
    color: #f0f6fc;
    border-bottom-color: transparent; /* Handled by the ::after element now */
    background-color: rgba(47, 129, 247, 0.1);
}

.tab-btn.active::after {
    transform: scaleX(1);
}

.tab-panel {
    display: none; /* Panels are hidden by default */
}

.tab-panel.active {
    display: block; /* The active panel is shown */
}

/* --- New Modal Grid Layout --- */
.modal-grid-container {
    display: grid;
    grid-template-columns: 2fr 1fr; /* 66% / 33% split */
    gap: 2rem;
    height: 100%;
}

.modal-main-panel {
    display: flex;
    flex-direction: column;
}

.modal-info-panel {
    background-color: #161b22;
    padding: 1.5rem;
    border-radius: 0.5rem;
    border: 1px solid #30363d;
    height: fit-content;
    max-height: 100%;
    overflow-y: auto;
}

/* Overriding some base modal styles for the new layout */
.modal-content {
    max-width: 75rem; /* Wider modal */
    width: 95%;
    padding: 0; /* Remove padding to allow full-bleed columns */
    /* We need to manage overflow differently */
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-close-btn {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    z-index: 1010;
    width: 2rem;
    height: 2rem;
    background-color: rgba(13, 17, 23, 0.7);
    border-radius: 50%;
    color: #c9d1d9;
    transition: all 0.2s ease;
}
.modal-close-btn:hover {
    background-color: #2f81f7;
    color: white;
    transform: scale(1.1);
}
.modal-close-btn svg {
    width: 1.25rem;
    height: 1.25rem;
}


#modal-content-body {
    padding: 1.5rem 2rem;
}

/* --- New Modal Header & Tags --- */
#modal-content-body .modal-header {
    text-align: left;
    padding: 0 0 1rem 0;
    margin: 0;
    border: none;
    background: none;
}
#modal-content-body .modal-header::after {
    display: none;
}
#modal-content-body .modal-map-name {
    font-size: 3.5rem; /* Larger */
    text-shadow: 0 0 0.625rem rgba(255, 255, 255, 0.1);
    font-weight: 800; /* Bolder */
}
.modal-map-tags {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.75rem; /* More space */
}
.tag {
    display: inline-flex; /* Use flex for alignment */
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.9rem;
    border-radius: 2rem;
    font-size: 0.85rem;
    font-weight: 700;
    border: 1px solid;
    text-transform: uppercase;
    letter-spacing: 0.0313rem;
}
.tag-location {
    background-color: rgba(139, 92, 246, 0.15);
    border-color: rgba(139, 92, 246, 0.6);
    color: #c4b5fd;
}
.tag-gamemode {
    background-color: rgba(34, 197, 94, 0.15);
    border-color: rgba(34, 197, 94, 0.6);
    color: #86efac;
}

/* --- New Modal Tabs Layout --- */
.modal-tabs-container {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    margin-top: 1rem;
}
.modal-tabs {
    border-bottom: 1px solid #30363d;
    flex-shrink: 0;
}
.tab-panels {
    flex-grow: 1;
    overflow-y: auto;
    padding-top: 1.5rem;
}

/* --- Info Panel Details --- */

.info-card {
    background-color: #0d1117;
    border: 1px solid #30363d;
    border-radius: 0.5rem;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.info-card:last-child {
    margin-bottom: 0;
}

.info-card h4 {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.5rem;
    color: #2f81f7;
    margin: 0 0 1rem 0;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #30363d;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.map-description {
    font-size: 0.95rem;
    color: #a1aab4;
    line-height: 1.6;
}
.map-callout-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.map-callout-list li {
    background-color: #0d1117;
    padding: 0.6rem 1rem;
    border-radius: 0.375rem;
    border: 1px solid #30363d;
    color: #c9d1d9;
    cursor: pointer;
    transition: all 0.2s ease;
}
.map-callout-list li:hover {
    background-color: #1c283a;
    border-color: #2f81f7;
    color: white;
    transform: translateX(0.25rem);
    box-shadow: 0 0.25rem 0.9375rem rgba(0,0,0,0.2);
}
.quick-facts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
.fact-item {
    background-color: rgba(33, 38, 45, 0.6);
    padding: 0.75rem;
    border-radius: 0.375rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.fact-item strong {
    font-size: 0.8rem;
    color: #8b949e;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.0313rem;
}
.fact-item span {
    font-size: 1rem;
    color: #c9d1d9;
    font-weight: 500;
}

/* Callout point highlight */
.callout-point.highlight {
    box-shadow: 0 0 1.25rem 0.3125rem rgba(255, 255, 0, 0.9);
    background-color: yellow;
    border-color: white;
    transform: translate(-50%, -50%) scale(1.3);
    animation: none;
}
