* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: #f0f2f5;
  color: #1c1e21;
  min-height: 100vh;
}

/* Header */
.header {
  background: #fff;
  border-bottom: 1px solid #ddd;
  padding: 0 16px;
  display: flex;
  align-items: center;
  height: 56px;
  position: sticky;
  top: 0;
  z-index: 100;
  gap: 12px;
}

.logo {
  font-size: 24px;
  font-weight: 700;
  color: #1877f2;
  letter-spacing: -0.5px;
  flex-shrink: 0;
}

/* Tab Navigation */
.tabs {
  display: flex;
  gap: 4px;
  flex: 1;
  justify-content: center;
  min-width: 0;
}

.tab {
  padding: 12px 16px;
  border: none;
  background: none;
  font-size: 14px;
  font-weight: 500;
  color: #65676b;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: all 0.2s;
  white-space: nowrap;
}

.tab:hover {
  background: #f0f2f5;
  border-radius: 8px 8px 0 0;
}

.tab.active {
  color: #1877f2;
  border-bottom-color: #1877f2;
}

/* Status indicator on tabs */
.tab .status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-left: 6px;
  vertical-align: middle;
}

.tab .status-dot.pending {
  background: #bec3c9;
}

.tab .status-dot.accepted {
  background: #31a24c;
}

.tab .status-dot.declined {
  background: #fa3e3e;
}

/* Hamburger (hidden on wide screens) */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  flex-shrink: 0;
}

.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: #1c1e21;
  border-radius: 1px;
  transition: transform 0.2s, opacity 0.2s;
}

.hamburger.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.hamburger.open span:nth-child(2) {
  opacity: 0;
}

.hamburger.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Responsive: narrow screens */
@media (max-width: 600px) {
  .hamburger {
    display: flex;
    margin-left: auto;
  }

  .tabs {
    display: none;
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    background: #fff;
    flex-direction: column;
    border-bottom: 1px solid #ddd;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    gap: 0;
    z-index: 99;
  }

  .tabs.open {
    display: flex;
  }

  .tab {
    padding: 14px 20px;
    border-bottom: none;
    border-left: 3px solid transparent;
    text-align: left;
    font-size: 15px;
  }

  .tab.active {
    border-bottom: none;
    border-left-color: #1877f2;
    background: #f0f2f5;
  }

  .tab:hover {
    border-radius: 0;
  }
}

/* Content Area */
.content {
  max-width: 680px;
  margin: 20px auto;
  padding: 0 16px;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* Cards */
.card {
  background: #fff;
  border-radius: 8px;
  border: 1px solid #ddd;
  padding: 16px;
  margin-bottom: 16px;
}

.card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #ddd;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: #65676b;
  font-weight: 600;
}

.card-name {
  font-weight: 600;
  font-size: 15px;
}

.card-time {
  font-size: 13px;
  color: #65676b;
}

.card-body {
  font-size: 15px;
  line-height: 1.4;
  margin-bottom: 12px;
}

.card-image {
  width: 100%;
  height: 200px;
  background: #e4e6eb;
  border-radius: 8px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #8a8d91;
  font-size: 14px;
}

/* Action Buttons (Like, etc.) */
.card-actions {
  display: flex;
  border-top: 1px solid #ddd;
  padding-top: 8px;
  gap: 4px;
}

.action-btn {
  flex: 1;
  padding: 8px;
  border: none;
  background: none;
  font-size: 14px;
  font-weight: 600;
  color: #65676b;
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.15s;
}

.action-btn:hover {
  background: #f0f2f5;
}

.action-btn.liked {
  color: #1877f2;
}

/* Marketplace Items */
.marketplace-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.marketplace-item {
  background: #fff;
  border-radius: 8px;
  border: 1px solid #ddd;
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow 0.15s;
}

.marketplace-item:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.marketplace-img {
  width: 100%;
  height: 160px;
  background: #e4e6eb;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #8a8d91;
  font-size: 14px;
}

.marketplace-info {
  padding: 10px;
}

.marketplace-price {
  font-weight: 700;
  font-size: 17px;
}

