/* Reset */
html,
body,
div,
span,
applet,
object,
iframe,
h1,
h2,
h3,
h4,
h5,
h6,
p,
blockquote,
pre,
a,
abbr,
acronym,
address,
big,
cite,
code,
del,
dfn,
em,
img,
ins,
kbd,
q,
s,
samp,
small,
strike,
strong,
sub,
sup,
tt,
var,
b,
u,
i,
center,
dl,
dt,
dd,
ol,
ul,
li,
fieldset,
form,
label,
legend,
table,
caption,
tbody,
tfoot,
thead,
tr,
th,
td,
article,
aside,
canvas,
details,
embed,
figure,
figcaption,
footer,
header,
hgroup,
menu,
nav,
output,
ruby,
section,
summary,
time,
mark,
audio,
video {
    margin: 0;
    padding: 0;
    border: 0;
    font-size: 100%;
    vertical-align: baseline;
}

article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
menu,
nav,
section {
    display: block;
}

body {
    line-height: 1;
}

ol,
ul {
    list-style: none;
}

blockquote,
q {
    quotes: none;
}

blockquote:before,
blockquote:after,
q:before,
q:after {
    content: "";
    content: none;
}

table {
    border-collapse: collapse;
    border-spacing: 0;
}

/* Base Styles */
html,
body {
    font-family: "Source Code Pro", monospace;
    font-size: 16px;
    line-height: 1.5;
    background-color: #fff;
    color: #333;
}

@media (max-width: 1024px) {
    html,
    body {
        font-size: 14px;
    }
}

@media (max-width: 768px) {
    html,
    body {
        font-size: 13px;
    }
}

@media (max-width: 400px) {
    html,
    body {
        font-size: 12px;
    }
}

.Site {
    max-width: 880px;
    margin: 0 auto;
    padding: 2rem;
}

a {
    color: #9333ea;
    text-decoration: none;
}

a:hover {
    color: rgba(147, 51, 234, 0.8);
}

p {
    margin-bottom: 1rem;
}

h1,
h2,
h3 {
    font-weight: bold;
}

h4,
h5,
h6 {
    font-weight: bolder;
}

h1 {
    font-size: 1.6rem;
    margin-top: 3rem;
    margin-bottom: 1.5rem;
}

h2 {
    font-size: 1.5rem;
    margin-top: 1rem;
    margin-bottom: 1rem;
}

h3 {
    font-size: 1.4rem;
    margin-top: 1rem;
    margin-bottom: 1rem;
}

h4 {
    font-size: 1.2rem;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

/* Header */
.Header {
    margin-bottom: 0.75rem;
}

.Header-border {
    opacity: 0.4;
    margin-top: 0.4rem;
    overflow: hidden;
    user-select: none;
}

.Header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.Header-logo {
    font-size: 2.2rem;
}

.Header-logo a {
    color: #333;
}

.Header-logo a:hover {
    color: #9333ea;
}

.Header-nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    font-size: 1.3rem;
}

@media (max-width: 400px) {
    .Header-nav {
        font-size: 1.1rem;
        gap: 1rem;
    }
}

.Header-nav a {
    color: #333;
    opacity: 0.4;
}

.Header-nav a:hover {
    color: #9333ea;
    opacity: 1;
}

@media (max-width: 400px) {
    .Header-logo {
        font-size: 1.8rem;
    }
}

/* Footer */
.Footer {
    margin-top: 2rem;
}

.Footer-border {
    opacity: 0.4;
    margin-bottom: 1em;
    overflow: hidden;
    user-select: none;
}

.Footer-inner {
    display: flex;
    justify-content: space-between;
}

.Footer-inner a {
    color: #333;
    opacity: 0.4;
}

.Footer-inner a:hover {
    color: #9333ea;
    opacity: 1;
}

/* Home */
.Home-about {
    font-size: 1.2rem;
}

.Home-posts {
    margin-bottom: 4rem;
}

.Home-posts:last-child {
    margin-bottom: 0;
}

.Home-posts-title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    font-weight: bold;
}

.Home-posts-post {
    font-size: 1.2rem;
    margin-bottom: 0.25rem;
}

.Home-posts-post-date {
    opacity: 0.8;
}

