:root {
    --primary-color: #fd7e14;
    --bg-dark: #1a1a1a;
    --bg-light: #ffffff;
    --text-dark: #ffffff;
    --text-light: #333333;
    --card-bg-dark: #2d2d2d;
    --card-bg-light: #f8f9fa;
}

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

body {
    font-family: 'Nunito Sans', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-dark);
    transition: all 0.3s ease;
    overflow-x: hidden;
}

body.light-mode {
    background-color: var(--bg-light);
    color: var(--text-light);
}

/* Navigation */
.navbar {
    background-color: var(--bg-dark);
    border-bottom: 1px solid #444;
    padding: 1rem 0;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    transform: translateY(0);
    transition: transform 0.25s ease, background-color 0.3s ease;
}

.light-mode .navbar {
    background-color: var(--bg-light);
    border-bottom: 1px solid #ddd;
}

/* Hide state when scrolling down */
.navbar.navbar-hidden {
    transform: translateY(-100%);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Search Styles */
.search-container {
    position: relative;
}

.search-box {
    display: flex;
    align-items: center;
    background-color: var(--card-bg-dark);
    border: 1px solid #444;
    border-radius: 4px;
    padding: 0.5rem;
    transition: all 0.3s ease;
}

.light-mode .search-box {
    background-color: var(--card-bg-light);
    border: 1px solid #ddd;
}

.search-box:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(253, 126, 20, 0.2);
}

.search-icon {
    color: #888;
    margin-right: 0.5rem;
    flex-shrink: 0;
}

.search-input {
    background: none;
    border: none;
    color: inherit;
    outline: none;
    width: 200px;
    font-family: inherit;
    font-size: 0.9rem;
}

.search-input::placeholder {
    color: #888;
}

.light-mode .search-input::placeholder {
    color: #666;
}

/* Hamburger Menu */
.hamburger {
    background: none;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    padding: 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hamburger svg {
    width: 20px;
    height: 20px;
}

/* Search Button */
.search-btn {
    background: none;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    padding: 0.5rem;
    border-radius: 4px;
    cursor: pointer;
}

/* Theme Toggle */
.theme-toggle {
    background: none;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
}

/* Brand */
.brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: inherit;
}

/* Brand Logo */
.brand-logo {
    width: 30px;
    height: 30px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden; /* Ensures the image stays within bounds */
    flex-shrink: 0; /* Prevents the logo from shrinking */
}

.brand-image {
    width: 100%;
    height: 100%;
    object-fit: contain; /* Ensures the entire image is visible */
    display: block;
}

.brand-text {
    font-size: 1.2rem;
    font-weight: bold;
}

/* Main Content */
.main-content {
    max-width: 1200px;
    margin: 80px auto 0;
    padding: 2rem 1.5rem;
    display: block;
    box-sizing: border-box;
}

.main-content p,
.card p {
    margin-left: 1.5rem;
    margin-right: 1.5rem;
}

button, .btn, .theme-toggle {
    margin-left: 0.5rem;
    margin-right: 0.5rem;
}

.header-spacer {
    height: 80px;
}

/* Section Headers */
.section-header {
    margin: 2rem 1rem 1rem 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-color);
}

.section-header h2 {
    font-size: 1.5rem;
    color: var(--primary-color);
}

