/* Wildoria Wiki — Shared Stylesheet */
/* ==================================== */

:root {
    --bg-primary: #0f1117;
    --bg-secondary: #1a1d27;
    --bg-card: #222634;
    --bg-hover: #2a2f3f;
    --text-primary: #e0e0e0;
    --text-secondary: #a0a4b0;
    --text-muted: #6b7080;
    --accent: #4a9eff;
    --accent-hover: #6bb5ff;
    --accent-dim: #2a5a8a;
    --border: #2a2f3f;
    --border-light: #353a4a;
    --green: #4caf50;
    --orange: #ff9800;
    --red: #f44336;
    --purple: #ab47bc;
    --cyan: #26c6da;
    --radius: 8px;
    --shadow: 0 2px 8px rgba(0,0,0,0.3);
    --max-width: 1200px;
    --sidebar-width: 260px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', 'Noto Sans', 'Noto Sans SC', 'Noto Sans JP', 'Noto Sans KR', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.7;
    min-height: 100vh;
}

/* ===== Layout ===== */

.layout {
    display: flex;
    min-height: 100vh;
}

/* ===== Sidebar ===== */

.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    overflow-y: auto;
    z-index: 100;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 20px 20px 16px;
    border-bottom: 1px solid var(--border);
}

.sidebar-logo {
    font-size: 22px;
    font-weight: 700;
    color: var(--accent);
    text-decoration: none;
    letter-spacing: 1px;
}

.sidebar-logo:hover {
    color: var(--accent-hover);
}

.sidebar-version {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.sidebar-nav {
    flex: 1;
    padding: 12px 0;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.15s ease;
    border-left: 3px solid transparent;
}

.sidebar-nav a:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-left-color: var(--accent-dim);
}

.sidebar-nav a.active {
    background: var(--bg-card);
    color: var(--accent);
    border-left-color: var(--accent);
}

.sidebar-nav a svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    opacity: 0.7;
}

.sidebar-nav a.active svg {
    opacity: 1;
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border);
}

.lang-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.lang-btn {
    padding: 4px 10px;
    font-size: 12px;
    border: 1px solid var(--border-light);
    background: var(--bg-card);
    color: var(--text-secondary);
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s ease;
}

.lang-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.lang-btn.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

/* ===== Main Content ===== */

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 40px;
    max-width: calc(var(--max-width) + var(--sidebar-width));
}

.content-wrapper {
    max-width: var(--max-width);
    margin: 0 auto;
}

/* ===== Typography ===== */

h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
    font-weight: 600;
    line-height: 1.3;
}

h1 {
    font-size: 32px;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border);
}

h2 {
    font-size: 24px;
    margin-top: 40px;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

h3 {
    font-size: 20px;
    margin-top: 28px;
    margin-bottom: 12px;
}

h4 {
    font-size: 16px;
    margin-top: 20px;
    margin-bottom: 8px;
}

p {
    margin-bottom: 14px;
    color: var(--text-primary);
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.15s ease;
}

a:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

code {
    font-family: 'Cascadia Code', 'Fira Code', 'Consolas', monospace;
    background: var(--bg-card);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
    color: var(--cyan);
}

pre {
    background: var(--bg-card);
    padding: 16px;
    border-radius: var(--radius);
    overflow-x: auto;
    border: 1px solid var(--border);
    margin-bottom: 16px;
}

pre code {
    background: none;
    padding: 0;
    color: var(--text-primary);
}

/* ===== Cards ===== */

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 16px;
    transition: border-color 0.2s ease;
}

.card:hover {
    border-color: var(--border-light);
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

/* ===== Tables ===== */

table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    font-size: 14px;
}

