
/* Navigation from Game Library */
header {
    background-color: #1a1f2e;
    color: white;
    padding: 0.8rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid #30363d;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    color: #e6edf3;
}

.logo i {
    margin-right: 8px;
    color: #58a6ff;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 1rem;
    margin: 0;
    padding: 0;
}

nav li {
    margin: 0;
}

nav a {
    color: #8b949e;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.95rem;
}

nav a:hover, nav a.active {
    color: #e6edf3;
    background-color: #30363d;
}

/* Remove old navigation styles */
.header, .topnav, .dropdown, .dropdown-content {
    display: none;
}

/* Background from Software Library */
body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

body.light {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    nav ul {
        flex-wrap: wrap;
        justify-content: center;
    }
}
:root {
    --bg-primary: #0f1419;
    --bg-secondary: #1a1f2e;
    --text-primary: #e6edf3;
    --text-secondary: #8b949e;
    --accent: #58a6ff;
    --hover: #30363d;
    --border: #21262d;
    --transition: all 0.3s ease;
    --focus-ring: 0 0 0 3px rgba(88, 166, 255, 0.4);
    --bg-primary-light: #ffffff;
    --bg-secondary-light: #f6f8fa;
    --text-primary-light: #1f2328;
    --text-secondary-light: #59636e;
    --accent-light: #0969da;
    --hover-light: #eaeef2;
    --border-light: #d1d9e0;
    --focus-ring-light: 0 0 0 3px rgba(9, 105, 218, 0.4);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--bg-primary);
    font-family: 'Segoe UI', Arial, sans-serif;
    color: var(--text-primary);
    line-height: 1.8;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    cursor: url('./pirate_cursor.png'), auto;
}

body.light {
    --bg-primary: var(--bg-primary-light);
    --bg-secondary: var(--bg-secondary-light);
    --text-primary: var(--text-primary-light);
    --text-secondary: var(--text-secondary-light);
    --accent: var(--accent-light);
    --hover: var(--hover-light);
    --border: var(--border-light);
    --focus-ring: var(--focus-ring-light);
    background: var(--bg-primary-light);
}

h1, h2, h3, h4 {
    font-family: Georgia, 'Times New Roman', Times, serif;
    color: var(--text-primary);
    margin: 20px 0;
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 1.8rem;
    color: var(--text-secondary);
}

a {
    color: var(--accent);
    text-decoration: none;
    font-weight: bold;
    transition: var(--transition);
    cursor: url('./pirate_cursor_hover.png'), pointer;
    margin-left: 5px;
}

a:hover {
    color: var(--text-primary);
    text-decoration: underline;
}

/* Focus states for accessibility */
a:focus,
button:focus,
input:focus {
    outline: none;
    box-shadow: var(--focus-ring);
}

a[data-tooltip] {
    position: relative;
}

a[data-tooltip]:hover:after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.9rem;
    white-space: nowrap;
    z-index: 10;
    border: 1px solid var(--border);
}

.link-highlight {
    color: #58a6ff;
    font-weight: bold;
}

body.light .link-highlight {
    color: #0969da;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.move {
    text-align: center;
}

.move input, .move button {
    padding: 10px;
    width: 100%;
    max-width: 400px;
    margin: 10px 0;
    border: 1px solid var(--border);
    border-radius: 5px;
    background: var(--bg-secondary);
    color: var(--text-primary);
}

/* Theme toggle fixed positioning */
#themeToggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    padding: 10px 15px;
    font-size: 1.5em;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    background: var(--accent);
    color: var(--text-primary);
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    transition: transform 0.2s, background 0.3s;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: manipulation;
}

#themeToggle:hover {
    transform: scale(1.1);
    background: var(--hover);
}

#themeToggle:focus {
    box-shadow: var(--focus-ring), 0 2px 8px rgba(0,0,0,0.3);
}

/* Search container with clear button */
.search-container {
    position: relative;
    display: inline-block;
    width: 100%;
    max-width: 400px;
    margin: 10px 0;
}

#searchInput {
    padding-right: 40px;
}

#clearSearch {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 5px 10px;
    font-size: 1.2em;
    color: var(--text-secondary);
    transition: var(--transition);
}

