/* ==============================================
   AI for Geo — ხელოვნური ინტელექტი საქართველოსთვის
   Design: Inspired by TBC Bank, Bank of Georgia
   Fonts: Noto Sans Georgian (Google Fonts)
   Palette: Trust-evoking navy + sky blue + warm accents
   ============================================== */

:root {
  --primary: #0F3A75;
  --primary-light: #10B2EE;
  --primary-bg: #dbeafe;
  --accent: #EBCB8E;
  --accent-green: #10b981;
  --bg: #f0f4f8;
  --bg-white: #ffffff;
  --text: #1a202c;
  --text-secondary: #475569;
  --text-light: #94a3b8;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.1);
  --radius: 10px;
  --radius-lg: 16px;
  --font: 'Noto Sans Georgian', 'Segoe UI', system-ui, sans-serif;
}

/* --- Reset --- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--primary-light); }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { line-height: 1.35; font-weight: 600; }
h1 { font-size: 2.2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.1rem; }

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

/* --- Buttons --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 24px; border-radius: 8px; font-family: var(--font);
  font-size: 0.9rem; font-weight: 500; border: none; cursor: pointer;
  transition: all 0.15s; text-decoration: none;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: #0c2f5e; color: #fff; transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-outline { background: transparent; color: var(--primary); border: 1.5px solid var(--primary); }
.btn-outline:hover { background: var(--primary-bg); }
.btn-sm { padding: 7px 16px; font-size: 0.82rem; }
.btn-full { width: 100%; }

/* ==============================================
   HEADER
   ============================================== */
.header {
  background: var(--bg-white);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px; gap: 20px;
}
.logo {
  display: flex; align-items: center; gap: 10px;
  color: var(--text); font-weight: 700; flex-shrink: 0;
}
.logo:hover { color: var(--text); }
.logo-icon { flex-shrink: 0; }
.logo-text { display: flex; flex-direction: column; }
.logo-name { font-size: 1rem; font-weight: 700; line-height: 1.2; }
.logo-tagline { font-size: 0.65rem; color: var(--text-light); font-weight: 400; }

.nav { display: flex; gap: 4px; }
.nav-link {
  padding: 6px 14px; border-radius: 6px;
  color: var(--text-secondary); font-size: 0.88rem; font-weight: 500;
  transition: all 0.15s;
}
.nav-link:hover { color: var(--primary); background: var(--primary-bg); }

.header-actions { display: flex; align-items: center; gap: 12px; }
.user-menu { display: flex; align-items: center; gap: 12px; }
.user-greeting { font-size: 0.85rem; color: var(--text-secondary); }

.mobile-toggle {
  display: none; flex-direction: column; gap: 4px;
  background: none; border: none; cursor: pointer; padding: 6px;
}
.mobile-toggle span { width: 20px; height: 2px; background: var(--text); border-radius: 2px; transition: 0.2s; }

/* ==============================================
   HERO
   ============================================== */
.hero {
  background: linear-gradient(135deg, #0F3A75 0%, #1a5276 50%, #10B2EE 100%);
  color: #fff; padding: 56px 0 48px; text-align: center;
}
.hero h1 { font-size: 2rem; font-weight: 700; margin-bottom: 14px; }
.hero-accent { color: var(--accent); }
.hero-sub { font-size: 1rem; opacity: 0.85; max-width: 560px; margin: 0 auto; }

/* ==============================================
   NEWS / ARTICLES
   ============================================== */
.news-section { padding: 48px 0 40px; }
.section-head { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; }
.section-head h2 { margin: 0; }
.badge {
  font-size: 0.72rem; font-weight: 600; padding: 3px 10px;
  border-radius: 20px; background: var(--border); color: var(--text-secondary);
}
.badge-blue { background: var(--primary-bg); color: var(--primary); }

.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.article-card {
  background: var(--bg-white); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
  transition: all 0.2s;
}
.article-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }

