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

:root {
    --bg-body: #f4f4f5;
    --bg-card: #ffffff;
    --text-main: #37352f;
    --text-muted: #737373;
    --primary: #4b5563;
    /* Memos uses neutral/slate mostly, simplified */
    --accent: #10b981;
    /* Green accent */
    --border: #e5e7eb;
    --hover: #f3f4f6;
    --sidebar-w: 240px;
}

/* Dark Mode Support (Basic) */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-body: #18181b;
        --bg-card: #27272a;
        --text-main: #e4e4e7;
        --text-muted: #a1a1aa;
        --border: #3f3f46;
        --hover: #3f3f46;
    }
}

body {
    font-family: 'Roboto', sans-serif;
    margin: 0;
    background-color: var(--bg-body);
    color: var(--text-main);
    display: flex;
    justify-content: center;
    min-height: 100vh;
}

/* Layout Grid: [Sidebar] [Main Feed] [Right Panel] */
.layout {
    display: flex;
    width: 100%;
    max-width: 1200px;
    padding: 20px;
    gap: 30px;
}

/* --- Sidebar --- */
.sidebar {
    width: var(--sidebar-w);
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: sticky;
    top: 20px;
    height: fit-content;
}

.logo {
    font-size: 1.25rem;
    font-weight: 700;
    padding: 0 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--text-main);
    text-decoration: none;
    font-weight: 500;
    transition: background 0.1s;
    cursor: pointer;
}

.nav-item:hover,
.nav-item.active {
    background-color: var(--hover);
}

.nav-icon {
    width: 20px;
    text-align: center;
}

.section-title {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 10px 12px 5px;
}

.tag-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.tag-item {
    padding: 6px 12px;
    font-size: 0.9rem;
    color: var(--text-muted);
    border-radius: 6px;
    cursor: pointer;
}

.tag-item:hover {
    background-color: var(--hover);
    color: var(--text-main);
}

/* --- Main Feed --- */
.main-feed {
    flex: 1;
    max-width: 600px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Editor */
.editor-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

textarea {
    width: 100%;
    border: none;
    resize: none;
    outline: none;
    font-size: 1rem;
    background: transparent;
    color: var(--text-main);
    font-family: inherit;
    min-height: 80px;
}

.editor-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tools {
    display: flex;
    gap: 8px;
}

.tool-btn {
    padding: 6px;
    border-radius: 6px;
    cursor: pointer;
    color: var(--text-muted);
    background: transparent;
    border: none;
    font-size: 1.1rem;
}

.tool-btn:hover {
    background-color: var(--hover);
    color: var(--text-main);
}

.post-btn {
    background-color: var(--accent);
    color: white;
    border: none;
    padding: 6px 16px;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.2s;
}

.post-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

select {
    padding: 6px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-right: 8px;
}

/* Memo List */
.memo-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.memo-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    position: relative;
    transition: box-shadow 0.2s;
}

.memo-card:hover {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
}

.memo-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.author-name {
    font-weight: 600;
    color: var(--text-main);
}

.memo-meta {
    display: flex;
    align-items: center;
    gap: 8px;
}

.memo-content {
    font-size: 1rem;
    line-height: 1.6;
    word-break: break-word;
    color: var(--text-main);
}

/* Markdown Styles */
.markdown-body p {
    margin-bottom: 8px;
}

.markdown-body ul,
.markdown-body ol {
    padding-left: 20px;
    margin-bottom: 8px;
}

.markdown-body pre {
    background: var(--hover);
    padding: 12px;
    border-radius: 8px;
    overflow-x: auto;
    font-size: 0.9rem;
}

.markdown-body blockquote {
    border-left: 3px solid var(--border);
    padding-left: 12px;
    color: var(--text-muted);
    margin: 8px 0;
}

.markdown-body a {
    color: var(--accent);
    text-decoration: none;
}

.markdown-body a:hover {
    text-decoration: underline;
}

/* Images */
.resource-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 8px;
    margin-top: 12px;
}

.resource-img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--border);
    cursor: pointer;
}

/* --- Right Panel (Stats) --- */
.right-panel {
    width: 200px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.stats-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
}

.stats-header {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 12px;
}

.heatmap {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
}

.day-box {
    width: 10px;
    height: 10px;
    background-color: var(--border);
    border-radius: 2px;
    opacity: 0.5;
}

.day-box.active {
    background-color: var(--accent);
    opacity: 1;
}

.hidden {
    display: none;
}

.error {
    color: #f43f5e;
    font-size: 0.9rem;
    margin-top: 8px;
}

/* Login/Landing Styles Override for simple pages */
.auth-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 40px;
    width: 100%;
    max-width: 400px;
    margin: 80px auto;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.auth-container h2 {
    margin-bottom: 20px;
}

.auth-container input {
    background: var(--bg-body);
    border: 1px solid var(--border);
    color: var(--text-main);
    box-shadow: none;
}

/* ... Previous styles ... */
/* --- Landing Page Styles --- */
.landing-page {
    display: block;
    /* Override flex centered layout if needed, or adjust */
    background-color: var(--bg-body);
}

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

