/* assets/css/main.css */

* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
    --primary: #0a8270;
    --primary-dark: #065c4f;
    --primary-light: #e6f4f1;
    --accent: #ff6b35;
    --text-dark: #1a2e3a;
    --text-muted: #5a6e7a;
    --bg-light: #f8fafc;
    --bg-white: #ffffff;
    --radius: 20px;
    --radius-sm: 12px;
    --shadow: 0 4px 20px rgba(0,0,0,0.05);
    --shadow-hover: 0 20px 30px -12px rgba(0,0,0,0.1);
}
body { font-family: 'Inter', sans-serif; background: var(--bg-light); color: var(--text-dark); line-height: 1.5; }
.container { max-width: 1280px; margin: 0 auto; padding: 0 24px; }

/* Header */
header { position: sticky; top: 0; background: rgba(255,255,255,0.98); backdrop-filter: blur(10px); z-index: 1000; border-bottom: 1px solid #eef2f4; }
.nav { display: flex; justify-content: space-between; align-items: center; padding: 16px 24px; max-width: 1280px; margin: 0 auto; }
.brand { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.logo { width: 42px; height: 42px; background: var(--primary); border-radius: 12px; display: flex; align-items: center; justify-content: center; overflow: hidden; text-decoration: none; flex-shrink: 0; }
.logo img { width: 100%; height: 100%; object-fit: cover; }
.brand-info { display: flex; flex-direction: column; }
.brand-title a { font-size: 22px; font-weight: 800; text-decoration: none; color: var(--text-dark); line-height: 1.2; }
.brand-title span { color: var(--primary); }
.brand-tagline { font-size: 10px; font-weight: 600; color: var(--primary); letter-spacing: 0.3px; margin-top: 2px; white-space: nowrap; text-transform: uppercase; }
.nav-links { display: flex; gap: 8px; list-style: none; }
.nav-links a { text-decoration: none; color: var(--text-muted); font-weight: 500; padding: 8px 16px; border-radius: 40px; transition: 0.2s; }
.nav-links a:hover, .nav-links a.active { background: var(--primary-light); color: var(--primary); }
.header-actions { display: flex; gap: 12px; align-items: center; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 20px; border-radius: 40px; font-weight: 600; font-size: 14px; cursor: pointer; border: none; transition: 0.2s; text-decoration: none; }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-2px); }
.btn-outline { background: transparent; border: 1.5px solid var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary-light); }
.hamburger { display: none; background: none; border: none; font-size: 24px; cursor: pointer; }

