/* ============================================================
   Shabibeh - Stylesheet
   Clean, minimalist, mobile-first design
   ============================================================ */

/* ----- Reset & Base ----- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background-color: #faf8f5; /* soft beige */
  color: #1a1a2e;            /* dark navy text */
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ----- Container ----- */
.container {
  width: 100%;
  max-width: 520px;
  padding: 2rem 1.25rem;
  margin: 0 auto;
  flex: 1;
}

/* ----- Header ----- */
header {
  text-align: center;
  margin-bottom: 2rem;
}

header h1 {
  font-size: 2rem;
  font-weight: 700;
  color: #16213e; /* dark blue */
  letter-spacing: -0.5px;
}

.subtitle {
  color: #555;
  font-size: 0.95rem;
  margin-top: 0.35rem;
}

/* ----- Form Elements ----- */
textarea,
input[type="password"],
input[type="text"] {
  width: 100%;
  padding: 0.85rem 1rem;
  font-size: 1rem;
  border: 2px solid #d1d1d1;
  border-radius: 10px;
  background: #fff;
  color: #1a1a2e;
  resize: vertical;
  transition: border-color 0.2s;
  font-family: inherit;
}

textarea:focus,
input:focus {
  outline: none;
  border-color: #16213e;
}

textarea {
  min-height: 120px;
}

/* Character counter */
.char-count {
  text-align: right;
  font-size: 0.8rem;
  color: #888;
  margin-top: 0.3rem;
  margin-bottom: 0.75rem;
}

.char-count.over-limit {
  color: #c0392b;
  font-weight: 600;
}

/* ----- Buttons ----- */
button {
  display: block;
  width: 100%;
  padding: 0.85rem;
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  background-color: #16213e; /* dark blue */
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background-color 0.2s, opacity 0.2s;
  font-family: inherit;
}

button:hover {
  background-color: #1a2a50;
}

button:active {
  opacity: 0.85;
}

button:disabled {
  background-color: #a0a0a0;
  cursor: not-allowed;
}

.secondary-btn {
  background-color: transparent;
  color: #16213e;
  border: 2px solid #16213e;
}

.secondary-btn:hover {
  background-color: #16213e;
  color: #fff;
}


/* ----- Success Message ----- */
.success-message {
  text-align: center;
  padding: 2rem 0;
}

.success-message .checkmark {
  display: block;
  font-size: 3rem;
  color: #27ae60;
  margin-bottom: 0.75rem;
}

.success-message p {
  font-size: 1.2rem;
  font-weight: 600;
  color: #1a1a2e;
  margin-bottom: 1.5rem;
}

/* ----- Error Message ----- */
.error {
  background-color: #fdecea;
  color: #c0392b;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
  margin-top: 1rem;
  text-align: center;
}

/* ----- Home Button (top left) ----- */
.home-btn {
  position: fixed;
  top: 1rem;
  left: 1rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #16213e;
  background-color: #e8e8ed;
  text-decoration: none;
  padding: 0.45rem 1rem;
  border-radius: 8px;
  transition: background-color 0.2s;
  font-family: inherit;
}

.home-btn:hover {
  background-color: #d0d0d8;
}

/* ----- Admin Button (bottom right) ----- */
.admin-btn {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #16213e;
  background-color: #e8e8ed;
  text-decoration: none;
  padding: 0.45rem 1rem;
  border-radius: 8px;
  transition: background-color 0.2s;
  font-family: inherit;
}

.admin-btn:hover {
  background-color: #d0d0d8;
}

/* ----- User's Submitted Questions ----- */
.my-questions-heading {
  font-size: 1rem;
  font-weight: 600;
  color: #16213e;
  margin-bottom: 0.75rem;
  padding-top: 1rem;
  border-top: 1px solid #e0e0e0;
}

.my-question-card .edit-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  font-size: 1rem;
  border-radius: 8px;
  background-color: #e8e8ed;
  color: #16213e;
}

.my-question-card .edit-btn:hover {
  background-color: #16213e;
  color: #fff;
}

