@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700;800&family=VT323&family=Lexend:wght@300;400;500;600;700&display=swap');

:root {
    --bg-dark: #f5efe6; /* Light parchment/cream background */
    --panel-bg: transparent;
    --panel-border: 1px solid #e6ded3;
    
    --mc-gold: #d4a359; /* Classic medieval gold */
    --mc-yellow: #f8df95;
    --mc-green: #68a357; /* Emerald claims green */
    --mc-dark-green: #27471d; 
    --mc-red: #8a2b2b; /* Deep burgundy/red */
    --mc-aqua: #52a3a3;
    
    --text-main: #3e352d; /* Dark charcoal brown text */
    --text-muted: #6b5d52; /* Medium warm brown description text */
    
    --sidebar-width: 320px;
    --font-heading: 'Cinzel', 'VT323', serif;
    --font-body: 'Lexend', sans-serif;
    
    --radius-sm: 3px;
    --radius-md: 6px;
    --radius-lg: 8px;
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Scrollbars */
::-webkit-scrollbar {
    width: 10px;
}
::-webkit-scrollbar-track {
    background: #eae3d7;
}
::-webkit-scrollbar-thumb {
    background: #c7bdad;
    border-radius: var(--radius-sm);
}
::-webkit-scrollbar-thumb:hover {
    background: #b5aa99;
}

/* Layout Wrapper */
.wiki-container {
    display: flex;
    min-height: calc(100vh - 120px);
    margin-top: 120px; /* Shift content down for fixed header */
}

.wiki-container.homepage-layout {
    display: block;
}

/* Main Content Area */
.wiki-main {
    flex: 1;
    padding: 40px 60px;
    transition: margin-left 0.3s ease;
}

.homepage-layout .wiki-main {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    padding: 40px 20px;
}

.subpage-layout .wiki-main {
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
}

/* Top Navigation Bar Styles */
.top-nav-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
}

.top-mini-bar {
    background-color: #17120e;
    border-bottom: 1px solid rgba(212, 163, 89, 0.15);
    display: flex;
    justify-content: space-between;
    padding: 8px 60px;
    font-size: 11px;
    font-family: var(--font-heading);
    font-weight: 700;
    letter-spacing: 1.5px;
    color: rgba(212, 163, 89, 0.7);
}

.main-header-bar {
    background: linear-gradient(to bottom, #2b1f18, #1e1510);
    border-bottom: 3px solid var(--mc-gold);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 60px;
    height: 88px;
}

.header-brand .brand-link {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.header-logo-img {
    height: 48px;
    width: auto;
    margin-right: 14px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.brand-names {
    display: flex;
    flex-direction: column;
}

.brand-title {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: 0.5px;
    line-height: 1.1;
}

.brand-subtitle {
    font-family: var(--font-heading);
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--mc-gold);
    letter-spacing: 2px;
}

.header-menu {
    display: flex;
    gap: 30px;
}

.header-menu a {
    text-decoration: none;
    color: #e5ded5;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: color 0.2s;
}

.header-menu a:hover {
    color: var(--mc-gold);
}

.discord-btn {
    display: inline-block;
    padding: 8px 18px;
    background: transparent;
    border: 1px solid var(--mc-gold);
    border-radius: var(--radius-sm);
    color: var(--mc-gold);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
}

.discord-btn:hover {
    background-color: var(--mc-gold);
    color: #1e1510;
}

.burger-menu {
    display: none;
}

/* Sidebar Wrapper (Only on subpages) */
.wiki-sidebar {
    position: fixed;
    top: 120px;
    left: 0;
    width: var(--sidebar-width);
    height: calc(100vh - 120px);
    background-color: #fbf9f5;
    border-right: 1px solid #e6ded3;
    display: flex;
    flex-direction: column;
    z-index: 99;
    box-shadow: 4px 0 15px rgba(0, 0, 0, 0.02);
}

.search-container {
    padding: 18px 20px;
    border-bottom: 1px solid #e6ded3;
}

.search-input {
    width: 100%;
    padding: 10px 16px;
    background: #fff;
    border: 1px solid #e6ded3;
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 0.9rem;
    outline: none;
    border-radius: var(--radius-md);
    transition: all 0.2s;
}

.search-input:focus {
    border-color: var(--mc-gold);
    box-shadow: 0 0 0 3px rgba(212, 163, 89, 0.15);
}

/* Sidebar Navigation */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 20px 14px;
}

.nav-category {
    margin-bottom: 8px;
}

.nav-category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 12px 16px;
    background: transparent;
    border: none;
    color: var(--text-main);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.02rem;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s;
    border-radius: var(--radius-md);
}