.article-card.featured {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.article-card.georgia-highlight { border-left: 4px solid var(--accent-green); }

.article-img {
  position: relative; height: 180px; overflow: hidden;
  background: linear-gradient(135deg, var(--primary-bg), #ede9fe);
}
.article-card.featured .article-img { height: 100%; min-height: 240px; }
.article-img img { width: 100%; height: 100%; object-fit: cover; }
.article-img.no-img img { display: none; }

.img-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 3rem;
}

.geo-badge {
  position: absolute; top: 10px; left: 10px;
  background: var(--accent-green); color: #fff;
  padding: 3px 10px; border-radius: 20px;
  font-size: 0.72rem; font-weight: 600;
}

.article-body { padding: 20px; }
.article-title { font-size: 1.05rem; margin-bottom: 8px; line-height: 1.5; }
.article-title a { color: var(--text); }
.article-title a:hover { color: var(--primary); }
.article-summary {
  font-size: 0.88rem; color: var(--text-secondary);
  line-height: 1.7; margin-bottom: 12px;
  display: -webkit-box; -webkit-line-clamp: 3;
  -webkit-box-orient: vertical; overflow: hidden;
}

.article-meta {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  font-size: 0.78rem; color: var(--text-light);
}
.source { font-weight: 500; color: var(--primary-light); }
.geo-tag { background: #dcfce7; color: #166534; padding: 1px 8px; border-radius: 4px; font-weight: 500; }

.more-cta {
  text-align: center; margin-top: 36px; padding: 28px;
  background: var(--border-light); border-radius: var(--radius-lg);
}
.more-cta p { margin-bottom: 16px; color: var(--text-secondary); }

/* ==============================================
   NEWSLETTER
   ============================================== */
.newsletter-section { padding: 48px 0 56px; background: var(--bg-white); }
.newsletter-card {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 40px; padding: 40px; background: var(--bg);
  border-radius: var(--radius-lg); border: 1px solid var(--border);
}
.newsletter-info h2 { margin-bottom: 12px; }
.newsletter-info p { color: var(--text-secondary); margin-bottom: 20px; }
.benefits-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.benefits-list li { font-size: 0.9rem; padding-left: 8px; }
.benefits-list li::before { content: '✓ '; color: var(--accent-green); font-weight: 700; }

.newsletter-form { display: flex; flex-direction: column; gap: 16px; }
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group label { font-size: 0.82rem; font-weight: 500; color: var(--text-secondary); }
.form-group input[type="email"],
.form-group input[type="text"],
.form-group textarea,
.form-group select {
  padding: 10px 14px; border: 1px solid var(--border); border-radius: 8px;
  font-family: var(--font); font-size: 0.9rem; outline: none;
  background: var(--bg-white); transition: border-color 0.15s;
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
  border-color: var(--primary-light);
}

.radio-group { display: flex; gap: 16px; flex-wrap: wrap; }
.radio-label {
  display: flex; align-items: center; gap: 6px;
  font-size: 0.88rem; cursor: pointer;
}
.radio-label input[type="radio"] { accent-color: var(--primary); width: 16px; height: 16px; }

.form-note { font-size: 0.78rem; color: var(--text-light); text-align: center; margin-top: 4px; }

/* ==============================================
   ABOUT
   ============================================== */
.about-section { padding: 56px 0; }
.about-section h2 { text-align: center; margin-bottom: 36px; }
.about-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px;
}
.about-card {
  text-align: center; padding: 28px 16px;
  background: var(--bg-white); border: 1px solid var(--border);
  border-radius: var(--radius-lg); transition: all 0.2s;
}
.about-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.about-icon { font-size: 2rem; margin-bottom: 12px; display: flex; justify-content: center; align-items: center; min-height: 48px; }
.about-card h3 { margin-bottom: 8px; }
.about-card p { font-size: 0.85rem; color: var(--text-secondary); }

/* ==============================================
   SEARCH
   ============================================== */
.page-top { padding: 40px 0 24px; background: var(--primary); color: #fff; }
.page-top h1 { margin-bottom: 12px; }
.page-desc { color: rgba(255,255,255,0.8); margin-bottom: 20px; }

.search-bar { display: flex; gap: 10px; max-width: 600px; }
.search-bar input {
  flex: 1; padding: 10px 16px; border: 2px solid rgba(255,255,255,0.3);
  border-radius: 8px; background: rgba(255,255,255,0.15); color: #fff;
  font-family: var(--font); font-size: 0.95rem; outline: none;
}
.search-bar input::placeholder { color: rgba(255,255,255,0.6); }
.search-bar input:focus { border-color: #fff; background: rgba(255,255,255,0.2); }
.search-bar .btn-primary { background: #fff; color: var(--primary); }
.search-bar .btn-primary:hover { background: var(--primary-bg); }

.results-section { padding: 32px 0 56px; }
.results-count { margin-bottom: 24px; color: var(--text-secondary); }

.results-list { display: flex; flex-direction: column; gap: 16px; }
.result-item {
  background: var(--bg-white); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; transition: all 0.15s;
}
.result-item:hover { box-shadow: var(--shadow-md); }
.result-item h3 { font-size: 1.05rem; margin-bottom: 8px; }
.result-item h3 a { color: var(--text); }
.result-item h3 a:hover { color: var(--primary); }
.result-item p { font-size: 0.88rem; color: var(--text-secondary); margin-bottom: 10px; }

/* ==============================================
   ARCHIVE
   ============================================== */
.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 20px; }
.filter-btn {
  padding: 6px 18px; border-radius: 20px; border: 1px solid rgba(255,255,255,0.4);
  background: transparent; color: rgba(255,255,255,0.8);
  font-family: var(--font); font-size: 0.82rem; font-weight: 500;
  transition: all 0.15s; cursor: pointer;
}
.filter-btn:hover, .filter-btn.active { background: #fff; color: var(--primary); border-color: #fff; }

.archive-section { padding: 32px 0 56px; }
.archive-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.archive-item {
  display: flex; flex-direction: column; background: var(--bg-white);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  overflow: hidden; transition: all 0.2s;
}
.archive-item:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.archive-item.georgia-highlight { border-left: 4px solid var(--accent-green); }
.archive-img { height: 160px; overflow: hidden; background: var(--primary-bg); display: flex; align-items: center; justify-content: center; }
.archive-img img { width: 100%; height: 100%; object-fit: cover; }
.archive-body { padding: 16px; flex: 1; display: flex; flex-direction: column; }
.archive-body h3 { margin-bottom: 8px; font-size: 0.95rem; line-height: 1.4; }
.archive-body h3 a { color: var(--text); }
.archive-body h3 a:hover { color: var(--primary); }
.archive-body p { font-size: 0.82rem; color: var(--text-secondary); margin-bottom: 10px; line-height: 1.6; flex: 1; }

.pagination { display: flex; justify-content: center; gap: 6px; margin-top: 36px; }
.page-btn {
  width: 38px; height: 38px; display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); border-radius: 8px; background: var(--bg-white);
  font-family: var(--font); font-weight: 500; color: var(--text-secondary);
  transition: all 0.15s;
}
.page-btn:hover, .page-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ==============================================
   MODAL
   ============================================== */
.modal {
  display: none; position: fixed; inset: 0; z-index: 200;
  align-items: center; justify-content: center;
}
.modal.active { display: flex; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.5); }
.modal-box {
  position: relative; background: var(--bg-white);
  border-radius: var(--radius-lg); padding: 36px;
  width: 90%; max-width: 440px; max-height: 90vh; overflow-y: auto;
  box-shadow: var(--shadow-lg);
}
.modal-close {
  position: absolute; top: 12px; right: 16px;
  background: none; border: none; font-size: 1.8rem;
  cursor: pointer; color: var(--text-light);
  z-index: 10; padding: 8px; line-height: 1;
  transition: color 0.15s, transform 0.15s;
}
.modal-close:hover {
  color: var(--text);
  transform: scale(1.1);
}

.auth-content h2 { text-align: center; margin-bottom: 8px; }
.auth-subtitle { text-align: center; color: var(--text-secondary); font-size: 0.9rem; margin-bottom: 20px; }
.auth-benefits { background: var(--border-light); border-radius: var(--radius); padding: 16px 20px; margin-bottom: 24px; }
.auth-benefits h4 { font-size: 0.88rem; margin-bottom: 10px; }
.auth-benefits ul { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.auth-benefits li { font-size: 0.85rem; }

.auth-buttons { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.btn-auth {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 12px 20px; border-radius: 8px; font-family: var(--font);
  font-size: 0.9rem; font-weight: 500; border: 1px solid var(--border);
  transition: all 0.15s; color: var(--text);
}
.btn-auth:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); color: var(--text); }
.btn-google { background: #fff; }
.btn-google:hover { background: #f8f9fa; }
.btn-facebook { background: #1877F2; color: #fff; border-color: #1877F2; }
.btn-facebook:hover { background: #166fe5; color: #fff; }
.btn-microsoft { background: #fff; }
.btn-microsoft:hover { background: #f8f9fa; }

.auth-privacy { text-align: center; font-size: 0.8rem; color: var(--text-light); line-height: 1.6; }
.auth-privacy p { margin: 0; }

/* ==============================================
   ALERTS
   ============================================== */
.alert {
  padding: 12px 20px; border-radius: 8px; margin: 16px 0;
  font-size: 0.9rem;
}
.alert-success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }

.empty-state {
  text-align: center; padding: 48px 20px; color: var(--text-light);
  background: var(--bg-white); border-radius: var(--radius-lg);
  border: 1px dashed var(--border);
}

/* ==============================================
   FOOTER
   ============================================== */
.footer { background: #0F172A; color: #94a3b8; padding: 48px 0 0; margin-top: 0; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; padding-bottom: 32px; border-bottom: 1px solid #1e293b; }
.footer-brand .logo { margin-bottom: 12px; }
.footer-desc { font-size: 0.85rem; line-height: 1.7; opacity: 0.7; }
.footer-col h4 { color: #fff; font-size: 0.9rem; margin-bottom: 14px; }
.footer-col a { display: block; color: #94a3b8; font-size: 0.85rem; padding: 3px 0; transition: color 0.15s; }
.footer-col a:hover { color: #fff; }
.footer-bottom { text-align: center; padding: 18px 0; font-size: 0.8rem; opacity: 0.5; }

/* ==============================================
   FORUM
   ============================================== */
.forum-top-bar { display: flex; gap: 16px; align-items: center; margin-top: 20px; }
.forum-search { display: flex; gap: 8px; flex: 1; max-width: 400px; }
.forum-search input {
  flex: 1; padding: 8px 14px; border: 2px solid rgba(255,255,255,0.3);
  border-radius: 8px; background: rgba(255,255,255,0.15); color: #fff;
  font-family: var(--font); font-size: 0.9rem;
}
.forum-search input::placeholder { color: rgba(255,255,255,0.6); }

.forum-section { padding: 32px 0 56px; }

.search-results-info {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 20px; padding: 12px 16px;
  background: var(--primary-bg); border-radius: var(--radius);
}

.forum-list { background: var(--bg-white); border-radius: var(--radius-lg); border: 1px solid var(--border); overflow: hidden; }

.forum-header {
  display: grid; grid-template-columns: 1fr 80px 80px 100px; gap: 16px;
  padding: 12px 20px; background: var(--primary-bg); font-weight: 600;
  font-size: 0.8rem; color: var(--text-secondary); text-transform: uppercase;
}

.forum-item {
  display: grid; grid-template-columns: 1fr 80px 80px 100px; gap: 16px;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  align-items: center; transition: background 0.15s;
}
.forum-item:last-child { border-bottom: none; }
.forum-item:hover { background: #f8fafc; }
.forum-item.pinned { background: #fefce8; }

.forum-topic { display: flex; gap: 12px; align-items: flex-start; }
.pin-badge { font-size: 1.1rem; line-height: 1; }
.forum-topic-content { flex: 1; min-width: 0; }
.forum-title { font-size: 1rem; margin-bottom: 6px; line-height: 1.4; }
.forum-title a { color: var(--text); }
.forum-title a:hover { color: var(--primary); }

.forum-meta { display: flex; gap: 10px; align-items: center; font-size: 0.8rem; color: var(--text-secondary); }
.forum-avatar { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; }
.forum-avatar-placeholder {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem; font-weight: 600;
}

.forum-stat { font-size: 1rem; font-weight: 600; color: var(--text); text-align: center; display: block; }
.forum-stat-small { font-size: 0.8rem; color: var(--text-secondary); text-align: center; display: block; }

.forum-replies, .forum-views, .forum-activity { text-align: center; }

/* Single Post Page */
.page-top-compact { padding: 20px 0; }
.breadcrumb { font-size: 0.85rem; color: rgba(255,255,255,0.7); }
.breadcrumb a { color: rgba(255,255,255,0.9); }
.breadcrumb a:hover { text-decoration: underline; }

.forum-post-section { padding: 32px 0 56px; }

.forum-post-main {
  background: var(--bg-white); border-radius: var(--radius-lg);
  border: 1px solid var(--border); margin-bottom: 32px;
}

.post-header { padding: 24px 24px 0; }
.post-header h1 { font-size: 1.5rem; margin-bottom: 16px; line-height: 1.4; }

.post-meta { display: flex; gap: 12px; align-items: center; }
.post-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.post-avatar-placeholder {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; font-weight: 600;
}
.post-meta-text { display: flex; flex-direction: column; gap: 2px; }
.post-author { font-weight: 600; color: var(--text); }
.post-date { font-size: 0.8rem; color: var(--text-secondary); }
.post-edited { font-size: 0.75rem; color: var(--text-secondary); font-style: italic; }

.post-content {
  padding: 24px; font-size: 1rem; line-height: 1.8; color: var(--text);
  border-top: 1px solid var(--border); margin-top: 20px;
}

.post-footer {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 24px; background: var(--primary-bg);
  border-top: 1px solid var(--border);
}
.post-stats { display: flex; gap: 20px; font-size: 0.85rem; color: var(--text-secondary); }
.post-actions { display: flex; gap: 10px; }

.inline-form { display: inline; }
.btn-danger { background: #dc2626; color: #fff; border-color: #dc2626; }
.btn-danger:hover { background: #b91c1c; }

/* Replies */
.forum-replies-section { margin-bottom: 32px; }
.forum-replies-section h2 { margin-bottom: 20px; font-size: 1.2rem; }

.replies-list { display: flex; flex-direction: column; gap: 16px; margin-bottom: 32px; }

.reply-item {
  display: flex; gap: 16px;
  background: var(--bg-white); border-radius: var(--radius-lg);
  border: 1px solid var(--border); padding: 20px;
}

.reply-sidebar { flex-shrink: 0; }
.reply-avatar { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; }
.reply-avatar-placeholder {
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; font-weight: 600;
}

.reply-main { flex: 1; min-width: 0; }
.reply-header { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.reply-author { font-weight: 600; color: var(--text); }
.reply-date { font-size: 0.8rem; color: var(--text-secondary); }
.reply-edited { font-size: 0.75rem; color: var(--text-secondary); font-style: italic; }
.reply-number { margin-left: auto; font-size: 0.8rem; color: var(--text-secondary); }

.reply-content { font-size: 0.95rem; line-height: 1.7; color: var(--text); }

.reply-actions { display: flex; gap: 16px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.btn-link { background: none; border: none; color: var(--primary); font-size: 0.85rem; cursor: pointer; padding: 0; }
.btn-link:hover { text-decoration: underline; }
.btn-link-danger { color: #dc2626; }

.no-replies { text-align: center; padding: 32px; color: var(--text-secondary); font-style: italic; }

/* Reply Form */
.reply-form-container {
  background: var(--bg-white); border-radius: var(--radius-lg);
  border: 1px solid var(--border); padding: 24px;
}
.reply-form-container h3 { margin-bottom: 16px; font-size: 1.1rem; }
.reply-form textarea {
  width: 100%; padding: 14px; border: 1px solid var(--border);
  border-radius: var(--radius); font-family: var(--font);
  font-size: 0.95rem; resize: vertical; margin-bottom: 16px;
}
.reply-form textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(15,58,117,0.1); }

.forum-nav { margin-top: 24px; }

/* Forum Form Pages */
.forum-form-section { padding: 32px 0 56px; }
.forum-form-card {
  max-width: 700px; margin: 0 auto;
  background: var(--bg-white); border-radius: var(--radius-lg);
  border: 1px solid var(--border); padding: 32px;
}
.forum-form-card h1 { margin-bottom: 8px; }
.form-subtitle { color: var(--text-secondary); margin-bottom: 24px; }

.forum-form .form-group { margin-bottom: 20px; }
.forum-form label { display: block; font-weight: 600; margin-bottom: 8px; }
.forum-form input[type="text"],
.forum-form textarea {
  width: 100%; padding: 12px 14px; border: 1px solid var(--border);
  border-radius: var(--radius); font-family: var(--font); font-size: 0.95rem;
}
.forum-form input:focus, .forum-form textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(15,58,117,0.1);
}
.forum-form textarea { resize: vertical; min-height: 200px; }
.form-hint { display: block; font-size: 0.8rem; color: var(--text-secondary); margin-top: 6px; }

.form-actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 24px; }

.alert { padding: 14px 18px; border-radius: var(--radius); margin-bottom: 20px; }
.alert-error { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }
.alert-success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; }

/* ==============================================
   FILE UPLOAD & ATTACHMENTS
   ============================================== */
.file-upload-area {
  position: relative;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 32px 20px;
  text-align: center;
  transition: all 0.2s;
  cursor: pointer;
  background: var(--bg);
}

.file-upload-area:hover, .file-upload-area.drag-over {
  border-color: var(--primary-light);
  background: var(--primary-bg);
}

.file-upload-area-compact { padding: 20px 16px; }

.file-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.upload-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.upload-icon { font-size: 2rem; }
.upload-text { font-weight: 500; color: var(--text); }
.upload-text-compact { font-size: 0.9rem; color: var(--text-secondary); }
.upload-hint { font-size: 0.8rem; color: var(--text-light); }
.upload-icon-inline { margin-right: 4px; }

.file-upload-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
  display: block;
}

.file-preview-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
}

.file-preview-list-compact { margin-top: 12px; gap: 8px; }

.file-preview-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.85rem;
}

.file-preview-thumb {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 6px;
}

.file-preview-icon { font-size: 1.5rem; }
.file-preview-name { color: var(--text); max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-preview-size { color: var(--text-light); font-size: 0.75rem; }

/* Existing attachments in edit forms */
.existing-attachments { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }
.existing-attachment-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
}

.existing-attachment-thumb {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 6px;
}

.existing-attachment-icon { font-size: 1.8rem; }
.existing-attachment-name { font-size: 0.85rem; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.existing-attachment-size { font-size: 0.75rem; color: var(--text-light); }

.delete-checkbox {
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  margin-left: auto;
}

.delete-checkbox input { width: 16px; height: 16px; cursor: pointer; }
.delete-label { font-size: 0.8rem; color: #dc2626; }

/* ==============================================
   IMAGE GALLERY
   ============================================== */
.post-images, .reply-images { margin-top: 20px; }

.image-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.image-gallery-small { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }

.gallery-item { position: relative; overflow: hidden; border-radius: var(--radius); }

.gallery-link {
  display: block;
  aspect-ratio: 4/3;
  overflow: hidden;
}

.gallery-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.gallery-link:hover .gallery-image { transform: scale(1.05); }

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
}

.lightbox.active { opacity: 1; visibility: visible; }

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: none;
  border: none;
  color: #fff;
  font-size: 2.5rem;
  cursor: pointer;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s;
}

.lightbox-close:hover { background: rgba(255, 255, 255, 0.1); }

.lightbox-image {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: var(--radius);
}

/* ==============================================
   FILE LIST
   ============================================== */
.post-files, .reply-files { margin-top: 16px; }

.attachments-title {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
  font-weight: 500;
}

.file-list { display: flex; flex-wrap: wrap; gap: 10px; }
.file-list-compact { gap: 8px; }

.file-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  transition: all 0.2s;
  font-size: 0.85rem;
}

.file-item:hover {
  background: var(--primary-bg);
  border-color: var(--primary-light);
  color: var(--primary);
}

.file-icon { font-size: 1.2rem; }
.file-name { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-size { color: var(--text-light); font-size: 0.75rem; }

/* Forum link styling */
.forum-link {
  color: var(--primary-light);
  text-decoration: underline;
  word-break: break-all;
}

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

/* ==============================================
   RESPONSIVE
   ============================================== */
@media (max-width: 900px) {
  .article-card.featured { grid-template-columns: 1fr; }
  .article-card.featured .article-img { height: 200px; }
  .newsletter-card { grid-template-columns: 1fr; }
  .about-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .archive-list { grid-template-columns: repeat(2, 1fr); }

  .forum-header { display: none; }
  .forum-item { grid-template-columns: 1fr; gap: 8px; }
  .forum-replies, .forum-views, .forum-activity { display: none; }
  .forum-top-bar { flex-direction: column; align-items: stretch; }
  .forum-search { max-width: none; }

  .image-gallery { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .image-gallery-small { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
  .existing-attachments { flex-direction: column; }
  .existing-attachment-item { width: 100%; }
}

@media (max-width: 640px) {
  h1 { font-size: 1.6rem; }
  h2 { font-size: 1.3rem; }
  .hero { padding: 40px 0 36px; }
  .hero h1 { font-size: 1.5rem; }

  .mobile-toggle { display: flex; }
  .nav {
    display: none; position: absolute; top: 64px; left: 0; right: 0;
    flex-direction: column; background: var(--bg-white); padding: 12px;
    border-bottom: 1px solid var(--border); box-shadow: var(--shadow-md);
  }
  .nav.open { display: flex; }
  .user-greeting { display: none; }

  .articles-grid { grid-template-columns: 1fr; }
  .newsletter-card { padding: 24px; }
  .about-grid { grid-template-columns: 1fr; }

  .archive-list { grid-template-columns: 1fr; gap: 16px; }
  .archive-img { height: 160px; }

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

  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
}
