/* ============================================
   ======== FORUM PAGE STYLES (v3 - Nytt system) =========
   ============================================ */

 :root {
  --brand-primary: #FF6B35;
  --brand-secondary: #F7B32B;
  --text-primary: #212529;
  --text-secondary: #6c757d;
  --bg-light: #f8f9fa;
  --bg-white: #ffffff;
  --border-color: #dee2e6;
  --radius: 12px;
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* ============================================
   ========== GENERAL & HERO ================
   ============================================ */

.hero {
  text-align: center;
  padding: clamp(2rem, 8vw, 4rem) 1.25rem;
  background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-secondary) 100%);
  color: var(--bg-white);
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 2.8rem);
  margin: 0;
  font-weight: 800;
  text-shadow: 1px 1px 3px rgba(0,0,0,0.1);
}

.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.2rem);
  margin: 0.5rem 0 0 0;
  opacity: 0.95;
}

.center-wrap {
  max-width: 1200px;
  margin: 0 auto;
}

/* ============================================
   ========== AUTH & SUBSCRIPTION VIEWS =====
   ============================================ */

.auth-section {
  padding: 4rem 1.25rem;
}

.alert {
  background: var(--bg-light);
  border-radius: var(--radius);
  padding: clamp(1.5rem, 5vw, 3rem);
  text-align: center;
  border-left: 5px solid var(--brand-primary);
}

.alert h2 {
  margin: 0 0 1rem 0;
  font-size: clamp(1.4rem, 4vw, 1.8rem);
  color: var(--text-primary);
}

.alert p {
  margin: 0 0 2rem 0;
  color: var(--text-secondary);
}

.alert-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.subscription-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin-top: 2.5rem;
}

.subscription-card {
  background: var(--bg-white);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: left;
  transition: all 0.3s ease;
  position: relative;
}

.subscription-card:hover {
  transform: translateY(-5px);
  border-color: var(--brand-primary);
  box-shadow: var(--shadow);
}

.subscription-card.featured {
  border-color: var(--brand-primary);
  transform: scale(1.05);
}

.discount-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--brand-primary);
  color: var(--bg-white);
  padding: 5px 15px;
  border-radius: 20px;
  font-weight: bold;
  font-size: 0.85rem;
}

.subscription-card h3 {
  margin: 1rem 0 0.5rem 0;
  font-size: 1.5rem;
}

.price {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--brand-primary);
  margin: 1rem 0;
}

