/* Sitemap specific styles */

/* Hide mobile header on desktop */
.mobile-header,
.mobile-nav-toggle {
    display: none;
}

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

button {
    all: unset;
    cursor: pointer;
    box-sizing: border-box;
}

body {
    background: black;
    margin: 0;
    overflow-x: hidden;
    font-family: "Orbitron", "Courier New", monospace;
    min-height: 100vh;
}

a[href^='http']::after {
    content: url('IMAGES/external.png');
    margin-left: 0.25em;
}

a:link {
    color: red;
    text-decoration: none;
}

a:visited {
    color: darkred;
    text-decoration: none;
}

/* SHAKE EFFECT FOR ALL NON-NAV LINKS */
a:not(nav a):not(s a):not(a:has(s)):not(.current-page) {
    position: relative;
}

a:not(nav a):not(s a):not(a:has(s)):not(.current-page):hover {
    animation: linkShake 0.3s ease-in-out;
}

@keyframes linkShake {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(-1px, 0); }
    50% { transform: translate(1px, 0); }
    75% { transform: translate(-1px, 0); }
}

/* strikethrough links not clickable or animated */
a s,
s a,
a:has(s) {
    text-decoration: line-through !important;
    color: #999999 !important;
    opacity: 0.8;
    pointer-events: none;
    cursor: default;
    animation: none !important;
}

a s:hover,
s a:hover,
a:has(s):hover {
    animation: none !important;
    text-decoration: line-through !important;
}

/* MAIN CONTAINER */
.maincontainer {
    position: relative;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    padding: 65px 20px 40px 20px;
    min-height: 100vh;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* GO BACK BUTTON */
nav {
    position: fixed;
    top: 30px;
    left: 30px;
    z-index: 100;
}

nav a {
    color: red !important;
    text-decoration: none;
    border: 2px solid red;
    background: black;
    padding: 10px 20px;
    font-weight: bold;
    font-family: "Audiowide", "Courier New", monospace;
    transition: all 0.2s ease-in-out;
    position: relative;
    display: inline-block;
}

nav a:visited {
    color: red !important;
}

@keyframes pulseGlow {
    0%, 100% {
        filter: drop-shadow(0 0 3px red) drop-shadow(0 0 6px red);
    }
    50% {
        filter: drop-shadow(0 0 6px red) drop-shadow(0 0 12px red);
    }
}

nav a:hover {
    background: #111111; 
    color: red !important; 
    transform: translateY(-3px);
    animation: pulseGlow 2s ease-in-out infinite alternate;
}

/* ACTIVE BUTTON WITH GLITCH */
nav a.active {
    background: #111111;
    color: red !important;
    transform: translateY(-2px);
    animation: pulseGlow 3s ease-in-out infinite alternate;
}

nav a.active::before,
nav a.active::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 10px 20px;
    pointer-events: none;
    opacity: 0;
    overflow: hidden;
    background: black;
}

nav a.active.glitch {
    animation: navShake 0.5s ease-in-out, pulseGlow 3s ease-in-out infinite alternate;
}

nav a.active.glitch::before {
    animation: navTearLeft 0.5s ease-in-out;
    color: #ff00ff;
    z-index: 1;
}

nav a.active.glitch::after {
    animation: navTearRight 0.5s ease-in-out;
    color: #00ffff;
    z-index: 2;
}

@keyframes navShake {
    0%, 100% { transform: translateY(-2px) translate(0, 0); }
    10% { transform: translateY(-2px) translate(-2px, 0); }
    20% { transform: translateY(-2px) translate(2px, 0); }
    30% { transform: translateY(-2px) translate(-1px, 0); }
    40% { transform: translateY(-2px) translate(3px, 0); }
    50% { transform: translateY(-2px) translate(-2px, 0); }
    60% { transform: translateY(-2px) translate(1px, 0); }
    70% { transform: translateY(-2px) translate(-3px, 0); }
    80% { transform: translateY(-2px) translate(2px, 0); }
    90% { transform: translateY(-2px) translate(-1px, 0); }
}

