/* ============================================================================
   Alberta Birds Blog - Styles
   ============================================================================ */

/* === Reset & Base === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #2c5f2d;
    --primary-dark: #1a3d1b;
    --secondary: #7ba05b;
    --accent: #c67e3b;
    --bg: #f8f9fa;
    --text: #333;
    --text-light: #666;
    --border: #ddd;
    --white: #fff;
    --error: #dc3545;
    --success: #28a745;
    --warning: #ffc107;
    --info: #17a2b8;
}

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

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
}

/* === Header === */
header {
    background: var(--primary);
    color: var(--white);
    padding: 1.5rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

header h1 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

header h1 a {
    color: var(--white);
    text-decoration: none;
}

header nav {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

header nav a {
    color: var(--white);
    text-decoration: none;
    opacity: 0.9;
    transition: opacity 0.2s;
}

header nav a:hover {
    opacity: 1;
    text-decoration: underline;
}

/* === Main Content === */
main {
    padding: 2rem 0;
    min-height: 60vh;
}

/* === Footer === */
footer {
    background: var(--primary-dark);
    color: var(--white);
    padding: 2rem 0;
    margin-top: 3rem;
    text-align: center;
}

footer small {
    opacity: 0.8;
}

/* === Flash Messages === */
.flash-messages {
    margin-bottom: 1.5rem;
}

.alert {
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 4px;
    border: 1px solid transparent;
}

.alert-success {
    background: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.alert-error {
    background: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

.alert-warning {
    background: #fff3cd;
    border-color: #ffeeba;
    color: #856404;
}

.alert-info {
    background: #d1ecf1;
    border-color: #bee5eb;
    color: #0c5460;
}

/* === Blog Header === */
.blog-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--secondary);
}

.blog-header h2 {
    color: var(--primary);
    font-size: 2rem;
}

.blog-header .subtitle {
    color: var(--text-light);
    font-size: 1.1rem;
}

/* === Post Preview (Homepage) === */
.posts-list {
    max-width: 800px;
    margin: 0 auto;
}

.post-preview {
    background: var(--white);
    padding: 2rem;
    margin-bottom: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    border-left: 4px solid var(--secondary);
}

.post-preview h3 {
    margin-bottom: 0.5rem;
}

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

.post-preview h3 a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.post-meta {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.post-excerpt {
    margin: 1rem 0;
    line-height: 1.7;
}

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

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

.no-posts {
    text-align: center;
    color: var(--text-light);
    padding: 3rem;
}

/* === Full Post === */
.post-full {
    background: var(--white);
    padding: 2.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    max-width: 800px;
    margin: 0 auto 2rem;
}

.post-full h2 {
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.post-content {
    margin-top: 1.5rem;
    line-height: 1.8;
    font-size: 1.05rem;
}

.post-image {
    margin-top: 1.5rem;
}

.post-image img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

/* === Comments === */
.comments-section {
    max-width: 800px;
    margin: 0 auto;
}

.comments-section h3 {
    color: var(--primary);
    margin-bottom: 1.5rem;
}

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

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

.comment.bot-comment {
    border-left-color: var(--secondary);
    background: #f9fdf9;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.comment-author {
    font-weight: 600;
    color: var(--primary);
}

.comment-date {
    color: var(--text-light);
    font-size: 0.9rem;
}

.comment-content {
    line-height: 1.6;
}

.no-comments {
    text-align: center;
    color: var(--text-light);
    padding: 2rem;
    background: var(--white);
    border-radius: 4px;
}

/* === Comment Form === */
.comment-form {
    background: var(--white);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    margin-top: 2rem;
}

.comment-form h4 {
    color: var(--primary);
    margin-bottom: 1rem;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text);
}

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

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.form-group small {
    display: block;
    margin-top: 0.25rem;
    color: var(--text-light);
    font-size: 0.85rem;
}

/* Honeypot (hidden from humans) */
.honeypot {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

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

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

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

.btn-success {
    background: var(--success);
}

.btn-danger {
    background: var(--error);
}

.btn-warning {
    background: var(--warning);
    color: var(--text);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.btn-block {
    display: block;
    width: 100%;
}

.button-group {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* === Pagination === */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;
}

.page-info {
    color: var(--text-light);
}

/* === About Page === */
.about-page {
    max-width: 800px;
    margin: 0 auto;
}

.about-page h2 {
    color: var(--primary);
    margin-bottom: 1.5rem;
}

.about-content {
    background: var(--white);
    padding: 2.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    line-height: 1.8;
}

.about-content h3 {
    color: var(--primary);
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.about-content ul {
    margin-left: 2rem;
    margin-bottom: 1rem;
}

.about-content li {
    margin-bottom: 0.5rem;
}

/* === Error Pages === */
.error-page {
    text-align: center;
    padding: 4rem 2rem;
}

.error-page h2 {
    color: var(--primary);
    margin-bottom: 1rem;
}

/* === Post Navigation === */
.post-navigation {
    max-width: 800px;
    margin: 2rem auto;
}

/* ============================================================================
   ADMIN STYLES
   ============================================================================ */

.admin-body {
    background: #f4f5f7;
}

.admin-header {
    background: var(--primary-dark);
}

.admin-header h1 {
    font-size: 1.5rem;
}

.admin-content {
    padding: 2rem 0;
}

/* === Login Page === */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
}

.login-box {
    background: var(--white);
    padding: 2.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    width: 100%;
    max-width: 400px;
}

.login-box h1 {
    text-align: center;
    color: var(--primary);
    margin-bottom: 1.5rem;
}

.login-footer {
    text-align: center;
    margin-top: 1rem;
}

/* === Stats Grid === */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--white);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    text-align: center;
}

.stat-card h3 {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.stat-card p {
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

.stat-card small {
    color: var(--text-light);
    font-size: 0.85rem;
}

.stat-alert {
    border-left: 4px solid var(--error);
}

.stat-warning {
    border-left: 4px solid var(--warning);
}

.stat-success {
    border-left: 4px solid var(--success);
}

/* === Dashboard Sections === */
.dashboard-section {
    background: var(--white);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    margin-bottom: 2rem;
}

.dashboard-section h3 {
    color: var(--primary);
    margin-bottom: 1.5rem;
}

.no-data {
    text-align: center;
    color: var(--text-light);
    padding: 2rem;
}

/* === Admin Tables === */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
}

.admin-table thead {
    background: var(--primary);
    color: var(--white);
}

.admin-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
}

.admin-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
}

.admin-table tbody tr:hover {
    background: #f8f9fa;
}

/* === Badges === */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 500;
}

.badge-bot {
    background: var(--secondary);
    color: var(--white);
}

.badge-post {
    background: var(--info);
    color: var(--white);
}

.badge-comment {
    background: var(--accent);
    color: var(--white);
}

.badge-search {
    background: var(--text-light);
    color: var(--white);
}

.badge-response {
    background: var(--success);
    color: var(--white);
}

/* === Tabs === */
.tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--border);
}

