/* NoteSurf Web — Dark Theme */

:root {
    --bg: #0a0a0a;
    --fg: #e5e5e5;
    --fg-muted: #737373;
    --accent: #f59e0b;
    --accent-hover: #d97706;
    --surface: #141414;
    --surface-2: #1a1a1a;
    --border: #262626;
    --border-focus: #404040;
    --danger: #ef4444;
    --danger-hover: #dc2626;
    --success: #22c55e;
    --radius: 8px;
    --radius-lg: 12px;
    --max-width: 1200px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--fg);
    line-height: 1.6;
    min-height: 100vh;
}

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

/* Navigation */
.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.5rem;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--fg);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-brand svg { width: 24px; height: 24px; }
.nav-logo { width: 28px; height: 28px; border-radius: 6px; }

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

.nav-user {
    color: var(--fg-muted);
    font-size: 0.875rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--fg);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
    font-family: inherit;
}

.btn:hover { background: var(--surface-2); border-color: var(--border-focus); }

.btn-primary {
    background: var(--accent);
    color: #000;
    border-color: var(--accent);
    font-weight: 600;
}

.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #000; }

.btn-danger {
    background: transparent;
    color: var(--danger);
    border-color: var(--danger);
}

.btn-danger:hover { background: var(--danger); color: #fff; }

.btn-ghost {
    background: transparent;
    border-color: transparent;
    color: var(--fg-muted);
}

.btn-ghost:hover { color: var(--fg); background: var(--surface-2); }

.btn-sm { padding: 0.25rem 0.625rem; font-size: 0.8125rem; }

/* Forms */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.form-group label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--fg-muted);
}

.input {
    padding: 0.625rem 0.75rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--fg);
    font-size: 0.9375rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.15s;
}

.input:focus { border-color: var(--accent); }
.input::placeholder { color: var(--fg-muted); }

/* Auth pages */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem 1rem;
}

.auth-card {
    width: 100%;
    max-width: 400px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
}

.auth-card h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.auth-card .subtitle {
    color: var(--fg-muted);
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
}

.auth-card form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.auth-card .form-footer {
    text-align: center;
    margin-top: 1rem;
    font-size: 0.875rem;
    color: var(--fg-muted);
}

.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--danger);
}

.alert-success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: var(--success);
}

/* Notes list page */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    max-width: var(--max-width);
    margin: 0 auto;
}

.page-header h1 { font-size: 1.5rem; font-weight: 700; }

.search-bar {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem 1rem;
}

.search-bar .input { width: 100%; }

.notes-grid {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem 2rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 0.75rem;
}

.note-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    text-decoration: none;
    color: inherit;
}

.note-card:hover { border-color: var(--border-focus); background: var(--surface-2); }
.note-card.pinned { border-left: 3px solid var(--accent); }

.note-card .note-title {
    font-weight: 600;
    font-size: 0.9375rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.note-card .note-preview {
    color: var(--fg-muted);
    font-size: 0.8125rem;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.note-card .note-meta {
    color: var(--fg-muted);
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: auto;
}

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--fg-muted);
    max-width: var(--max-width);
    margin: 0 auto;
}

.empty-state h2 { font-size: 1.25rem; margin-bottom: 0.5rem; color: var(--fg); }
.empty-state p { margin-bottom: 1.5rem; }

/* Note editor page */
.editor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.5rem;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    gap: 1rem;
}

.editor-header .back-link {
    color: var(--fg-muted);
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.editor-header .back-link:hover { color: var(--fg); }

.editor-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.save-status {
    font-size: 0.8125rem;
    color: var(--fg-muted);
    padding: 0.25rem 0.5rem;
}

.save-status.saving { color: var(--accent); }
.save-status.saved { color: var(--success); }
.save-status.error { color: var(--danger); }

.editor-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 120px);
}

.editor-title {
    font-size: 1.5rem;
    font-weight: 700;
    padding: 0.5rem 0;
    border: none;
    background: transparent;
    color: var(--fg);
    outline: none;
    width: 100%;
    font-family: inherit;
}