@keyframes navTearLeft {
    0%, 100% { opacity: 0; clip-path: inset(0 0 0 0); transform: translateX(0); }
    5% { opacity: 0.8; clip-path: inset(23% 0 67% 0); transform: translateX(-8px); }
    15% { opacity: 0.7; clip-path: inset(61% 0 12% 0); transform: translateX(-5px); }
    25% { opacity: 0.9; clip-path: inset(8% 0 88% 0); transform: translateX(-10px); }
    35% { opacity: 0.6; clip-path: inset(47% 0 31% 0); transform: translateX(-6px); }
    45% { opacity: 0.8; clip-path: inset(72% 0 15% 0); transform: translateX(-9px); }
    55% { opacity: 0.7; clip-path: inset(19% 0 73% 0); transform: translateX(-7px); }
    65% { opacity: 0.9; clip-path: inset(54% 0 28% 0); transform: translateX(-11px); }
    75% { opacity: 0.6; clip-path: inset(33% 0 59% 0); transform: translateX(-5px); }
    85% { opacity: 0.8; clip-path: inset(68% 0 7% 0); transform: translateX(-8px); }
    95% { opacity: 0.5; clip-path: inset(11% 0 81% 0); transform: translateX(-4px); }
}

@keyframes navTearRight {
    0%, 100% { opacity: 0; clip-path: inset(0 0 0 0); transform: translateX(0); }
    8% { opacity: 0.7; clip-path: inset(41% 0 48% 0); transform: translateX(7px); }
    18% { opacity: 0.9; clip-path: inset(77% 0 9% 0); transform: translateX(9px); }
    28% { opacity: 0.6; clip-path: inset(14% 0 79% 0); transform: translateX(5px); }
    38% { opacity: 0.8; clip-path: inset(52% 0 36% 0); transform: translateX(11px); }
    48% { opacity: 0.7; clip-path: inset(29% 0 64% 0); transform: translateX(6px); }
    58% { opacity: 0.9; clip-path: inset(66% 0 18% 0); transform: translateX(10px); }
    68% { opacity: 0.6; clip-path: inset(7% 0 86% 0); transform: translateX(8px); }
    78% { opacity: 0.8; clip-path: inset(44% 0 42% 0); transform: translateX(7px); }
    88% { opacity: 0.7; clip-path: inset(81% 0 3% 0); transform: translateX(9px); }
    98% { opacity: 0.5; clip-path: inset(26% 0 68% 0); transform: translateX(4px); }
}

/* ============================================ */
/* ACCESSIBILITY PANEL POSITIONING */
/* ============================================ */
.accessibility-panel {
    top: 150px;
    left: 30px;
}
/* ============================================ */
/* THEMES PANEL POSITIONING */
/* ============================================ */
body.page-sitemap .themes-panel {
    top: 420px;
    left: 30px;
    transition: top 0.3s ease;
}

/* When accessibility panel is collapsed */
body.accessibility-collapsed.page-sitemap .themes-panel {
    top: 220px;
}

/* Smaller screens themes panel goes to bottom */
@media (max-width: 1250px) {
    body.page-sitemap .themes-panel {
        top: auto;
        bottom: 290px;
        left: 30px;
        transition: bottom 0.3s ease;
    }
    
    body.page-sitemap .accessibility-panel {
        top: auto;
        bottom: 20px;
        left: 30px;
        transition: bottom 0.3s ease;
    }
    
    /* When accessibility panel is collapsed on smaller screens */
    body.accessibility-collapsed.page-sitemap .themes-panel {
        bottom: 90px;
        top: auto;
    }
}

/* CONTENT AREA */
main {
    position: relative;
    min-height: 100vh;
    width: 100%;
    font-family: "Orbitron", "Courier New", monospace;
    color: red;
}

main h1 {
    margin-bottom: 5px;
    font-size: 2em;
    font-family: "Audiowide", "Courier New", monospace;
    color: red;
    line-height: 1.2;
}

main h3 {
    font-family: "Audiowide", "Courier New", monospace;
    margin-top: 20px;
    margin-bottom: 8px;
    font-size: 1.2em;
    color: red;
    line-height: 1.2;
}

main p {
    font-family: "Space Mono", monospace;
    font-size: 0.7em;
    margin: 0 0 35px 0;
    padding: 0;
    color: red;
    line-height: 1.3;
}

.sitemap-section {
    margin-bottom: 0;
}

.parent-link {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 3px;
}

.parent-link a {
    font-weight: bold;
    font-size: 0.75em;
    text-decoration: none;
    text-transform: uppercase;
    font-family: "Audiowide", "Courier New", monospace;
    line-height: 1.2;
    display: inline;
}

.parent-link a:link {
    color: red;
}

.parent-link a:visited {
    color: darkred;
}

.parent-link a:hover {
    text-decoration: none;
}

