/**
 * World Explorer Styles
 * Hierarchical navigation for El'anthar lore
 */

#world-explorer-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    min-height: 600px;
}

/* --- Breadcrumbs --- */
.explorer-breadcrumbs {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-xl);
    font-family: var(--font-heading);
    color: var(--color-ethereal);
    font-size: var(--text-sm);
    flex-wrap: wrap;
}

.breadcrumb-item {
    cursor: pointer;
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.breadcrumb-item:hover {
    color: var(--color-gold);
}

.breadcrumb-item.active {
    color: var(--color-gold);
    cursor: default;
    pointer-events: none;
}

.breadcrumb-separator {
    color: var(--color-ethereal-dark);
}

/* --- Navigation Header --- */
.explorer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-xl);
    border-bottom: 1px solid rgba(184, 160, 96, 0.2);
    padding-bottom: var(--space-md);
}

.back-button {
    background: transparent;
    border: 1px solid var(--color-gold);
    color: var(--color-gold);
    padding: var(--space-xs) var(--space-md);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: var(--font-heading);
    text-transform: uppercase;
    font-size: var(--text-xs);
    letter-spacing: 0.1em;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.back-button:hover {
    background: rgba(184, 160, 96, 0.1);
    box-shadow: 0 0 15px rgba(184, 160, 96, 0.2);
}

.back-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    border-color: var(--color-ethereal-dark);
    color: var(--color-ethereal-dark);
}

/* --- Grid Layout --- */
.explorer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--space-lg);
    width: 100%;
}

/* --- Cards --- */
.explorer-card {
    background: #000000;
    /* Gives it an aged, burned parchment look but dark */
    border: 1px solid rgba(212, 175, 55, 0.5);
    border-radius: 8px;
    /* Slightly rounded edges */
    padding: var(--space-2xl) var(--space-lg);
    cursor: pointer;
    transition: all 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.8), inset 0 0 30px rgba(0, 0, 0, 0.9);
    min-height: 290px;
}

.explorer-card::before {
    content: '';
    position: absolute;
    top: 5px;
    left: 5px;
    right: 5px;
    bottom: 5px;
    border: 1px solid rgba(212, 175, 55, 0.1);
    border-radius: 2px;
    pointer-events: none;
    transition: all 0.5s ease;
}

.explorer-card:hover {
    transform: translateY(-8px);
    border-color: rgba(212, 175, 55, 0.8);
    box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.9), 0 15px 35px rgba(0, 0, 0, 0.8), 0 0 20px rgba(212, 175, 55, 0.2);
}

.explorer-card:hover::before {
    border-color: rgba(212, 175, 55, 0.4);
    top: 8px;
    left: 8px;
    right: 8px;
    bottom: 8px;
}

.explorer-card::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, rgba(212, 175, 55, 0.1) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.6s ease;
    mix-blend-mode: screen;
    pointer-events: none;
}

.explorer-card:hover::after {
    opacity: 1;
}

.explorer-card-icon {
    color: var(--color-gold);
    margin-bottom: var(--space-lg);
    width: 65px;
    height: 65px;
    display: flex;
    align-items: center;
    justify-content: center;
    filter: drop-shadow(0 0 10px rgba(212, 175, 55, 0.7));
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.explorer-card:hover .explorer-card-icon {
    transform: scale(1.1) translateY(-5px);
    filter: drop-shadow(0 0 15px rgba(212, 175, 55, 1));
}

.explorer-card-icon svg {
    width: 100%;
    height: 100%;
    stroke-width: 1.5;
}

.explorer-card h3 {
    font-family: var(--font-heading);
    color: var(--color-parchment);
    font-size: 24px;
    font-weight: 600;
    margin-bottom: var(--space-sm);
    text-shadow: 0 2px 5px rgba(0, 0, 0, 1), 0 0 15px rgba(212, 175, 55, 0.3);
    position: relative;
    z-index: 2;
    transition: all 0.4s ease;
}

.explorer-card:hover h3 {
    color: var(--color-gold);
    text-shadow: 0 0 20px rgba(212, 175, 55, 0.8);
}

.explorer-card p {
    color: #ffffff;
    font-size: var(--text-sm);
    line-height: 1.6;
    position: relative;
    z-index: 2;
    opacity: 0.85;
}

.category-indicator {
    margin-top: auto;
    padding-top: var(--space-xl);
    font-size: 11px;
    font-family: var(--font-heading);
    color: var(--color-gold);
    text-transform: uppercase;
    letter-spacing: 0.2em;
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    z-index: 2;
    transition: all 0.3s ease;
}

.explorer-card:hover .category-indicator {
    color: #ffd700;
    text-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
}

/* --- Leaf Node View --- */

.leaf-image {
    width: 100%;
    margin-bottom: var(--space-xl);
    border-radius: var(--radius-md);
    overflow: hidden;
    position: relative;
}

.leaf-image::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 15%;
    background: linear-gradient(to top, rgba(10, 10, 15, 0.9), transparent);
    pointer-events: none;
}

