* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #0d0f12;
    color: #e0e4eb;
    display: flex;  
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    background-image: url('https://wallpapercave.com/wp/wp14722108.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    filter: contrast(0.5) brightness(0.35) saturate(0.7);
}

.hamburger {
    display: none;
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 1000;
    background: #111317;
    border: 1px solid #1f242d;
    border-radius: 8px;
    color: #fff;
    width: 42px;
    height: 42px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    transition: background 0.3s;
}
.hamburger:hover {
    background: #1c2029;
}
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99;
    background: rgba(0,0,0,0.6);
}

.sidebar {
    width: 240px;
    background-color: #111317; 
    border-right: 1px solid #1f242d;
    display: flex;
    flex-direction: column;
    padding: 30px 20px;
    position: fixed;
    height: 100vh;
    z-index: 100;
    transition: transform 0.3s ease;
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .hamburger {
        display: flex;
    }
    .sidebar-overlay.open {
        display: block;
    }
}

.logo-container {
    display: flex;
    justify-content: center;
    margin-bottom: 40px;
}
.knight-logo {
    width: 80px;
    height: 80px;
    background-image: url('https://cdn.wikimg.net/en/hkwiki/images/thumb/9/94/Knight_godmaster.png/1024px-Knight_godmaster.png');
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    filter: drop-shadow(0 0 12px rgba(255, 255, 255, 0.25));
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.nav-item {
    color: #8a94a6;
    text-decoration: none;
    padding: 12px 15px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.nav-item:hover, .nav-item.active {
    background-color: #1c2029;
    color: #ffffff;
}

.sidebar-footer {
    margin-top: auto;
    font-size: 0.8rem;
    color: #4f5866;
    text-align: center;
}

.main-content {
    margin-left: 240px; 
    flex: 1;
    padding: 50px;
    max-width: 1200px;
}

@media (max-width: 768px) {
    .main-content {
        margin-left: 0;
        padding: 70px 20px 30px;
    }
    .content-header h1 {
        font-size: 1.5rem;
    }
    .subtitle {
        font-size: 0.9rem;
        margin-bottom: 25px;
    }
}

.content-header h1 {
    font-size: 2.2rem;
    color: #ffffff;
    letter-spacing: 1px;
    margin-bottom: 5px;
}

.subtitle {
    color: #6f7c91;
    font-size: 1rem;
    margin-bottom: 40px;
}

.search-section {
    margin-bottom: 40px;
}

.search-bar-container {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

#vendor {
    flex: 1;
    max-width: 450px;
    background-color: #15181f;
    border: 1px solid #232936;
    border-radius: 8px;
    padding: 14px 20px;
    color: #ffffff;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s;
}

#vendor:focus {
    border-color: #3b4659;
}

#search {
    background-color: #28303f;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 0 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s;
}

#search:hover {
    background-color: #364257;
} 

.category-filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-btn {
    background-color: #15181f;
    color: #7a879e;
    border: 1px solid #232936;
    padding: 8px 18px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.filter-btn:hover, .filter-btn.active {
    background-color: #232936;
    color: #ffffff;
    border-color: #3b4659;
}

@media (max-width: 768px) {
    .search-bar-container {
        flex-direction: column;
    }
    #vendor {
        max-width: 100%;
    }
    #search {
        padding: 12px;
    }
}
 
.results-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.vendor-card {
    background-color: #111317;
    border: 1px solid #1f242d;
    border-radius: 12px;
    padding: 25px;
    display: flex;
    gap: 30px;
}
.vendor-info {
    flex: 1;
    max-width: 40%;
    border-right: 1px solid #1f242d;
    padding-right: 20px;
}

@media (max-width: 768px) {
    .vendor-card {
        flex-direction: column;
        gap: 20px;
    }
    .vendor-info {
        max-width: 100%;
        border-right: none;
        border-bottom: 1px solid #1f242d;
        padding-right: 0;
        padding-bottom: 20px;
    }
    .vendor-info h2 {
        font-size: 1.4rem;
    }
    .all-items-grid {
        grid-template-columns: 1fr;
    }
    .vendor-heading {
        font-size: 1.2rem;
    }
}