.tab {
    padding: 0.75rem 1.5rem;
    text-decoration: none;
    color: var(--text);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}

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

.tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 600;
}

/* === Comments List (Admin) === */
.comments-list-admin {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.comment-item {
    background: var(--white);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.comment-item .comment-header {
    margin-bottom: 0.5rem;
}

.comment-email {
    color: var(--text-light);
    font-size: 0.9rem;
}

.comment-meta {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    display: flex;
    gap: 1rem;
}

.comment-actions {
    margin-top: 1rem;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* === Bot Control === */
.bot-status-panel,
.bot-personas-panel,
.bot-activity-panel {
    background: var(--white);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    margin-bottom: 2rem;
}

.bot-status-panel h3,
.bot-personas-panel h3,
.bot-activity-panel h3 {
    color: var(--primary);
    margin-bottom: 1.5rem;
}

.status-info {
    margin-bottom: 1.5rem;
}

.status-info p {
    margin-bottom: 0.5rem;
}

.status-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-weight: 600;
}

.status-active {
    background: var(--success);
    color: var(--white);
}

.status-paused {
    background: var(--warning);
    color: var(--text);
}

/* === Personas Grid === */
.personas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.persona-card {
    border: 1px solid var(--border);
    padding: 1.5rem;
    border-radius: 8px;
    background: #f9fdf9;
}

.persona-card h4 {
    color: var(--primary);
    margin-bottom: 0.75rem;
}

.persona-card p {
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
}

.persona-bio {
    color: var(--text-light);
}

.persona-stats {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.persona-stats small {
    color: var(--text-light);
}

/* === Admin Forms === */
.admin-form {
    background: var(--white);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.form-meta {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1.5rem;
}

.form-meta p {
    margin-bottom: 0.5rem;
}

/* === Responsive === */
@media (max-width: 768px) {
    header nav {
        flex-direction: column;
        gap: 0.75rem;
    }

    .post-preview {
        padding: 1.5rem;
    }

    .post-full,
    .comment-form {
        padding: 1.5rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .personas-grid {
        grid-template-columns: 1fr;
    }

    .pagination {
        flex-direction: column;
    }

    .button-group {
        flex-direction: column;
    }

    .admin-table {
        font-size: 0.9rem;
    }

    .admin-table th,
    .admin-table td {
        padding: 0.75rem 0.5rem;
    }
}
