:root {
  --primary-color: #92c23b;
  --primary-dark: #7aa331;
  --bg-color: #fafafa;
  --card-bg: #ffffff;
  --text-main: #262626;
  --text-muted: #8e8e8e;
  --border-color: #dbdbdb;
  --radius-lg: 16px;
  --radius-md: 12px;
  --shadow-soft: 0 4px 12px rgba(0, 0, 0, 0.05);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
  background-color: var(--bg-color);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

header {
  background: var(--card-bg);
  border-bottom: 1px solid var(--border-color);
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 10;
}

.logo {
  font-size: 20px;
  font-weight: bold;
  color: var(--primary-color);
  text-decoration: none;
}

.my-answers-btn {
  background: none;
  border: none;
  color: var(--text-main);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

main {
  max-width: 600px;
  margin: 0 auto;
  padding: 20px;
  min-height: 100vh;
}

/* Cards */
.card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  transition: transform 0.2s ease;
  text-decoration: none;
  display: block;
  color: inherit;
}

.card:active {
  transform: scale(0.98);
}

.card h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
}

.card .meta {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
}

/* Buttons */
.btn {
  display: inline-block;
  background: var(--primary-color);
  color: #fff;
  border: none;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  width: 100%;
  transition: background 0.2s;
}

.btn:hover {
  background: var(--primary-dark);
}

.btn-outline {
  background: transparent;
  color: var(--primary-color);
  border: 1px solid var(--primary-color);
}

/* Question Page */
.page-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 20px;
}

.answer-item {
  background: var(--card-bg);
  padding: 16px;
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  box-shadow: var(--shadow-soft);
  position: relative;
}

.answer-item .author {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
}

.author .badge {
  background-color: var(--primary-color);
  color: white;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 10px;
  margin-left: 8px;
}

.answer-item .text {
  font-size: 15px;
  margin-bottom: 12px;
}

.action-bar {
  display: flex;
  gap: 16px;
  margin-top: 10px;
}

.action-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Thread / Replies */
.replies-container {
  margin-top: 16px;
  padding-left: 16px;
  border-left: 2px solid var(--border-color);
  display: none; /* hidden by default */
}

.reply-item {
  margin-bottom: 12px;
}
.reply-item:last-child {
  margin-bottom: 0;
}
.reply-item .author {
  font-size: 13px;
}
.reply-item .text {
  font-size: 14px;
}

/* Form Styles */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
}

.form-control {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 15px;
  background: var(--bg-color);
}
.form-control:focus {
  outline: none;
  border-color: var(--primary-color);
}

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

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: flex-end;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: var(--card-bg);
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 24px;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

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

.close-modal {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  position: absolute;
  top: 16px;
  right: 16px;
  color: var(--text-muted);
}

/* Toast */
.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #333;
  color: #fff;
  padding: 12px 24px;
  border-radius: 24px;
  font-size: 14px;
  transition: transform 0.3s;
  z-index: 200;
}
.toast.active {
  transform: translateX(-50%) translateY(0);
}

/* Utility */
.hidden { display: none !important; }
.text-center { text-align: center; }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }

/* Share logic */
.share-bar {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}
.share-btn {
  flex: 1;
  padding: 10px;
  border-radius: var(--radius-md);
  text-align: center;
  font-weight: bold;
  text-decoration: none;
  color: white;
}
.whatsapp-btn { background: #25D366; }
.facebook-btn { background: #1877F2; }

/* Loader */
.loader {
  border: 3px solid var(--border-color);
  border-top: 3px solid var(--primary-color);
  border-radius: 50%;
  width: 24px;
  height: 24px;
  animation: spin 1s linear infinite;
  margin: 20px auto;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
