/* CSS Custom Properties */
:root {
    /* Colors */
    --color-primary: #1877f2;
    --color-primary-hover: #166fe5;
    --color-primary-disabled: #6c757d;
    --color-text: #1c1e21;
    --color-text-secondary: #65676b;
    --color-background: #f0f2f5;
    --color-surface: #fff;

    /* Error colors */
    --color-error-bg: #ffebe8;
    --color-error-text: #c41e3a;
    --color-error-border: #f5c2c7;

    /* Form inputs */
    --input-padding: 12px;
    --input-border-radius: 6px;
    --input-border-color: #dddfe2;
    --input-focus-border: #1877f2;

    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;

    /* Button */
    --button-padding: 12px 24px;
    --button-border-radius: 6px;
    --button-font-size: 15px;
    --button-font-weight: 600;
}

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
    line-height: 1.6;
    color: #1c1e21;
    background-color: #f0f2f5;
}

a {
    color: #1877f2;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Container */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navbar */
.navbar {
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 12px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    color: #1877f2;
}

.logo:hover {
    text-decoration: none;
}

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

.nav-links a {
    color: #65676b;
    font-weight: 500;
}

.nav-links a:hover {
    color: #1877f2;
}

.btn-new-post {
    background-color: #1877f2;
    color: white !important;
    padding: 8px 16px;
    border-radius: 6px;
}

.btn-new-post:hover {
    background-color: #166fe5;
    text-decoration: none;
}

/* Main content */
main {
    margin-top: 20px;
    margin-bottom: 40px;
    min-height: calc(100vh - 200px);
}

/* Authentication pages */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: #f0f2f5;
}

.auth-box {
    background: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1), 0 8px 16px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
}

.auth-box h1 {
    color: #1877f2;
    text-align: center;
    margin-bottom: 10px;
}

.auth-box h2 {
    text-align: center;
    margin-bottom: 20px;
    color: #1c1e21;
}

.auth-link {
    text-align: center;
    margin-top: 20px;
    color: #65676b;
}

/* Forms, Buttons, and Error styles */
@import url('forms.css');

/* Reactions */
.reactions-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
    margin-bottom: 0.5rem;
}

.reaction-button,
.add-reaction-button {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    background-color: var(--color-surface);
    border: 1px solid var(--input-border-color);
    border-radius: 12px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.reaction-button:hover,
.add-reaction-button:hover {
    background-color: var(--color-background);
    border-color: var(--color-primary);
}

.reaction-button.user-reacted {
    background-color: #e7f3ff;
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.reaction-count {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-secondary);
}

.add-reaction-button {
    color: var(--color-text-secondary);
    font-weight: 600;
}

/* Feed */
.feed h1 {
    margin-bottom: 20px;
    color: #1c1e21;
}

.empty-state {
    background: white;
    padding: 40px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.empty-state p {
    color: #65676b;
    margin-bottom: 20px;
    font-size: 16px;
}

.empty-state .btn-primary {
    width: auto;
    display: inline-block;
}

/* Post cards */
.post-card {
    background: white;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.post-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.post-author {
    font-weight: 600;
    color: #1c1e21;
}

.post-author:hover {
    text-decoration: underline;
}

.post-time {
    font-size: 13px;
    color: #65676b;
}

.post-content h2 {
    font-size: 20px;
    margin-bottom: 8px;
    color: #1c1e21;
}

.post-content h2 a {
    color: #1c1e21;
}

.post-content h2 a:hover {
    color: #1877f2;
}

.post-content p {
    color: #1c1e21;
    line-height: 1.5;
}

.post-footer {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e4e6eb;
}

/* Thread view */
.thread-post {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.thread-post h1 {
    font-size: 24px;
    margin-bottom: 12px;
    color: #1c1e21;
}

/* Reply form */
.reply-form-section {
    background: white;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.reply-form-section h3 {
    margin-bottom: 12px;
    color: #1c1e21;
}

.reply-form textarea {
    margin-bottom: 12px;
}

.reply-form .btn-primary {
    width: auto;
}

/* Replies */
.replies {
    background: white;
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.replies h3 {
    margin-bottom: 16px;
    color: #1c1e21;
}

.reply {
    border-left: 2px solid #e4e6eb;
    padding-left: 16px;
    margin-bottom: 16px;
    padding-bottom: 16px;
}

.reply:last-child {
    margin-bottom: 0;
}

.reply-header {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 8px;
}

.reply-author {
    font-weight: 600;
    color: #1c1e21;
    font-size: 14px;
}

.reply-time {
    font-size: 12px;
    color: #65676b;
}

.reply-content p {
    color: #1c1e21;
    margin-bottom: 12px;
    font-size: 14px;
    line-height: 1.5;
}

.reply-actions {
    margin-bottom: 12px;
}

.inline-reply-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.inline-reply-form textarea {
    font-size: 14px;
    padding: 8px;
}

.nested-replies {
    margin-top: 16px;
    margin-left: 12px;
}

/* Profile */
.profile-header {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.profile-header h1 {
    margin-bottom: 8px;
    color: #1c1e21;
}

.profile-info {
    color: #65676b;
    font-size: 14px;
}

.profile-posts h2 {
    margin-bottom: 16px;
    color: #1c1e21;
}

/* Footer */
footer {
    background-color: #fff;
    padding: 20px 0;
    text-align: center;
    color: #65676b;
    border-top: 1px solid #e4e6eb;
    margin-top: 40px;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }

    .auth-box {
        padding: 24px;
    }

    .nav-links {
        gap: 12px;
    }
}