.vendor-avatar {
    width: 100%;
    aspect-ratio: 3 / 4;
    max-height: 260px;
    background-color: #1a1d24;
    border-radius: 8px;
    margin-bottom: 15px;
    background-image: url('https://placehold.co/300x400/1a1d24/ffffff?text=Merchant');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.vendor-info h2 {
    color: #ffffff;
    font-size: 1.8rem;
    margin-bottom: 5px;
}

.location-badge {
    display: inline-block;
    color: #8a94a6;
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.vendor-desc {
    color: #a0aec0;
    font-size: 0.95rem;
    line-height: 1.5;
}


.items-list {
    flex: 1.5;
    display: flex;
    flex-direction: column;
}

.items-list h3 {
    color: #8a94a6;
    font-size: 1.1rem;
    margin-bottom: 15px;
    text-transform: uppercase;
}

#wares-ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}


.ware-item {
    background-color: #15181f;
    border: 1px solid #232936;
    border-radius: 8px;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ware-details {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ware-icon {
    width: 36px;
    height: 36px;
    object-fit: contain;
    border-radius: 4px;
}

.ware-name {
    color: #ffffff;
    font-weight: 600;
    font-size: 1.05rem;
}

.ware-category {
    color: #4f5866;
    font-size: 0.8rem;
    margin-top: 3px;
}

.ware-price {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #ffffff;
    font-weight: bold;
    font-size: 1.1rem;
}

.geo-currency {
    color: #8a94a6;
    font-size: 0.85rem;
    font-weight: normal;
}

.vendor-section {
    margin-bottom: 30px;
}

.vendor-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #1f242d;
}

.vendor-portrait {
    width: 44px;
    height: 60px;
    object-fit: contain;
    border-radius: 6px;
    background-color: #15181f;
}

.vendor-heading {
    color: #ffffff;
    font-size: 1.5rem;
}

.all-items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 8px;
}

.all-item-card {
    background-color: #15181f;
    border: 1px solid #232936;
    border-radius: 8px;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: border-color 0.2s;
}

.all-item-card:hover {
    border-color: #3b4659;
}

.all-item-name {
    color: #ffffff;
    font-weight: 500;
}

.all-item-price {
    color: #e0e4eb;
    font-weight: 600;
}

.placeholder-view {
    text-align: center;
    padding: 80px 20px;
}

.placeholder-view h2 {
    color: #ffffff;
    font-size: 1.8rem;
    margin-bottom: 12px;
}

.placeholder-view p {
    color: #6f7c91;
    font-size: 1.1rem;
}

.map-container {
    position: relative;
    width: 100%;
    max-height: 80vh;
    overflow: hidden;
    border-radius: 10px;
    border: 1px solid #1f242d;
    background: #0d0f12;
    cursor: grab;
    user-select: none;
    touch-action: none;
}

.map-container.grabbing {
    cursor: grabbing;
}

.map-viewport {
    position: relative;
    width: 100%;
    aspect-ratio: 4498 / 2901;
    transform-origin: 0 0;
    overflow: hidden;
}

.map-viewport img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: fill;
    pointer-events: none;
    image-rendering: auto;
}

.map-marker {
    position: absolute;
    width: 22px;
    height: 28px;
    transform: translate(-50%, -100%);
    cursor: pointer;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.map-marker-icon {
    width: 22px;
    height: 28px;
    object-fit: contain;
    border-radius: 4px;
    border: 2px solid rgba(255, 215, 0, 0.8);
    background: rgba(13, 15, 18, 0.85);
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.4);
    transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
    pointer-events: none;
}

.map-marker:hover .map-marker-icon,
.map-marker.active .map-marker-icon {
    transform: scale(1.3);
    border-color: #ffd700;
    box-shadow: 0 0 16px rgba(255, 215, 0, 0.8);
    z-index: 20;
}

.map-marker.active .map-marker-icon {
    border-color: #4fc3f7;
    box-shadow: 0 0 16px rgba(79, 195, 247, 0.8);
}

.map-marker-tooltip {
    position: absolute;
    bottom: calc(100% + 4px);
    left: 50%;
    transform: translateX(-50%);
    background: #111317;
    border: 1px solid #2a3344;
    border-radius: 6px;
    padding: 4px 10px;
    white-space: nowrap;
    font-size: 0.8rem;
    color: #fff;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s;
    z-index: 30;
}

.map-marker:hover .map-marker-tooltip {
    opacity: 1;
}

.map-zoom-controls {
    position: absolute;
    bottom: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    z-index: 50;
}

.map-zoom-btn {
    width: 40px;
    height: 40px;
    background: #1c2029;
    border: 1px solid #2a3344;
    border-radius: 8px;
    color: #fff;
    font-size: 1.3rem;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.map-zoom-btn:hover {
    background: #28303f;
}

.map-zoom-level {
    text-align: center;
    color: #8a94a6;
    font-size: 0.8rem;
    padding: 4px 0;
}

.map-coords {
    position: absolute;
    bottom: 20px;
    left: 20px;
    color: #4f5866;
    font-size: 0.8rem;
    z-index: 50;
}

.map-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #6f7c91;
    font-size: 1rem;
    z-index: 5;
}

.map-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.map-header h2 {
    color: #ffffff;
    font-size: 1.5rem;
}

.map-header p {
    color: #6f7c91;
    font-size: 0.9rem;
}

.map-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
    padding: 10px 14px;
    background: #111317;
    border: 1px solid #1f242d;
    border-radius: 8px;
}

@media (max-width: 768px) {
    .map-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
    .map-header h2 {
        font-size: 1.2rem;
    }
    .map-container {
        max-height: 60vh;
    }
    .map-zoom-controls {
        bottom: 10px;
        right: 10px;
    }
    .map-zoom-btn {
        width: 34px;
        height: 34px;
        font-size: 1.1rem;
    }
    .map-coords {
        display: none;
    }
}

.map-legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.78rem;
    color: #8a94a6;
    cursor: default;
}

.map-legend-img {
    width: 18px;
    height: 24px;
    object-fit: contain;
    border-radius: 2px;
    border: 1px solid rgba(255, 215, 0, 0.5);
    background: rgba(13, 15, 18, 0.7);
    flex-shrink: 0;
}