/* ==========================================================================
   PalestineDay - Global Diaspora Community & Culture Platform Stylesheet
   DEV.to / Forem Inspired Architecture with Modern Slate & Cultural Aesthetics
   ========================================================================== */

:root {
  --bg-main: #0b1120;
  --bg-card: #131f37;
  --bg-card-hover: #192947;
  --bg-input: #070d1a;
  --bg-sidebar: #0f182e;
  
  --primary: #009639; /* Palestinian Emerald Green */
  --primary-hover: #00b344;
  --primary-glow: rgba(0, 150, 57, 0.25);
  
  --accent-red: #EE2A35; /* Palestinian Flag Crimson Red */
  --accent-gold: #F59E0B; /* Heritage Warm Gold */
  --accent-cyan: #00F0FF;
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  --border-color: rgba(255, 255, 255, 0.08);
  --border-highlight: rgba(0, 150, 57, 0.4);
  
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-pill: 9999px;
  
  --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.4);
  --shadow-hover: 0 10px 30px rgba(0, 0, 0, 0.6);
  --glass-backdrop: blur(12px);
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

button, input, select, textarea {
  font-family: inherit;
}

/* ==========================================================================
   Header & Top Navigation
   ========================================================================== */

.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(11, 17, 32, 0.92);
  backdrop-filter: var(--glass-backdrop);
  border-bottom: 1px solid var(--border-color);
  height: 64px;
  display: flex;
  align-items: center;
}

.nav-container {
  width: 100%;
  max-width: 1380px;
  margin: 0 auto;
  padding: 0 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 900;
  font-size: 1.25rem;
  color: #fff;
  letter-spacing: -0.02em;
}

.brand-flag-badge {
  display: flex;
  height: 22px;
  width: 32px;
  border-radius: 3px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
  flex-direction: column;
  position: relative;
}

.flag-black { background: #000; height: 33.33%; width: 100%; }
.flag-white { background: #fff; height: 33.33%; width: 100%; }
.flag-green { background: #009639; height: 33.34%; width: 100%; }
.flag-red-triangle {
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  border-top: 11px solid transparent;
  border-bottom: 11px solid transparent;
  border-left: 14px solid #EE2A35;
}

.nav-search-bar {
  flex: 1;
  max-width: 480px;
  position: relative;
  display: flex;
  align-items: center;
}

.nav-search-input {
  width: 100%;
  height: 38px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0 1rem 0 2.4rem;
  color: #fff;
  font-size: 0.88rem;
  transition: all 0.2s ease;
}

.nav-search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 12px var(--primary-glow);
}

.nav-search-icon {
  position: absolute;
  left: 0.85rem;
  color: var(--text-dim);
  font-size: 0.85rem;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.45rem 1rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 0 15px var(--primary-glow);
  transform: translateY(-1px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--border-color);
  color: var(--text-main);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.btn-red {
  background: var(--accent-red);
  color: #fff;
  border-color: var(--accent-red);
}

.btn-red:hover {
  background: #d81b25;
  box-shadow: 0 0 15px rgba(238, 42, 53, 0.35);
}

/* ==========================================================================
   3-Column Community Layout (DEV.to Architecture)
   ========================================================================== */

.community-layout-container {
  width: 100%;
  max-width: 1380px;
  margin: 1.5rem auto 3rem;
  padding: 0 1.25rem;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr) 320px;
  gap: 1.5rem;
  align-items: start;
}

/* --- Left Sidebar --- */
.sidebar-left {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  position: sticky;
  top: 80px;
}

.sidebar-nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.sidebar-nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0.85rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.sidebar-nav-link:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

.sidebar-nav-link.active {
  background: rgba(0, 150, 57, 0.15);
  color: var(--primary);
  font-weight: 700;
  border-left: 3px solid var(--primary);
}

.sidebar-section-title {
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  margin-bottom: 0.45rem;
  padding: 0 0.5rem;
}

.chapter-badge-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}

.chapter-badge-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.chapter-badge-item.active {
  background: rgba(0, 150, 57, 0.15);
  color: var(--primary);
  font-weight: 700;
}

.tag-item-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.35rem 0.65rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}

.tag-item-link:hover {
  color: var(--primary);
  background: rgba(0, 150, 57, 0.08);
}