.toggle-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1em;
    padding: 3px;
    color: red;
    font-weight: bold;
    line-height: 1;
    font-family: "Audiowide", "Courier New", monospace;
}

.toggle-btn:hover {
    opacity: 0.7;
}

.child-links {
    display: none;
    padding-left: 25px;
    margin-top: 3px;
    font-weight: bold;
}

.child-links.show {
    display: block;
}

.child-links a {
    text-decoration: none;
    padding: 0;
    display: block;
    width: fit-content;
    font-family: "Orbitron", "Courier New", monospace;
    font-size: 0.7em;
    line-height: 1.3;
    margin-bottom: 2px;
}

.child-links a:link {
    color: red;
}

.child-links a:visited {
    color: darkred;
}

.child-links a:hover {
    text-decoration: none;
}

.child-links a.current-page {
    pointer-events: none;
    cursor: default;
}

/* Nested dropdown styles */
.nested-section {
    margin-top: 3px;
}

.nested-section .parent-link {
    padding-left: 0;
}

.nested-parent {
    font-weight: normal;
    text-decoration: none;
    font-family: "Orbitron", "Courier New", monospace;
}

.nested-parent:link {
    color: red;
}

.nested-parent:visited {
    color: darkred;
}

.nested-parent:hover {
    text-decoration: none;
}

.child-links.nested-child {
    padding-left: 20px;
    font-weight: bold;
}

/* Coelacanth decoration - desktop only */
.coelacanth-decoration {
    position: absolute;
    right: 102px;
    top: 153px;
    z-index: 100;
    pointer-events: none;
}

.coelacanth-decoration img {
    width: 270px;
    height: auto;
    display: block;
}

/* FOOTER */
footer {
    position: relative;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 50;
    color: red;
    background: transparent;
    font-size: 8px;
    font-weight: bold;
    text-align: center;
    margin-top: 40px;
}

/* ============================================ */
/* ============================================ */
/* MOBILE RESPONSIVE STYLES */
/* ============================================ */
@media (max-width: 768px) {
    /* MOBILE BACKGROUND */
    body {
        background: black;
        background-attachment: fixed !important;
        padding: 10px !important;
    }
    
    /* Hide desktop grid background animation */
    .wrap {
        display: none !important;
    }
    
    /* Hide accessibility panel on mobile */
    .accessibility-panel {
        display: none !important;
    }
    
    /* MOBILE CONTAINER */
    .maincontainer {
        width: 100% !important;
        max-width: 100% !important;
        padding: 5px !important;
        gap: 15px !important;
        border: none !important;
        box-shadow: none !important;
        font-size: 110%;
    }
    
    /* ==================== */
    /* MOBILE HEADER */
    /* ==================== */
    header {
        position: relative;
        display: flex !important;
        align-items: center;
        justify-content: space-between;
        padding: 10px;
        margin-bottom: 10px;
    }
    
    header h1 {
        text-align: left !important;
        font-size: 18px !important;
        margin: 0 !important;
        flex: 1;
        line-height: 1.2;
        letter-spacing: 1px;
        font-family: "Audiowide", "Courier New", monospace;
        color: red !important;
    }
    
    /* HAMBURGER MENU BUTTON */
    .mobile-nav-toggle {
        display: flex !important;
        flex-direction: column;
        gap: 4px;
        background: black;
        border: 2px solid red;
        padding: 8px;
        cursor: pointer;
        width: 40px;
        height: 40px;
        justify-content: center;
        align-items: center;
        flex-shrink: 0;
    }
    
    .mobile-nav-toggle span {
        display: block;
        width: 24px;
        height: 2px;
        background: red;
        transition: 0.3s;
    }
    
    /* Animate hamburger to X when open */
    .mobile-nav-toggle.open span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    
    .mobile-nav-toggle.open span:nth-child(2) {
        opacity: 0;
    }
    
    .mobile-nav-toggle.open span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -7px);
    }
    
    /* Mobile nav dropdown */
    .mobile-nav,
    nav {
        display: flex !important;
        position: fixed;
        top: 70px;
        left: 10px;
        right: 10px;
        background: black;
        border: 2px solid red;
        flex-direction: column;
        z-index: 1000;
        padding: 0;
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        visibility: hidden;
        transform: translateY(-10px);
        transition: max-height 0.3s ease, opacity 0.3s ease, transform 0.3s ease, visibility 0s 0.3s;
    }
    
    /* Show nav when open */
    .mobile-nav.mobile-open,
    nav.mobile-open {
        max-height: 500px;
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
        transition: max-height 0.3s ease, opacity 0.3s ease, transform 0.3s ease, visibility 0s;
    }
    
    /* Mobile nav links */
    .mobile-nav a,
    nav a {
        display: block;
        padding: 15px 20px;
        margin: 0;
        border: none;
        border-bottom: 1px solid red;
        background: black !important;
        text-align: left;
        font-size: 0.9em;
        color: red !important;
        text-decoration: none;
        font-family: "Audiowide", "Courier New", monospace;
        font-weight: bold;
        transform: none !important;
    }
    
    .mobile-nav a:last-child,
    nav a:last-child {
        border-bottom: none;
    }
    
    .mobile-nav a:hover,
    .mobile-nav a.active,
    nav a:hover,
    nav a.active {
        background: rgba(255, 0, 0, 0.1) !important;
        transform: none !important;
        animation: none !important;
    }
    
    /* Remove glitch effects on mobile */
    .mobile-nav a.active::before,
    .mobile-nav a.active::after,
    nav a.active::before,
    nav a.active::after {
        display: none !important;
    }
    
    /* ==================== */
    /* MOBILE MAIN CONTENT */
    /* ==================== */
    main {
        position: relative;
        min-height: auto;
        padding-bottom: 40px;
    }
    
    /* ==================== */
    /* MOBILE FOOTER */
    /* ==================== */
    footer {
        position: relative;
        padding: 20px 10px;
        text-align: center;
        font-size: 7px;
        line-height: 1.5;
        background: transparent;
    }
    
    footer p {
        margin: 0;
    }
    
    /* Remove hover animations on mobile */
    a:not(nav a):hover {
        animation: none;
    }
}
    
    /* Remove hover animations on mobile */
    a:not(nav a):hover {
        animation: none;
    }
}

