/* ===== VARIABLES ===== */
:root {
  --baby-blue: #a8d8ea;
  --sky: #87ceeb;
  --light-blue: #cce7f5;
  --pale-blue: #e8f4fd;
  --deep-blue: #4a90d9;
  --accent: #5b9bd5;
  --accent2: #7ec8e3;
  --purple-soft: #b8a9d9;
  --pink-soft: #f0b8d4;
  --gradient-main: linear-gradient(135deg, #a8d8ea 0%, #87ceeb 40%, #b8d4f0 70%, #c9b8e8 100%);
  --gradient-card: linear-gradient(145deg, #ffffff 0%, #f0f8ff 100%);
  --gradient-header: linear-gradient(135deg, #5b9bd5 0%, #7ec8e3 50%, #a8d8ea 100%);
  --white: #ffffff;
  --text-dark: #2c3e50;
  --text-mid: #546e8a;
  --text-light: #89a7c0;
  --border: rgba(168,216,234,0.4);
  --shadow: 0 4px 20px rgba(91,155,213,0.15);
  --shadow-lg: 0 8px 40px rgba(91,155,213,0.25);
  --radius: 16px;
  --radius-sm: 10px;
  --nav-height: 64px;
  --font: 'Nunito', sans-serif;
  --font2: 'Poppins', sans-serif;
}

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font);
  background: var(--pale-blue);
  color: var(--text-dark);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--pale-blue); }
::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 10px; }

/* ===== APP WRAPPER ===== */
#app {
  min-height: 100vh;
  background: var(--gradient-main);
  background-attachment: fixed;
}

/* ===== PAGES ===== */
.page { display: none; min-height: 100vh; }
.page.active { display: flex; flex-direction: column; }

/* ===== LOGIN PAGE ===== */
.login-bg {
  min-height: 100vh;
  background: var(--gradient-main);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  position: relative;
  overflow: hidden;
}

.login-bg::before {
  content: '';
  position: absolute;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, transparent 70%);
  top: -100px; right: -100px;
  border-radius: 50%;
}

.login-bg::after {
  content: '';
  position: absolute;
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(184,169,217,0.3) 0%, transparent 70%);
  bottom: -50px; left: -50px;
  border-radius: 50%;
}

.login-card {
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.9);
  border-radius: 28px;
  padding: 40px;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-lg);
  position: relative;
  z-index: 1;
  animation: popIn 0.5s cubic-bezier(0.34,1.56,0.64,1) both;
}

@keyframes popIn {
  from { opacity:0; transform: scale(0.8) translateY(20px); }
  to   { opacity:1; transform: scale(1) translateY(0); }
}

.login-logo {
  text-align: center;
  margin-bottom: 28px;
}

.login-logo .logo-icon {
  width: 72px; height: 72px;
  background: var(--gradient-header);
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  box-shadow: 0 8px 24px rgba(91,155,213,0.4);
  margin-bottom: 12px;
}

.login-logo h1 {
  font-size: 22px;
  font-weight: 900;
  background: var(--gradient-header);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.login-logo p {
  font-size: 12px;
  color: var(--text-light);
  font-family: var(--font2);
}

/* Step indicators */
.steps {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 24px;
}

.step-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--border);
  transition: all 0.3s;
}

.step-dot.active {
  background: var(--accent);
  width: 24px;
  border-radius: 4px;
}

/* Name grid */
.name-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 20px;
  max-height: 280px;
  overflow-y: auto;
  padding-right: 4px;
}

.name-btn {
  background: var(--pale-blue);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
  font-family: var(--font);
}

.name-btn:hover {
  border-color: var(--accent);
  background: var(--light-blue);
  transform: translateY(-1px);
}

.name-btn.selected {
  border-color: var(--deep-blue);
  background: linear-gradient(135deg, var(--light-blue), var(--baby-blue));
  box-shadow: 0 4px 12px rgba(91,155,213,0.3);
}

.name-btn .nb-name { font-weight: 800; font-size: 14px; color: var(--text-dark); }
.name-btn .nb-role {
  font-size: 10px;
  color: var(--text-light);
  font-family: var(--font2);
  margin-top: 2px;
}

.name-btn .nb-badge {
  display: inline-block;
  font-size: 9px;
  padding: 2px 6px;
  border-radius: 100px;
  font-weight: 700;
  margin-top: 4px;
}

