/* ================================================================
   style.css — shared styles for all website pages
   ================================================================ */

/* ------------------------------------------------------------------ */
/* Reset & base                                                         */
/* ------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --green: #3d3a8a;
  --green-light: #5c58a8;
  --green-bg: #eeeef8;
  --red: #c62828;
  --red-bg: #ffebee;
  --grey: #666;
  --border: #e0e0e0;
  --card-bg: #fafafa;
  --radius: 8px;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 15px;
  color: #222;
  background: #f0f0f8;
  min-height: 100vh;
}

a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ------------------------------------------------------------------ */
/* Navigation bar                                                       */
/* ------------------------------------------------------------------ */
.navbar {
  background: #1e1b3a;
  color: #fff;
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}
.nav-brand { font-size: 18px; font-weight: 700; color: #fff; }
.nav-links { display: flex; gap: 16px; align-items: center; }
.nav-links a { color: rgba(255,255,255,0.85); font-size: 14px; font-weight: 500; }
.nav-links a:hover { color: #fff; text-decoration: none; }
.nav-links a.active { color: #fff; border-bottom: 2px solid #fff; padding-bottom: 2px; }

/* ------------------------------------------------------------------ */
/* Page container                                                       */
/* ------------------------------------------------------------------ */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 32px 20px;
}

/* ------------------------------------------------------------------ */
/* Cards                                                                */
/* ------------------------------------------------------------------ */
.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}
.card-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--green);
}

/* ------------------------------------------------------------------ */
/* Purchase item card                                                   */
/* ------------------------------------------------------------------ */
.purchase-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}
.purchase-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s;
}
.purchase-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.12); }

