/* ---------- Reset & dasar ---------- */
* { margin: 0; padding: 0;
    -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%;
  scroll-behavior: smooth; -webkit-overflow-scrolling: touch;
}
body {
  font-family: -apple-system, "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 14px; line-height: 1.5; color: #262626; background: #fafafa;
  -webkit-overflow-scrolling: touch;
}
a { color: #0095f6; text-decoration: none; }
a:hover { text-decoration: underline; }
img { border: 0; max-width: 100%; height: auto; vertical-align: middle; }
input, textarea, button { font-family: inherit; font-size: 14px; }

.container { max-width: 640px; margin: 0 auto; padding: 10px; }
.muted { color: #8e8e8e; font-size: 12px; }

/* ---------- Topbar ---------- */
.topbar { background: #fff; border-bottom: 1px solid #dbdbdb; }
.topbar-inner { max-width: 935px; margin: 0 auto; padding: 8px 10px; text-align: center; }
.topbar .brand {
  display: inline-block; font-weight: 700; font-size: 24px; color: #262626; font-style: italic;
  font-family: 'Brush Script MT','Snell Roundhand','Segoe Script','Lucida Handwriting','Apple Chancery','Comic Sans MS',cursive;
}
.topbar .nav { margin-top: 4px; }
.topbar .nav a {
  display: inline-block; margin: 0 7px; font-size: 13px; font-weight: 600; color: #262626;
}
.topbar .nav a:hover { color: #0095f6; text-decoration: none; }

.badge-notif {
  display: inline-block; background: #ed4956; color: #fff;
  font-size: 10px; font-weight: 700; padding: 1px 5px; border-radius: 8px;
  vertical-align: top; margin-left: 2px;
}

/* ---------- Hero SVG ---------- */
.hero { display: block; width: 100%; overflow: hidden; background: #833ab4; }
.hero-svg { display: block; width: 100%; height: 180px; }

.hero-full {
  min-height: 60vh;
  border-radius: 8px; overflow: hidden;
  -webkit-border-radius: 8px; -moz-border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}
.hero-full .hero-svg {
  display: block; width: 100%; height: 60vh; min-height: 320px;
}

.landing-cta { text-align: center; padding: 24px 10px; }
.landing-cta .btn { margin: 4px 6px; min-width: 100px; }

/* ---------- Story strip ---------- */
.story-strip {
  white-space: nowrap; overflow-x: auto; overflow-y: hidden;
  background: #fff; border: 1px solid #dbdbdb; border-radius: 8px;
  -webkit-border-radius: 8px; -moz-border-radius: 8px;
  margin: 12px 0; padding: 10px 6px;
  -webkit-overflow-scrolling: touch;
}
.story-item {
  display: inline-block; width: 76px; text-align: center;
  margin: 0 4px; vertical-align: top; color: #262626;
}
.story-item:hover { text-decoration: none; }
.story-ring {
  display: block; width: 62px; height: 62px; margin: 0 auto 4px;
  border-radius: 50%; -webkit-border-radius: 50%;
  background-color: #efefef;
  background-size: cover; -webkit-background-size: cover;
  background-position: center; background-repeat: no-repeat;
  border: 2px solid #E1306C;
  line-height: 58px; text-align: center;
  font-size: 24px; font-weight: 700; color: #0095f6;
}
.story-ring-add { background: #f7f7f7; border: 2px dashed #0095f6; }
.story-name {
  display: block; font-size: 11px; color: #262626;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ---------- Feed ---------- */
.feed { list-style: none; margin: 12px 0; }
.feed-item {
  background: #fff; border: 1px solid #dbdbdb; border-radius: 8px;
  -webkit-border-radius: 8px; margin-bottom: 12px; overflow: hidden;
}
.feed-head { padding: 10px 12px; overflow: hidden; }
.feed-avatar {
  display: inline-block; width: 36px; height: 36px;
  border-radius: 50%; -webkit-border-radius: 50%;
  background-size: cover; -webkit-background-size: cover;
  background-position: center; background-repeat: no-repeat;
  background-color: #efefef; border: 1px solid #dbdbdb;
  vertical-align: middle; margin-right: 10px;
}
.feed-head-info {
  display: inline-block; vertical-align: middle;
  max-width: 80%; word-wrap: break-word;
}
.feed-user { font-weight: 700; color: #262626; }
.feed-img {
  display: block; width: 100%; padding-bottom: 100%;
  background-size: cover; -webkit-background-size: cover;
  background-position: center; background-repeat: no-repeat; background-color: #efefef;
}
.feed-cap { padding: 8px 12px 4px; word-wrap: break-word; }
.feed-cap a { color: #00376b; font-weight: 600; }
.feed-time { padding: 0 12px 10px; font-size: 11px; color: #8e8e8e; }

/* ---------- Grid 3x3 ---------- */
.grid { font-size: 0; list-style: none; margin: 0 -2px; padding: 0; }
.grid > li { display: inline-block; vertical-align: top; width: 33.3333%; padding: 2px; font-size: 14px; }
.thumb {
  display: block; width: 100%; padding-bottom: 100%;
  background-size: cover; -webkit-background-size: cover;
  background-position: center; background-repeat: no-repeat; background-color: #efefef;
}

/* ============================================================
   AVATAR
   ============================================================ */
.avatar-link {
  display: inline-block;
  text-decoration: none;
  line-height: 0;
  font-size: 0;
  vertical-align: middle;
}
a.avatar-link:hover { text-decoration: none; opacity: 0.92; }

.avatar-img {
  display: block;
  width: 84px; height: 84px;
  margin: 0 auto 8px;
  padding: 0;
  border: 2px solid #dbdbdb;
  border-radius: 50%;
  -webkit-border-radius: 50%;
  -moz-border-radius: 50%;
  background-color: #efefef;
  background-size: cover;
  -webkit-background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
  overflow: hidden;
}
.avatar-img-story { border: 3px solid #E1306C; }
.avatar-img-empty { display: inline-block; }

/* ---------- Profile head ---------- */
.profile-head {
  background: #fff; border: 1px solid #dbdbdb; border-radius: 8px;
  padding: 14px; margin: 12px 0; text-align: center;
  -webkit-border-radius: 8px; -moz-border-radius: 8px;
}
.profile-username { font-size: 18px; font-weight: 700; }
.profile-name { color: #8e8e8e; font-size: 13px; margin-top: 2px; }
.profile-stats { margin: 8px 0; font-size: 13px; }
.profile-stats span, .profile-stats a { margin: 0 10px; color: #262626; }
.profile-bio { margin: 8px 0; font-size: 13px; }
.profile-actions { margin-top: 10px; }
.profile-actions .btn { margin: 3px; }

.profile-story-hint {
  text-align: center; margin: 6px 0 4px;
  font-size: 13px; font-weight: 600;
}

/* ---------- Aksi admin di halaman profil pengguna ---------- */
.profile-admin-actions {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed #dbdbdb;
  text-align: center;
}
.profile-admin-actions .btn {
  min-width: 180px;
}

/* ---------- Auth card ---------- */
.auth-card {
  background: #fff; border: 1px solid #dbdbdb; border-radius: 8px;
  max-width: 380px; margin: 24px auto; padding: 22px;
  -webkit-border-radius: 8px; -moz-border-radius: 8px;
}
.auth-title { font-size: 20px; margin-bottom: 14px; text-align: center; }
.form label { display: block; margin-bottom: 10px; font-weight: 600; font-size: 13px; }
.form input[type="text"], .form input[type="email"], .form input[type="password"],
.form input[type="file"], .form textarea {
  display: block; width: 100%; margin-top: 4px; padding: 8px 10px;
  border: 1px solid #dbdbdb; border-radius: 4px; background: #fafafa;
  -webkit-border-radius: 4px; -moz-border-radius: 4px;
}
.form input[type="file"] { padding: 6px 8px; }
.form input:focus, .form textarea:focus { outline: none; border-color: #a0a0a0; background: #fff; }
.auth-alt { text-align: center; margin-top: 12px; font-size: 13px; color: #8e8e8e; }

/* ---------- Preview avatar di Edit Profil ---------- */
.edit-avatar-preview { text-align: center; padding: 8px 0 16px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block; padding: 7px 14px; border: 1px solid #dbdbdb;
  background: #fff; color: #262626; border-radius: 4px; cursor: pointer;
  font-weight: 600; font-size: 13px; text-align: center;
  -webkit-border-radius: 4px; -moz-border-radius: 4px;
}
.btn:hover { background: #f2f2f2; text-decoration: none; }
.btn-primary { background: #0095f6; border-color: #0095f6; color: #fff; }
.btn-primary:hover { background: #0077c8; color: #fff; }
.btn-danger { background: #ed4956; border-color: #ed4956; color: #fff; }
.btn-danger:hover { background: #c33; color: #fff; }
.btn-small { padding: 4px 8px; font-size: 12px; }

/* ---------- Badges ---------- */
.badge-verified {
  display: inline-block; background: #0095f6; color: #fff;
  font-size: 10px; font-weight: 700; letter-spacing: 0.4px;
  padding: 1px 6px; border-radius: 3px; vertical-align: middle; margin-left: 4px;
  -webkit-border-radius: 3px; -moz-border-radius: 3px;
}
.badge-admin {
  display: inline-block; background: #262626; color: #fff;
  font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 3px;
  margin-left: 4px; vertical-align: middle;
}

/* ---------- Flash / error / empty ---------- */
.flash, .error {
  padding: 10px 12px; border-radius: 6px; margin: 10px 0; font-size: 13px;
  -webkit-border-radius: 6px; -moz-border-radius: 6px;
}
.flash { background: #e7f8ee; border: 1px solid #b8e6c8; color: #1a7a3f; }
.error { background: #ffeef0; border: 1px solid #ffc2c8; color: #a81623; }
.empty { text-align: center; padding: 30px 10px; color: #8e8e8e; }

/* ---------- Pagination ---------- */
.pagination { text-align: center; padding: 14px 0 22px; }
.pagination a, .pagination .disabled, .pagination .page-info {
  display: inline-block; margin: 0 4px; padding: 6px 10px; border-radius: 4px; font-size: 13px;
}
.pagination a { background: #fff; border: 1px solid #dbdbdb; color: #262626; }
.pagination a:hover { background: #0095f6; color: #fff; border-color: #0095f6; text-decoration: none; }
.pagination .disabled { color: #c7c7c7; background: #fafafa; border: 1px solid #efefef; }
.pagination .page-info { color: #8e8e8e; }

/* ---------- Post view ---------- */
.post-view { background: #fff; border: 1px solid #dbdbdb; border-radius: 8px;
  margin: 12px 0; overflow: hidden; }
.post-view-img img { display: block; width: 100%; height: auto; }
.post-view-meta { padding: 12px; }
.post-actions { margin: 10px 0; }

/* ---------- Story view ---------- */
.story-view { background: #000; border-radius: 8px; overflow: hidden; margin: 12px 0;
  text-align: center; }
.story-view-head { padding: 10px 12px; color: #fff; text-align: left; }
.story-view-head a { color: #fff; font-weight: 700; }
.story-view-img img { display: block; width: 100%; height: auto; max-height: 80vh; margin: 0 auto; }
.story-view-nav { padding: 10px; }
.story-view-nav .btn { margin: 0 4px; }
.story-view-actions { padding: 8px 12px 0; text-align: right; }

/* ---------- User / notif list ---------- */
.list-head { padding: 12px 4px; }
.list-head h1 { font-size: 18px; margin-top: 6px; }
.user-list, .notif-list { list-style: none; }
.user-list li, .notif-item {
  background: #fff; border: 1px solid #dbdbdb; border-radius: 6px;
  padding: 10px 12px; margin-bottom: 8px;
}
.notif-item { overflow: hidden; }
.notif-thumb {
  display: inline-block; width: 44px; height: 44px; vertical-align: middle;
  background-size: cover; -webkit-background-size: cover;
  background-position: center; border-radius: 4px; margin-right: 10px;
}
.notif-body { display: inline-block; vertical-align: middle; width: 78%; }
.notif-read { opacity: 0.65; }

/* ---------- Notifikasi: tombol hapus ---------- */
.notif-delete-all { margin-top: 8px; }
.notif-delete-all .btn { display: inline-block; }
.notif-delete-one { float: right; margin-top: 4px; }
.notif-delete-one .btn { padding: 2px 8px; font-size: 14px; line-height: 1.1; }

/* ---------- Baris daftar pengguna ---------- */
.user-row { position: relative; overflow: hidden; padding: 10px 12px; }
.user-row-avatar {
  display: inline-block; width: 44px; height: 44px;
  border-radius: 50%; -webkit-border-radius: 50%;
  background-size: cover; -webkit-background-size: cover;
  background-position: center; background-repeat: no-repeat;
  background-color: #efefef; border: 1px solid #dbdbdb;
  vertical-align: middle; margin-right: 10px;
}
.user-row-body {
  display: inline-block; vertical-align: middle;
  max-width: 60%; word-wrap: break-word;
}
.user-row-name { font-weight: 700; color: #262626; }
.user-row .btn { float: right; margin-top: 8px; }

/* ============================================================
   HALAMAN CARI — BULLETPROOF CENTERING
   ============================================================ */
.search-page {
  display: block;
  width: 100%;
  padding: 12px 4px 4px;
  text-align: center;
}

.search-title {
  display: block;
  font-size: 18px;
  margin: 0 0 10px;
  text-align: center;
  color: #262626;
}

.search-form {
  display: block;
  width: 100%;
  margin: 0 0 6px;
  padding: 0;
  text-align: center;
}

.search-inner {
  display: inline-block;
  padding: 0;
  margin: 0;
  white-space: nowrap;
  vertical-align: middle;
  text-align: center;
}

.search-input {
  display: inline-block;
  vertical-align: middle;
  width: 220px;
  max-width: 65%;
  min-width: 0;
  padding: 9px 14px;
  margin: 0 6px 0 0;
  border: 1px solid #dbdbdb;
  border-radius: 20px;
  -webkit-border-radius: 20px;
  -moz-border-radius: 20px;
  background: #fafafa;
  font-size: 14px;
  -webkit-appearance: none;
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
}
.search-input:focus {
  outline: none;
  border-color: #a0a0a0;
  background: #fff;
}

.search-form .btn,
.search-form .search-btn {
  display: inline-block;
  vertical-align: middle;
  padding: 9px 16px;
  margin: 0;
  border-radius: 20px;
  -webkit-border-radius: 20px;
  -moz-border-radius: 20px;
  font-size: 13px;
}

.search-info {
  padding: 10px 4px 12px;
  font-size: 13px;
  color: #262626;
  text-align: center;
}

.search-bio {
  margin-top: 2px;
  font-size: 12px;
  color: #8e8e8e;
  word-wrap: break-word;
}

/* ---------- Admin ---------- */
.admin h1 { font-size: 22px; margin-bottom: 12px; }
.admin-box { background: #fff; border: 1px solid #dbdbdb; border-radius: 8px;
  padding: 14px; margin-bottom: 12px; }
.admin-box h2 { font-size: 15px; margin-bottom: 8px; }
.admin-users { list-style: none; }
.admin-users li { border-top: 1px solid #efefef; padding: 10px 0; }
.admin-users li:first-child { border-top: 0; }
.admin-actions { margin-top: 6px; }

.admin-stories { list-style: none; }
.admin-stories li { border-top: 1px solid #efefef; padding: 10px 0; overflow: hidden; }
.admin-stories li:first-child { border-top: 0; }
.admin-story-thumb {
  display: inline-block; width: 48px; height: 48px;
  border-radius: 6px; -webkit-border-radius: 6px;
  background-size: cover; -webkit-background-size: cover;
  background-position: center; background-repeat: no-repeat;
  background-color: #efefef; border: 1px solid #dbdbdb;
  vertical-align: middle; margin-right: 10px;
}
.admin-story-info {
  display: inline-block; vertical-align: middle;
  max-width: 55%; word-wrap: break-word;
}
.admin-stories form { float: right; margin-top: 12px; }

/* ---------- Footer ---------- */
.footer { text-align: center; color: #8e8e8e; font-size: 12px; padding: 20px 10px; }

/* ---------- Layar kecil (iPhone 4, XT535, Z2) ---------- */
@media (max-width: 480px) {
  .topbar .brand { font-size: 20px; }
  .topbar .nav a { margin: 0 5px; font-size: 12px; }
  .hero-svg { height: 140px; }
  .hero-full { min-height: 50vh; }
  .hero-full .hero-svg { height: 50vh; min-height: 260px; }
  .landing-cta { padding: 18px 8px; }
  .container { padding: 8px; }
  .auth-card { margin: 14px 8px; padding: 16px; }
  .notif-body { width: 70%; max-width: 55%; }
  .notif-delete-one .btn { padding: 2px 6px; font-size: 13px; }
  .user-row-body { max-width: 55%; }
  .user-row .btn { padding: 3px 8px; font-size: 11px; }
  .story-item { width: 68px; }
  .story-ring { width: 54px; height: 54px; line-height: 50px; font-size: 20px; }
  .feed-avatar { width: 32px; height: 32px; }
  .feed-head-info { max-width: 75%; }
  .admin-story-info { max-width: 45%; }
  .admin-stories form { margin-top: 14px; }
  .story-view-actions { text-align: center; padding: 6px 0 0; }

  .avatar-img { width: 76px; height: 76px; }

  .profile-admin-actions .btn {
    min-width: 140px;
    padding: 6px 12px;
    font-size: 12px;
  }

  .search-input {
    width: 150px;
    max-width: 55%;
    padding: 8px 12px;
    font-size: 13px;
    margin-right: 5px;
  }
  .search-form .btn,
  .search-form .search-btn {
    padding: 8px 13px;
    font-size: 12px;
  }
}