#clearSearch:hover {
    color: var(--text-primary);
}

#clearSearch:focus {
    color: var(--accent);
}

/* Search results message */
#searchResults {
    margin: 10px 0;
    font-style: italic;
    color: var(--text-secondary);
    font-size: 0.95rem;
    min-height: 1.5em;
}

/* Control buttons for expand/collapse */
.control-buttons {
    margin: 15px 0;
}

.control-buttons button {
    margin: 5px 10px 5px 0;
    padding: 8px 16px;
    cursor: pointer;
    background: var(--accent);
    color: #ffffff;
    border: none;
    border-radius: 5px;
    transition: var(--transition);
    touch-action: manipulation;
    font-weight: 600;
}

.control-buttons button:hover {
    background: var(--hover);
    transform: scale(1.05);
}

body.light .control-buttons button {
    color: #ffffff;
}

.right {
    text-align: right;
}

.header {
    padding: 15px;
    text-align: center;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 20px;
    backdrop-filter: blur(5px);
    border-bottom: 1px solid var(--border);
}

.topnav {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--bg-secondary);
    display: flex;
    justify-content: space-around;
    padding: 10px 0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    flex-wrap: wrap;
    border-bottom: 1px solid var(--border);
}

.topnav a {
    color: var(--text-primary);
    text-decoration: none;
    padding: 12px 25px;
    border-radius: 5px;
    transition: var(--transition);
    font-size: 1.1rem;
}

.topnav a:hover {
    background-color: var(--hover);
}

.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: var(--bg-secondary);
    min-width: 200px;
    padding: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    z-index: 1;
    border-radius: 5px;
    opacity: 0;
    transform: translateY(10px);
    transition: var(--transition);
    border: 1px solid var(--border);
}

.dropdown-content a {
    color: var(--text-primary);
    padding: 10px 15px;
    text-decoration: none;
    display: block;
    text-align: left;
    background-color: var(--hover);
    border-radius: 5px;
    margin: 5px 0;
    transition: var(--transition);
}

.dropdown-content a:hover {
    background-color: var(--accent);
    transform: scale(1.05);
}

.dropdown:hover .dropdown-content,
.dropdown:focus-within .dropdown-content {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

section {
    background-color: var(--bg-secondary);
    padding: 25px;
    margin: 30px auto;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    max-width: 900px;
    animation: fadeIn 1.5s ease-in-out;
    transform: perspective(1000px) rotateX(0deg) rotateY(0deg);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

section:hover {
    transform: perspective(1000px) rotateX(2deg) rotateY(-2deg);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

section h1, section h2 {
    text-align: left;
    margin-left: 0;
    border-bottom: 1px solid var(--border);
    padding-bottom: 10px;
}

.toggle-btn {
    float: right;
    background: var(--accent);
    border: none;
    padding: 8px 12px;
    border-radius: 5px;
    color: #ffffff;
    cursor: pointer;
    transition: var(--transition);
    touch-action: manipulation;
    font-weight: bold;
    font-size: 1.2em;
    line-height: 1;
    min-width: 35px;
}

.toggle-btn:hover {
    background: var(--hover);
    transform: scale(1.1);
}

.toggle-btn .toggle-icon {
    display: inline-block;
}

.section-content {
    display: block;
    opacity: 1;
    max-height: 5000px;
    overflow: hidden;
    transition: opacity 0.3s ease, max-height 0.3s ease;
}

.section-content.hidden {
    display: none;
    opacity: 0;
    max-height: 0;
}

li {
    margin: 15px 0;
    font-size: 1.2rem;
    line-height: 1.8;
    display: flex;
    align-items: center;
    animation: fadeIn 1.5s ease-in-out;
    transition: var(--transition);
}

li:hover {
    color: var(--accent);
    background: rgba(88, 166, 255, 0.1);
    border-left: 4px solid var(--accent);
    padding-left: 10px;
    cursor: pointer;
}

body.light li:hover {
    background: rgba(9, 105, 218, 0.1);
}

img {
    display: inline-block;
    vertical-align: middle;
    margin-right: 15px;
    border-radius: 5px;
    transition: var(--transition);
    width: 48px;
    height: 48px;
}

img:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px 5px rgba(88, 166, 255, 0.3);
}

body.light img:hover {
    box-shadow: 0 0 15px 5px rgba(9, 105, 218, 0.3);
}

.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin: 20px auto;
    padding: 10px;
    max-width: 1200px;
}

.image-grid a {
    display: flex;
    justify-content: center;
    align-items: center;
    text-decoration: none;
}

.image-grid img {
    width: 100%;
    max-width: 200px;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: var(--transition);
    margin: 0;
}

.image-grid img:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
}

