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

:root {
    --primary-color: #00dc82;
    --secondary-color: #00dc82;
    --text-color: #2c3e50;
    --bg-color: #ffffff;
    --card-bg: rgba(255, 255, 255, 0.9);
    --card-border: rgba(0, 0, 0, 0.1);
    --nav-hover: rgba(0, 220, 130, 0.1);
    --header-bg: rgba(255, 255, 255, 0.9);
    --nav-icon-filter: none;
    --glow-color: rgba(0, 220, 130, 0.2);
    --code-bg: #282c34;
}

.dark-theme {
    --text-color: rgba(255, 255, 255, 0.9);
    --bg-color: #1a1b26;
    --card-bg: rgba(26, 27, 38, 0.95);
    --card-border: rgba(255, 255, 255, 0.1);
    --nav-hover: rgba(255, 255, 255, 0.05);
    --header-bg: rgba(26, 27, 38, 0.9);
    --nav-icon-filter: invert(1);
    --glow-color: rgba(255, 255, 255, 0.1);
    --code-bg: #24283b;
    --terminal-green: #4ade80;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

@keyframes twinkle {
    0% { opacity: 0.3; }
    50% { opacity: 1; }
    100% { opacity: 0.3; }
}

body {
    color: var(--text-color);
    background: var(--bg-color);
    transition: all 0.3s ease;
    min-height: 100vh;
    line-height: 1.6;
    position: relative;
    overflow-x: hidden;
}

body::before {
    display: none;
}

.dark-theme body::before {
    opacity: 0.4;
}

.app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

header {
    width: 100%;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    padding: 0.8rem 1.5rem;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--card-border);
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--header-bg);
}

.logo-container {
    max-width: none;
    width: auto;
    margin-left: 1rem;
}

.home-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    color: var(--text-color);
}

.logo {
    height: 35px;
    width: auto;
}

nav {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.8rem 1.2rem;
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-color);
    transition: all 0.3s ease;
    margin-bottom: 0.3rem;
    position: relative;
    overflow: hidden;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.nav-link:hover {
    background: var(--nav-hover);
    color: var(--primary-color);
    transform: translateX(5px);
}

.nav-link.active {
    background: var(--primary-color);
    color: white;
    font-weight: 600;
}

.nav-icon {
    width: 20px;
    height: 20px;
    filter: var(--nav-icon-filter);
}

.nav-link.active .nav-icon {
    filter: brightness(0) invert(1);
}

.theme-toggle {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-color);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px var(--glow-color);
    z-index: 1000;
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    transform: scale(1.05);
    background: var(--primary-color);
    box-shadow: 0 4px 15px var(--glow-color);
}

.theme-toggle svg {
    width: 20px;
    height: 20px;
    fill: #ffffff;
    transition: all 0.3s ease;
}

/* Light theme specific styles */
[data-theme="light"] .theme-toggle {
    background: var(--primary-color);
}

/* Dark theme specific styles */
[data-theme="dark"] .theme-toggle {
    background: var(--primary-color);
}

.theme-icon {
    width: 24px;
    height: 24px;
}

.dark-theme .theme-icon.dark,
.theme-icon.light {
    display: none;
}

.dark-theme .theme-icon.light,
.theme-icon.dark {
    display: block;
}

main {
    flex: 1;
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.page {
    display: none;
    animation: fadeIn 0.3s ease-out;
}

.page.active {
    display: block;
}

.hero-section {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: auto;
    padding: 1rem 0;
}

.features-section {
    margin-bottom: 2rem;
}

.features-title {
    text-align: center;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-size: 2rem;
    position: relative;
    padding-bottom: 1rem;
}

.features-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--primary-color);
    border-radius: 2px;
}

.features-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
    max-width: 600px;
}

.feature-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent, rgba(100, 108, 255, 0.1), transparent);
    transform: translateX(-100%);
    transition: transform 0.5s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary-color);
    box-shadow: 0 8px 30px rgba(0, 220, 130, 0.15);
}

.feature-card:hover::before {
    transform: translateX(100%);
}

.feature-card h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.feature-card p {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text-color);
    opacity: 0.9;
}

.novel-container {
    display: flex;
    gap: 2rem;
    height: 100%;
    width: 100%;
}