.leaf-image img {
    width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
    filter: brightness(0.85) saturate(1.1);
    transition: filter 0.4s ease;
}

.explorer-leaf-view:hover .leaf-image img {
    filter: brightness(0.95) saturate(1.2);
}

.leaf-content hr {
    border: none;
    border-top: 1px solid rgba(184, 160, 96, 0.3);
    margin: var(--space-xl) 0;
}

.leaf-content h3 {
    font-family: var(--font-heading);
    font-size: var(--text-xl);
    color: var(--color-gold);
    margin-top: var(--space-xl);
    margin-bottom: var(--space-md);
    text-shadow: 0 0 15px rgba(184, 160, 96, 0.2);
}

.explorer-leaf-view {
    background: rgba(10, 10, 15, 0.8);
    border: 1px solid var(--color-gold);
    border-radius: var(--radius-lg);
    padding: var(--space-2xl);
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.8);
}

.leaf-header {
    text-align: center;
    margin-bottom: var(--space-xl);
    border-bottom: 2px solid rgba(184, 160, 96, 0.3);
    padding-bottom: var(--space-lg);
}

.leaf-title {
    font-family: var(--font-heading);
    font-size: var(--text-3xl);
    color: var(--color-gold);
    margin-bottom: var(--space-sm);
    text-shadow: 0 0 20px rgba(184, 160, 96, 0.3);
}

.leaf-content {
    font-family: var(--font-body);
    font-size: var(--text-md);
    color: var(--color-gold);
    line-height: 1.8;
}

.leaf-content p {
    margin-bottom: var(--space-md);
}

/* --- Animations --- */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-in {
    animation: fadeIn 0.5s ease forwards;
}

.delay-1 {
    animation-delay: 0.1s;
}

.delay-2 {
    animation-delay: 0.2s;
}

.delay-3 {
    animation-delay: 0.3s;
}

/* --- Map Modal & Interactive Map Features --- */

.map-interactive {
    cursor: pointer;
    transition: all 0.4s ease;
}

.map-interactive:hover {
    box-shadow: 0 0 30px rgba(212, 175, 55, 0.4);
    transform: translateY(-2px);
}

.map-hint {
    position: absolute;
    bottom: 15px;
    right: 15px;
    background: rgba(10, 10, 15, 0.8);
    color: var(--color-gold);
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 12px;
    font-family: var(--font-heading);
    letter-spacing: 0.1em;
    border: 1px solid rgba(212, 175, 55, 0.3);
    pointer-events: none;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 10;
}

.map-interactive:hover .map-hint {
    opacity: 1;
    transform: translateY(0);
}

.category-map-header {
    margin-bottom: var(--space-2xl);
    width: 100%;
}

.category-map-header .leaf-image {
    max-height: 500px;
    border: 1px solid var(--color-gold);
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
}

/* Modal Overlay */
.map-modal-overlay {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    justify-content: center;
    align-items: center;
    flex-direction: column;
    animation: fadeIn 0.3s ease;
}

.map-modal-content {
    max-width: 95%;
    max-height: 85vh;
    object-fit: contain;
    border: 2px solid var(--color-gold);
    border-radius: var(--radius-md);
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.8), 0 0 20px rgba(212, 175, 55, 0.3);
    animation: scaleUp 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

@keyframes scaleUp {
    from {
        transform: scale(0.9);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.map-modal-close {
    position: absolute;
    top: 20px;
    right: 40px;
    color: var(--color-gold);
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 1001;
}

.map-modal-close:hover,
.map-modal-close:focus {
    color: #fff;
    text-shadow: 0 0 10px rgba(212, 175, 55, 0.8);
}

.map-modal-caption {
    margin-top: 20px;
    color: var(--color-gold);
    font-family: var(--font-heading);
    font-size: 24px;
    letter-spacing: 0.1em;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
    text-align: center;
}