.image-item p {
    margin-top: 10px;
    font-size: 1rem;
    color: var(--text-primary);
}

.status {
    font-size: 0.85rem;
    color: var(--text-primary);
    background: var(--hover);
    padding: 3px 8px;
    border-radius: 3px;
    margin-left: 10px;
    opacity: 0.8;
}

.button-container {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 30px auto;
}

#backToTop {
    padding: 12px 25px;
    background-color: var(--accent);
    color: #ffffff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    transition: var(--transition);
    touch-action: manipulation;
    font-weight: 600;
}

#backToTop:hover {
    background-color: var(--hover);
    transform: scale(1.05);
}

#nextPage {
    padding: 12px 25px;
    background-color: var(--accent);
    color: #ffffff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    text-decoration: none;
    transition: var(--transition);
    touch-action: manipulation;
    font-weight: 600;
}

#nextPage:hover {
    background-color: var(--hover);
    transform: scale(1.05);
}

.sidebar {
    position: fixed;
    right: 20px;
    top: 100px;
    background: var(--bg-secondary);
    padding: 15px;
    border-radius: 5px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    max-width: 200px;
    height: 70vh;
    overflow-y: auto;
    border: 1px solid var(--border);
}

.sidebar h2 {
    font-size: 1.2rem;
    margin: 0 0 10px;
}

.sidebar ul {
    list-style: none;
    padding: 0;
}

.sidebar a {
    display: block;
    padding: 8px;
    margin: 3px 0;
    border-radius: 4px;
    transition: var(--transition);
}

.sidebar a:hover {
    background: var(--hover);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.move h1, .move p, .move input, .move button {
    animation: fadeIn 1.5s ease-in-out;
}

.image-grid img {
    animation: fadeIn 1.5s ease-in-out;
    animation-fill-mode: forwards;
}

footer {
    background: var(--bg-secondary);
    color: var(--text-primary);
    text-align: center;
    padding: 40px 0;
    margin-top: 50px;
    border-top: 2px solid var(--border);
    box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.1);
}

footer a {
    margin: 0 20px;
    display: inline-block;
}

@media (max-width: 768px) {
    .topnav {
        flex-direction: column;
        align-items: center;
    }

    .topnav a {
        margin: 5px 0;
        width: 100%;
        text-align: center;
    }

    .dropdown-content {
        position: static;
        display: none;
        width: 100%;
        box-shadow: none;
        margin-top: 5px;
    }

    .dropdown:hover .dropdown-content,
    .dropdown:focus-within .dropdown-content {
        display: block;
    }

    .image-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }

    .image-grid img {
        max-width: 150px;
    }

    section {
        padding: 15px;
        margin: 20px 10px;
    }

    .sidebar {
        display: none;
    }

    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    .header {
        padding: 10px;
    }

    footer {
        padding: 20px 0;
    }

    footer a {
        margin: 0 10px;
    }

    #themeToggle {
        top: 10px;
        right: 10px;
        width: 45px;
        height: 45px;
        font-size: 1.3em;
    }

    .control-buttons {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .control-buttons button {
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
    }
}

@media (max-width: 480px) {
    .image-grid {
        grid-template-columns: 1fr;
    }

    .image-grid img {
        max-width: 100%;
    }

    li {
        flex-direction: column;
        text-align: center;
        font-size: 1rem;
    }

    img {
        margin: 0 0 10px 0;
    }

    .topnav a {
        padding: 10px;
    }

    footer a {
        display: block;
        margin: 10px 0;
    }

    .search-container {
        max-width: 100%;
    }

    #themeToggle {
        width: 40px;
        height: 40px;
        font-size: 1.1em;
    }
}
