

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
:root {
  --bg:        #FFFFFF;
  --surface:   #F7F7FA;
  --surface2:  #EDEDF2;
  --border:    #E4E4ED;
  --text:      #0A0A14;
  --text2:     #6B6B80;
  --text3:     #A0A0B0;
  --lost:      #FF3B30;
  --lost-bg:   #FFF0EF;
  --found:     #30D158;
  --found-bg:  #EDFFF3;
  --accent:    #2C2C2E; 
  --gold:      #FF9F0A;
  --nav-h:     64px;
  --r:         16px;
  --r-sm:      10px;
  --shadow:    0 4px 24px rgba(0,0,0,0.08);
  --shadow-lg: 0 12px 48px rgba(0,0,0,0.14);
}
html, body {
  height: 100%;
  width: 100%;
  overflow: hidden;
  font-family: 'Tajawal', sans-serif;
  background: #E8E8F0;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}


#frame {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
#app-shell {
  width: 100%;
  max-width: 430px;
  height: 100%;
  max-height: 100vh;
  position: relative;
  overflow: hidden;
  background: var(--bg);
  box-shadow: var(--shadow-lg);
}


.screen {
  position: absolute;
  inset: 0;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  visibility: hidden;
  pointer-events: none;
  will-change: transform, opacity;
}
.screen.active {
  visibility: visible;
  pointer-events: all;
}