/* ============================================ */
/* MOBILE-ONLY SITEMAP CONTENT STYLES */
/* ============================================ */
@media (max-width: 768px) {
    /* Make parent links full-width clickable bars on mobile */
    .parent-link {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 0 !important;
        margin-bottom: 5px !important;
        padding: 12px 15px !important;
        background: rgba(255, 0, 0, 0.1) !important;
        border: 2px solid red !important;
        cursor: pointer !important;
        transition: all 0.2s !important;
        user-select: none !important;
    }
    
    .parent-link:hover {
        background: rgba(255, 0, 0, 0.2) !important;
    }
    
    .parent-link a {
        flex: 1 !important;
        font-size: 0.85em !important;
        pointer-events: none !important;
    }
    
    /* Toggle arrow instead of +/- on mobile */
    .toggle-btn {
        background: none !important;
        border: none !important;
        color: red !important;
        font-size: 0 !important; /* Hide the text */
        padding: 0 !important;
        margin: 0 !important;
        transition: transform 0.3s !important;
        pointer-events: none !important;
        width: 30px !important;
        height: 30px !important;
        position: relative !important;
    }
    
    .toggle-btn::before {
        content: "▼" !important;
        font-size: 18px !important; /* Show arrow at readable size */
        position: absolute !important;
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
    }
    
    .toggle-btn.open::before {
        content: "▲" !important;
    }
    
    /* Child links styling for mobile */
    .child-links {
        padding-left: 15px !important;
        margin-top: 0 !important;
        margin-bottom: 10px !important;
        border-left: 2px solid rgba(255, 0, 0, 0.3) !important;
    }
    
    .child-links a {
        display: block !important;
        padding: 8px 10px !important;
        margin-bottom: 3px !important;
        font-size: 0.8em !important;
        background: rgba(0, 0, 0, 0.3) !important;
        border: 1px solid rgba(255, 0, 0, 0.2) !important;
        width: auto !important;
    }
    
    .child-links a:hover {
        background: rgba(255, 0, 0, 0.1) !important;
    }
    
    /* Nested sections on mobile */
    .nested-section .parent-link {
        margin-left: 0 !important;
        padding: 10px 12px !important;
        background: rgba(255, 0, 0, 0.05) !important;
    }
    
    .child-links.nested-child {
        padding-left: 10px !important;
    }
    
    /* Sitemap section spacing on mobile */
    .sitemap-section {
        margin-bottom: 15px !important;
    }
    
    /* Main content headings on mobile */
    main h1 {
        font-size: 15px !important;
        margin-bottom: 10px !important;
    }
    
    main h3 {
        font-size: 1.1em !important;
        margin-top: 20px !important;
        margin-bottom: 10px !important;
    }
    
    main p {
        font-size: 0.85em !important;
        margin-bottom: 20px !important;
    }
}

