/* =================================
   Components
   - Reusable UI elements like buttons, cards, tables, forms, and modals.
================================= */

/* --- Buttons --- */
.btn {
  display: inline-block;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  transition:
    background-color 0.2s ease,
    transform 0.1s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background-color: #1877f2; /* A more modern blue */
  color: #fff;
}

.btn-primary:hover {
  background-color: #166fe5;
}

.btn-secondary {
  background-color: #e4e6eb;
  color: #050505;
}

.btn-secondary:hover {
  background-color: #d8dadf;
}

.btn-danger {
  background-color: #fa383e;
  color: #fff;
}

.btn-danger:hover {
  background-color: #e32b31;
}

.btn-icon {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease;
}

.btn-icon:hover {
  background-color: #f0f2f5;
}

.btn-icon .material-symbols-outlined {
  font-size: 1.25rem;
}
.btn-icon.delete-survey-btn .material-symbols-outlined {
  color: #fa383e; /* red */
}
.btn-icon.resolve-report-btn .material-symbols-outlined {
  color: #34c759; /* green */
}
.btn-icon.edit-report-btn .material-symbols-outlined {
  color: #1877f2; /* blue */
}

/* --- Cards --- */
.card {
  background-color: #fff;
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  margin-bottom: 1.5rem;
}

.card h3 {
  margin-top: 0;
  border-bottom: 1px solid #dddfe2;
  padding-bottom: 0.75rem;
  margin-bottom: 1rem;
}

/* --- Tables --- */
.table-wrapper {
  overflow-x: auto; /* For responsive tables */
}

.table {
  width: 100%;
  border-collapse: collapse;
  background-color: #fff;
}

.table th,
.table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid #dddfe2;
}

.table th {
  background-color: #f5f6f7;
  font-weight: 600;
}

.table tr:last-child td {
  border-bottom: none;
}

.table tr:hover {
  background-color: #f5f6f7;
}

.feedback-count-btn {
  background: none;
  border: none;
  color: #1877f2;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  text-decoration: underline;
}

.feedback-count-btn:hover {
  color: #166fe5;
}

.feedback-list {
  display: grid;
  gap: 1rem;
}

.feedback-item {
  border: 1px solid #dddfe2;
  border-radius: 8px;
  padding: 1rem;
}

.feedback-item p {
  margin: 0 0 0.5rem;
}

.feedback-item small,
.feedback-empty {
  color: #606770;
}

/* --- Forms --- */
.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #ccd0d5;
  border-radius: 6px;
  font-size: 1rem;
  box-sizing: border-box; /* Important for width: 100% */
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: #1877f2;
  box-shadow: 0 0 0 2px #e7f3ff;
}

/* --- Modals --- */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.6);
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal-content {
  background: #fff;
  padding: 2rem;
  border-radius: 8px;
  width: 90%;
  max-width: 500px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  position: relative;
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 1.5rem;
  cursor: pointer;
  color: #606770;
  border: none;
  background: none;
}

/* --- User Stats --- */
.user-stats {
  background-color: #e7f3ff;
  border: 1px solid #1877f2;
  color: #1c1e21;
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.user-stats p {
  margin: 0;
  position: relative; /* For tooltip positioning */
}

/* --- Info Icon --- */
.info-icon {
  vertical-align: middle;
  font-size: 1rem;
  color: #606770;
  margin-left: 4px;
  cursor: help;
}

/* --- Info Tooltip --- */
.info-tooltip {
  position: absolute;
  background-color: #333;
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-size: 0.875rem;
  z-index: 10;
  bottom: 125%; /* Position above the icon */
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: 250px;
  text-align: center;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* Arrow for the tooltip */
.info-tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: #333 transparent transparent transparent;
}

/* --- Status Indicators --- */
.activeDot {
  height: 12px;
  width: 12px;
  background-color: #34c759; /* Green */
  border-radius: 50%;
  display: inline-block;
  margin-right: 8px;
  vertical-align: middle;
}

.inactiveDot {
  height: 12px;
  width: 12px;
  background-color: #ff3b30; /* Red */
  border-radius: 50%;
  display: inline-block;
  margin-right: 8px;
  vertical-align: middle;
}

/* --- More Options Dropdown --- */
.more-options {
  position: relative;
  display: inline-block;
}

.more-options-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
}

.more-options-btn:hover {
  background-color: #f0f2f5;
}

.more-options-content {
  display: none;
  position: absolute;
  right: 0;
  background-color: #fff;
  min-width: 160px;
  box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
  z-index: 1;
  border-radius: 6px;
  overflow: hidden;
}

.more-options-content a {
  color: black;
  padding: 12px 16px;
  text-decoration: none;
  display: block;
  cursor: pointer;
}

.more-options-content a:hover {
  background-color: #f1f1f1;
}

/* --- Notifications --- */
.notification-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  border-bottom: 1px solid #dddfe2;
  gap: 1rem;
}

.notification-item:last-child {
  border-bottom: none;
}

.notification-item.read {
  opacity: 0.6;
}

.notification-content {
  flex-grow: 1;
}

.notification-item p {
  margin: 0;
}

.notification-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.notification-link {
  font-size: 0.875rem;
  font-weight: 600;
}

.notification-link-disabled {
  font-size: 0.875rem;
  color: #999;
  font-style: italic;
}