.nav-category-header:hover {
    background: #f3edd8;
}

.nav-category-header.active {
    color: var(--mc-red);
    background: #f3edd8;
    border-left: 3px solid var(--mc-red);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.nav-category-header .arrow {
    font-size: 0.7rem;
    opacity: 0.5;
    transition: transform 0.2s;
}

.nav-category-header.active .arrow {
    transform: rotate(90deg);
    opacity: 1;
    color: var(--mc-red);
}

.nav-pages {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding-left: 12px;
    margin-top: 4px;
}

.nav-pages a {
    display: block;
    padding: 8px 16px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    border-left: 2px solid transparent;
    transition: all 0.2s;
}

.nav-pages a:hover {
    color: var(--mc-red);
    border-left-color: var(--mc-red);
    background: rgba(138, 43, 43, 0.02);
}

.nav-pages a.active {
    color: var(--mc-red);
    border-left-color: var(--mc-red);
    background: rgba(138, 43, 43, 0.05);
    font-weight: 600;
}

/* Modern Panel Structure */
.mc-panel {
    padding: 0;
}

.mc-panel.article-panel {
    background-color: #fff;
    border: 1px solid #e6ded3;
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    padding: 48px;
}

/* Headings */
h1 {
    font-family: var(--font-heading);
    font-size: 2.8rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 24px;
    border-bottom: 2px solid #e6ded3;
    padding-bottom: 12px;
    line-height: 1.1;
}

.homepage-layout h1 {
    border-bottom: none;
    padding-bottom: 0;
}

h2 {
    font-family: var(--font-heading);
    font-size: 2.1rem;
    font-weight: 700;
    color: var(--mc-red);
    margin-top: 36px;
    margin-bottom: 20px;
    border-bottom: 1px solid #e6ded3;
    padding-bottom: 8px;
}

h3 {
    font-family: var(--font-heading);
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--text-main);
    margin-top: 28px;
    margin-bottom: 14px;
}

p {
    margin-bottom: 20px;
    color: var(--text-muted);
}

strong {
    color: #2c2520;
}

/* Accent alerts */
.mc-alert {
    background: #fff;
    border-left: 4px solid var(--mc-gold);
    border-right: 1px solid #e6ded3;
    border-top: 1px solid #e6ded3;
    border-bottom: 1px solid #e6ded3;
    border-radius: var(--radius-md);
    padding: 20px;
    margin: 28px 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
}

.mc-alert.info {
    border-left-color: var(--mc-aqua);
    background: #f4fafa;
    border-right-color: #d1eded;
    border-top-color: #d1eded;
    border-bottom-color: #d1eded;
}

.mc-alert.danger {
    border-left-color: var(--mc-red);
    background: #faf4f4;
    border-right-color: #edd1d1;
    border-top-color: #edd1d1;
    border-bottom-color: #edd1d1;
}

.mc-alert-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.15rem;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mc-alert.info .mc-alert-title { color: var(--mc-aqua); }
.mc-alert.danger .mc-alert-title { color: var(--mc-red); }

/* Buttons styling - blocky brown/gold button styling */
.mc-btn {
    display: inline-block;
    padding: 10px 22px;
    background: #2b1f18;
    border: 1px solid #3d2d23;
    border-bottom: 3px solid #1c1511;
    border-radius: var(--radius-sm);
    color: #ffd899;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.5px;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.1s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.mc-btn:hover {
    background: #3d2d23;
    color: #fff;
    transform: translateY(1px);
    border-bottom-width: 2px;
}

