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

html,
body {
    height: 100%;
    font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
    color: #111;
    background: #f6f7fb;
}

.container {
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 15px;
}

.site-footer .container {
    min-height: 0px;
}

.site-header {
    width: 100%;
    margin: 0 auto;
    padding: 1rem;
    background: white;
    border-bottom: 1px solid #e6e9ef;
    position: sticky;
    top: 0;
    z-index: 10;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.logo {
    font-weight: 700;
    color: #0f172a;
    text-decoration: none;
    font-size: 1.25rem;
}

nav ul {
    min-width: 250px;
    list-style: none;
    display: flex;
    justify-content: space-around;
    gap: 10px;
}

nav ul a {
    text-decoration: none;
}

.main-grid {
    width: 100%;
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 1.25rem;
    padding: 1.25rem 0.5rem;
}

.sidebar {
    background: white;
    padding: 1rem;
    border-radius: 10px;
    box-shadow: 0 6px 18px rgba(20, 20, 50, 0.04);
    height: fit-content;
}

.content-area {
    background: white;
    padding: 1.25rem;
    border-radius: 10px;
    box-shadow: 0 6px 18px rgba(20, 20, 50, 0.04);
}

.search label {
    display: block;
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
    color: #374151;
}

#searchInput {
    width: 100%;
    padding: 0.5rem;
    border-radius: 8px;
    border: 1px solid #e6e9ef;
}

.categories h3,
.recent-posts h3 {
    margin-bottom: 0.5rem;
    color: #0f172a;
}

.categories ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.categories li button {
    border: none;
    background: #eef2ff;
    padding: 0.5rem 0.6rem;
    border-radius: 8px;
    cursor: pointer;
    text-align: left;
}

.categories li button.active {
    background: #c7d2fe;
}

button#clearFilter {
    margin-top: 0.5rem;
}

.post-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.post-list li a {
    display: block;
    padding: 0.5rem;
    border-radius: 8px;
    text-decoration: none;
    color: #0f172a;
    border: 1px solid transparent;
}

.post-list li a:hover {
    background: #f8fafc;
    border-color: #e6eefb;
}

.post-view h1 {
    font-size: 1.7rem;
    margin-bottom: 0.35rem;
}

.post-meta {
    color: #6b7280;
    font-size: 0.9rem;
    margin-bottom: 0.8rem;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
}

.post-actions {
    display: flex;
    gap: 0.5rem;
}

.post-image {
    width: 100%;
    height: 300px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.post-content {
    line-height: 1.7;
    color: #111827;
    margin-bottom: 1.25rem;
}

.tag {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    background: #eff6ff;
    margin-right: 0.5rem;
    font-size: 0.85rem;
}

.comments {
    margin-top: 1.25rem;
    border-top: 1px dashed #e6e9ef;
    padding-top: 1rem;
}

.comment-form {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.comment-form input,
.comment-form textarea {
    padding: 0.6rem;
    border-radius: 8px;
    border: 1px solid #e6e9ef;
    width: 100%;
}

.comment {
    background: #fbfcff;
    padding: 0.75rem;
    border-radius: 8px;
    margin-top: 0.5rem;
    border: 1px solid #eef2ff;
}

.comment .who {
    font-weight: 600;
    font-size: 0.95rem;
}

.comment .when {
    color: #6b7280;
    font-size: 0.85rem;
}

.site-footer {
    margin-top: 1.5rem;
    text-align: center;
    color: #6b7280;
    padding: 1rem 0;
}

.comment .post-actions {
    flex-direction: row-reverse;
    justify-content: flex-end;
}

.small-btn {
    padding: 0.4rem 0.6rem;
    border-radius: 8px;
    border: 1px solid #e6e9ef;
    background: white;
    cursor: pointer;
}

.share-buttons {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

@media (max-width: 880px) {
    .main-grid {
        grid-template-columns: 1fr;
    }

    .post-image {
        height: 200px;
    }
}

/* Authentication */
.auth-container {
    width: 100%;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

#loginForm, #signupForm {
    width: 90%;
    max-width: 330px;
    min-height: 280px;
    padding: 0.6rem;
    border-radius: 1.2rem;
    background-color: white;
    box-shadow: 0 0 15px 3px rgba(20, 20, 50, 0.04);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 0.8rem
}

#loginForm input,  #signupForm input {
    width: 100%;
    padding: 0.5rem;
    border-radius: 0.5rem;
    border: 1px solid #e6e9ef;
}

#loginForm button, #signupForm button {
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
}

#loginForm a, #signupForm a {
    text-decoration: none;
}

.logout-btn {
  background-color: #ff4444;
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 5px;
  cursor: pointer;
}

.logout-btn:hover {
  background-color: #cc0000;
}

.logout-btn:active {
    transform: scale(0.9);
}