.chapter-sidebar {
    width: 300px;
    background: var(--card-bg);
    border-radius: 12px;
    border: 1px solid var(--card-border);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    height: 100%;
    overflow-y: auto;
}

.chapter-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.chapter-item {
    margin: 0.3rem 0;
    padding: 0.8rem 1.2rem;
    border-radius: 8px;
    font-weight: 500;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text-color);
    border: 1px solid transparent;
}

.chapter-item:hover {
    background: var(--nav-hover);
    color: var(--primary-color);
    transform: translateX(5px);
}

.chapter-item.active {
    background: var(--primary-color);
    color: white;
    font-weight: 600;
}

.content-container {
    flex: 1;
    background: var(--card-bg);
    border-radius: 12px;
    padding: 2rem 3rem;
    border: 1px solid var(--card-border);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    font-size: 1.1rem;
    line-height: 1.8;
    height: 100%;
}

.story-content, .about-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.story-content h1, .about-content h1 {
    font-size: 2.8rem;
    font-weight: 700;
    background: linear-gradient(45deg, var(--primary-color), #4ade80);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 2rem;
}

.story-content h2, .about-content h2 {
    font-size: 2rem;
    font-weight: 600;
    color: var(--primary-color);
    margin: 2.5rem 0 1.5rem;
}

.story-content p, .about-content p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-color);
    margin-bottom: 1.5rem;
}

.story-content code, .about-content code {
    font-family: 'Fira Code', monospace;
    font-size: 0.9em;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    background: rgba(0, 220, 130, 0.1);
    color: var(--primary-color);
}

.story-content pre, .about-content pre {
    background: var(--code-bg);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid rgba(0, 220, 130, 0.2);
    margin: 2rem 0;
}

.story-content pre code, .about-content pre code {
    background: none;
    color: #fff;
    padding: 0;
}

.story-content blockquote, .about-content blockquote {
    border-left: 4px solid var(--primary-color);
    padding: 1rem 1.5rem;
    margin: 2rem 0;
    background: rgba(0, 220, 130, 0.05);
    border-radius: 0 12px 12px 0;
}

/* Space theme for cards and elements */
.feature-card, .message, .chapter-item, .content-container {
    position: relative;
    overflow: hidden;
}

.feature-card::after, .message::after, .chapter-item::after, .content-container::after {
    display: none;
}

/* Enhanced dark theme */
.dark-theme {
    --text-color: rgba(255, 255, 255, 0.9);
    --bg-color: #0a0a1f;
    --card-bg: rgba(20, 20, 40, 0.7);
    --card-border: rgba(100, 108, 255, 0.2);
    --nav-hover: rgba(100, 108, 255, 0.1);
    --header-bg: rgba(10, 10, 31, 0.8);
}

#chat-section {
    height: 100%;
    padding: 1rem;
}

.chat-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--card-bg);
    border-radius: 12px;
    border: 1px solid var(--card-border);
    position: relative;
    overflow: hidden;
}

.messages-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    overflow-y: auto;
    padding: 2rem;
    scroll-behavior: smooth;
    height: calc(100% - 80px); /* 80px is approximate height of input container */
}

.message {
    display: flex;
    flex-direction: column;
    min-width: 60px;
    max-width: 80%;
    margin: 0.3rem 0;
    padding: 0.8rem 1rem;
    border-radius: 8px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    word-wrap: break-word;
}

.message.user {
    align-self: flex-end;
    background: var(--primary-color);
    color: white;
    border: none;
}

.message.assistant {
    align-self: flex-start;
    background: var(--card-bg);
}

.message-content {
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 0.5rem;
    white-space: pre-wrap;
    word-break: break-word;
}

.message-author {
    font-size: 0.8rem;
    opacity: 0.7;
    text-align: right;
    margin-top: 0.3rem;
}

.input-container {
    padding: 1.5rem;
    background: var(--card-bg);
    border-top: 1px solid var(--card-border);
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-shrink: 0;
    height: 80px; /* Fixed height for input container */
}

.message-input {
    flex: 1;
    padding: 1rem 1.2rem;
    border: 1px solid var(--card-border);
    border-radius: 8px;
    background: var(--bg-color);
    color: var(--text-color);
    font-size: 1rem;
    resize: none;
    min-height: 24px;
    max-height: 150px;
    line-height: 1.5;
    transition: all 0.3s ease;
}