.badge-owner { background: linear-gradient(135deg, #ffd700, #ffaa00); color: #5a3e00; }
.badge-admin { background: linear-gradient(135deg, var(--accent), var(--accent2)); color: white; }
.badge-user  { background: var(--pale-blue); color: var(--text-light); border: 1px solid var(--border); }

/* OTP boxes */
.otp-section { text-align: center; }
.otp-title { font-size: 16px; font-weight: 800; margin-bottom: 6px; color: var(--text-dark); }
.otp-sub { font-size: 12px; color: var(--text-light); margin-bottom: 20px; font-family: var(--font2); }

.otp-boxes {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-bottom: 16px;
}

.otp-box {
  width: 48px; height: 56px;
  background: var(--pale-blue);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  text-align: center;
  font-size: 22px;
  font-weight: 900;
  color: var(--deep-blue);
  outline: none;
  transition: all 0.2s;
  font-family: var(--font);
}

.otp-box:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(91,155,213,0.2); }
.otp-box.filled { background: var(--light-blue); border-color: var(--accent); }

/* Credential form */
.cred-form { display: flex; flex-direction: column; gap: 14px; }

.field-group { display: flex; flex-direction: column; gap: 6px; }

.field-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-mid);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-family: var(--font2);
}

.field-input {
  background: var(--pale-blue);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-family: var(--font);
  font-size: 14px;
  color: var(--text-dark);
  outline: none;
  transition: all 0.2s;
  width: 100%;
}

.field-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(91,155,213,0.15); background: white; }

/* Buttons */
.btn-primary {
  background: var(--gradient-header);
  border: none;
  border-radius: var(--radius-sm);
  padding: 14px 20px;
  color: white;
  font-family: var(--font);
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
  width: 100%;
  transition: all 0.2s;
  box-shadow: 0 4px 16px rgba(91,155,213,0.4);
  letter-spacing: 0.02em;
}

.btn-primary:hover { filter: brightness(1.08); transform: translateY(-1px); box-shadow: 0 6px 20px rgba(91,155,213,0.5); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-ghost {
  background: transparent;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 20px;
  color: var(--text-mid);
  font-family: var(--font);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  width: 100%;
  transition: all 0.2s;
  margin-top: 8px;
}

.btn-ghost:hover { border-color: var(--accent); color: var(--accent); background: var(--pale-blue); }

.btn-icon {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.btn-icon:hover { background: var(--pale-blue); }

/* Timer */
.otp-timer {
  font-size: 12px;
  color: var(--text-light);
  font-family: var(--font2);
  margin-bottom: 16px;
}

.otp-timer span { color: var(--accent); font-weight: 700; }

/* ===== MAIN LAYOUT ===== */
.main-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--gradient-main);
  background-attachment: fixed;
}

/* ===== TOP HEADER ===== */
.top-header {
  background: rgba(255,255,255,0.7);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-logo { display: flex; align-items: center; gap: 10px; }
.header-logo .logo-sm {
  width: 38px; height: 38px;
  background: var(--gradient-header);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.header-logo span {
  font-weight: 900;
  font-size: 16px;
  background: var(--gradient-header);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header-right { display: flex; align-items: center; gap: 8px; }

.online-badge {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--text-light);
  font-family: var(--font2);
}

.online-dot { width: 8px; height: 8px; background: #4caf50; border-radius: 50%; box-shadow: 0 0 6px #4caf50; animation: pulse 2s infinite; }

@keyframes pulse { 0%,100% { opacity:1; } 50% { opacity:0.5; } }

/* ===== CONTENT AREA ===== */
.content-area {
  flex: 1;
  padding-bottom: calc(var(--nav-height) + 20px);
  overflow-y: auto;
}

/* ===== BOTTOM NAV ===== */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--nav-height);
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0 10px;
  z-index: 100;
  box-shadow: 0 -4px 20px rgba(91,155,213,0.1);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  background: none;
  color: var(--text-light);
  font-family: var(--font);
  font-size: 10px;
  font-weight: 700;
  flex: 1;
}

.nav-item svg { width: 22px; height: 22px; transition: all 0.2s; }

.nav-item.active { color: var(--deep-blue); }
.nav-item.active svg { filter: drop-shadow(0 2px 6px rgba(91,155,213,0.5)); transform: translateY(-2px); }

.nav-item:hover { color: var(--accent); background: var(--pale-blue); }

/* ===== FEED PAGE ===== */
.feed-container { max-width: 600px; margin: 0 auto; padding: 16px; }

.feed-stories {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 16px 0;
  margin-bottom: 8px;
  scrollbar-width: none;
}

.feed-stories::-webkit-scrollbar { display: none; }

.story-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  flex-shrink: 0;
}