.mc-btn:active {
    transform: translateY(2px);
    border-bottom-width: 1px;
}

/* Lists styling */
ul, ol {
    margin-bottom: 24px;
    padding-left: 24px;
    color: var(--text-muted);
}

li {
    margin-bottom: 10px;
}

li strong {
    color: #2c2520;
}

code {
    background: #eae3d7;
    color: #8a2b2b;
    padding: 3px 6px;
    border-radius: var(--radius-sm);
    font-family: monospace;
    font-size: 0.9rem;
    border: 1px solid #dcd3c5;
}

/* Grid layout */
.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin: 32px 0;
}

.grid-card {
    background: #fff;
    border: 1px solid #e6ded3;
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: all 0.25s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.02);
}

.grid-card:hover {
    border-color: var(--mc-gold);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
}

/* Recipe card */
.recipe-container {
    background: #fff;
    border: 1px solid #e6ded3;
    border-radius: var(--radius-lg);
    padding: 24px;
    display: inline-block;
    margin: 20px 0;
    box-shadow: 0 4px 15px rgba(0,0,0,0.02);
    transition: border-color 0.2s;
}

.recipe-container:hover {
    border-color: var(--mc-gold);
}

.recipe-image {
    display: block;
    width: 100%;
    max-width: 550px;
    height: auto;
    border-radius: var(--radius-md);
    cursor: zoom-in;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    background: #f5efe6;
}

.recipe-image:hover {
    transform: scale(1.01);
}