#splash {
  background: #FFFFFF;
  align-items: center;
  justify-content: center;
  gap: 20px;
}
.splash-logo-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.splash-icon {
  width: 90px; height: 90px;
  background: linear-gradient(135deg, #8BC34A, #009688);
  border-radius: 26px;
  display: flex; align-items: center; justify-content: center;
  font-size: 38px; color: #fff;
  box-shadow: 0 16px 40px rgba(44,44,46,0.25);
}
.splash-name {
  font-size: 32px; font-weight: 800; letter-spacing: -1px;
  background: linear-gradient(135deg, #8BC34A, #009688);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.splash-sub { font-size: 16px; color: var(--text2); font-weight: 500; }
.splash-loader {
  display: flex; gap: 8px; margin-top: 40px;
}
.splash-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent); opacity: 0.3;
}


#auth {
  overflow-y: auto;
  padding: 0;
}
.auth-header {
  padding: 60px 28px 28px;
  background: linear-gradient(160deg, #F7F7FA 0%, #fff 100%);
}
.auth-logo-row {
  display: flex; align-items: center; gap: 12px; margin-bottom: 28px;
}
.auth-logo-icon {
  width: 44px; height: 44px;
  background: linear-gradient(135deg, #8BC34A, #009688);
  border-radius: 12px; color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
}
.auth-logo-text { font-size: 22px; font-weight: 800; letter-spacing: -0.5px; }
.auth-title { font-size: 28px; font-weight: 800; line-height: 1.2; letter-spacing: -0.5px; }
.auth-sub   { font-size: 15px; color: var(--text2); margin-top: 6px; }

.auth-tabs {
  display: flex; background: var(--surface); border-radius: var(--r); padding: 4px;
  margin: 0 28px 24px;
}
.auth-tab {
  flex: 1; padding: 10px; border-radius: 12px; border: none;
  font-family: 'Tajawal', sans-serif; font-size: 15px; font-weight: 700;
  cursor: pointer; background: transparent; color: var(--text2);
  transition: all 0.2s;
}
.auth-tab.active { background: var(--bg); color: var(--text); box-shadow: var(--shadow); }

.auth-form { padding: 0 28px 40px; display: flex; flex-direction: column; gap: 14px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label { font-size: 13px; font-weight: 700; color: var(--text2); text-transform: uppercase; letter-spacing: 0.5px; }
.form-input {
  padding: 14px 16px; border: 1.5px solid var(--border); border-radius: var(--r-sm);
  font-family: 'Tajawal', sans-serif; font-size: 16px; color: var(--text);
  background: var(--surface); outline: none; transition: border-color 0.2s;
  width: 100%;
}
.form-input:focus { border-color: var(--accent); background: #fff; }
.form-input::placeholder { color: var(--text3); }

.btn-primary {
  width: 100%; padding: 16px; border: none; border-radius: var(--r-sm);
  font-family: 'Tajawal', sans-serif; font-size: 18px; font-weight: 700;
  cursor: pointer; background: linear-gradient(135deg, #8BC34A, #009688);
  color: #fff; box-shadow: 0 6px 20px rgba(44,44,46,0.25);
  transition: transform 0.15s, box-shadow 0.15s;
  margin-top: 6px;
}
.btn-primary:active { transform: scale(0.98); box-shadow: 0 3px 10px rgba(44,44,46,0.15); }
.btn-secondary {
  padding: 12px 20px; border: 1.5px solid var(--border); border-radius: var(--r-sm);
  font-family: 'Tajawal', sans-serif; font-size: 15px; font-weight: 700;
  cursor: pointer; background: var(--bg); color: var(--text);
  transition: background 0.15s;
}
.btn-secondary:active { background: var(--surface); }
.btn-danger {
  padding: 12px 20px; border: 1.5px solid var(--lost); border-radius: var(--r-sm);
  font-family: 'Tajawal', sans-serif; font-size: 15px; font-weight: 700;
  cursor: pointer; background: var(--lost-bg); color: var(--lost);
}


#bottom-nav {
  position: absolute; bottom: 0; left: 0; right: 0;
  height: var(--nav-h); background: rgba(255,255,255,0.95);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-around; padding: 0 8px;
  z-index: 100;
}
.nav-btn {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; padding: 8px 0; border: none; background: none; cursor: pointer;
  color: var(--text3); transition: color 0.2s; position: relative;
}
.nav-btn.active { color: var(--accent); }
.nav-btn .nav-icon { font-size: 20px; line-height: 1; }
.nav-btn .nav-label { font-family: 'Tajawal', sans-serif; font-size: 11px; font-weight: 700; }
.nav-create-btn {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  padding: 0; border: none; cursor: pointer; background: none; position: relative;
}
.nav-create-inner {
  width: 52px; height: 52px; border-radius: 18px;
  background: linear-gradient(135deg, #8BC34A, #009688);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 20px rgba(44,44,46,0.25); margin-top: -12px;
  font-size: 20px; color: #fff;
}
.nav-badge {
  position: absolute; top: 6px; right: 14px;
  min-width: 16px; height: 16px; border-radius: 8px;
  background: var(--lost); color: #fff; font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; padding: 0 4px;
}


#main-app {
  position: absolute; inset: 0;
  display: none;
  flex-direction: column;
}
#main-app.active { display: flex; }
.tab-content {
  position: absolute; inset: 0 0 var(--nav-h) 0;
  overflow: hidden;
  display: none;
}
.tab-content.active { display: flex; flex-direction: column; }


.screen-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 52px 20px 16px; background: var(--bg);
  border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.screen-header-title { font-size: 22px; font-weight: 800; letter-spacing: -0.5px; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 12px; border: none;
  background: var(--surface); display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 16px; color: var(--text);
}


#tab-home { background: var(--surface); }

.feed-type-filter {
  display: flex; gap: 8px; padding: 12px 16px;
  background: var(--bg); border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.filter-chip {
  padding: 7px 16px; border-radius: 20px; border: 1.5px solid var(--border);
  font-family: 'Tajawal', sans-serif; font-size: 14px; font-weight: 700;
  cursor: pointer; background: var(--bg); color: var(--text2); transition: all 0.2s;
  white-space: nowrap; display: flex; align-items: center; gap: 6px;
}
.filter-chip i { font-size: 10px; }
.filter-chip.active-all    { background: var(--text); color: #fff; border-color: var(--text); }
.filter-chip.active-lost   { background: var(--lost); color: #fff; border-color: var(--lost); }
.filter-chip.active-found  { background: var(--found); color: #fff; border-color: var(--found); }

.home-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 52px 20px 12px; background: var(--bg);
  flex-shrink: 0;
}
.home-greeting .greeting-name { font-size: 24px; font-weight: 800; letter-spacing: -0.5px; display:flex; align-items:center; gap:8px;}
.home-greeting .greeting-sub  { font-size: 14px; color: var(--text2); margin-top: 2px; font-weight: 500;}
.home-avatar {
  width: 42px; height: 42px; border-radius: 14px;
  background: linear-gradient(135deg, #8BC34A, #009688);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 700; color: #fff; overflow: hidden;
}
.home-avatar img { width: 100%; height: 100%; object-fit: cover; }


#feed-container {
  flex: 1; overflow-y: auto; overflow-x: hidden;
  scroll-snap-type: y mandatory; background: var(--surface);
  -webkit-overflow-scrolling: touch;
  padding-bottom: 12px;
}
#feed-container::-webkit-scrollbar { display: none; }

.feed-card {
  scroll-snap-align: start;
  height: calc(100vh - var(--nav-h) - 180px);
  min-height: 480px;
  max-height: 640px;
  background: var(--bg);
  border-radius: 20px;
  margin: 10px 12px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  display: flex; flex-direction: column;
  cursor: pointer;
}
.card-img-area {
  position: relative; flex: 1; background: var(--surface2); overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  min-height: 200px;
}
.card-img-area img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.card-img-placeholder {
  display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--text3);
}
.card-img-placeholder .ph-icon { font-size: 48px; opacity: 0.4; }
.card-img-placeholder .ph-cat  { font-size: 15px; font-weight: 700; text-transform: capitalize; }
.card-img-carousel {
  position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 4px;
}
.carousel-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: rgba(255,255,255,0.5); transition: background 0.2s;
}
.carousel-dot.active { background: #fff; }

.card-type-badge {
  position: absolute; top: 14px; right: 14px;
  padding: 5px 12px; border-radius: 20px; font-size: 12px; font-weight: 800;
  letter-spacing: 0.5px; text-transform: uppercase;
}
.badge-lost  { background: var(--lost);  color: #fff; }
.badge-found { background: var(--found); color: #fff; }

.card-status-badge {
  position: absolute; top: 14px; left: 14px;
  padding: 4px 10px; border-radius: 20px;
  background: rgba(0,0,0,0.6); backdrop-filter: blur(6px); display: flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 700; color: #fff; letter-spacing: 0.5px;
}

.card-body {
  padding: 14px 16px; display: flex; flex-direction: column; gap: 8px;
  border-top: 1px solid var(--border);
}
.card-user-row {
  display: flex; align-items: center; gap: 8px;
}
.card-avatar {
  width: 32px; height: 32px; border-radius: 10px;
  background: linear-gradient(135deg, #8BC34A, #009688);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; color: #fff; overflow: hidden; flex-shrink: 0;
}
.card-avatar img { width: 100%; height: 100%; object-fit: cover; }
.card-user-info { flex: 1; min-width: 0; }
.card-user-name { font-size: 14px; font-weight: 700; }
.card-user-badge { font-size: 12px; color: var(--text2); font-weight: 500;}
.card-views { font-size: 13px; color: var(--text3); white-space: nowrap; display:flex; align-items:center; gap:4px; }

.card-title    { font-size: 16px; font-weight: 800; letter-spacing: -0.2px; line-height: 1.3; }
.card-desc     { font-size: 14px; color: var(--text2); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-weight: 500;}
.card-meta-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.card-location { font-size: 13px; color: var(--text2); display: flex; align-items: center; gap: 4px; font-weight: 500; }
.card-date     { font-size: 13px; color: var(--text3); font-weight: 500; }
.card-tags     { display: flex; gap: 5px; flex-wrap: wrap; }
.tag {
  padding: 3px 9px; border-radius: 10px; font-size: 12px; font-weight: 700;
  background: var(--surface); color: var(--text2);
}

.card-actions {
  display: flex; gap: 8px; padding-top: 2px;
}
.card-action-btn {
  flex: 1; padding: 10px 0; border: none; border-radius: 10px;
  font-family: 'Tajawal', sans-serif; font-size: 14px; font-weight: 700;
  cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 6px;
  transition: transform 0.15s;
}
.card-action-btn:active { transform: scale(0.96); }
.btn-resolve { background: var(--found-bg); color: var(--found); }
.btn-detail  { background: var(--surface);  color: var(--text);  }
.btn-map-btn { background: #EEF2FF;          color: var(--accent); }

.feed-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  height: 300px; gap: 12px; color: var(--text3);
}
.feed-empty .empty-icon { font-size: 52px; opacity: 0.4; }
.feed-empty p { font-size: 15px; font-weight: 700; }


#tab-search { background: var(--bg); }
.search-bar-wrap {
  padding: 52px 16px 12px; background: var(--bg); border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.search-bar {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface); border-radius: 14px;
  padding: 12px 16px; border: 1.5px solid transparent;
  transition: border-color 0.2s;
}
.search-bar:focus-within { border-color: var(--accent); background: #fff; }
.search-input {
  flex: 1; border: none; background: none; font-family: 'Tajawal', sans-serif;
  font-size: 16px; font-weight: 500; color: var(--text); outline: none;
}
.search-input::placeholder { color: var(--text3); }
.search-icon { font-size: 16px; color: var(--text3); }
.search-clear { font-size: 16px; color: var(--text3); cursor: pointer; display: flex; align-items: center; justify-content: center;}

.search-filters-row {
  display: flex; gap: 6px; padding: 10px 16px; overflow-x: auto; flex-shrink: 0;
  border-bottom: 1px solid var(--border);
}
.search-filters-row::-webkit-scrollbar { display: none; }
.s-chip {
  padding: 6px 14px; border-radius: 20px; border: 1.5px solid var(--border); display: flex; align-items: center; gap: 6px;
  font-family: 'Tajawal', sans-serif; font-size: 13px; font-weight: 700;
  cursor: pointer; background: var(--bg); color: var(--text2); white-space: nowrap;
  transition: all 0.2s;
}
.s-chip i { font-size: 10px; }
.s-chip.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.s-chip.lost-chip.active { background: var(--lost); border-color: var(--lost); }
.s-chip.found-chip.active { background: var(--found); border-color: var(--found); }

#search-results {
  flex: 1; overflow-y: auto; padding: 8px 12px;
  display: flex; flex-direction: column; gap: 8px;
}
#search-results::-webkit-scrollbar { display: none; }

.search-result-card {
  background: var(--bg); border-radius: 14px; padding: 14px;
  border: 1px solid var(--border); cursor: pointer;
  display: flex; gap: 12px; align-items: flex-start;
  transition: box-shadow 0.2s;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.search-result-card:active { box-shadow: var(--shadow); }
.result-img {
  width: 72px; height: 72px; border-radius: 10px; color: var(--text3);
  background: var(--surface2); flex-shrink: 0; overflow: hidden;
  display: flex; align-items: center; justify-content: center; font-size: 28px;
}
.result-img img { width: 100%; height: 100%; object-fit: cover; }
.result-body { flex: 1; min-width: 0; }
.result-top  { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.result-badge {
  padding: 2px 8px; border-radius: 8px; font-size: 11px; font-weight: 800; text-transform: uppercase;
}
.result-title { font-size: 15px; font-weight: 700; margin-bottom: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.result-desc  { font-size: 13px; color: var(--text2); font-weight: 500; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.result-footer { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.result-loc   { font-size: 12px; font-weight: 500; color: var(--text3); display: flex; align-items: center; gap: 4px; }
.search-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 260px; gap: 10px; color: var(--text3); }
.search-empty p { font-size: 15px; font-weight: 500; }


#tab-create { background: var(--bg); }
.create-header {
  padding: 52px 20px 16px; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.create-header h2 { font-size: 24px; font-weight: 800; letter-spacing: -0.5px; }
.create-header p  { font-size: 14px; color: var(--text2); font-weight: 500; margin-top: 4px; }

.create-type-row {
  display: flex; gap: 10px; padding: 16px; flex-shrink: 0;
}
.type-btn {
  flex: 1; padding: 18px 12px; border-radius: 16px; border: 2px solid var(--border);
  font-family: 'Tajawal', sans-serif; cursor: pointer; background: var(--bg);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  transition: all 0.2s;
}
.type-btn .type-icon { font-size: 28px; }
.type-btn .type-label { font-size: 15px; font-weight: 800; }
.type-btn .type-sub   { font-size: 12px; font-weight: 500; color: var(--text2); }
.type-btn.lost-selected   { border-color: var(--lost);  background: var(--lost-bg);  }
.type-btn.found-selected  { border-color: var(--found); background: var(--found-bg); }
.type-btn.lost-selected  .type-label, .type-btn.lost-selected .type-icon { color: var(--lost);  }
.type-btn.found-selected .type-label, .type-btn.found-selected .type-icon { color: var(--found); }

#create-form-area {
  flex: 1; overflow-y: auto; padding: 0 16px 20px;
}
#create-form-area::-webkit-scrollbar { display: none; }

.create-section { margin-bottom: 18px; }
.create-section-title {
  font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--text2); margin-bottom: 8px;
}
.create-input {
  width: 100%; padding: 13px 14px; border: 1.5px solid var(--border);
  border-radius: 12px; font-family: 'Tajawal', sans-serif; font-size: 15px; font-weight: 500;
  color: var(--text); background: var(--surface); outline: none;
  transition: border-color 0.2s, background 0.2s;
}
.create-input:focus { border-color: var(--accent); background: #fff; }
.create-input::placeholder { color: var(--text3); }
textarea.create-input { resize: none; height: 80px; line-height: 1.5; }

.img-upload-area {
  display: flex; gap: 8px; overflow-x: auto; padding: 2px;
}
.img-upload-area::-webkit-scrollbar { display: none; }
.img-thumb {
  width: 80px; height: 80px; border-radius: 12px;
  background: var(--surface2); flex-shrink: 0; position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.img-thumb img { width: 100%; height: 100%; object-fit: cover; }
.img-thumb .remove-img {
  position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%;
  background: rgba(0,0,0,0.6); color: #fff; border: none; cursor: pointer;
  font-size: 12px; display: flex; align-items: center; justify-content: center;
}
.img-add-btn {
  width: 80px; height: 80px; border-radius: 12px; border: 2px dashed var(--border);
  background: var(--surface); display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 6px;
  cursor: pointer; flex-shrink: 0; font-size: 20px; color: var(--text3);
}

.tags-input-wrap { position: relative; }
.tags-display { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.tag-item {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 10px; background: var(--surface2);
  font-size: 13px; font-weight: 700; color: var(--text);
}
.tag-remove { border: none; background: none; cursor: pointer; font-size: 12px; color: var(--text3); padding: 0; }

.select-field {
  width: 100%; padding: 13px 14px; border: 1.5px solid var(--border);
  border-radius: 12px; font-family: 'Tajawal', sans-serif; font-size: 15px; font-weight: 500;
  color: var(--text); background: var(--surface); outline: none; appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236B6B80' stroke-width='2'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 18px;
}

.map-pick-btn {
  width: 100%; padding: 13px 14px; border: 1.5px solid var(--border);
  border-radius: 12px; font-family: 'Tajawal', sans-serif; font-size: 15px; font-weight: 500;
  cursor: pointer; background: var(--surface); color: var(--text2);
  display: flex; align-items: center; gap: 8px; text-align: left;
}
.map-pick-btn.selected { border-color: var(--accent); color: var(--text); background: #EEF2FF; }


#tab-profile { background: var(--surface); }
#profile-scroll { flex: 1; overflow-y: auto; }
#profile-scroll::-webkit-scrollbar { display: none; }

.profile-header-card {
  background: var(--bg); padding: 52px 20px 20px; margin-bottom: 10px;
}
.profile-top { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 16px; }
.profile-avatar {
  width: 72px; height: 72px; border-radius: 22px;
  background: linear-gradient(135deg, #8BC34A, #009688);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; font-weight: 800; color: #fff; flex-shrink: 0; overflow: hidden;
}
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-info { flex: 1; }
.profile-name  { font-size: 22px; font-weight: 800; letter-spacing: -0.5px; }
.profile-email { font-size: 14px; color: var(--text2); font-weight: 500; margin-top: 2px; }
.profile-badge { font-size: 14px; font-weight: 700; margin-top: 6px; }
.profile-logout { font-size: 14px; color: var(--lost); font-weight: 700; border: none; background: none; cursor: pointer; font-family: 'Tajawal';}

.points-card {
  background: linear-gradient(135deg, #4A4A4A 0%, #1C1C1E 100%);
  border-radius: 16px; padding: 16px 20px; color: #fff; margin-bottom: 14px;
}
.points-label  { font-size: 13px; font-weight: 700; opacity: 0.8; text-transform: uppercase; letter-spacing: 0.5px; }
.points-value  { font-size: 38px; font-weight: 800; letter-spacing: -1px; }
.points-sub    { font-size: 14px; font-weight: 500; opacity: 0.8; margin-top: 2px; }
.level-bar-wrap { margin-top: 12px; }
.level-bar-labels { display: flex; justify-content: space-between; font-size: 12px; font-weight: 500; opacity: 0.8; margin-bottom: 4px; }
.level-bar { height: 6px; background: rgba(255,255,255,0.25); border-radius: 3px; overflow: hidden; }
.level-fill { height: 100%; background: #fff; border-radius: 3px; transition: width 0.8s ease; }

.stats-row {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
  margin-bottom: 14px;
}
.stat-card {
  background: var(--surface); border-radius: 12px; padding: 12px 8px; text-align: center;
}
.stat-num   { font-size: 22px; font-weight: 800; }
.stat-label { font-size: 11px; color: var(--text2); font-weight: 700; text-transform: uppercase; letter-spacing: 0.3px; }

.section-card { background: var(--bg); border-radius: 16px; padding: 16px; margin-bottom: 10px; }
.section-title-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.section-title { font-size: 16px; font-weight: 800; display:flex; align-items:center; gap:8px;}

.place-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 0; border-bottom: 1px solid var(--border);
}
.place-item:last-child { border-bottom: none; }
.place-icon {
  width: 36px; height: 36px; border-radius: 10px; color: var(--accent);
  background: #EEF2FF; display: flex; align-items: center; justify-content: center; font-size: 16px;
}
.place-name { flex: 1; font-size: 15px; font-weight: 700; }
.place-remove { border: none; background: none; cursor: pointer; font-size: 16px; color: var(--text3); }
.place-remove:hover { color: var(--lost); }

.profile-post-mini {
  display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border);
  cursor: pointer; align-items: center;
}
.profile-post-mini:last-child { border-bottom: none; }
.mini-img {
  width: 48px; height: 48px; border-radius: 10px; color: var(--text3);
  background: var(--surface2); flex-shrink: 0; overflow: hidden;
  display: flex; align-items: center; justify-content: center; font-size: 20px;
}
.mini-img img { width: 100%; height: 100%; object-fit: cover; }
.mini-body { flex: 1; min-width: 0; }
.mini-title { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-meta  { font-size: 12px; font-weight: 500; color: var(--text2); margin-top: 2px; display: flex; align-items:center; gap: 6px; }


.modal-overlay {
  position: absolute; inset: 0; background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px); z-index: 200;
  display: none; align-items: flex-end; justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal-sheet {
  background: var(--bg); border-radius: 24px 24px 0 0;
  width: 100%; max-height: 92vh;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.modal-handle {
  width: 40px; height: 4px; border-radius: 2px;
  background: var(--border); margin: 12px auto 0; flex-shrink: 0;
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.modal-title { font-size: 18px; font-weight: 800; }
.modal-close {
  width: 32px; height: 32px; border-radius: 10px; border: none;
  background: var(--surface); cursor: pointer; font-size: 16px;
  display: flex; align-items: center; justify-content: center; color: var(--text);
}
.modal-body { flex: 1; overflow-y: auto; padding: 16px 20px; }
.modal-body::-webkit-scrollbar { display: none; }
.modal-footer { padding: 16px 20px; border-top: 1px solid var(--border); flex-shrink: 0; }


.detail-img-slider { position: relative; width: 100%; height: 240px; background: var(--surface2); overflow: hidden; flex-shrink: 0; }
.detail-img-slider img { width: 100%; height: 100%; object-fit: cover; }
.detail-img-placeholder { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: var(--text3); font-size: 48px; }

.detail-type-badge {
  position: absolute; top: 14px; right: 14px;
  padding: 6px 14px; border-radius: 20px; font-size: 13px; font-weight: 800; letter-spacing: 0.5px;
}
.detail-user-row { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.detail-avatar {
  width: 44px; height: 44px; border-radius: 14px;
  background: linear-gradient(135deg, #8BC34A, #009688);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 700; color: #fff; overflow: hidden;
}
.detail-avatar img { width: 100%; height: 100%; object-fit: cover; }
.detail-user-name  { font-size: 16px; font-weight: 700; }
.detail-user-badge { font-size: 13px; font-weight: 500; color: var(--text2); }
.detail-title { font-size: 20px; font-weight: 800; letter-spacing: -0.5px; margin-bottom: 8px; }
.detail-desc  { font-size: 15px; font-weight: 500; color: var(--text2); line-height: 1.6; margin-bottom: 14px; }

.detail-meta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.meta-item {
  background: var(--surface); border-radius: 12px; padding: 10px 12px;
}
.meta-label { font-size: 11px; color: var(--text2); font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 2px; }
.meta-value { font-size: 14px; font-weight: 700; }


#map-container { height: 320px; width: 100%; border-radius: 14px; overflow: hidden; flex-shrink: 0; z-index: 10; }
#map-location-name { width: 100%; padding: 12px 14px; border: 1.5px solid var(--border); border-radius: 12px; font-family: 'Tajawal', sans-serif; font-size: 15px; font-weight: 500; color: var(--text); background: var(--surface); outline: none; margin-top: 12px; }
#map-location-name:focus { border-color: var(--accent); background: #fff; }


#toast {
  position: absolute; bottom: calc(var(--nav-h) + 16px); left: 16px; right: 16px;
  background: var(--text); color: #fff; border-radius: 14px;
  padding: 14px 18px; font-size: 15px; font-weight: 700;
  z-index: 500; display: none; align-items: center; gap: 10px;
  box-shadow: 0 8px 28px rgba(0,0,0,0.20);
}
#toast.success { background: #1C2B1D; }
#toast.error   { background: #2B1C1C; }


#celebrate {
  position: absolute; inset: 0; z-index: 600;
  display: none; align-items: center; justify-content: center;
  flex-direction: column; gap: 16px;
  background: rgba(255,255,255,0.95);
  text-align: center; padding: 40px;
}
.celebrate-icon { font-size: 80px; color: var(--gold); }
.celebrate-title { font-size: 32px; font-weight: 800; letter-spacing: -1px; }
.celebrate-pts   { font-size: 20px; color: var(--accent); font-weight: 800; }
.celebrate-sub   { font-size: 15px; font-weight: 500; color: var(--text2); }


.lb-item { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.lb-item:last-child { border-bottom: none; }
.lb-rank { width: 28px; font-size: 16px; font-weight: 800; color: var(--text2); text-align: center; }
.lb-rank.gold   { color: #FFD60A; }
.lb-rank.silver { color: #C0C0C0; }
.lb-rank.bronze { color: #CD7F32; }
.lb-av {
  width: 38px; height: 38px; border-radius: 12px;
  background: linear-gradient(135deg, #8BC34A, #009688);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700; color: #fff; overflow: hidden;
}
.lb-av img { width: 100%; height: 100%; object-fit: cover; }
.lb-name   { flex: 1; font-size: 15px; font-weight: 700; }
.lb-pts    { font-size: 15px; font-weight: 800; color: var(--accent); }
.lb-badge  { font-size: 13px; font-weight: 500; color: var(--text2); }


.spinner {
  width: 32px; height: 32px; border-radius: 50%;
  border: 3px solid var(--border); border-top-color: var(--accent);
  animation: spin 0.7s linear infinite; margin: 20px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }


.hidden { display: none !important; }
.row { display: flex; gap: 8px; }
.mt-8 { margin-top: 8px; }
.full-width { width: 100%; }
.divider { height: 1px; background: var(--border); margin: 12px 0; }

@media (min-width: 430px) {
  #app-shell { border-radius: 0; border-left: 1px solid #ddd; border-right: 1px solid #ddd; }
}
.map-search-row { display: flex; gap: 8px; margin-bottom: 10px; }
.map-search-row .create-input { flex: 1; padding: 10px 14px; }
.map-search-row .icon-btn { width: 42px; height: 42px; background: var(--surface2); flex-shrink: 0; }


.map-search-wrap { position: relative; flex: 1; }
.map-autocomplete-results {
  position: absolute; top: 100%; left: 0; right: 0;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 12px; margin-top: 4px; z-index: 9999; 
  max-height: 200px; overflow-y: auto; box-shadow: var(--shadow-lg);
}
.map-autocomplete-item {
  padding: 12px 14px; border-bottom: 1px solid var(--border);
  font-size: 13px; font-weight: 500; color: var(--text);
  cursor: pointer; display: flex; align-items: center; gap: 8px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.map-autocomplete-item:last-child { border-bottom: none; }
.map-autocomplete-item:active { background: var(--surface2); }
.map-autocomplete-item i { color: var(--text3); }
.notif-card { background: var(--bg); border-radius: 12px; padding: 14px; margin-bottom: 8px; border: 1px solid var(--border); display: flex; gap: 12px; }
.notif-card.unread { border-left: 4px solid var(--accent); background: #fdfdff; }
.notif-icon { width: 40px; height: 40px; border-radius: 50%; background: var(--surface2); display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
.notif-body { flex: 1; font-size: 14px; font-weight: 500; }
.notif-time { font-size: 11px; color: var(--text3); margin-top: 4px; }

/* Update this existing class */
.home-avatar {
  width: 42px; height: 42px; border-radius: 14px;
  background: linear-gradient(135deg, #8BC34A, #009688);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 700; color: #fff; overflow: hidden;
  
  /* ADDED: Icon border */
  border: 2px solid var(--accent);
  padding: 2px;
  background-clip: content-box;
}
.home-avatar img { 
  width: 100%; height: 100%; object-fit: cover; 
  border-radius: 10px; /* Added to fit inside the padding */
}