/* Neverworld Destination Guide - Frontend Styles */
/* 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;
    height: 100vh;
    max-height: 600px; /* Adjust as needed for viewer */
    overflow: hidden;
}

/* Horizontal rule styling */
#DestinationGuide hr {
    border: 1px solid var(--dark-color);
    margin: 0.1em 0 0.1em 0;
}

/* About icon */
#AboutIcon {
    float: right;
    margin-bottom: 0.5em;
}

#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: 30px;
    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);
}

/* Navigation locator */
#Locator {
    padding: 0.5em 0;
    font-weight: bold;
    font-size: 0.95em;
    white-space: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
}

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

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

/* Destinations container - HORIZONTAL scroll only */
#Destinations {
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    padding: 0.4em 0;
    height: auto;
    max-height: none;
}

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

.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;
}

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

/* Teleport button */
.TPButton {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 0.2em 0.4em;
    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;
}

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

/* Tile name at bottom */
.tile > div:last-child {
    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);
}

/* Error styling */
.error {
    background-color: var(--error-bg-color);
    padding: 0.2em;
    color: var(--font-color);
    border-radius: 4px;
    margin: 0.2em 0;
}

/* External link icon */
.external {
    width: 0.95em;
    margin: 0;
    padding: 0;
}

/* Switch element (hidden by default) */
.switch {
    display: none;
}

.tile:hover img + .switch {
    display: inline-block;
}

/* Category sections */
#DestinationGuide > div:not(#AboutIcon):not(#Description) {
    margin-bottom: 1em;
}

#DestinationGuide > div strong {
    font-size: 1.1em;
    color: var(--font-color);
    display: block;
    margin-bottom: 0.5em;
    padding-bottom: 0.2em;
    border-bottom: 1px solid var(--bright-bg-color);
}

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

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

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

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

/* Ensure no vertical overflow anywhere */
#DestinationGuide, 
#DestinationGuide * {
    box-sizing: border-box;
}

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

/* Mobile/small screen adjustments */
@media (max-width: 600px) {
    .tile {
        width: 140px;
    }
    
    .tile img,
    .no-image-placeholder {
        width: 140px;
        height: 105px;
    }
    
    #Description {
        max-width: 20em;
        right: 5px;
    }
    
    #Locator {
        font-size: 0.85em;
    }
}

/* 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 .tile img {
    width: 160px !important;
    height: 120px !important;
    object-fit: cover !important;
}