.my-question-card .edit-textarea {
  width: 100%;
  min-height: 80px;
  margin-bottom: 0.5rem;
}

.my-question-card .save-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  font-size: 1rem;
  border-radius: 8px;
  background-color: #27ae60;
  color: #fff;
}

.my-question-card .save-btn:hover {
  background-color: #219a52;
}

.my-question-card .cancel-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  font-size: 1rem;
  border-radius: 8px;
}

/* ----- Dashboard ----- */
.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.dashboard-header h2 {
  font-size: 1.15rem;
  color: #16213e;
}

.dashboard-actions {
  display: flex;
  gap: 0.4rem;
}

.dashboard-actions .secondary-btn {
  width: auto;
  padding: 0.4rem 0.75rem;
  font-size: 0.8rem;
}

/* ----- IP Grouping ----- */
.ip-group {
  margin-bottom: 1.5rem;
}

.ip-group-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.75rem;
  background-color: #e8e8ed;
  border-radius: 8px;
  margin-bottom: 0.5rem;
}

.ip-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #16213e;
  font-family: monospace;
}

.ip-count {
  font-size: 0.75rem;
  color: #555;
}

/* Question card in admin dashboard */
.question-card {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  padding: 1rem 1.15rem;
  margin-bottom: 0.75rem;
  transition: box-shadow 0.2s;
}

.question-card:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.question-card .question-text {
  font-size: 0.95rem;
  line-height: 1.5;
  color: #1a1a2e;
  word-wrap: break-word;
}

.question-card .question-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.65rem;
}

.question-card .timestamp {
  font-size: 0.75rem;
  color: #999;
}

/* Action buttons row */
.question-actions {
  display: flex;
  gap: 0.4rem;
}

.question-card .check-btn,
.question-card .delete-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  font-size: 1rem;
  border-radius: 8px;
}

.question-card .check-btn {
  background-color: #e8e8ed;
  color: #16213e;
}

.question-card .check-btn:hover {
  background-color: #27ae60;
  color: #fff;
}

/* When viewing answered questions, show checkmark as green */
.question-card .check-btn.checked {
  background-color: #27ae60;
  color: #fff;
}

.question-card .check-btn.checked:hover {
  background-color: #e8e8ed;
  color: #16213e;
}

.question-card .delete-btn {
  background-color: #fdecea;
  color: #c0392b;
}

.question-card .delete-btn:hover {
  background-color: #c0392b;
  color: #fff;
}

/* ----- Delete Confirmation Modal ----- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal {
  background: #fff;
  border-radius: 14px;
  padding: 1.75rem 1.5rem;
  width: 90%;
  max-width: 340px;
  text-align: center;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.modal p {
  font-size: 1.05rem;
  font-weight: 600;
  color: #1a1a2e;
  margin-bottom: 1.25rem;
}

.modal-actions {
  display: flex;
  gap: 0.6rem;
}

.modal-actions button {
  flex: 1;
  padding: 0.65rem;
  font-size: 0.9rem;
  border-radius: 8px;
}

.delete-confirm-btn {
  background-color: #c0392b;
}

.delete-confirm-btn:hover {
  background-color: #a93226;
}

/* ----- Utility Classes ----- */
.hidden {
  display: none !important;
}

.muted {
  color: #888;
  text-align: center;
  font-size: 0.9rem;
  padding: 2rem 0;
}

/* ----- Home Page ----- */
.home-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 3rem;
}

.home-nav {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.nav-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 1.5rem 1rem;
  background: #fff;
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  text-decoration: none;
  color: #1a1a2e;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.nav-card:hover {
  border-color: #16213e;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.nav-icon {
  font-size: 2rem;
  margin-bottom: 0.25rem;
}

.nav-label {
  font-size: 1.1rem;
  font-weight: 600;
  color: #16213e;
}

.nav-desc {
  font-size: 0.85rem;
  color: #888;
}

/* ----- Desktop Adjustments ----- */
@media (min-width: 600px) {
  .container {
    padding: 3rem 1.5rem;
  }

  header h1 {
    font-size: 2.4rem;
  }
}