/* Hide mobile sitemap on desktop */
.sitemap-mobile {
    display: none;
}

/* ============================================ */
/* MOBILE SITEMAP STYLES */
/* ============================================ */
@media (max-width: 768px) {
    /* Hide desktop sitemap on mobile */
    .sitemap-desktop {
        display: none !important;
    }
    
    /* Show mobile sitemap */
    .sitemap-mobile {
        display: block !important;
    }
    
    /* Mobile parent links - link and button as separate boxes */
    .parent-link-mobile {
        display: flex;
        align-items: stretch;
        gap: 5px; /* Space between the two boxes */
        margin-bottom: 8px;
    }
    
    .parent-link-mobile a {
        flex: 1;
        padding: 12px 15px;
        font-size: 0.85em;
        font-weight: bold;
        text-transform: uppercase;
        font-family: "Audiowide", "Courier New", monospace;
        color: red;
        text-decoration: none;
        pointer-events: auto; /* Link is clickable */
        display: flex;
        align-items: center;
        background: rgba(255, 0, 0, 0.1);
        border: 2px solid red;
    }
    
    .parent-link-mobile a:active {
        background: rgba(255, 0, 0, 0.2);
    }
    
    /* Mobile toggle button - separate box on the right */
    .toggle-btn-mobile {
        background: rgba(255, 0, 0, 0.15);
        border: 2px solid red;
        color: red;
        font-size: 18px;
        padding: 12px;
        margin: 0;
        line-height: 1;
        pointer-events: auto; /* Button is clickable */
        font-family: "Audiowide", "Courier New", monospace;
        width: 50px;
        min-width: 50px;
        text-align: center;
        cursor: pointer;
        transition: background 0.2s;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .toggle-btn-mobile:active {
        background: rgba(255, 0, 0, 0.3);
    }
    
    /* Change content based on state */
    .toggle-btn-mobile::after {
        content: "▼";
        font-size: 14px;
    }
    
    .toggle-btn-mobile.open::after {
        content: "▲";
        font-size: 14px;
    }
    
    /* Mobile child links */
    .child-links-mobile {
        display: none;
        padding-left: 15px;
        margin-top: 0;
        margin-bottom: 10px;
        border-left: 2px solid rgba(255, 0, 0, 0.3);
    }
    
    .child-links-mobile.show {
        display: block;
    }
    
    .child-links-mobile a {
        display: block;
        padding: 10px 12px;
        margin-bottom: 3px;
        font-size: 0.8em;
        background: rgba(0, 0, 0, 0.3);
        border: 1px solid rgba(255, 0, 0, 0.2);
        color: red;
        text-decoration: none;
        font-family: "Orbitron", "Courier New", monospace;
    }
    
    .child-links-mobile a:active {
        background: rgba(255, 0, 0, 0.15);
    }
    
    /* Mobile nested sections */
    .nested-section-mobile .parent-link-mobile {
        margin-left: 0;
        padding: 10px 12px;
        background: rgba(255, 0, 0, 0.05);
        font-size: 0.9em;
    }
    
    .child-links-mobile.nested-child-mobile {
        padding-left: 10px;
    }
    
    /* Mobile sitemap section spacing */
    .sitemap-section-mobile {
        margin-bottom: 12px;
    }
}

/* Mobile sitemap headings - more specific */
    .sitemap-mobile h1,
    .sitemap-mobile main h1 {
        font-size: 1.4em !important;
        margin-bottom: 10px !important;
        margin-top: 15px;
    }

    /* Remove boxes from strikethrough (non-existent) links on mobile */
    .parent-link-mobile a:has(s) {
        background: transparent !important;
        border: 1px dashed rgba(153, 153, 153, 0.3) !important;
    }
    
    .child-links-mobile a:has(s) {
        background: transparent !important;
        border: 1px dashed rgba(153, 153, 153, 0.3) !important;
    }
    
    /* Remove any border/styling from the s tag itself */
    .parent-link-mobile a s,
    .child-links-mobile a s {
        border: none !important;
        background: transparent !important;
    }

/* hide coelacanth on mobile */
@media (max-width: 768px) {
    .coelacanth-decoration {
        display: none !important;
    }
}