/* Cards */
.card {
    background-color: var(--card-bg-dark);
    border-radius: 8px;
    padding: 2rem;
    margin-bottom: 2rem;
    margin-left: 1rem;
    margin-right: 1rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.light-mode .card {
    background-color: var(--card-bg-light);
}

.novel-item {
    display: flex;
    gap: 1rem;
    padding: 1rem 2rem;
    border-bottom: 1px solid #444;
    align-items: center;
}

.light-mode .novel-item {
    border-bottom: 1px solid #ddd;
}

.novel-cover {
    width: 80px;
    height: 120px;
    background-color: #555;
    border-radius: 4px;
    flex-shrink: 0;
}

.novel-info h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.novel-meta {
    font-size: 0.9rem;
    color: #888;
}

/* Balanced spacing for novel-info container */
.novel-info {
        margin-left: 1.5rem;
        margin-right: 1.5rem;
        padding-left: 0.5rem;
        padding-right: 0.5rem;
}

@media (max-width: 768px) {
    .novel-info {
        margin-left: 0.5rem;
        margin-right: 0.5rem;
        padding-left: 0;
        padding-right: 0;
    }
}

.light-mode .novel-meta {
    color: #666;
}

/* Recent Updates */
.update-item {
    padding: 0.75rem 0;
    border-bottom: 1px solid #444;
    margin-left: 0.5rem;
    margin-right: 0.5rem;
}

.light-mode .update-item {
    border-bottom: 1px solid #ddd;
}

.update-item:last-child {
    border-bottom: none;
}

.update-title {
    font-weight: bold;
    margin-bottom: 0.25rem;
}

.update-chapter {
    color: var(--primary-color);
    font-size: 0.9rem;
}

.update-time {
    font-size: 0.8rem;
    color: #888;
}

.light-mode .update-time {
    color: #666;
}

/* News */
.news-item {
    padding: 1rem 0;
    border-bottom: 1px solid #444;
    margin-left: 0.5rem;
    margin-right: 0.5rem;
}

.light-mode .news-item {
    border-bottom: 1px solid #ddd;
}

.news-title {
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.news-date {
    font-size: 0.8rem;
    color: #888;
}

.light-mode .news-date {
    color: #666;
}

/* Footer */
footer {
    background-color: var(--bg-dark);
    border-top: 1px solid #444;
    padding: 2rem 0;
    margin-top: 3rem;
}

.light-mode footer {
    background-color: var(--bg-light);
    border-top: 1px solid #ddd;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.footer-links a {
    color: inherit;
    text-decoration: none;
    font-size: 0.9rem;
}

.footer-links a:hover {
    color: var(--primary-color);
}

.footer-copyright {
    color: #888;
    font-size: 0.8rem;
}

.light-mode .footer-copyright {
    color: #666;
}

/* Menu Styles */
.left-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 300px;
    height: 100%;
    background-color: var(--bg-dark);
    color: var(--text-dark);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 1100;
    overflow-y: auto;
    box-shadow: 2px 0 10px rgba(0,0,0,0.2);
}

.light-mode .left-menu {
    background-color: var(--bg-light);
    color: var(--text-light);
}

.left-menu.show {
    transform: translateX(0);
}

/* Hide scrollbar visuals in left menu */
.left-menu::-webkit-scrollbar {
    width: 0;
    height: 0;
}
.left-menu {
    scrollbar-width: none; /* Firefox */
}

.offcanvas-header {
    padding: 1rem;
    border-bottom: 1px solid #444;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.light-mode .offcanvas-header {
    border-bottom: 1px solid #ddd;
}

.offcanvas-title {
    font-size: 1.25rem;
    font-weight: bold;
    margin: 0;
}

.btn-close {
    background: none;
    border: none;
    color: inherit;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.offcanvas-body {
    padding: 1rem;
}

.left-menu-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.menu-item img {
    transition: filter 0s ease;
}

/* When dark mode is active */
body.dark-mode .menu-item img {
    filter: brightness(0) invert(1);
}



.menu-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: inherit;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.2s;
}

a.discord-button img {
    transition: transform 0.2s ease;
}

a.discord-button:hover img {
    transform: scale(1.1);
}



.menu-item:hover {
    background-color: rgba(253, 126, 20, 0.1);
}

.menu-item.active {
    background-color: rgba(253, 126, 20, 0.2);
    color: var(--primary-color);
}

.menu-item svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
    flex-shrink: 0;
    vertical-align: middle;
}

hr {
    border: none;
    border-top: 1px solid #444;
    margin: 1rem 0;
}

.light-mode hr {
    border-top: 1px solid #ddd;
}

.locale-switch, .theme-selector {
    padding: 0.5rem 1rem;
}

.dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: none;
    border: 1px solid #444;
    color: inherit;
    padding: 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    width: 100%;
}

