@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800&display=swap');

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

:root {
  --blue: #1877f2;
  --blue-dark: #145dbf;
  --blue-light: #e7f0fd;
  --green: #42b883;
  --green-dark: #2d9c6a;
  --orange: #f5a623;
  --red: #e53935;
  --gray-50: #f0f2f5;
  --gray-100: #e4e6eb;
  --gray-300: #b0b3b8;
  --gray-500: #65676b;
  --gray-700: #444950;
  --gray-900: #1c1e21;
  --white: #ffffff;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.10);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.12);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.14);
  --radius: 8px;
  --radius-lg: 16px;
  --font: 'Nunito', sans-serif;
  --transition: all 0.2s ease;
}

body {
  font-family: var(--font);
  background: var(--gray-50);
  color: var(--gray-900);
  min-height: 100vh;
}

/* ===== HEADER ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: var(--white);
  border-bottom: 1px solid var(--gray-100);
  box-shadow: var(--shadow-sm);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  height: 60px;
  max-width: 1400px;
  margin: 0 auto;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  flex-shrink: 0;
}
.logo-icon {
  width: 40px;
  height: 40px;
  background: var(--blue);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}
.logo-text {
  font-size: 20px;
  font-weight: 800;
  color: var(--blue);
  letter-spacing: -0.5px;
}

.header-search {
  flex: 1;
  max-width: 400px;
  position: relative;
}
.header-search input {
  width: 100%;
  padding: 9px 16px 9px 40px;
  background: var(--gray-50);
  border: 1.5px solid transparent;
  border-radius: 24px;
  font-family: var(--font);
  font-size: 14px;
  color: var(--gray-900);
  outline: none;
  transition: var(--transition);
}
.header-search input:focus {
  border-color: var(--blue);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(24,119,242,0.1);
}
.header-search input::placeholder { color: var(--gray-500); }
.header-search .search-icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-500);
  font-size: 15px;
  pointer-events: none;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-700);
  transition: var(--transition);
  white-space: nowrap;
}
.nav-link:hover { background: var(--gray-100); color: var(--gray-900); }
.nav-link.active { color: var(--blue); background: var(--blue-light); }

.btn-publish {
  background: var(--blue);
  color: var(--white) !important;
  padding: 8px 18px;
  border-radius: 24px;
  font-weight: 700;
}
.btn-publish:hover { background: var(--blue-dark) !important; transform: translateY(-1px); box-shadow: var(--shadow-md); }

.btn-login {
  border: 1.5px solid var(--blue);
  color: var(--blue) !important;
  border-radius: 24px;
  padding: 7px 16px;
}
.btn-login:hover { background: var(--blue-light) !important; }

/* ===== USER DROPDOWN ===== */
.user-menu-wrapper { position: relative; }

.user-avatar-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--blue);
  color: white;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 15px;
  cursor: pointer;
  flex-shrink: 0;
  transition: var(--transition);
  box-shadow: 0 0 0 2px var(--white), 0 0 0 4px transparent;
}
.user-avatar-btn:hover {
  box-shadow: 0 0 0 2px var(--white), 0 0 0 4px var(--blue);
}

.user-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  background: white;
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  min-width: 220px;
  z-index: 500;
  overflow: hidden;
  animation: dropIn 0.15s ease;
}
.user-dropdown.open { display: block; }

@keyframes dropIn {
  from { opacity: 0; transform: translateY(-8px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.user-dropdown-header {
  padding: 16px;
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  gap: 12px;
}
.user-dropdown-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--blue);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 16px;
  flex-shrink: 0;
}
.user-dropdown-info strong { font-size: 14px; font-weight: 800; color: var(--gray-900); display: block; }
.user-dropdown-info small { font-size: 11px; color: var(--gray-500); }

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-700);
  text-decoration: none;
  transition: background 0.15s;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}
.dropdown-item:hover { background: var(--gray-50); color: var(--gray-900); }
.dropdown-item .di-icon { font-size: 18px; width: 24px; text-align: center; }
.dropdown-item.danger { color: var(--red); }
.dropdown-item.danger:hover { background: #fdecea; }
.dropdown-divider { height: 1px; background: var(--gray-100); margin: 4px 0; }

/* ===== PAGE WRAPPER ===== */
.page-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px 20px;
}

/* ===== BADGES ===== */
.badge-verified {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #eaf7ee;
  color: #1a7a3e;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 12px;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}
.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none !important; }

.btn-primary { background: var(--blue); color: white; }
.btn-primary:hover { background: var(--blue-dark); transform: translateY(-1px); box-shadow: var(--shadow-md); }

.btn-green { background: var(--green); color: white; }
.btn-green:hover { background: var(--green-dark); transform: translateY(-1px); }

.btn-orange { background: var(--orange); color: white; }
.btn-orange:hover { background: #e0961e; transform: translateY(-1px); }

.btn-red { background: var(--red); color: white; }
.btn-red:hover { background: #c62828; transform: translateY(-1px); }

.btn-ghost { background: var(--gray-100); color: var(--gray-700); }
.btn-ghost:hover { background: var(--gray-300); }

.btn-outline { background: transparent; color: var(--blue); border: 1.5px solid var(--blue); }
.btn-outline:hover { background: var(--blue-light); }

/* ===== SKELETON LOADER ===== */
@keyframes shimmer {
  0% { background-position: -600px 0; }
  100% { background-position: 600px 0; }
}
.skeleton {
  background: linear-gradient(90deg, var(--gray-100) 25%, #f5f5f5 50%, var(--gray-100) 75%);
  background-size: 600px 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius);
}

/* ===== TOAST ===== */
.toast-container {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}
.toast {
  background: var(--gray-900);
  color: white;
  padding: 12px 20px;
  border-radius: 24px;
  font-family: var(--font);
  font-weight: 700;
  font-size: 14px;
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.3s ease, toastOut 0.3s ease 2.7s forwards;
  white-space: nowrap;
}
.toast.success { background: #1a7a3e; }
.toast.error { background: #c62828; }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(16px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toastOut {
  from { opacity: 1; }
  to   { opacity: 0; }
}

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--gray-500);
}
.empty-state .empty-icon { font-size: 56px; margin-bottom: 16px; }
.empty-state h3 { font-size: 18px; font-weight: 800; color: var(--gray-700); margin-bottom: 8px; }
.empty-state p { font-size: 14px; margin-bottom: 24px; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .header-inner { gap: 8px; padding: 0 12px; }
  .logo-text { display: none; }
  .header-search { max-width: none; flex: 1; }
  .nav-link span { display: none; }
  .btn-publish span { display: none; }
  .btn-publish { padding: 8px 14px; font-size: 18px; font-weight: 800; min-width: 38px; }
  .btn-publish::before { content: '+'; }
  .btn-login { padding: 7px 12px; font-size: 13px; }
}