.editor-title::placeholder { color: var(--fg-muted); }

.editor-content {
    flex: 1;
    padding: 0.75rem 0;
    border: none;
    background: transparent;
    color: var(--fg);
    font-size: 0.9375rem;
    line-height: 1.7;
    resize: none;
    outline: none;
    width: 100%;
    font-family: inherit;
}

.editor-content::placeholder { color: var(--fg-muted); }

/* Dialog/Modal */
dialog.modal {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    color: var(--fg);
    max-width: 400px;
    width: calc(100% - 2rem);
}

dialog.modal::backdrop { background: rgba(0, 0, 0, 0.6); }

dialog.modal h2 { font-size: 1.125rem; margin-bottom: 0.75rem; }
dialog.modal p { color: var(--fg-muted); font-size: 0.875rem; margin-bottom: 1.25rem; }

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

/* Pin indicator */
.pin-icon { color: var(--accent); font-size: 0.75rem; }

/* Landing page */
.landing {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.landing-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    border-bottom: 1px solid var(--border);
}

.landing-nav-links {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.hero {
    text-align: center;
    padding: 6rem 2rem 4rem;
    max-width: 640px;
    margin: 0 auto;
}

.hero h1 {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.02em;
    margin-bottom: 1.25rem;
}

.hero-sub {
    font-size: 1.125rem;
    color: var(--fg-muted);
    line-height: 1.7;
    margin-bottom: 2rem;
}

.hero-actions {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

.features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 2rem 4rem;
}

.feature {
    text-align: center;
    padding: 1.5rem;
}

.feature-icon {
    color: var(--accent);
    margin-bottom: 1rem;
}

.feature h3 {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.feature p {
    color: var(--fg-muted);
    font-size: 0.9375rem;
    line-height: 1.6;
}

/* Download section */
.download-section {
    text-align: center;
    padding: 4rem 2rem;
    border-top: 1px solid var(--border);
}

.download-section h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.download-section > p {
    color: var(--fg-muted);
    margin-bottom: 2rem;
}

.download-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    max-width: 900px;
    margin: 0 auto;
}

.download-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.download-card svg { color: var(--accent); }

.download-card h3 {
    font-size: 1.125rem;
    font-weight: 700;
}

.download-card p {
    color: var(--fg-muted);
    font-size: 0.875rem;
    line-height: 1.5;
    margin-bottom: 0.5rem;
}

.download-card .btn { width: 100%; justify-content: center; }

.download-meta {
    font-size: 0.75rem;
    color: var(--fg-muted);
    margin-top: 0.25rem;
}

.download-card-soon { opacity: 0.5; }

.btn-disabled {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--fg-muted);
    font-size: 0.875rem;
    cursor: default;
    font-family: inherit;
}

.cta-section {
    text-align: center;
    padding: 4rem 2rem;
    border-top: 1px solid var(--border);
}

.cta-section h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.cta-section p {
    color: var(--fg-muted);
    margin-bottom: 1.5rem;
}

.landing-footer {
    margin-top: auto;
    text-align: center;
    padding: 2rem;
    border-top: 1px solid var(--border);
    color: var(--fg-muted);
    font-size: 0.8125rem;
}

/* Responsive */
@media (max-width: 640px) {
    .nav { padding: 0.5rem 1rem; }
    .page-header { padding: 1rem; }
    .search-bar { padding: 0 1rem 0.75rem; }
    .notes-grid { padding: 0 1rem 1.5rem; grid-template-columns: 1fr; }
    .editor-container { padding: 1rem; }
    .editor-header { padding: 0.5rem 1rem; }
    .landing-nav { padding: 0.75rem 1rem; }
    .hero { padding: 3rem 1.5rem 2rem; }
    .hero h1 { font-size: 2rem; }
    .hero-sub { font-size: 1rem; }
    .features { grid-template-columns: 1fr; gap: 1rem; padding: 1rem 1.5rem 2rem; }
    .download-cards { grid-template-columns: 1fr; gap: 1rem; }
    .download-section { padding: 2rem 1.5rem; }
}
