/* Blog Stylesheet */

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

:root {
    --primary: #0066cc;
    --primary-dark: #0052a3;
    --danger: #dc3545;
    --success: #28a745;
    --info: #17a2b8;
    --light: #f8f9fa;
    --border: #dee2e6;
    --text: #333;
}

html {
    font-size: 16px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--text);
    background: #fafafa;
    line-height: 1.6;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Navigation */
.navbar {
    background: white;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

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

.nav-brand a {
    font-size: 1.5rem;
    font-weight: bold;
    text-decoration: none;
    color: var(--primary);
}

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

.nav-link {
    text-decoration: none;
    color: var(--text);
    transition: color 0.2s;
}

.nav-link:hover {
    color: var(--primary);
}

.user-greeting {
    font-size: 0.9rem;
    color: #666;
}

/* Alerts */
.alert {
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 5px;
    border-left: 4px solid;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border-left-color: var(--success);
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border-left-color: var(--danger);
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border-left-color: var(--info);
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

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

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 1rem;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

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

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: var(--primary);
    color: white;
    text-decoration: none;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.2s;
}

.btn:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: #6c757d;
}

.btn-secondary:hover {
    background: #5a6268;
}

/* Auth Container */
.auth-container {
    max-width: 400px;
    margin: 2rem auto;
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.auth-container h2 {
    margin-bottom: 1.5rem;
}

.auth-container p {
    margin-top: 1rem;
    text-align: center;
}

.auth-container a {
    color: var(--primary);
    text-decoration: none;
}

.auth-container a:hover {
    text-decoration: underline;
}

/* Search */
.search-section {
    margin: 2rem 0;
}

.search-form {
    display: flex;
    gap: 0.5rem;
}

.search-form input {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 1rem;
}

/* Posts List */
.posts-list {
    margin: 2rem 0;
}

.post-preview {
    background: white;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: box-shadow 0.2s;
}

.post-preview:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.post-preview h2 {
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
}

.post-preview h2 a {
    color: var(--primary);
    text-decoration: none;
}

.post-preview h2 a:hover {
    text-decoration: underline;
}

.post-meta {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 1rem;
}

.post-preview p {
    color: #555;
    margin-bottom: 1rem;
    line-height: 1.6;
}

.read-more {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.read-more:hover {
    text-decoration: underline;
}

/* Single Post */
.post-single {
    background: white;
    padding: 2rem;
    margin-bottom: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.post-single h1 {
    margin-bottom: 0.5rem;
    font-size: 2rem;
}

.post-content {
    margin-top: 2rem;
    line-height: 1.8;
    color: #444;
}

.post-content p {
    margin-bottom: 1rem;
}

.post-content strong {
    font-weight: 600;
}

.post-content em {
    font-style: italic;
}

/* Comments */
.comments-section {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.comments-section h3 {
    margin-bottom: 1.5rem;
}

.comment-form {
    background: var(--light);
    padding: 1.5rem;
    margin-bottom: 2rem;
    border-radius: 5px;
}

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

.comment-form textarea {
    resize: vertical;
}

.comments-list {
    margin-top: 2rem;
}

.comment {
    background: var(--light);
    padding: 1.5rem;
    margin-bottom: 1rem;
    border-radius: 5px;
    border-left: 4px solid var(--primary);
}

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

.comment-header strong {
    font-size: 1rem;
}

.comment-date {
    font-size: 0.85rem;
    color: #666;
}

.delete-link {
    color: var(--danger);
    text-decoration: none;
    font-size: 0.85rem;
}

.delete-link:hover {
    text-decoration: underline;
}

.comment-body {
    color: #555;
    line-height: 1.6;
}

.no-comments {
    color: #666;
    font-style: italic;
    text-align: center;
    padding: 2rem;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.page-link {
    padding: 0.5rem 0.75rem;
    background: white;
    color: var(--primary);
    text-decoration: none;
    border: 1px solid var(--border);
    border-radius: 4px;
    transition: all 0.2s;
}

.page-link:hover {
    background: var(--primary);
    color: white;
}

.page-info {
    padding: 0.5rem 0.75rem;
    background: var(--light);
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 0.9rem;
}

/* Footer */
footer {
    background: #333;
    color: white;
    text-align: center;
    padding: 2rem 1rem;
    margin-top: 3rem;
}

footer p {
    margin: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .navbar .container {
        flex-direction: column;
        gap: 1rem;
    }

    .nav-links {
        flex-direction: column;
        gap: 0.75rem;
        width: 100%;
    }

    .search-form {
        flex-direction: column;
    }

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

    .post-single,
    .comments-section {
        padding: 1rem;
    }

    .post-single h1 {
        font-size: 1.5rem;
    }

    .comment-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .pagination {
        font-size: 0.9rem;
    }

    .page-link,
    .page-info {
        padding: 0.4rem 0.6rem;
        font-size: 0.9rem;
    }
}
