/* Neverworld Destination Guide - Horizontal Layout */
/* Optimized for Firestorm Viewer display */

:root {
    --main-bg-color: #2b2b2b;
    --dark-color: #090909;
    --bright-bg-color: #565656;
    --font-color: #f6f6f6;
    --error-bg-color: #ff0000;
    --hover-color: 104,130,120;
}

/* Reset and base styles */
* {
    box-sizing: border-box;
}

#DestinationGuide,
#DestinationGuide * {
    color: var(--font-color);
    font-family: "DejaVu Sans", Arial, sans-serif;
    background-color: var(--main-bg-color);
    padding: 0;
    margin: 0;
}

#DestinationGuide a:focus {
    outline: 0;
}

/* Main container - NO vertical scroll, fixed height */
#DestinationGuide {
    margin: 0.1em 0.25em 0 0.25em !important;
    height: 250px !important;
    min-height: 250px !important;
    max-height: 250px !important;
    overflow: hidden !important;
    position: relative !important;
    display: block !important;
}

/* Breadcrumb Navigation */
#BreadcrumbNav {
    padding: 0.5em 0;
    font-size: 0.9em;
    border-bottom: 1px solid var(--bright-bg-color);
    margin-bottom: 0.5em;
    white-space: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
}

#BreadcrumbNav a {
    color: var(--font-color);
    text-decoration: none;
    margin-right: 0.5em;
    padding: 0.2em 0.5em;
    border-radius: 4px;
    transition: background-color 0.2s;
}

#BreadcrumbNav a:hover {
    background-color: var(--bright-bg-color);
}

#BreadcrumbNav .separator {
    margin: 0 0.3em;
    color: var(--bright-bg-color);
}

/* About icon */
#AboutIcon {
    position: absolute;
    top: 0;
    right: 10px;
    z-index: 100;
}

#AboutIcon a {
    font-size: 0.95em;
    padding: 0.2em 0.5em;
    font-weight: bold;
    color: var(--bright-bg-color);
    text-decoration: none;
    border: 1px solid var(--bright-bg-color);
    border-radius: 4px;
}

#AboutIcon a:hover {
    background-color: var(--bright-bg-color);
    color: var(--main-bg-color);
}

/* Description panel */
#Description {
    position: absolute;
    top: 40px;
    right: 10px;
    z-index: 1000;
    white-space: normal;
    display: none;
    max-width: 25em;
    padding: 1em;
    background-color: var(--bright-bg-color);
    border: 2px solid var(--font-color);
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

/* Main content container - HORIZONTAL scroll only */
#MainContent {
    overflow-x: auto !important;
    overflow-y: hidden !important;
    white-space: nowrap !important;
    padding: 0.4em 0 !important;
    height: calc(250px - 60px) !important;
    position: relative !important;
}

/* Category view */
#CategoryView {
    display: inline-block;
    width: 100%;
    height: 100%;
    white-space: nowrap;
}

/* Category tiles (main menu) */
.category-tile {
    position: relative;
    margin: 0.4em 0.5em;
    display: inline-block;
    text-align: center;
    background-color: var(--bright-bg-color);
    width: 160px;
    overflow: hidden;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95em;
    vertical-align: top;
    transition: all 0.2s ease;
}

.category-tile:hover {
    box-shadow: 0 0 2px 5px rgba(var(--hover-color), 1);
    transform: translateY(-2px);
}

.category-tile img {
    width: 160px;
    height: 120px;
    object-fit: cover;
    display: block;
}

/* Category name at bottom */
.category-tile .category-name {
    padding: 0.5em 0.2em;
    font-weight: bold;
    font-size: 0.9em;
    white-space: normal;
    word-wrap: break-word;
    line-height: 1.2;
    min-height: 2.4em;
    background-color: var(--bright-bg-color);
}

.category-tile .category-count {
    font-size: 0.8em;
    color: var(--font-color);
    opacity: 0.8;
}

/* Destination tiles (when viewing category contents) */
.destination-tile {
    position: relative;
    margin: 0.4em 0.5em;
    display: inline-block;
    text-align: center;
    background-color: var(--bright-bg-color);
    width: 160px;
    overflow: hidden;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95em;
    vertical-align: top;
    transition: all 0.2s ease;
}

.destination-tile:hover {
    box-shadow: 0 0 2px 5px rgba(var(--hover-color), 1);
    transform: translateY(-2px);
}

.destination-tile img {
    width: 160px;
    height: 120px;
    object-fit: cover;
    display: block;
}

/* No image placeholder */
.no-image-placeholder {
    width: 160px;
    height: 120px;
    background-color: var(--dark-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bright-bg-color);
    font-size: 0.8em;
}