.story-ring {
  width: 58px; height: 58px;
  border-radius: 50%;
  background: var(--gradient-header);
  padding: 3px;
  box-shadow: 0 2px 10px rgba(91,155,213,0.3);
}

.story-ring img, .story-ring .story-placeholder {
  width: 100%; height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid white;
  background: var(--light-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 900;
  color: var(--deep-blue);
}

.story-name { font-size: 10px; color: var(--text-mid); font-weight: 700; max-width: 60px; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Feed post card */
.post-card {
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.9);
  border-radius: 20px;
  margin-bottom: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
  animation: slideUp 0.4s ease both;
}

@keyframes slideUp {
  from { opacity:0; transform: translateY(16px); }
  to   { opacity:1; transform: translateY(0); }
}

.post-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
}

.post-avatar {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--gradient-header);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  color: white;
  font-size: 16px;
  cursor: pointer;
  flex-shrink: 0;
  overflow: hidden;
}

.post-avatar img { width: 100%; height: 100%; object-fit: cover; }

.post-meta { flex: 1; }
.post-username { font-weight: 800; font-size: 14px; color: var(--text-dark); cursor: pointer; }
.post-username:hover { color: var(--accent); }
.post-time { font-size: 11px; color: var(--text-light); font-family: var(--font2); }

.post-image { width: 100%; max-height: 400px; object-fit: cover; display: block; }

.post-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
}

.action-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font);
  font-size: 13px;
  color: var(--text-mid);
  font-weight: 700;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}

.action-btn:hover { background: var(--pale-blue); color: var(--accent); }
.action-btn.liked { color: #e91e63; }
.action-btn svg { width: 20px; height: 20px; }

.post-caption {
  padding: 4px 16px 12px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-dark);
}

.post-caption strong { font-weight: 800; cursor: pointer; }
.post-caption strong:hover { color: var(--accent); }

.post-hashtags { color: var(--accent); font-weight: 700; }

/* Comments */
.comments-section { padding: 0 16px 16px; border-top: 1px solid var(--border); margin-top: 4px; }
.comments-title { font-size: 12px; font-weight: 700; color: var(--text-light); padding: 10px 0 8px; font-family: var(--font2); }

.comment-item { display: flex; gap: 8px; margin-bottom: 10px; align-items: flex-start; }
.comment-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--gradient-header);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 900;
  color: white;
  flex-shrink: 0;
  overflow: hidden;
}
.comment-avatar img { width:100%;height:100%;object-fit:cover; }

.comment-bubble {
  background: var(--pale-blue);
  border-radius: 12px 12px 12px 4px;
  padding: 8px 12px;
  flex: 1;
}

.comment-user { font-size: 12px; font-weight: 800; color: var(--text-dark); }
.comment-text { font-size: 12px; color: var(--text-mid); margin-top: 2px; }

.comment-input-row {
  display: flex;
  gap: 8px;
  padding: 8px 16px;
  border-top: 1px solid var(--border);
  align-items: center;
}

.comment-input {
  flex: 1;
  background: var(--pale-blue);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 8px 16px;
  font-family: var(--font);
  font-size: 13px;
  outline: none;
  transition: all 0.2s;
}

.comment-input:focus { border-color: var(--accent); background: white; }

/* ===== CHAT PAGE ===== */
.chat-layout { display: flex; height: calc(100vh - var(--nav-height) - 60px); }

