

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

*,
*::before,
*::after { box-sizing: border-box; }
.hidden { display: none !important; }
:focus-visible { outline: 2px solid #00ffff; outline-offset: 2px; }

section {
  width: 100%;
  margin: 1.5rem auto;
  padding: 1.25rem;
  background: rgba(15,15,15,0.95);
  border: 1px solid #00ffff;
  border-radius: 12px;
  box-shadow: 0 0 12px rgba(0,255,255,0.12);
}

h2, h3 { color: #00ffff; margin: 0 0 1rem; }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.btn-secondary {
  background: transparent; color: #00ffff; border: 1px solid #00ffff; border-radius: 6px; padding: 8px 12px; cursor: pointer; font-weight: 600;
}
.btn-secondary:hover { background: rgba(0,255,255,0.08); }

#login-msg {
  display: none;
  background: rgba(0,0,0,0.8);
  border: 1px solid #ff0000;
  color: #ff0000; 
  padding: 10px 12px;
  border-radius: 8px;
  max-width: 1000px;
  margin: 16px auto;
  font-weight: 600;
  text-align: center;
  z-index: 9999;
  top: 75px;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0;
  transition: opacity 0.3s ease;
}
#page-loader {
  width: 100%; height: 3px;
  background: linear-gradient(90deg,#00ffff,#00cccc,#00ffff);
  background-size: 200% 100%;
  animation: loaderShine 1s infinite linear;
}
@keyframes loaderShine { 0% { background-position: 0% 0%; } 100% { background-position: 200% 0%; } }

.info {
  padding: 10px 12px;
  border: 1px solid #7ddcff;
  color: #cfefff;
  border-radius: 8px;
  background: rgba(0,140,255,0.06);
}
.error {
  padding: 10px 12px;
  border: 1px solid #ff0000; 
  color: #ff0000; 
  border-radius: 8px;
  background: rgba(255,0,0,0.1); 
}

.response-box {
  display: none;
  padding: 10px 15px;
  border-radius: 6px;
  margin-top: 8px;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.response-success {
  display: block;
  background: rgba(0,255,255,0.12);
  color: #00ffff;
  border: 1px solid #00ffff;
}
.response-error {
  display: block;
  background: rgba(255,0,0,0.12);
  color: #ff0000; 
  border: 1px solid #ff0000; 
}

.view-threads-container { margin-bottom: 0.75rem; }
.posted-threads-title { color: #7ddcff; margin: 0 0 10px; font-weight: 600; }

#threads-list { display: flex; flex-direction: column; gap: 12px; }

.thread-card {
  background: #000;
  border: 1px solid #00ffff;
  border-radius: 8px;
  padding: 14px 16px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.thread-card:hover { box-shadow: 0 0 14px rgba(0,255,255,0.12); border-color: #00e0e0; }
.thread-card h5 { color: #00ffff; margin: 0; font-size: 1.05rem; }
.thread-card p { color: #fff; margin: 6px 0 0; font-size: 0.95rem; }
.thread-card .thread-meta { color: #7ddcff; font-size: 0.85rem; margin-top: 8px; }

.thread-actions { display: flex; gap: 8px; align-items: center; }
.view-btn {
  background: transparent; color: #00ffff; border: 1px solid #00ffff;
  border-radius: 6px; padding: 6px 10px; cursor: pointer; font-weight: 600;
}
.view-btn:hover { background: rgba(0,255,255,0.08); }

.create-thread-container { margin-top: 1.25rem; }
.thread-input-wrapper { display: flex; flex-direction: column; gap: 10px; }

#thread-title, #thread-input {
  width: 100%; background: #000; color: #00ffff; border: 1px solid #00ffff; border-radius: 6px; padding: 10px 12px;
  font-size: 1rem;
}
#thread-input { min-height: 110px; resize: vertical; }

.create-actions { display: flex; align-items: center; gap: 12px; margin-top: 6px; }
#submit-thread {
  background: #00ffff; color: #000; border: none; border-radius: 6px; padding: 10px 18px; cursor: pointer; font-weight: bold;
}
#submit-thread:hover { background: #00cccc; }

.thread-discussion .thread-header { border-bottom: 1px solid #00ffff; margin-bottom: 20px; padding-bottom: 10px; }
.thread-discussion .header-row { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.thread-discussion h3 { color: #00ffff; margin-bottom: 6px; }
.thread-discussion p { color: #e0e0e0; }
.thread-discussion .thread-meta { font-size: 0.9rem; color: #7ddcff; }

#discussion-comments { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
.comment {
  background: #000; border: 1px solid #00ffff; border-radius: 8px; padding: 12px 16px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.comment:hover { box-shadow: 0 0 12px rgba(0,255,255,0.08); border-color: #00e0e0; }

.comment-header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.comment-header .username { color: #00ffff; font-weight: 600; font-size: 0.95rem; }
.comment-header .timestamp { font-size: 0.82rem; color: #7ddcff; }
.comment-body { color: #fff; font-size: 0.95rem; }

.comment-input-wrapper { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
#discussion-comment-input {
  width: 100%; min-height: 90px; background: #000; color: #00ffff; border: 1px solid #00ffff; border-radius: 6px; padding: 12px; resize: vertical;
}
#submit-discussion-comment {
  background: #00ffff; color: #000; border: none; border-radius: 6px; padding: 10px 18px; cursor: pointer; font-weight: bold;
}
#submit-discussion-comment:hover { background: #00cccc; }

@media (max-width: 900px) {
  section { padding: 1rem; }
  .thread-card { grid-template-columns: 1fr; }
  .thread-card .thread-meta { margin-top: 8px; }
}

/* Mobile responsive fixes for forums */

@media (max-width: 768px) {
  .forums-wrapper {
    gap: 1.5rem;
    padding: 0.5rem;
  }
  
  .thread-form,
  .replies-section {
    padding: 1rem;
  }
  
  .thread-form h2,
  .replies-section h3 {
    font-size: 1.1rem;
  }
  
  .thread-form input,
  .thread-form textarea {
    font-size: 0.9rem;
  }
  
  .form-actions {
    flex-direction: column;
    align-items: stretch;
  }
  
  .form-actions button {
    width: 100%;
  }
  
  .replies-list {
    gap: 1rem;
  }
  
  .reply-item {
    padding: 0.75rem;
  }
  
  .reply-header {
    flex-direction: column;
    gap: 0.25rem;
  }
  
  .no-replies {
    padding: 2rem 1rem;
  }
  
  .live-update {
    width: 90%;
    left: 5%;
    transform: none;
    font-size: 0.85rem;
    padding: 0.75rem 1rem;
  }
}

@media (max-width: 480px) {
  .forums-wrapper {
    margin-top: 80px;
  }
  
  .thread-form h2,
  .replies-section h3 {
    font-size: 1rem;
  }
  
  #char-count,
  #reply-char-count {
    font-size: 0.8rem;
  }
}