.lp-logo {
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.lp-links {
    display: flex;
    gap: 20px;
    align-items: center;
}

.lp-btn-primary {
    background-color: var(--accent);
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    border: none;
    font-weight: 500;
    cursor: pointer;
    font-size: 0.95rem;
    transition: opacity 0.2s;
}

.lp-btn-primary:hover {
    opacity: 0.9;
}

.lp-btn-secondary {
    background-color: white;
    color: var(--text-main);
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid var(--border);
    text-decoration: none;
    font-weight: 500;
    transition: background 0.2s;
}

.lp-btn-secondary:hover {
    background-color: var(--hover);
}

.lp-btn-primary.large,
.lp-btn-secondary.large {
    padding: 12px 24px;
    font-size: 1.1rem;
}

.lp-btn-primary.full {
    width: 100%;
}

.lp-hero {
    text-align: center;
    padding: 80px 20px 40px;
    max-width: 800px;
    margin: 0 auto;
}

.lp-title {
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 24px;
    color: var(--text-main);
}

.lp-subtitle {
    font-size: 1.25rem;
    color: var(--text-muted);
    margin-bottom: 40px;
    line-height: 1.6;
}

.lp-cta-group {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-bottom: 60px;
}

.lp-preview {
    margin-top: 40px;
    display: flex;
    justify-content: center;
}

.lp-screenshot-placeholder {
    width: 100%;
    max-width: 800px;
    height: 400px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.lp-fake-ui-header {
    height: 36px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding-left: 12px;
    background: var(--hover);
}

.ui-dots span {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #d4d4d8;
    margin-right: 6px;
}

.lp-fake-ui-body {
    flex: 1;
    display: flex;
}

.fake-sidebar {
    width: 200px;
    border-right: 1px solid var(--border);
    background: var(--bg-body);
    opacity: 0.5;
}

.fake-feed {
    flex: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.fake-card {
    height: 80px;
    background: var(--hover);
    border-radius: 8px;
    width: 80%;
}

.lp-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    max-width: 1000px;
    margin: 60px auto;
    padding: 0 20px;
}

.feature-card {
    background: var(--bg-card);
    padding: 24px;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.feature-icon {
    font-size: 2rem;
    margin-bottom: 16px;
}

.feature-card h3 {
    margin-bottom: 12px;
    font-weight: 600;
}

.feature-card p {
    color: var(--text-muted);
    line-height: 1.5;
}

.lp-pricing {
    background: var(--bg-card);
    padding: 80px 20px;
    text-align: center;
    border-top: 1px solid var(--border);
    margin-top: 80px;
}

.lp-pricing h2 {
    margin-bottom: 40px;
    font-size: 2rem;
}

.lp-pricing-card {
    max-width: 360px;
    margin: 0 auto;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 32px;
    background: var(--bg-body);
}

.price-tag {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 24px;
}

.lp-pricing-card ul {
    list-style: none;
    padding: 0;
    margin-bottom: 32px;
    text-align: left;
}

.lp-pricing-card li {
    margin-bottom: 12px;
    color: var(--text-muted);
}

.lp-footer {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.status-indicator {
    display: inline-block;
    margin-top: 8px;
    font-weight: 500;
}


/* --- Pricing Card --- */
.pricing-card {
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(20px);
    max-width: 380px;
    width: 100%;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
}

.pricing-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
}

.pricing-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
    border-color: rgba(255, 255, 255, 0.15);
}

.price {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 8px;
    color: #fff;
    letter-spacing: -0.02em;
}

.period {
    font-size: 1rem;
    color: var(--text-muted);
    font-weight: 500;
    vertical-align: middle;
}

.features {
    list-style: none;
    padding: 0;
    text-align: left;
    margin: 32px 0;
    border-top: 1px solid var(--glass-border);
    border-bottom: 1px solid var(--glass-border);
    padding-top: 24px;
    padding-bottom: 24px;
}

.features li {
    margin-bottom: 14px;
    color: #e2e8f0;
    display: flex;
    align-items: center;
    font-size: 0.95rem;
}

.features li::before {
    content: '✓';
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    color: #818cf8;
    background: rgba(129, 140, 248, 0.1);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    font-size: 12px;
    font-weight: bold;
}

/* --- Button --- */
.cta-btn,
button {
    background: #fff;
    color: #000;
    border: none;
    padding: 16px 24px;
    border-radius: 12px;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    width: 100%;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.1);
}

.cta-btn:hover,
button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 255, 255, 0.2);
    background: #ffffff;
}

.cta-btn:active,
button:active {
    transform: translateY(0);
}

/* Form Styles */
input {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--glass-border);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
    color: white;
    padding: 14px 16px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

input:focus {
    outline: none;
    border-color: var(--primary);
}

/* Dashboard & Auth Containers */
.auth-container,
.card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(16px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    h1 {
        font-size: 3rem;
    }

    .hero {
        padding-top: 120px;
    }

    nav {
        padding: 20px;
    }
}