/* --- Center Feed Area --- */
.feed-center {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.feed-tabs-header {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.4rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.feed-tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.92rem;
  font-weight: 600;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.feed-tab-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.feed-tab-btn.active {
  color: #fff;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.08);
}

/* --- Create Story / Memory Quick Bar --- */
.create-post-quick-bar {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.15rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  cursor: pointer;
  transition: border-color 0.2s;
}

.create-post-quick-bar:hover {
  border-color: var(--primary);
}

.quick-bar-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--primary);
}

.quick-bar-placeholder {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.85rem;
  color: var(--text-dim);
  font-size: 0.85rem;
}

/* --- Post Card (DEV.to Style) --- */
.post-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-card);
}

.post-card:hover {
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: var(--shadow-hover);
}

.post-cover-image {
  width: 100%;
  height: 220px;
  object-fit: cover;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.post-cover-image:hover {
  transform: scale(1.015);
}

.post-card-body {
  padding: 1.25rem 1.5rem;
}

.post-author-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.65rem;
}

.post-author-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
}

.post-author-info {
  display: flex;
  flex-direction: column;
}

.post-author-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: #fff;
}

.post-author-meta {
  font-size: 0.75rem;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.post-title {
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.3;
  margin-bottom: 0.5rem;
  color: #fff;
  cursor: pointer;
}

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

.post-tags-row {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin-bottom: 0.85rem;
}

.post-tag-chip {
  font-size: 0.75rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.05);
  cursor: pointer;
}

.post-tag-chip:hover {
  color: var(--primary);
  border-color: rgba(0, 150, 57, 0.3);
}

.post-footer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 0.65rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.post-reactions-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.reaction-pill-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  padding: 0.25rem 0.55rem;
  border-radius: var(--radius-pill);
  font-size: 0.78rem;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  cursor: pointer;
  transition: all 0.2s;
}

.reaction-pill-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.reaction-pill-btn.reacted {
  background: rgba(0, 150, 57, 0.15);
  border-color: rgba(0, 150, 57, 0.3);
  color: var(--primary);
}

.post-meta-group {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  font-size: 0.78rem;
  color: var(--text-dim);
}

.bookmark-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s;
  padding: 0.2rem;
}

.bookmark-btn:hover {
  color: var(--accent-gold);
  transform: scale(1.15);
}

.bookmark-btn.saved {
  color: var(--accent-gold);
}

/* --- Right Sidebar --- */
.sidebar-right {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  position: sticky;
  top: 80px;
}

.sidebar-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  box-shadow: var(--shadow-card);
}

.sidebar-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.85rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
}

.sidebar-card-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.event-mini-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.event-mini-item:last-child {
  border-bottom: none;
}

.event-mini-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
}

.event-mini-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ==========================================================================
   Modals & Drawers
   ========================================================================== */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.modal-backdrop.active {
  display: flex;
  opacity: 1;
}

.modal-content {
  background: #0f182e;
  border: 1px solid var(--border-highlight);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  max-width: 680px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
  transform: translateY(20px);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-backdrop.active .modal-content {
  transform: translateY(0);
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
}

.modal-close:hover {
  color: #fff;
}

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

.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.form-input, .form-textarea, .form-select {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.85rem;
  color: #fff;
  font-size: 0.9rem;
  transition: border-color 0.2s;
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 12px var(--primary-glow);
}

.form-textarea {
  min-height: 140px;
  resize: vertical;
}

/* ==========================================================================
   Hosted Solutions Blueprint Grid
   ========================================================================== */

.arch-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 1rem;
  transition: all 0.2s;
}

.arch-card:hover {
  border-color: var(--primary);
  background: rgba(0, 150, 57, 0.04);
}

.arch-card-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.arch-free-tier-badge {
  background: rgba(0, 150, 57, 0.15);
  color: var(--primary);
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  font-weight: 700;
  display: inline-block;
  margin-bottom: 0.4rem;
}

.code-block-embed {
  background: #060b14;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.85rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: #38bdf8;
  overflow-x: auto;
  margin-top: 0.5rem;
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */

@media (max-width: 1080px) {
  .community-layout-container {
    grid-template-columns: 220px minmax(0, 1fr);
  }
  .sidebar-right {
    display: none;
  }
}

@media (max-width: 768px) {
  .community-layout-container {
    grid-template-columns: 1fr;
    margin-top: 0.75rem;
  }

  .sidebar-left {
    display: none;
  }

  .nav-search-bar {
    display: none;
  }

  .header {
    height: 56px;
  }

  .post-card-body {
    padding: 1rem;
  }

  .post-title {
    font-size: 1.15rem;
  }
}