.Home-posts-post-arrow {
    opacity: 0.5;
}

.Home-posts-post-title {
    color: #9333ea;
}

.Home-posts-post-title:hover {
    color: rgba(147, 51, 234, 0.8);
}

.item-tags {
    opacity: 0.6;
    font-size: 0.9rem;
    margin-left: 0.5ch;
}

/* Submit Form */
.submit-section {
    margin-bottom: 2rem;
}

.submit-toggle {
    padding: 0.75rem 1.5rem;
    background: #9333ea;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    font-family: "Source Code Pro", monospace;
}

.submit-toggle:hover {
    background: rgba(147, 51, 234, 0.8);
}

.submit-form {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 1.5rem;
    margin-top: 1rem;
}

.submit-form.hidden {
    display: none;
}

.submit-form h3 {
    margin: 0 0 0.5rem 0;
}

.form-description {
    margin: 0 0 1.5rem 0;
    color: #666;
    font-size: 0.875rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.form-group input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
    font-family: "Source Code Pro", monospace;
    box-sizing: border-box;
}

.form-group input:focus {
    outline: none;
    border-color: #9333ea;
}

.form-group small {
    display: block;
    margin-top: 0.25rem;
    color: #666;
    font-size: 0.75rem;
}

.form-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

.submit-btn {
    padding: 0.75rem 1.5rem;
    background: #9333ea;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    font-family: "Source Code Pro", monospace;
    flex: 1;
}

.submit-btn:hover {
    background: rgba(147, 51, 234, 0.8);
}

.cancel-btn {
    padding: 0.75rem 1.5rem;
    background: #eee;
    color: #222;
    border: 1px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    font-family: "Source Code Pro", monospace;
}

.cancel-btn:hover {
    background: #ddd;
}

/* AI Form Fill */
.form-group textarea {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
    font-family: "Source Code Pro", monospace;
    box-sizing: border-box;
    resize: vertical;
}

.form-group textarea:focus {
    outline: none;
    border-color: #9333ea;
}

.ai-fill-section {
    margin: 1.5rem 0;
}

.ai-fill-btn {
    width: 100%;
    padding: 0.875rem 1.5rem;
    background: linear-gradient(135deg, #7c3aed 0%, #9333ea 100%);
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 600;
    font-family: "Source Code Pro", monospace;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(147, 51, 234, 0.3);
}

.ai-fill-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #6d28d9 0%, #7c3aed 100%);
    box-shadow: 0 4px 12px rgba(147, 51, 234, 0.4);
    transform: translateY(-1px);
}

.ai-fill-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.ai-fill-loading {
    display: inline-block;
}

.hidden {
    display: none !important;
}

.form-divider {
    display: flex;
    align-items: center;
    margin: 1.5rem 0;
    color: #666;
    font-size: 0.875rem;
}

.form-divider::before,
.form-divider::after {
    content: "";
    flex: 1;
    border-bottom: 1px solid #ddd;
}

.form-divider span {
    padding: 0 1rem;
}

/* Filters */
.Home-posts-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.date-filter-inline {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    opacity: 0.8;
}

.date-filter-inline label {
    font-weight: normal;
}

.date-filter-inline input {
    padding: 0.25rem 0.5rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-family: "Source Code Pro", monospace;
    font-size: 0.9rem;
}

.date-filter-inline input:focus {
    outline: none;
    border-color: #9333ea;
}

.date-filter-inline button {
    padding: 0.25rem 0.75rem;
    background: #eee;
    border: 1px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
    font-family: "Source Code Pro", monospace;
    font-size: 0.9rem;
}

.date-filter-inline button:hover {
    background: #ddd;
}

.tag-filters {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tag-filters span {
    font-weight: 500;
}

#tag-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tag-btn {
    padding: 0.25rem 0.75rem;
    background: #eee;
    border: 1px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.875rem;
    font-family: "Source Code Pro", monospace;
}

.tag-btn:hover {
    background: #ddd;
}

.tag-btn.active {
    background: #9333ea;
    color: #fff;
    border-color: #9333ea;
}

/* Events */
.Events {
    margin-bottom: 2rem;
}

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

.Events-section:last-child {
    margin-bottom: 0;
}

