/* ============================================================
   Novi Feedback Forum — Styles
   Brand: #221E1F black, #FF6201 orange, #FAFAF2 off-white
   Font:  Inter
   ============================================================ */

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --black: #221E1F;
  --black-light: #2A2526;
  --orange: #FF6201;
  --orange-dark: #CC4E00;
  --navy: #3850DA;
  --off-white: #FAFAF2;
  --white: #FFFFFF;
  --grey-100: #F5F5F5;
  --grey-200: #E5E5E5;
  --grey-400: #A3A3A3;
  --grey-500: #737373;
  --grey-600: #525252;
  --success: #34C759;
  --error: #FF3B30;
  --border: rgba(250, 250, 242, 0.08);
  --text-muted: rgba(250, 250, 242, 0.5);
  --radius: 12px;
  --radius-sm: 8px;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: 'Inter', -apple-system, 'Segoe UI', Arial, sans-serif;
  background: var(--black);
  color: var(--off-white);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ===== HEADER ===== */

.header {
  border-bottom: 1px solid var(--border);
  padding: 20px 0;
}

.header-inner {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.header-logo {
  height: 40px;
  width: auto;
}

.header-title h1 {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.2;
}

.header-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

.header-back {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
  white-space: nowrap;
  transition: color 0.15s;
}
.header-back:hover {
  color: var(--off-white);
}

/* ===== MAIN ===== */

.main {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 24px;
  width: 100%;
  flex: 1;
}

/* ===== SUBMIT SECTION ===== */

.submit-section {
  padding: 32px 0 24px;
  border-bottom: 1px solid var(--border);
}

.section-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 4px;
}

.section-desc {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.feedback-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-row {
  display: flex;
  gap: 14px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.form-group-name { flex: 2; }
.form-group-category { flex: 1; }

.form-group label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
}

.optional {
  font-weight: 300;
  opacity: 0.6;
}

.form-group input,
.form-group textarea,
.form-group select {
  background: var(--black-light);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--off-white);
  font-family: inherit;
  font-size: 14px;
  padding: 10px 14px;
  outline: none;
  transition: border-color 0.15s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: var(--orange);
}

.form-group textarea {
  resize: vertical;
  min-height: 60px;
}

.form-group select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%23737373' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

.btn-submit {
  align-self: flex-start;
  background: var(--orange);
  color: var(--white);
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 28px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-submit:hover { background: var(--orange-dark); }
.btn-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.form-message {
  font-size: 13px;
  padding: 8px 0;
}
.form-message.success { color: var(--success); }
.form-message.error { color: var(--error); }

/* ===== FILTER SECTION ===== */

.filter-section {
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
}

.filter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.filter-tabs {
  display: flex;
  gap: 4px;
}

.filter-tab {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  padding: 6px 16px;
  cursor: pointer;
  transition: all 0.15s;
}
.filter-tab:hover { color: var(--off-white); border-color: rgba(250, 250, 242, 0.2); }
.filter-tab.active {
  background: var(--orange);
  border-color: var(--orange);
  color: var(--white);
}

.filter-controls {
  display: flex;
  gap: 10px;
  align-items: center;
}

.search-input {
  background: var(--black-light);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--off-white);
  font-family: inherit;
  font-size: 13px;
  padding: 7px 12px;
  width: 180px;
  outline: none;
  transition: border-color 0.15s;
}
.search-input:focus { border-color: var(--orange); }

.sort-select {
  background: var(--black-light);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--off-white);
  font-family: inherit;
  font-size: 13px;
  padding: 7px 32px 7px 12px;
  outline: none;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%23737373' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}

/* ===== POSTS ===== */

.posts-section {
  padding: 20px 0 40px;
}

.posts-loading,
.posts-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 48px 0;
  font-size: 14px;
}

.posts-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Individual post card */
.post-card {
  background: var(--black-light);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
  transition: border-color 0.15s;
}
.post-card:hover {
  border-color: rgba(250, 250, 242, 0.15);
}

/* Vote button */
.vote-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 12px;
  min-width: 50px;
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
}
.vote-btn:hover {
  border-color: var(--orange);
  color: var(--orange);
}
.vote-btn.voted {
  background: var(--orange);
  border-color: var(--orange);
  color: var(--white);
}
.vote-btn .vote-arrow {
  font-size: 14px;
  line-height: 1;
}