th, td {
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    background: var(--bg-card);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

tr:hover td {
    background: var(--bg-hover);
}

/* ===== Badges ===== */

.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-green { background: rgba(76,175,80,0.2); color: var(--green); border: 1px solid rgba(76,175,80,0.3); }
.badge-orange { background: rgba(255,152,0,0.2); color: var(--orange); border: 1px solid rgba(255,152,0,0.3); }
.badge-red { background: rgba(244,67,54,0.2); color: var(--red); border: 1px solid rgba(244,67,54,0.3); }
.badge-blue { background: rgba(74,158,255,0.2); color: var(--accent); border: 1px solid rgba(74,158,255,0.3); }
.badge-purple { background: rgba(171,71,188,0.2); color: var(--purple); border: 1px solid rgba(171,71,188,0.3); }
.badge-cyan { background: rgba(38,198,218,0.2); color: var(--cyan); border: 1px solid rgba(38,198,218,0.3); }

/* ===== Key Display ===== */

.key {
    display: inline-block;
    padding: 2px 8px;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-bottom: 2px solid var(--border-light);
    border-radius: 4px;
    font-family: monospace;
    font-size: 13px;
    color: var(--text-primary);
    min-width: 28px;
    text-align: center;
}

/* ===== Alert Boxes ===== */

.alert {
    padding: 14px 18px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    border-left: 4px solid;
}

.alert-info {
    background: rgba(74,158,255,0.1);
    border-left-color: var(--accent);
}

.alert-warning {
    background: rgba(255,152,0,0.1);
    border-left-color: var(--orange);
}

.alert-danger {
    background: rgba(244,67,54,0.1);
    border-left-color: var(--red);
}

.alert-success {
    background: rgba(76,175,80,0.1);
    border-left-color: var(--green);
}

.alert p:last-child {
    margin-bottom: 0;
}

/* ===== Hero Section ===== */

.hero {
    text-align: center;
    padding: 48px 20px;
    margin-bottom: 32px;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-card) 100%);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.hero h1 {
    border-bottom: none;
    font-size: 42px;
    margin-bottom: 12px;
}

.hero p {
    font-size: 18px;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

.hero-badges {
    margin-top: 20px;
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
    align-items: center;
}

.hero-logo {
    max-width: 200px;
    width: 100%;
    height: auto;
    margin-bottom: 16px;
    border-radius: var(--radius);
}

.hero-badge {
    max-height: 32px;
    width: auto;
}

/* ===== Screenshots ===== */

.wiki-screenshot {
    width: 100%;
    max-width: 800px;
    height: auto;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    margin: 16px 0;
    display: block;
}

/* ===== Feature Grid ===== */

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.feature-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    transition: all 0.2s ease;
}

.feature-item:hover {
    border-color: var(--accent-dim);
    transform: translateY(-2px);
}

.feature-item h4 {
    margin-top: 0;
    color: var(--accent);
}

.feature-item p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 0;
}

/* ===== Biome Cards ===== */

.biome-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.biome-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    transition: all 0.2s ease;
    overflow: hidden;
}

.biome-card:hover {
    border-color: var(--accent-dim);
    transform: translateY(-2px);
}

.biome-color-strip {
    height: 6px;
    border-radius: 3px;
    margin-bottom: 14px;
}

/* ===== Mobile Toggle ===== */

.sidebar-toggle {
    display: none;
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 101;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 18px;
}

/* ===== Responsive ===== */

@media (max-width: 900px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        padding: 20px;
        padding-top: 60px;
    }

    .sidebar-toggle {
        display: block;
    }

    .hero h1 {
        font-size: 28px;
    }

    .hero p {
        font-size: 16px;
    }

    table {
        font-size: 12px;
    }

    th, td {
        padding: 6px 8px;
    }
}

/* ===== Footer ===== */

.wiki-footer {
    margin-top: 48px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}

.wiki-footer a {
    color: var(--text-secondary);
}

/* ===== Scrollbar ===== */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== Utility ===== */

.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mt-2 { margin-top: 8px; }
.mb-2 { margin-bottom: 8px; }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }

.itch-embed {
    max-width: 100%;
    overflow-x: auto;
    margin-bottom: 24px;
    text-align: center;
}

.itch-embed iframe {
    border: none;
    max-width: 100%;
    display: block;
    margin: 0 auto;
}

/* ===== Gallery & Icons ===== */

.gallery-section {
    margin-bottom: 48px;
}

.gallery-section h2 {
    margin-top: 0;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.gallery-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px;
    text-align: center;
    transition: border-color 0.2s ease;
}

.gallery-item:hover {
    border-color: var(--accent-dim);
}

.gallery-item img {
    width: 100%;
    height: auto;
    max-width: 96px;
    max-height: 96px;
    object-fit: contain;
    display: block;
    margin: 0 auto 8px;
    border-radius: 4px;
}

.gallery-label {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.3;
}

.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.image-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: border-color 0.2s ease;
}

.image-card:hover {
    border-color: var(--accent-dim);
}

.image-card img {
    width: 100%;
    height: auto;
    display: block;
    border-bottom: 1px solid var(--border);
}

.image-card .image-caption {
    padding: 12px;
    font-size: 14px;
    color: var(--text-secondary);
}