/* Teleport button */
.TPButton {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 0.3em 0.6em;
    letter-spacing: 0.15em;
    border: 1px solid var(--font-color);
    border-radius: 8px;
    background-color: var(--bright-bg-color);
    font-weight: bold;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 10;
    cursor: pointer;
}

.destination-tile:hover .TPButton {
    opacity: 1;
    box-shadow: 0 0 2px 5px rgba(var(--hover-color), 1);
}

/* Destination name at bottom */
.destination-tile .destination-name {
    padding: 0.3em 0.2em;
    font-weight: bold;
    font-size: 0.9em;
    white-space: normal;
    word-wrap: break-word;
    line-height: 1.2;
    min-height: 2.4em;
    background-color: var(--bright-bg-color);
}

/* Detail view */
#DetailView {
    display: none;
    position: absolute;
    top: 60px;  /* Start below breadcrumbs */
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--main-bg-color);
    z-index: 50;
    padding: 0.5em !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    white-space: nowrap !important;
}

#DetailView.active {
    display: block;
}

.detail-content {
    display: inline-flex;
    align-items: flex-start;
    white-space: normal;
    height: calc(200px - 100px); /* Adjust for breadcrumbs and padding */
    min-width: fit-content;
}

.detail-image {
    width: 160px !important;
    height: 120px !important;
    object-fit: cover;
    border-radius: 8px;
    margin-right: 1em;
    flex-shrink: 0;
}

.detail-info {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    height: 100%;
    max-width: 600px;
    min-width: 300px;
}

.detail-title {
    font-size: 1.2em;
    font-weight: bold;
    margin-bottom: 0.5em;
    line-height: 1.2;
}

.detail-description {
    font-size: 0.9em;
    line-height: 1.4;
    margin-bottom: 1em;
    flex-grow: 1;
    overflow-wrap: break-word;
}

.detail-teleport {
    display: inline-block;
    padding: 0.5em 1em;
    background-color: var(--bright-bg-color);
    color: var(--font-color);
    text-decoration: none;
    border-radius: 8px;
    font-weight: bold;
    transition: background-color 0.2s;
    align-self: flex-start;
}

.detail-teleport:hover {
    background-color: rgba(var(--hover-color), 1);
}

.close-detail {
    position: absolute;
    top: 0.5em;
    right: 0.5em;
    background: var(--bright-bg-color);
    border: none;
    color: var(--font-color);
    font-size: 1em;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 100;
}

/* Hidden state */
.hidden {
    display: none !important;
}

/* Scrollbar styling for webkit browsers */
#MainContent::-webkit-scrollbar,
#BreadcrumbNav::-webkit-scrollbar {
    height: 8px;
}

#MainContent::-webkit-scrollbar-track,
#BreadcrumbNav::-webkit-scrollbar-track {
    background: var(--dark-color);
    border-radius: 4px;
}

#MainContent::-webkit-scrollbar-thumb,
#BreadcrumbNav::-webkit-scrollbar-thumb {
    background: var(--bright-bg-color);
    border-radius: 4px;
}

#MainContent::-webkit-scrollbar-thumb:hover,
#BreadcrumbNav::-webkit-scrollbar-thumb:hover {
    background: var(--font-color);
}

/* Empty state */
.neverworld-guide-empty {
    text-align: center;
    padding: 2em;
    color: var(--bright-bg-color);
    font-style: italic;
    width: 100%;
    display: inline-block;
}

/* Mobile/small screen adjustments */
@media (max-width: 600px) {
    .category-tile,
    .destination-tile {
        width: 140px;
    }
    
    .category-tile img,
    .destination-tile img,
    .no-image-placeholder {
        width: 140px;
        height: 105px;
    }
    
    #Description {
        max-width: 20em;
        right: 5px;
    }
    
    #BreadcrumbNav {
        font-size: 0.8em;
    }
    
    .detail-content {
        padding: 0.5em;
    }
    
    .detail-image {
        width: 100%;
        max-width: 300px;
        height: auto;
    }
}

/* Ensure compatibility with various WordPress themes */
#DestinationGuide a,
#DestinationGuide a:visited,
#DestinationGuide a:hover,
#DestinationGuide a:active {
    color: inherit !important;
    text-decoration: none !important;
}

/* Override any theme styles that might interfere */
#DestinationGuide img {
    max-width: none !important;
    height: auto !important;
    border: none !important;
    box-shadow: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

#DestinationGuide .category-tile img,
#DestinationGuide .destination-tile img {
    width: 160px !important;
    height: 120px !important;
    object-fit: cover !important;
}