/* Post content */
.post-content {
  flex: 1;
  min-width: 0;
}

.post-title {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 4px;
  word-break: break-word;
}

.post-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 8px;
  word-break: break-word;
  /* Clamp to 3 lines */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-meta {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: var(--grey-500);
}

.post-category {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 500;
}
.post-category[data-cat="novi"] {
  background: rgba(255, 98, 1, 0.15);
  color: var(--orange);
}
.post-category[data-cat="novi-for-schools"] {
  background: rgba(56, 80, 218, 0.15);
  color: var(--navy);
}
.post-category[data-cat="general"] {
  background: rgba(250, 250, 242, 0.08);
  color: var(--grey-400);
}

/* Status badge */
.post-status {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 500;
}
.post-status[data-status="open"] {
  background: rgba(250, 250, 242, 0.08);
  color: var(--grey-400);
}
.post-status[data-status="planned"] {
  background: rgba(56, 80, 218, 0.15);
  color: var(--navy);
}
.post-status[data-status="in-progress"] {
  background: rgba(255, 98, 1, 0.15);
  color: var(--orange);
}
.post-status[data-status="completed"] {
  background: rgba(52, 199, 89, 0.15);
  color: var(--success);
}

/* ===== FOOTER ===== */

.footer {
  text-align: center;
  padding: 24px;
  font-size: 13px;
  color: var(--grey-500);
  border-top: 1px solid var(--border);
}
.footer a {
  color: var(--grey-400);
  text-decoration: none;
}
.footer a:hover { color: var(--off-white); }

/* ===== IMAGE UPLOAD ===== */

.image-upload-area {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: flex-start;
}

.image-previews {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.image-preview {
  position: relative;
  width: 80px;
  height: 80px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
}

.image-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.7);
  color: var(--off-white);
  border: none;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.image-remove:hover { background: var(--error); }

.btn-add-image {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border);
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s, color 0.15s;
}
.btn-add-image:hover {
  border-color: var(--orange);
  color: var(--orange);
}

/* ===== POST IMAGES ===== */

.post-images {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.post-image {
  width: 120px;
  height: 80px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: opacity 0.15s;
}
.post-image:hover { opacity: 0.8; }

/* ===== LIGHTBOX ===== */

.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  cursor: pointer;
  padding: 24px;
}
.lightbox-overlay img {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: var(--radius);
  cursor: default;
}

/* ===== COMMENTS ===== */

.comment-toggle {
  background: none;
  border: none;
  color: var(--grey-500);
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
  padding: 0;
  transition: color 0.15s;
}
.comment-toggle:hover { color: var(--off-white); }

.comments-section {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.comments-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}

.comments-loading,
.comments-empty {
  font-size: 13px;
  color: var(--text-muted);
  padding: 8px 0;
}

.comment {
  padding: 10px 12px;
  background: rgba(250, 250, 242, 0.03);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.comment-header {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 4px;
}

.comment-author {
  font-size: 13px;
  font-weight: 600;
  color: var(--off-white);
}

.comment-time {
  font-size: 11px;
  color: var(--grey-500);
}

.comment-body {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-muted);
  word-break: break-word;
}

.comment-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.comment-form .comment-name,
.comment-form .comment-text {
  background: var(--black-light);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--off-white);
  font-family: inherit;
  font-size: 13px;
  padding: 8px 12px;
  outline: none;
  transition: border-color 0.15s;
}
.comment-form .comment-name:focus,
.comment-form .comment-text:focus {
  border-color: var(--orange);
}

.comment-form .comment-text {
  resize: vertical;
  min-height: 40px;
}

.btn-comment-submit {
  align-self: flex-start;
  background: var(--orange);
  color: var(--white);
  border: none;
  border-radius: var(--radius-sm);
  padding: 7px 18px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-comment-submit:hover { background: var(--orange-dark); }
.btn-comment-submit:disabled { opacity: 0.5; cursor: not-allowed; }

/* ===== RESPONSIVE ===== */

@media (max-width: 600px) {
  .header-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .header-back { display: none; }

  .form-row {
    flex-direction: column;
  }

  .filter-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .filter-controls {
    width: 100%;
  }
  .search-input {
    flex: 1;
    width: auto;
  }

  .post-card {
    padding: 14px;
    gap: 12px;
  }
}