/* Lightbox */
.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(245, 239, 230, 0.95);
    backdrop-filter: blur(12px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.lightbox-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.lightbox-content {
    max-width: 90%;
    max-height: 80%;
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    border-radius: var(--radius-lg);
    border: 1px solid #e6ded3;
    box-shadow: 0 20px 50px rgba(0,0,0,0.08);
}

.lightbox-overlay.active .lightbox-content {
    transform: scale(1);
}

.lightbox-close {
    position: absolute;
    top: 24px;
    right: 24px;
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 1.2rem;
    color: var(--text-main);
    cursor: pointer;
    background: #fff;
    border: 1px solid #e6ded3;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.lightbox-close:hover {
    background: var(--mc-red);
    color: #fff;
    border-color: var(--mc-red);
    transform: rotate(90deg);
}

/* Mobile responsive toggle header */
.mobile-header {
    display: none;
}

/* Table Design */
.mc-table-container {
    overflow-x: auto;
    margin: 28px 0;
    border: 1px solid #e6ded3;
    border-radius: var(--radius-lg);
    background: #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.01);
}

.mc-table {
    width: 100%;
    border-collapse: collapse;
}

.mc-table th {
    background: #fbf9f5;
    color: var(--text-main);
    font-family: var(--font-heading);
    font-weight: 700;
    padding: 14px 18px;
    border-bottom: 2px solid #e6ded3;
    text-align: left;
    letter-spacing: 0.5px;
}

.mc-table td {
    padding: 14px 18px;
    border-bottom: 1px solid #f2ede4;
    color: var(--text-muted);
}

.mc-table tr:hover td {
    background: #fcfaf7;
}

/* Homepage-Specific Styling */
.banner-container {
    width: 100%;
    margin-bottom: 40px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid #e6ded3;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

.wiki-banner {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

.home-intro {
    text-align: center;
    max-width: 900px;
    margin: 0 auto;
}

.diamond-sep {
    color: var(--mc-gold);
    font-size: 1.4rem;
    margin-bottom: 8px;
}

.small-label-sub {
    font-family: var(--font-heading);
    font-size: 0.78rem;
    font-weight: 800;
    color: var(--mc-gold);
    letter-spacing: 2.5px;
    margin-bottom: 15px;
}

.home-title {
    font-family: var(--font-heading);
    font-size: 3.4rem;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1.15;
    margin-bottom: 18px;
}

.burgundy-text {
    color: var(--mc-red);
}

.home-desc {
    font-size: 1.15rem;
    font-weight: 300;
    color: var(--text-muted);
    font-style: italic;
    margin-bottom: 35px;
    line-height: 1.5;
}

/* Centered Connection Card */
.new-connection-card {
    background: #231610;
    border: 2px solid var(--mc-gold);
    border-radius: 4px;
    max-width: 800px;
    margin: 0 auto 30px auto;
    display: flex;
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
    position: relative;
}

.connection-col {
    flex: 1;
    padding: 16px 24px;
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.2s;
    text-align: left;
}

.connection-col:first-child {
    border-right: 1px solid rgba(212, 163, 89, 0.25);
}

.connection-col:hover {
    background-color: rgba(255, 255, 255, 0.03);
}

.col-header {
    grid-column: 1 / 3;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.col-header .status-dot {
    width: 7px;
    height: 7px;
    background-color: #55ff55;
    border-radius: 50%;
    box-shadow: 0 0 6px #55ff55;
}

.col-label {
    font-family: var(--font-heading);
    font-size: 0.68rem;
    font-weight: 800;
    color: rgba(212, 163, 89, 0.7);
    letter-spacing: 1.5px;
}

.col-val-text {
    grid-column: 1;
    font-family: var(--font-body);
    font-size: 1.05rem;
    color: #fff;
    font-weight: 500;
}

.copy-btn-text {
    grid-column: 2;
    color: var(--mc-gold);
    font-size: 0.72rem;
    font-family: var(--font-heading);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: color 0.2s;
}

.connection-col:hover .copy-btn-text {
    color: #fff;
}

.new-connection-card .copy-tooltip {
    position: absolute;
    bottom: -38px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #231610;
    color: var(--mc-yellow);
    padding: 6px 12px;
    font-family: var(--font-body);
    font-weight: 500;
    border: 1px solid rgba(212, 163, 89, 0.3);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.new-connection-card .copy-tooltip.show {
    opacity: 1;
}

/* Home Search Box */
.home-search-container {
    max-width: 800px;
    margin: 0 auto 40px auto;
    background: #fff;
    border: 1px solid #e6ded3;
    box-shadow: 0 4px 15px rgba(0,0,0,0.02);
    border-radius: 4px;
    display: flex;
    align-items: center;
    padding: 2px 18px;
}

.search-icon {
    font-size: 1.1rem;
    margin-right: 12px;
    opacity: 0.5;
}

.home-search-input {
    width: 100%;
    padding: 12px 0;
    border: none;
    outline: none;
    font-family: var(--font-body);
    font-size: 1.05rem;
    color: var(--text-main);
    background: transparent;
}

/* Responsive Overrides */
@media (max-width: 992px) {
    .top-mini-bar {
        padding: 8px 24px;
    }
    
    .main-header-bar {
        padding: 14px 24px;
    }
    
    .burger-menu {
        display: block;
        background: #3e2a1b;
        border: 1px solid #5a3d28;
        border-bottom: 3px solid #23160e;
        border-radius: var(--radius-sm);
        color: #ffd899;
        font-family: var(--font-heading);
        font-weight: 700;
        font-size: 0.9rem;
        padding: 6px 12px;
        cursor: pointer;
    }
    
    .wiki-sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        top: 120px;
        height: calc(100vh - 120px);
        z-index: 1001;
    }
    
    .wiki-sidebar.active {
        transform: translateX(0);
    }
    
    .subpage-layout .wiki-main {
        margin-left: 0;
        width: 100%;
        padding: 20px;
    }
    
    .mc-panel.article-panel {
        padding: 24px 16px;
    }
    
    .new-connection-card {
        flex-direction: column;
    }
    
    .connection-col:first-child {
        border-right: none;
        border-bottom: 1px solid rgba(212, 163, 89, 0.25);
    }
}

@media (max-width: 768px) {
    .home-title {
        font-size: 2.4rem;
    }
    
    .top-mini-bar {
        display: none;
    }
    
    .main-header-bar {
        top: 0;
    }
    
    .wiki-container {
        margin-top: 88px;
        min-height: calc(100vh - 88px);
    }
    
    .wiki-sidebar {
        top: 88px;
        height: calc(100vh - 88px);
    }
}