.subscription-card p {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

/* ============================================
   ========== FORUM CONTAINER & VIEWS =======
   ============================================ */

.forum-container {
  padding: 2.5rem 1.25rem;
}

.view-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.view-title {
  font-size: clamp(1.5rem, 4vw, 2rem);
  margin: 0 0 2rem 0;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.btn-back {
  background: none;
  border: 2px solid var(--brand-primary);
  color: var(--brand-primary);
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
}

.btn-back:hover {
  background: var(--brand-primary);
  color: var(--bg-white);
}

/* ============================================
   ========== CATEGORIES VIEW ===============
   ============================================ */

.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.category-card {
  background: var(--bg-white);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 1.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
}

.category-card:hover {
  transform: translateY(-4px);
  border-color: var(--brand-primary);
  box-shadow: var(--shadow);
}

.category-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 15px;
}

.category-icon {
  font-size: 2rem;
}

.category-name {
  margin: 0;
  font-size: 1.3rem;
  color: var(--text-primary);
  flex: 1;
}

.category-desc {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin: 1rem 0;
  flex-grow: 1;
}

.category-stats {
  display: flex;
  gap: 1.5rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
  border-top: 1px solid var(--border-color);
  padding-top: 1rem;
  margin-top: auto;
}

/* ============================================
   ========== TOPICS VIEW ===================
   ============================================ */

.topics-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.topic-item {
  background: var(--bg-white);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 1.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.topic-item:hover {
  transform: translateY(-2px);
  border-color: var(--brand-primary);
  box-shadow: var(--shadow);
}

.topic-item-main {
  flex-grow: 1;
}

.topic-title {
  margin: 0 0 0.5rem 0;
  font-size: 1.2rem;
  color: var(--text-primary);
}

.topic-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.topic-stats {
  flex-shrink: 0;
  text-align: right;
}

.topic-stat {
  display: block;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.topic-stat strong {
  font-size: 1.2rem;
  color: var(--text-primary);
  display: block;
}

/* ============================================
   ========== TOPIC (POSTS) VIEW ============
   ============================================ */

.post-card {
  background: var(--bg-white);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.post-card.original-post {
  border-width: 2px;
  border-color: var(--brand-primary);
}

.post-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}

.post-author-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.post-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg-light);
}

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

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

.post-date {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.post-content {
  line-height: 1.7;
  color: var(--text-primary);
  white-space: pre-wrap;
  word-break: break-word;
}

.post-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
  flex-wrap: wrap;
}

.btn-action {
  background: none;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.3s ease;
}

.btn-action:hover {
  background: var(--brand-primary);
  color: var(--bg-white);
  border-color: var(--brand-primary);
}

/* ============================================
   ========== REPLY & MODAL FORMS ===========
   ============================================ */

.reply-form {
  background: var(--bg-light);
  border-top: 2px solid var(--border-color);
  border-radius: var(--radius);
  padding: 2rem;
  margin-top: 2rem;
}

.reply-form h3 {
  margin: 0 0 1.5rem 0;
}

.modal {
  display: flex;
  position: fixed;
  z-index: 1000;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.6);
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background-color: var(--bg-white);
  padding: clamp(1.5rem, 5vw, 2.5rem);
  border-radius: var(--radius);
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  animation: slideUp 0.3s ease;
}

.modal-close {
  position: absolute;
  right: 1rem;
  top: 1rem;
  background: none;
  border: none;
  font-size: 2rem;
  cursor: pointer;
  color: var(--text-secondary);
  transition: color 0.3s ease;
}

.modal-close:hover {
  color: var(--brand-primary);
}

.modal-content h2 {
  margin: 0 0 2rem 0;
}

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

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

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-family: inherit;
  font-size: 1rem;
  transition: all 0.2s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.2);
}

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

.form-group input[readonly] {
  background-color: var(--bg-light);
  cursor: not-allowed;
}

.form-actions {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
  justify-content: flex-end;
}

/* ============================================
   ========== UTILITIES & HELPERS ===========
   ============================================ */

.btn {
  background: var(--brand-primary);
  color: var(--bg-white);
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
  display: inline-block;
  text-decoration: none;
  text-align: center;
}

.btn:hover {
  background: #e05a2d;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(255, 107, 53, 0.3);
}

.btn-secondary {
  background: #e9ecef;
  color: var(--text-primary);
}
.btn-secondary:hover {
  background: #ced4da;
  box-shadow: none;
}

.hidden {
  display: none !important;
}

.loading-placeholder,
.no-content-placeholder {
  text-align: center;
  color: var(--text-secondary);
  padding: 3rem 1rem;
  background: var(--bg-light);
  border-radius: var(--radius);
  border: 1px dashed var(--border-color);
}

.breadcrumbs {
  margin-bottom: 2rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.breadcrumbs a {
  color: var(--brand-primary);
  text-decoration: none;
  font-weight: 600;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ============================================
   ========== RESPONSIVE DESIGN =============
   ============================================ */

@media (max-width: 768px) {
  .subscription-card.featured {
    transform: scale(1);
  }

  .topic-item {
    flex-direction: column;
    gap: 0.5rem;
  }

  .topic-stats {
    text-align: left;
    display: flex;
    gap: 1.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
  }

  .topic-stat strong {
    display: inline;
    margin-right: 0.25rem;
  }

  .form-actions {
    flex-direction: column-reverse;
  }

  .form-actions .btn,
  .form-actions .btn-secondary {
    width: 100%;
  }
}