.chat-rooms {
  width: 260px;
  background: rgba(255,255,255,0.7);
  backdrop-filter: blur(10px);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.chat-rooms-header {
  padding: 16px;
  font-weight: 900;
  font-size: 16px;
  color: var(--text-dark);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.room-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  cursor: pointer;
  transition: all 0.2s;
  border-bottom: 1px solid rgba(168,216,234,0.2);
}

.room-item:hover { background: var(--pale-blue); }
.room-item.active { background: linear-gradient(135deg, var(--light-blue), var(--baby-blue)); }

.room-icon {
  width: 40px; height: 40px;
  border-radius: 12px;
  background: var(--gradient-header);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.room-info { flex: 1; overflow: hidden; }
.room-name { font-weight: 800; font-size: 13px; color: var(--text-dark); }
.room-last { font-size: 11px; color: var(--text-light); font-family: var(--font2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.room-badge {
  background: var(--deep-blue);
  color: white;
  border-radius: 50%;
  width: 20px; height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 900;
  flex-shrink: 0;
}

/* Chat messages area */
.chat-main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

.chat-header {
  padding: 12px 16px;
  background: rgba(255,255,255,0.8);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}

.chat-header .room-icon-sm {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: var(--gradient-header);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.chat-header .room-title { font-weight: 900; font-size: 15px; color: var(--text-dark); }
.chat-header .room-members { font-size: 11px; color: var(--text-light); font-family: var(--font2); }

.messages-area {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.msg-row { display: flex; gap: 8px; align-items: flex-end; }
.msg-row.own { flex-direction: row-reverse; }

.msg-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--gradient-header);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 900;
  color: white;
  flex-shrink: 0;
  cursor: pointer;
  overflow: hidden;
}
.msg-avatar img { width:100%;height:100%;object-fit:cover; }

.msg-content { max-width: 65%; }

.msg-username-tag {
  font-size: 11px;
  font-weight: 800;
  color: var(--accent);
  margin-bottom: 3px;
  font-family: var(--font2);
}

.msg-username-tag .title-badge {
  font-size: 9px;
  padding: 1px 6px;
  border-radius: 100px;
  margin-left: 4px;
  font-weight: 900;
}

.msg-bubble {
  background: rgba(255,255,255,0.9);
  border: 1px solid var(--border);
  border-radius: 16px 16px 16px 4px;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--text-dark);
  line-height: 1.5;
  box-shadow: 0 2px 8px rgba(91,155,213,0.1);
  word-break: break-word;
}

.msg-row.own .msg-bubble {
  background: var(--gradient-header);
  color: white;
  border-radius: 16px 16px 4px 16px;
  border-color: transparent;
}

.msg-time {
  font-size: 10px;
  color: var(--text-light);
  font-family: var(--font2);
  margin-top: 4px;
  text-align: right;
}

.msg-row.own .msg-time { text-align: right; }

/* Chat input */
.chat-input-bar {
  padding: 12px 16px;
  background: rgba(255,255,255,0.8);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
  align-items: center;
}

.chat-input {
  flex: 1;
  background: var(--pale-blue);
  border: 2px solid var(--border);
  border-radius: 20px;
  padding: 10px 18px;
  font-family: var(--font);
  font-size: 13px;
  outline: none;
  transition: all 0.2s;
  resize: none;
  max-height: 100px;
  overflow-y: auto;
}

.chat-input:focus { border-color: var(--accent); background: white; }

.send-btn {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--gradient-header);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(91,155,213,0.4);
  transition: all 0.2s;
  flex-shrink: 0;
}

.send-btn:hover { transform: scale(1.1); }
.send-btn svg { width: 18px; height: 18px; color: white; }

/* ===== PROFILE PAGE ===== */
.profile-page { max-width: 600px; margin: 0 auto; padding: 20px 16px; }

.profile-header {
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(10px);
  border-radius: 24px;
  overflow: hidden;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}

.profile-banner {
  height: 120px;
  background: var(--gradient-header);
  position: relative;
  cursor: pointer;
}

.profile-banner img { width: 100%; height: 100%; object-fit: cover; }
.banner-edit-overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: 0.2s;
  color: white;
  font-size: 13px;
  font-weight: 700;
}

.profile-banner:hover .banner-edit-overlay { opacity: 1; }

.profile-info-section {
  padding: 0 20px 20px;
  position: relative;
}

.profile-pic-wrapper {
  position: relative;
  display: inline-block;
  margin-top: -40px;
  margin-bottom: 12px;
}

.profile-pic {
  width: 80px; height: 80px;
  border-radius: 50%;
  border: 4px solid white;
  background: var(--gradient-header);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 900;
  color: white;
  cursor: pointer;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.profile-pic img { width:100%;height:100%;object-fit:cover; }

.profile-pic-edit {
  position: absolute;
  bottom: 0; right: 0;
  width: 24px; height: 24px;
  background: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: 2px solid white;
}

.profile-pic-edit svg { width: 12px; height: 12px; color: white; }

.profile-name { font-size: 20px; font-weight: 900; color: var(--text-dark); }
.profile-jawatan { font-size: 12px; color: var(--text-light); font-family: var(--font2); margin-top: 2px; }
.profile-bio { font-size: 13px; color: var(--text-mid); margin-top: 10px; line-height: 1.5; }

.profile-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.profile-link {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--pale-blue);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 12px;
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
  transition: 0.2s;
}

.profile-link:hover { background: var(--light-blue); }

.profile-stats { display: flex; gap: 24px; margin-top: 16px; }
.stat-item { text-align: center; }
.stat-num { font-size: 20px; font-weight: 900; color: var(--text-dark); }
.stat-label { font-size: 11px; color: var(--text-light); font-family: var(--font2); }

.edit-profile-btn {
  background: var(--pale-blue);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 20px;
  font-family: var(--font);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  color: var(--text-dark);
  transition: 0.2s;
  margin-top: 12px;
}

.edit-profile-btn:hover { border-color: var(--accent); color: var(--accent); }

/* Profile posts grid */
.profile-posts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  border-radius: var(--radius);
  overflow: hidden;
}