.Events-section-title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    font-weight: bold;
}

.Events-list {
    margin-bottom: 1rem;
}

.Events-event {
    font-size: 1.2rem;
    margin-bottom: 0.25rem;
}

.Events-event-date {
    opacity: 0.8;
}

.Events-event-arrow {
    opacity: 0.5;
    margin: 0 0.5ch;
}

.Events-event-title {
    color: #9333ea;
}

.Events-event-title:hover {
    color: rgba(147, 51, 234, 0.8);
}

.Events-empty {
    opacity: 0.6;
    font-style: italic;
}

/* Feed */
.Feed {
    margin-bottom: 2rem;
}

.Feed-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.Feed-title {
    font-size: 1.5rem;
    font-weight: bold;
    margin: 0;
}

.follow-btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: #9333ea;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 0.9rem;
    font-family: "Source Code Pro", monospace;
    text-decoration: none;
    cursor: pointer;
}

.follow-btn:hover {
    background: rgba(147, 51, 234, 0.8);
    color: #fff;
}

.Feed-loading {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 2rem;
    opacity: 0.7;
}

.Feed-loading-spinner {
    width: 1rem;
    height: 1rem;
    border: 2px solid #ccc;
    border-top-color: #9333ea;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.Feed-error {
    padding: 2rem;
    text-align: center;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 4px;
}

.Feed-error p {
    margin-bottom: 1rem;
    color: #991b1b;
}

.retry-btn {
    padding: 0.5rem 1rem;
    background: #eee;
    color: #333;
    border: 1px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
    font-family: "Source Code Pro", monospace;
}

.retry-btn:hover {
    background: #ddd;
}

.Feed-notes {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.Feed-note {
    padding: 1rem;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    background: #fff;
    transition: background 0.15s ease;
}

.Feed-note:hover {
    background: #fafafa;
}

.Feed-note--repost {
    border-color: #e9d5ff;
    background: #fdf4ff;
}

.Feed-note--repost:hover {
    background: #faf5ff;
}

.Feed-note-repost-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    color: #7c3aed;
    margin-bottom: 0.75rem;
    padding-left: 3.25rem;
}

.Feed-note-repost-label svg {
    flex-shrink: 0;
}

.Feed-note-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.Feed-note-author {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: inherit;
}

.Feed-note-author:hover .Feed-note-author-name {
    color: #9333ea;
}

.Feed-note-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    background: #e5e5e5;
}

.Feed-note-avatar--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #9333ea 0%, #c084fc 100%);
    color: #fff;
    font-weight: 600;
    font-size: 1.25rem;
}

.Feed-note-author-info {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}

.Feed-note-author-name {
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.Feed-note-author-handle {
    font-size: 0.85rem;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.Feed-note-time {
    font-size: 0.85rem;
    color: #666;
    white-space: nowrap;
    flex-shrink: 0;
}

.Feed-note-content {
    line-height: 1.6;
    word-wrap: break-word;
    overflow-wrap: break-word;
    padding-left: 3.25rem;
}

.Feed-note-content a {
    word-break: break-all;
}

.Feed-note-content .nostr-mention {
    background: #f3e8ff;
    padding: 0.1em 0.3em;
    border-radius: 3px;
    font-size: 0.9em;
}

.Feed-note-images {
    margin-top: 0.75rem;
    padding-left: 3.25rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.Feed-note-image {
    max-width: 100%;
    max-height: 300px;
    border-radius: 8px;
    object-fit: contain;
    border: 1px solid #e5e5e5;
}

@media (max-width: 500px) {
    .Feed-note-avatar {
        width: 40px;
        height: 40px;
    }

    .Feed-note-content,
    .Feed-note-images,
    .Feed-note-repost-label {
        padding-left: 0;
        margin-top: 0.75rem;
    }

    .Feed-note-repost-label {
        margin-top: 0;
        margin-bottom: 0.5rem;
    }
}

.Feed-actions {
    margin-top: 1.5rem;
    text-align: center;
}

.load-more-btn {
    padding: 0.75rem 2rem;
    background: #eee;
    color: #333;
    border: 1px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    font-family: "Source Code Pro", monospace;
}

.load-more-btn:hover {
    background: #ddd;
}