.purchase-card-img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  background: #f0f0f0;
  display: block;
}
.purchase-card-img-placeholder {
  width: 100%;
  height: 140px;
  background: linear-gradient(135deg, #eeeef8, #d0cff0);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
}
.purchase-card-body { padding: 12px; flex: 1; display: flex; flex-direction: column; gap: 4px; }
.purchase-card-name { font-size: 13px; font-weight: 600; line-height: 1.4; color: #222; }
.purchase-card-price { font-size: 14px; font-weight: 700; color: var(--red); }
.purchase-card-meta { font-size: 11px; color: var(--grey); display: flex; gap: 8px; }
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
}
.badge-public  { background: var(--green-bg); color: var(--green); }
.badge-private { background: #fff3e0; color: #e65100; }
.badge-amazon  { background: #fff8e1; color: #f57f17; }
.badge-aliexpress { background: #fff3e0; color: #e65100; }

.purchase-card-actions { padding: 0 12px 12px; display: flex; gap: 8px; }

/* ------------------------------------------------------------------ */
/* Buttons                                                              */
/* ------------------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 9px 18px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: background 0.2s, opacity 0.2s;
}
.btn-primary   { background: var(--green-light); color: #fff; }
.btn-primary:hover { background: var(--green); }
.btn-danger    { background: var(--red-bg); color: var(--red); }
.btn-danger:hover  { background: #ffcdd2; }
.btn-ghost     { background: transparent; color: var(--grey); border: 1px solid var(--border); }
.btn-ghost:hover   { background: #f5f5f5; }
.btn-sm        { padding: 5px 12px; font-size: 12px; }
.btn:disabled  { opacity: 0.6; cursor: not-allowed; }

/* ------------------------------------------------------------------ */
/* Forms                                                                */
/* ------------------------------------------------------------------ */
.form-group { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.form-group label { font-size: 13px; font-weight: 600; color: #444; }
.form-group input,
.form-group select,
.form-group textarea {
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { border-color: var(--green-light); }
.checkbox-row { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }

/* ------------------------------------------------------------------ */
/* Messages                                                             */
/* ------------------------------------------------------------------ */
.msg { padding: 10px 14px; border-radius: 6px; font-size: 13px; margin-top: 8px; }
.msg-error   { background: var(--red-bg); color: var(--red); }
.msg-success { background: var(--green-bg); color: var(--green); }
.msg-info    { background: #e3f2fd; color: #1565c0; }
.hidden      { display: none !important; }

/* ------------------------------------------------------------------ */
/* Auth page (index.html)                                               */
/* ------------------------------------------------------------------ */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1e1b3a 0%, #3d3a8a 100%);
}
.auth-box {
  background: #fff;
  padding: 36px;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
  width: 100%;
  max-width: 380px;
}
.auth-logo { text-align: center; margin-bottom: 24px; }
.auth-logo span { font-size: 40px; }
.auth-logo h1 { font-size: 22px; font-weight: 700; color: var(--green); margin-top: 8px; }
.auth-logo p  { color: var(--grey); font-size: 13px; margin-top: 4px; }

.tab-switcher {
  display: flex;
  border-bottom: 2px solid var(--border);
  margin-bottom: 20px;
}
.tab-btn {
  flex: 1;
  background: none;
  border: none;
  padding: 10px;
  cursor: pointer;
  font-size: 14px;
  color: var(--grey);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color 0.2s, border-color 0.2s;
  font-weight: 500;
}
.tab-btn.active { color: var(--green); border-bottom-color: var(--green); font-weight: 700; }

/* ------------------------------------------------------------------ */
/* Section headers                                                      */
/* ------------------------------------------------------------------ */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.section-title { font-size: 18px; font-weight: 700; }

/* ------------------------------------------------------------------ */
/* Friends list                                                         */
/* ------------------------------------------------------------------ */
.friend-list { display: flex; flex-direction: column; gap: 10px; }
.friend-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.friend-info { display: flex; align-items: center; gap: 10px; }
.friend-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--green-bg);
  color: var(--green);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  flex-shrink: 0;
}
.friend-username { font-weight: 600; }
.friend-actions { display: flex; gap: 6px; }

/* ------------------------------------------------------------------ */
/* Empty state                                                          */
/* ------------------------------------------------------------------ */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--grey);
}
.empty-state .icon { font-size: 40px; margin-bottom: 10px; }
.empty-state p { line-height: 1.6; }

/* ------------------------------------------------------------------ */
/* Profile header                                                       */
/* ------------------------------------------------------------------ */
.profile-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}
.profile-avatar-lg {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--green-bg);
  color: var(--green);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 700;
  flex-shrink: 0;
}
.profile-meta h2 { font-size: 22px; font-weight: 700; }
.profile-meta p  { color: var(--grey); font-size: 13px; margin-top: 4px; }

/* ------------------------------------------------------------------ */
/* Spinner                                                              */
/* ------------------------------------------------------------------ */
.spinner-wrap { text-align: center; padding: 30px; color: var(--grey); }
.spinner-sm {
  display: inline-block;
  width: 20px; height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--green-light);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------------ */
/* Social feed page                                                     */
/* ------------------------------------------------------------------ */
.social-feed-page {
  min-height: calc(100vh - 56px);
  background: #f0f0f8;
  padding: 32px 16px 60px;
}

#feed-container {
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-width: 600px;
  margin: 0 auto;
}

.social-card {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.09);
  overflow: hidden;
}

.social-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
}

.social-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--green-bg);
  color: var(--green);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
  flex-shrink: 0;
}

.social-card-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.social-username {
  font-weight: 700;
  font-size: 14px;
  color: var(--green);
}

.social-date {
  font-size: 12px;
  color: var(--grey);
}

.social-card-img {
  width: 100%;
  max-height: 340px;
  object-fit: cover;
  display: block;
  background: #f0f0f0;
}

.social-card-img-placeholder {
  width: 100%;
  height: 200px;
  background: linear-gradient(135deg, #eeeef8, #d0cff0);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 56px;
}

.social-card-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.social-card-name {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
  color: #222;
}

.social-card-price {
  font-size: 18px;
  font-weight: 700;
  color: var(--red);
}

.social-click-count {
  font-size: 13px;
  color: var(--grey);
}

.shop-btn {
  width: 100%;
  justify-content: center;
  font-size: 15px;
  padding: 12px;
  margin-top: 4px;
}