.message-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px var(--glow-color);
}

.send-button {
    padding: 1rem 2rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.send-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px var(--glow-color);
}

/* Scrollbar styles for messages container */
.messages-container::-webkit-scrollbar {
    width: 6px;
}

.messages-container::-webkit-scrollbar-track {
    background: transparent;
}

.messages-container::-webkit-scrollbar-thumb {
    background: var(--card-border);
    border-radius: 3px;
}

.messages-container::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* Loading animation */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    color: var(--text-color);
}

.loading img {
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

footer {
    padding: 1.5rem;
    text-align: center;
    border-top: 1px solid var(--card-border);
    background: var(--card-bg);
    margin-top: 2rem;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.social-link {
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.social-link:hover {
    opacity: 1;
}

.social-icon {
    width: 20px;
    height: 20px;
    filter: var(--nav-icon-filter);
}

.copyright {
    font-size: 0.9rem;
    opacity: 0.8;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(100, 108, 255, 0.2);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(100, 108, 255, 0.3);
}

/* Responsive design */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }

    .novel-container {
        flex-direction: column;
        height: auto;
    }

    .chapter-sidebar {
        width: 100%;
    }

    main {
        padding: 1rem;
    }

    .content-container, .chat-container {
        padding: 1rem;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }
}

.main-container {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    height: 100%;
}

.content-wrapper {
    display: flex;
    gap: 2rem;
    width: 100%;
    height: calc(100vh - 80px);
    padding: 0;
    max-width: none;
}

.sidebar {
    width: 250px;
    flex-shrink: 0;
    background: var(--card-bg);
    border-radius: 0;
    padding: 1rem;
    border: none;
    border-right: 1px solid var(--card-border);
    height: 100%;
    position: fixed;
    left: 0;
    top: 60px;
}

.content {
    flex: 1;
    margin-left: 250px;
    height: 100%;
}

.features-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
    max-width: 600px;
}

.feature-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    padding: 1.2rem;
    border-radius: 12px;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.feature-card h3 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: 1.3rem;
}

.feature-card p {
    font-size: 0.95rem;
    line-height: 1.5;
    opacity: 0.9;
}

.gitbook-style {
    height: 100%;
    background: var(--card-bg);
    border-radius: 8px;
    padding: 2rem 3rem;
    border: 1px solid var(--card-border);
    overflow-y: auto;
}

.gitbook-style h1,
.gitbook-style h2,
.gitbook-style h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.gitbook-style p {
    margin-bottom: 1rem;
    line-height: 1.8;
}

.gitbook-style code {
    background: rgba(100, 108, 255, 0.1);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: monospace;
}

.gitbook-style pre {
    background: rgba(0, 0, 0, 0.8);
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1rem 0;
}

.gitbook-style pre code {
    background: none;
    color: #fff;
}

.gitbook-style blockquote {
    border-left: 4px solid var(--primary-color);
    padding-left: 1rem;
    margin: 1rem 0;
    color: rgba(var(--text-color), 0.8);
}

@media (max-width: 768px) {
    .content-wrapper {
        flex-direction: column;
        padding: 1rem;
        height: auto;
    }

    .sidebar {
        width: 100%;
        position: static;
        margin-bottom: 1rem;
    }

    .novel-container {
        flex-direction: column;
        height: auto;
    }

    .chapter-sidebar {
        width: 100%;
        margin-bottom: 1rem;
    }

    .content-container {
        height: auto;
        min-height: 500px;
    }
}

/* Sci-fi elements */
.feature-card::after, .nav-link::after, .message::after, .send-button::after {
    display: none;
}

.message {
    display: inline-block;
    min-width: 60px;
    max-width: 80%;
    margin: 0.3rem 0;
    padding: 0.6rem 0.8rem;
    border-radius: 8px;
    position: relative;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.message.user {
    margin-left: auto;
    color: var(--text-color);
    border-top-right-radius: 2px;
}

.message.assistant {
    margin-right: auto;
    border-top-left-radius: 2px;
}

.message::before {
    content: '';
    position: absolute;
    top: -2px;
    width: 50%;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color), transparent);
}