.profile-post-thumb {
  aspect-ratio: 1;
  background: var(--light-blue);
  cursor: pointer;
  overflow: hidden;
  position: relative;
}

.profile-post-thumb img { width:100%;height:100%;object-fit:cover; transition: 0.3s; }
.profile-post-thumb:hover img { transform: scale(1.05); }

/* ===== UPLOAD PAGE ===== */
.upload-page { max-width: 500px; margin: 0 auto; padding: 20px 16px; }

.upload-card {
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(10px);
  border-radius: 24px;
  padding: 28px;
  box-shadow: var(--shadow);
}

.upload-card h2 { font-size: 20px; font-weight: 900; color: var(--text-dark); margin-bottom: 20px; }

.upload-drop-zone {
  border: 3px dashed var(--border);
  border-radius: var(--radius);
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
}

.upload-drop-zone:hover, .upload-drop-zone.drag-over {
  border-color: var(--accent);
  background: var(--pale-blue);
}

.upload-drop-zone .drop-icon { font-size: 40px; margin-bottom: 12px; }
.upload-drop-zone p { color: var(--text-mid); font-size: 14px; font-weight: 700; }
.upload-drop-zone span { color: var(--text-light); font-size: 12px; font-family: var(--font2); }

.upload-preview {
  position: relative;
  margin-bottom: 20px;
  border-radius: var(--radius);
  overflow: hidden;
  display: none;
}

.upload-preview img { width: 100%; max-height: 300px; object-fit: cover; display: block; border-radius: var(--radius); }
.upload-preview-remove {
  position: absolute;
  top: 10px; right: 10px;
  width: 32px; height: 32px;
  background: rgba(0,0,0,0.6);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: white;
  font-size: 16px;
}

/* ===== BOARD PAGE ===== */
.board-page { max-width: 600px; margin: 0 auto; padding: 20px 16px; }

.board-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.board-header h2 { font-size: 22px; font-weight: 900; color: var(--text-dark); }

.board-card {
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--accent);
  animation: slideUp 0.4s ease both;
}

.board-card .board-title { font-size: 16px; font-weight: 900; color: var(--text-dark); margin-bottom: 8px; }
.board-card .board-body { font-size: 13px; color: var(--text-mid); line-height: 1.6; margin-bottom: 12px; }
.board-card .board-footer { display: flex; align-items: center; justify-content: space-between; }
.board-card .board-author { font-size: 11px; color: var(--text-light); font-family: var(--font2); }
.board-card .board-time { font-size: 11px; color: var(--text-light); font-family: var(--font2); }
.board-card .board-category {
  display: inline-block;
  font-size: 10px;
  padding: 3px 10px;
  border-radius: 100px;
  background: var(--light-blue);
  color: var(--deep-blue);
  font-weight: 700;
  margin-bottom: 10px;
}

/* ===== PANELS ===== */
.panel-page { max-width: 600px; margin: 0 auto; padding: 20px 16px; }

.panel-header {
  background: var(--gradient-header);
  border-radius: 20px;
  padding: 24px;
  margin-bottom: 20px;
  color: white;
  box-shadow: var(--shadow-lg);
}

.panel-header h2 { font-size: 22px; font-weight: 900; }
.panel-header p { font-size: 12px; opacity: 0.8; font-family: var(--font2); margin-top: 4px; }