.marketplace-title {
  font-size: 14px;
  color: #65676b;
  margin-top: 2px;
}

/* Groups */
.group-card {
  background: #fff;
  border-radius: 8px;
  border: 1px solid #ddd;
  padding: 16px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.group-icon {
  width: 60px;
  height: 60px;
  border-radius: 8px;
  background: #e4e6eb;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}

.group-info {
  flex: 1;
}

.group-name {
  font-weight: 600;
  font-size: 16px;
  margin-bottom: 4px;
}

.group-meta {
  font-size: 13px;
  color: #65676b;
}

.join-btn {
  padding: 8px 20px;
  background: #e4e6eb;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.join-btn:hover {
  background: #d8dadf;
}

.join-btn.joined {
  background: #e7f3ff;
  color: #1877f2;
}

/* Messenger */
.chat-list {
  background: #fff;
  border-radius: 8px;
  border: 1px solid #ddd;
  overflow: hidden;
}

.chat-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  transition: background 0.15s;
  border-bottom: 1px solid #f0f2f5;
}

.chat-item:last-child {
  border-bottom: none;
}

.chat-item:hover {
  background: #f0f2f5;
}

.chat-preview {
  flex: 1;
}

.chat-name {
  font-weight: 600;
  font-size: 15px;
}

.chat-last {
  font-size: 13px;
  color: #65676b;
  margin-top: 2px;
}

.chat-time {
  font-size: 12px;
  color: #8a8d91;
}

/* Locked overlay */
.feature-locked {
  position: relative;
}

.feature-locked::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 8px;
  z-index: 1;
}

.locked-message {
  text-align: center;
  padding: 32px 16px;
  color: #65676b;
}

.locked-message p {
  margin-bottom: 12px;
  font-size: 15px;
}

.review-btn {
  padding: 8px 24px;
  background: #1877f2;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.review-btn:hover {
  background: #166fe5;
}

/* Modal */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 200;
  align-items: center;
  justify-content: center;
}

.modal-overlay.open {
  display: flex;
}

.modal {
  background: #fff;
  border-radius: 12px;
  width: 520px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.2);
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid #ddd;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h2 {
  font-size: 20px;
  font-weight: 700;
}

.modal-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: #e4e6eb;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  background: #d8dadf;
}

.modal-body {
  padding: 20px;
}

.modal-body h3 {
  font-size: 15px;
  font-weight: 600;
  color: #1877f2;
  margin-top: 16px;
  margin-bottom: 8px;
}

.modal-body h3:first-child {
  margin-top: 0;
}

.modal-body p {
  font-size: 15px;
  line-height: 1.5;
  color: #1c1e21;
  margin-bottom: 8px;
}

.modal-body ul {
  padding-left: 20px;
  margin-bottom: 8px;
}

.modal-body li {
  font-size: 14px;
  line-height: 1.6;
  color: #444;
}

.modal-footer {
  padding: 16px 20px;
  border-top: 1px solid #ddd;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.btn-accept {
  padding: 10px 28px;
  background: #1877f2;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.btn-accept:hover {
  background: #166fe5;
}

.btn-decline {
  padding: 10px 28px;
  background: #e4e6eb;
  color: #1c1e21;
  border: none;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.btn-decline:hover {
  background: #d8dadf;
}

/* Collapsible full terms */
.full-terms {
  margin-top: 16px;
  border-top: 1px solid #e4e6eb;
  padding-top: 12px;
}

.full-terms summary {
  font-size: 13px;
  font-weight: 600;
  color: #65676b;
  cursor: pointer;
  user-select: none;
}

.full-terms summary:hover {
  color: #1877f2;
}

.full-terms-content {
  margin-top: 12px;
}

.full-terms-content p {
  font-size: 13px;
  line-height: 1.6;
  color: #65676b;
  margin-bottom: 12px;
}

/* Reset button */
.reset-section {
  text-align: center;
  padding: 24px 0;
}

.reset-btn {
  background: none;
  border: none;
  font-size: 12px;
  color: #8a8d91;
  cursor: pointer;
  padding: 4px 8px;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.reset-btn:hover {
  color: #1877f2;
}