/* Hero */
.hero { background: linear-gradient(135deg, var(--primary-light) 0%, var(--bg-white) 100%); padding: 60px 0; text-align: center; border-bottom: 1px solid #eef2f4; }
.hero h1 { font-size: 48px; font-weight: 800; margin-bottom: 16px; }
.gradient-text { background: linear-gradient(135deg, var(--primary), var(--accent)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.hero p { font-size: 18px; color: var(--text-muted); max-width: 600px; margin: 0 auto; }
.stats { display: flex; justify-content: center; gap: 40px; margin-top: 40px; flex-wrap: wrap; }
.stat-card { background: white; padding: 20px 32px; border-radius: var(--radius-sm); box-shadow: var(--shadow); text-align: center; }
.stat-number { font-size: 32px; font-weight: 800; color: var(--primary); }
.stat-label { font-size: 13px; color: var(--text-muted); }

/* Write Section */
.write-section { background: white; padding: 32px; border-radius: var(--radius); margin: 40px 0; box-shadow: var(--shadow); }
.write-section textarea, .write-section input { width: 100%; padding: 14px; border: 1px solid #eef2f4; border-radius: var(--radius-sm); font-family: inherit; margin-bottom: 12px; }
.write-section textarea:focus, .write-section input:focus { outline: none; border-color: var(--primary); }

/* Filter Bar */
.filter-bar { display: flex; justify-content: space-between; align-items: center; margin: 32px 0; flex-wrap: wrap; gap: 16px; }
.filter-buttons { display: flex; gap: 12px; }
.filter-btn { padding: 8px 20px; border-radius: 40px; background: white; border: 1px solid #eef2f4; cursor: pointer; transition: 0.2s; }
.filter-btn.active { background: var(--primary); color: white; border-color: var(--primary); }

/* Posts Grid */
.posts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 24px; margin-bottom: 48px; }
.post-card { background: white; border-radius: var(--radius); border: 1px solid #eef2f4; overflow: hidden; transition: 0.3s; color: inherit; display: block; cursor: pointer; }
.post-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.card-header { padding: 20px 20px 0; display: flex; justify-content: space-between; }
.author-info { display: flex; align-items: center; gap: 12px; border-radius: 40px; padding: 4px 12px 4px 4px; margin-left: -4px; transition: 0.2s; }
.author-info:hover { background: var(--bg-light); }
.author-avatar { width: 48px; height: 48px; background: var(--primary-light); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; color: var(--primary); }
.author-name { font-weight: 600; }
.post-date { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.post-title { font-size: 20px; font-weight: 700; padding: 16px 20px 8px; line-height: 1.4; }
.post-excerpt { padding: 0 20px 16px; color: var(--text-muted); font-size: 14px; line-height: 1.6; }
.hashtags { padding: 0 20px 12px; display: flex; flex-wrap: wrap; gap: 8px; }
.hashtag { background: var(--primary-light); color: var(--primary); font-size: 11px; padding: 4px 10px; border-radius: 20px; }
.post-stats { padding: 12px 20px; border-top: 1px solid #eef2f4; display: flex; gap: 20px; font-size: 13px; color: var(--text-muted); }

.owner-actions button { background:none; border:none; color:var(--text-muted); cursor:pointer; font-size:16px; padding:4px; border-radius:50%; transition:0.2s; }
.owner-actions button:hover { background: #eef2f4; color: var(--text-dark); }

/* Trending Topics */
.trending-section { margin: 32px 0; padding: 20px; background: white; border-radius: var(--radius); box-shadow: var(--shadow); }
.trending-title { font-size: 16px; margin-bottom: 16px; color: var(--text-muted); }
.topic-list { display: flex; flex-wrap: wrap; gap: 12px; }
.topic-tag { background: var(--primary-light); color: var(--primary); padding: 8px 16px; border-radius: 40px; text-decoration: none; font-size: 14px; font-weight: 500; transition: 0.2s; }
.topic-tag:hover { background: var(--primary); color: white; }
.topic-tag .count { background: rgba(0,0,0,0.1); padding: 2px 6px; border-radius: 20px; margin-left: 8px; font-size: 11px; }

/* Modal */
.modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 2000; align-items: center; justify-content: center; }
.modal.active { display: flex; }
.modal-content { background: white; padding: 32px; border-radius: var(--radius); max-width: 450px; width: 90%; }
.modal-content input, .modal-content textarea { width: 100%; padding: 12px; margin: 12px 0; border: 1px solid #eef2f4; border-radius: var(--radius-sm); }

/* Toast */
.toast { position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%) translateY(100px); background: #333; color: white; padding: 12px 24px; border-radius: 40px; z-index: 3000; transition: 0.3s; opacity: 0; font-size: 14px; }
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

/* Dropdown Menus */
.user-menu { position: relative; }
.dropdown-menu { display: none; position: absolute; right: 0; top: 120%; width: 220px; background: white; border-radius: 12px; box-shadow: 0 10px 25px rgba(0,0,0,0.1); border: 1px solid #eef2f4; overflow: hidden; z-index: 1000; text-align: left; }
.dropdown-menu.show { display: block; animation: slideDown 0.2s ease forwards; }
.dropdown-item { display: flex; align-items: center; gap: 12px; padding: 12px 16px; color: var(--text-dark); text-decoration: none; border-bottom: 1px solid #eef2f4; transition: 0.2s; font-size: 14px; font-weight: 500; }
.dropdown-item:hover { background: var(--bg-light); color: var(--primary); }
.dropdown-item.text-danger { color: #ef4444; }
.dropdown-item.text-danger:hover { background: #fef2f2; color: #dc2626; }
@keyframes slideDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }

.loading { text-align: center; padding: 60px; color: var(--text-muted); }

/* Custom Toggle Switch */
.anonymous-toggle { display: flex; align-items: center; gap: 12px; cursor: pointer; user-select: none; }
.anonymous-toggle input { display: none; }
.toggle-slider { width: 44px; height: 24px; background: #cbd5e1; border-radius: 24px; position: relative; transition: 0.3s; flex-shrink: 0; }
.toggle-slider::after { content: ''; width: 18px; height: 18px; background: white; border-radius: 50%; position: absolute; top: 3px; left: 3px; transition: 0.3s; box-shadow: 0 2px 4px rgba(0,0,0,0.1); }
.anonymous-toggle input:checked + .toggle-slider { background: #0f172a; }
.anonymous-toggle input:checked + .toggle-slider::after { transform: translateX(20px); }
.toggle-label { font-weight: 600; color: var(--text-dark); display: flex; align-items: center; gap: 8px; }
.anonymous-box { margin: 16px 0; padding: 16px; background: #f8fafc; border-radius: 12px; border: 1px solid #e2e8f0; }

/* Mobile Floating Action Button (FAB) */
.fab-write { display: none; position: fixed; bottom: 80px; right: 20px; width: 60px; height: 60px; background: var(--primary); color: white; border-radius: 50%; font-size: 24px; align-items: center; justify-content: center; box-shadow: 0 4px 15px rgba(10,130,112,0.4); z-index: 999; cursor: pointer; transition: 0.3s; }
.fab-write:hover { transform: scale(1.05); }

/* Footer */
footer { background: #0a2e26; color: white; padding: 60px 0 30px; margin-top: 60px; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 40px; margin-bottom: 40px; }
.footer-links { display: flex; flex-direction: column; gap: 12px; }
.footer-links a { color: rgba(255,255,255,0.8); text-decoration: none; transition: color 0.2s; display: inline-flex; align-items: center; gap: 8px; font-size: 14px; }
.footer-links a i { width: 20px; text-align: center; }
.footer-links a:hover { color: white; }
.social-links { display: flex; gap: 16px; margin-top: 20px; flex-wrap: wrap; }
.social-links a { width: 40px; height: 40px; background: rgba(255,255,255,0.1); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: white; text-decoration: none; transition: all 0.2s; }
.social-links a:hover { background: var(--primary); transform: translateY(-2px); }
.contact-row { text-align: center; margin-bottom: 20px; padding: 15px 0; border-bottom: 1px solid rgba(255,255,255,0.1); border-top: 1px solid rgba(255,255,255,0.1); }
.contact-row a { color: rgba(255,255,255,0.8); text-decoration: none; margin: 0 15px; transition: color 0.2s; display: inline-flex; align-items: center; gap: 8px; font-size: 14px; }
.contact-row a:hover { color: white; }
.copyright { text-align: center; padding-top: 30px; border-top: 1px solid rgba(255,255,255,0.1); font-size: 13px; opacity: 0.9; line-height: 1.7; }
.footer-brand-line { font-size: 12px; margin-top: 12px; opacity: 0.8; font-weight: 500; letter-spacing: 0.5px; }
.legal-details { font-size: 11px; margin-top: 10px; opacity: 0.7; letter-spacing: 0.3px; display: block; }

/* Cookie Banner */
.cookie-banner { position: fixed; bottom: 0; left: 0; right: 0; background: white; box-shadow: 0 -8px 30px rgba(0,0,0,0.12); z-index: 1100; padding: 20px 24px; transform: translateY(100%); transition: transform 0.4s ease; border-top: 2px solid var(--primary-light); }
.cookie-banner.show { transform: translateY(0); }
.cookie-inner { max-width: 1280px; margin: 0 auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; }
.cookie-text { flex: 2; font-size: 14px; color: var(--text-dark); }
.cookie-text a { color: var(--primary); text-decoration: underline; }
.cookie-buttons { display: flex; gap: 12px; flex-wrap: wrap; }
.cookie-btn { padding: 8px 20px; border-radius: 40px; font-weight: 500; cursor: pointer; border: none; font-family: inherit; transition: 0.2s; }
.cookie-accept { background: var(--primary); color: white; }
.cookie-decline { background: #f1f3f4; color: #2c3e44; }
.cookie-accept:hover, .cookie-decline:hover { transform: translateY(-1px); opacity: 0.9; }

@media (max-width: 768px) {
    .hero h1 { font-size: 32px; }
    .posts-grid { grid-template-columns: 1fr; }
    .nav-links { display: none; position: absolute; top: 70px; left: 0; right: 0; background: white; flex-direction: column; padding: 20px; box-shadow: var(--shadow); }
    .nav-links.open { display: flex; }
    .hamburger { display: block; }
    .stats { gap: 16px; }
    .stat-card { padding: 12px 20px; }
    .fab-write { display: flex; }
}
@media (max-width: 680px) { .cookie-inner { flex-direction: column; text-align: center; } }

/* --- Post Page Styles --- */
.post-content { background: white; padding: 32px; border-radius: var(--radius); box-shadow: var(--shadow); }
.post-meta { display: flex; align-items: center; gap: 16px; margin-top: 24px; flex-wrap: wrap; }
.author-info-wrapper { display: flex; align-items: center; gap: 12px; cursor: pointer; padding: 4px 16px 4px 4px; border-radius: 40px; transition: 0.2s; margin-left: -4px; }
.author-info-wrapper:hover { background: #f8fafc; }
.author-info-wrapper .avatar { width: 48px; height: 48px; font-size: 16px; flex-shrink: 0; }
.post-owner-actions { margin-left: auto; display: flex; gap: 16px; }
.post-owner-actions button { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 18px; }
.post-owner-actions button:hover { color: var(--text-dark); }
.post-owner-actions .delete-btn:hover { color: #ef4444; }
.featured-image-container { width: 100%; border-radius: 12px; overflow: hidden; margin: 24px 0; }
.featured-image-container img { width: 100%; height: auto; object-fit: contain; }
.content-body { font-size: 17px; line-height: 1.7; color: #334155; }
.content-body h2, .content-body h3 { margin-top: 2em; margin-bottom: 1em; }
.content-body ul, .content-body ol { margin-left: 20px; margin-bottom: 1em; }
.disclaimer-box { background: #fffbeb; padding: 16px; border-radius: 12px; margin-top: 40px; font-size: 14px; color: #b45309; border-left: 4px solid #f59e0b; }
.ai-insights-box { background: #f0fdf4; border: 1px solid #bbf7d0; padding: 24px; border-radius: 16px; margin-top: 32px; }
.ai-insights-header { display: flex; align-items: center; gap: 12px; font-size: 18px; font-weight: 700; color: #15803d; margin-bottom: 16px; }
.ai-insights-box h4 { margin-top: 16px; margin-bottom: 8px; color: #166534; display: flex; align-items: center; gap: 8px; }
.ai-insights-box ul { list-style-type: '✓ '; padding-left: 20px; }
.ai-insights-box li { margin-bottom: 8px; }
.similar-story-link { display: block; background: white; padding: 12px; border-radius: 8px; margin-bottom: 8px; text-decoration: none; color: var(--text-dark); font-weight: 500; border: 1px solid #dcfce7; transition: 0.2s; }
.similar-story-link:hover { background: #dcfce7; color: #166534; }
.post-actions { margin-top: 32px; display: flex; gap: 16px; border-top: 1px solid #eef2f4; padding-top: 24px; }

/* Comments Section */
.comments-section { margin-top: 48px; }
.comment-box { width: 100%; padding: 14px; border-radius: 12px; border: 1px solid #e2e8f0; margin-bottom: 12px; }
.comments-list { margin-top: 32px; }
.comment-item, .comment-item-ai { display: flex; gap: 16px; margin-bottom: 24px; }
.comment-item .avatar, .comment-item-ai .avatar { width: 40px; height: 40px; font-size: 14px; flex-shrink: 0; cursor: pointer; }
.comment-body { background: #f8fafc; padding: 16px; border-radius: 12px; width: 100%; border: 1px solid #f1f5f9; }
.comment-item-ai .comment-body { background: linear-gradient(135deg, #f0fdfa, #f0fdf4); border-color: #ccfbf1; }
.comment-header { font-weight: 600; font-size: 14px; margin-bottom: 8px; color: var(--text-dark); display: flex; justify-content: space-between; }
.comment-content { font-size: 15px; color: #334155; line-height: 1.6; }
.comment-footer { font-size: 12px; color: var(--text-muted); margin-top: 12px; }