.light-mode .dropdown-toggle {
    border: 1px solid #ddd;
}

.flag {
    width: 20px;
    height: 15px;
}

.theme-selector {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.theme-selector svg {
    width: 20px;
    height: 20px;
}

.btn-group {
    display: flex;
    gap: 0;
}

.btn-group button {
    padding: 0.25rem 0.5rem;
    border: 1px solid #444;
    background: none;
    color: inherit;
    cursor: pointer;
    font-size: 0.8rem;
}

.light-mode .btn-group button {
    border: 1px solid #ddd;
}

.btn-group button:first-child {
    border-radius: 4px 0 0 4px;
}

.btn-group button:last-child {
    border-radius: 0 4px 4px 0;
}

.btn-group button.btn-dark {
    background-color: var(--primary-color);
    color: white;
}

.discord {
    text-align: center;
}

.discord img {
    width: 150px;
    height: auto;
}

.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    z-index: 1050;
    display: none;
}

.menu-overlay.show {
    display: block;
}

/* Responsive */

/* Mobile improvements */
@media (max-width: 768px) {
    /* Navbar adjustments */
    .nav-container {
        flex-wrap: wrap;
        gap: 0.5rem;
        padding: 0 0.75rem;
    }

    .nav-left, .nav-right {
        flex: 1 1 100%;
        justify-content: space-between;
    }

    .nav-left {
        order: 1;
        justify-content: center;
        position: relative;
    }

    .nav-right {
        order: 2;
        justify-content: flex-end;
        gap: 0.5rem;
    }

    /* Brand text smaller on mobile */
    .brand-text {
        font-size: 1rem;
    }

    /* Search box smaller and full width */
    .search-box {
        display: none;
    }

    /* Center search container block within nav on mobile */
    .nav-right .search-container {
        width: 100%;
        display: flex;
        justify-content: center;
    }

    .search-input {
        width: 100% !important;
        font-size: 1rem;
    }

    /* Theme toggle smaller and full width */
    .theme-toggle {
        padding: 0.4rem 0.75rem;
        font-size: 0.85rem;
        flex-shrink: 0;
    }

    /* Hamburger button bigger tap area */
    .hamburger {
        padding: 0.75rem;
        border-width: 2px;
        position: absolute;
        left: 0.75rem;
    }

    /* Prevent brand text from overlapping hamburger (nudge ~10px more) */
    .nav-left .brand {
        padding-left: 5.625rem;
    }

    /* Main content padding */
    .main-content {
        padding: 1rem 0.5rem;
    }

    /* Novel items stacked vertically */
    .novel-item {
        flex-direction: column;
        gap: 0.75rem;
    }

    .novel-cover {
        width: 100%;
        max-width: 150px;
        height: auto;
        aspect-ratio: 2 / 3;
        border-radius: 6px;
    }

    /* Update item spacing */
    .update-item {
        padding: 1rem 0;
    }

    /* Footer links wrap nicely */
    .footer-links {
        flex-direction: column;
        gap: 0.75rem;
    }

    /* Left menu width smaller */
    .left-menu {
        width: 260px;
    }

    /* Increase menu item tap size */
    .menu-item {
        padding: 1rem 1.25rem;
        font-size: 1rem;
    }

    /* Theme selector buttons bigger */
    .btn-group button {
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
    }
}

/* Extra small devices */
@media (max-width: 480px) {
    .nav-left, .nav-right {
        flex: 1 1 100%;
        justify-content: space-between;
    }

    .search-box {
        max-width: 100%;
    }

    .search-input {
        font-size: 0.95rem;
    }

    .theme-toggle {
        width: 100%;
        text-align: center;
        padding: 0.5rem 0;
        font-size: 0.9rem;
    }

    .novel-cover {
        max-width: 100%;
        height: auto;
    }

    .menu-item {
        font-size: 1.1rem;
        padding: 1.25rem 1.5rem;
    }
}

/* Ensure left-menu search box is visible on mobile */
@media (max-width: 768px) {
  .left-menu .search-box {
    display: flex !important;
  }
}