.message.user::before {
    right: 0;
}

.message.assistant::before {
    left: 0;
}

.send-button {
    padding: 0.8rem 1.5rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
}

.send-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px var(--glow-color);
}

#about-section {
    height: 100%;
}

#novel-section {
    height: 100%;
}

.story-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

.story-content h1 {
    font-size: 2.8rem;
    font-weight: 700;
    background: linear-gradient(45deg, var(--primary-color), #4ade80);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 2rem;
    line-height: 1.2;
}

.story-content h2 {
    font-size: 2rem;
    font-weight: 600;
    color: var(--primary-color);
    margin: 2.5rem 0 1.5rem;
    line-height: 1.3;
}

.story-content h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary-color);
    margin: 2rem 0 1rem;
    line-height: 1.4;
}

.story-content p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-color);
    margin-bottom: 1.5rem;
    text-align: justify;
    font-family: 'Fira Code', monospace;
}

.story-content ul, 
.story-content ol {
    margin: 1.5rem 0;
    padding-left: 2rem;
}

.story-content li {
    margin-bottom: 0.5rem;
    line-height: 1.7;
}

.story-content strong {
    color: var(--primary-color);
    font-weight: 600;
}

.story-content em {
    font-style: italic;
    color: var(--text-color);
}

.story-content hr {
    margin: 2rem 0;
    border: none;
    border-top: 2px solid var(--card-border);
}

.story-content blockquote {
    border-left: 4px solid var(--primary-color);
    padding: 1rem 1.5rem;
    margin: 2rem 0;
    background: rgba(0, 220, 130, 0.05);
    border-radius: 0 12px 12px 0;
}

.story-content blockquote p {
    margin-bottom: 0;
    font-style: italic;
}

.content-container {
    height: calc(100vh - 150px);
    overflow-y: auto;
    padding: 2rem;
    background: var(--card-bg);
    border-radius: 12px;
    border: 1px solid var(--card-border);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

/* Adjust header for the new layout */
header {
    height: 60px;
    padding: 0 1.5rem;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

/* Adjust main content area */
main {
    margin-top: 60px;
    padding: 0;
    max-width: none;
}

/* Media query for responsive design */
@media (max-width: 1024px) {
    .content-wrapper {
        padding: 0 1rem;
    }

    .sidebar {
        width: 200px;
    }

    .content {
        margin-left: 200px;
    }

    .content-container {
        padding: 2rem;
    }
}

@media (max-width: 768px) {
    .content-wrapper {
        flex-direction: column;
        padding: 1rem;
    }

    .sidebar {
        position: static;
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--card-border);
    }

    .content {
        margin-left: 0;
    }

    .novel-container {
        flex-direction: column;
    }

    .chapter-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--card-border);
    }
}

/* Home page styles */
.home-content {
    display: flex;
    justify-content: center;
    align-items: center;
    height: calc(100vh - 150px);
    text-align: center;
}

.home-content h1 {
    font-size: 4rem;
    font-weight: 700;
    color: var(--primary-color);
    font-family: 'Fira Code', monospace;
}

/* Features page styles */
.features-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    max-width: 800px;
    margin: 2rem auto;
    padding: 2rem;
}

.feature-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    padding: 2rem;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary-color);
    box-shadow: 0 8px 30px rgba(0, 220, 130, 0.15);
}

.feature-card h3 {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-family: 'Fira Code', monospace;
}

.feature-card p {
    font-size: 1.1rem;
    line-height: 1.7;
    color: var(--text-color);
    font-family: 'Fira Code', monospace;
}

/* Remove shine animations */
.feature-card::after,
.nav-link::after,
.message::after,
.content-container::after {
    display: none;
}

/* 404 Error page styles */
.error-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: calc(100vh - 150px);
    text-align: center;
    font-family: 'Fira Code', monospace;
}

.error-icon {
    width: 150px;
    height: 150px;
    margin-bottom: 2rem;
    opacity: 0.8;
}

.error-content h1 {
    font-size: 6rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1rem;
    line-height: 1;
    background: linear-gradient(45deg, var(--primary-color), #4ade80);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.error-content p {
    font-size: 1.2rem;
    color: var(--text-color);
    opacity: 0.8;
    margin-top: 1rem;
} 