.panel-section {
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}

.panel-section h3 { font-size: 15px; font-weight: 900; color: var(--text-dark); margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }

.stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 16px; }

.stat-card {
  background: var(--gradient-main);
  border-radius: var(--radius-sm);
  padding: 16px;
  text-align: center;
}

.stat-card .stat-n { font-size: 28px; font-weight: 900; color: var(--deep-blue); }
.stat-card .stat-l { font-size: 11px; color: var(--text-light); font-family: var(--font2); margin-top: 2px; }

.user-table { width: 100%; }
.user-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.user-row:last-child { border-bottom: none; }
.user-row .u-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--gradient-header);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 900;
  color: white;
  flex-shrink: 0;
}
.user-row .u-info { flex: 1; }
.user-row .u-name { font-size: 13px; font-weight: 800; color: var(--text-dark); }
.user-row .u-role { font-size: 11px; color: var(--text-light); font-family: var(--font2); }
.user-row .u-status { width: 8px; height: 8px; border-radius: 50%; background: #ccc; }
.user-row .u-status.online { background: #4caf50; box-shadow: 0 0 6px #4caf50; }

.ban-input-row { display: flex; gap: 8px; margin-top: 8px; }
.ban-input { flex: 1; }

/* ===== EDIT PROFILE MODAL ===== */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(8px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn { from { opacity:0; } to { opacity:1; } }

.modal-card {
  background: white;
  border-radius: 24px;
  padding: 28px;
  width: 100%;
  max-width: 480px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: popIn 0.3s cubic-bezier(0.34,1.56,0.64,1) both;
}

.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.modal-header h3 { font-size: 18px; font-weight: 900; color: var(--text-dark); }

/* ===== NOTIFICATION OVERLAY ===== */
.notif-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(10px);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.notif-overlay.hidden { display: none; }

.notif-card {
  background: white;
  border-radius: 28px;
  padding: 36px 28px;
  width: 100%;
  max-width: 360px;
  text-align: center;
  box-shadow: var(--shadow-lg);
  animation: popIn 0.4s cubic-bezier(0.34,1.56,0.64,1) both;
}

.notif-icon { font-size: 56px; margin-bottom: 16px; }
.notif-card h2 { font-size: 20px; font-weight: 900; color: var(--text-dark); margin-bottom: 12px; }
.notif-card p { font-size: 13px; color: var(--text-mid); line-height: 1.6; margin-bottom: 10px; font-family: var(--font2); }
.notif-warn { background: #fff3e0; border-radius: 10px; padding: 10px 14px; color: #e65100 !important; font-weight: 700 !important; font-size: 12px !important; }

/* ===== TOAST ===== */
#toast-container {
  position: fixed;
  top: 20px; right: 20px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 16px;
  min-width: 260px;
  max-width: 320px;
  box-shadow: var(--shadow-lg);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-dark);
  border-left: 4px solid var(--accent);
  animation: toastIn 0.4s cubic-bezier(0.34,1.56,0.64,1) both;
}

@keyframes toastIn {
  from { opacity:0; transform: translateX(60px); }
  to   { opacity:1; transform: translateX(0); }
}

.toast.success { border-left-color: #4caf50; }
.toast.error { border-left-color: #f44336; }
.toast.info { border-left-color: var(--accent); }

.toast-title { font-weight: 900; margin-bottom: 3px; }
.toast-body { font-weight: 600; color: var(--text-mid); font-size: 12px; font-family: var(--font2); }

/* ===== SPINNER ===== */
.spinner {
  display: inline-block;
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ===== EMPTY STATE ===== */
.empty-state { text-align: center; padding: 60px 20px; }
.empty-state .empty-icon { font-size: 48px; margin-bottom: 12px; }
.empty-state p { color: var(--text-light); font-size: 14px; font-family: var(--font2); }

/* ===== RESPONSIVE ===== */
@media (max-width: 600px) {
  .chat-rooms { width: 70px; }
  .room-info { display: none; }
  .room-badge { display: none; }
  .chat-rooms-header span { display: none; }
}

/* ===== MISC ===== */
.hidden { display: none !important; }
.divider { height: 1px; background: var(--border); margin: 16px 0; }
textarea.field-input { min-height: 80px; resize: vertical; }
.link-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.link-row .field-input { flex: 1; }
