/* ========== Variables ========== */
:root {
  --bg:        #f0f7ff;
  --bg2:       #e4f0fd;
  --surface:   #ffffff;
  --surface2:  #f8fbff;
  --border:    #d0e8f8;
  --border2:   #bcd9f4;
  --accent:    #0a7aff;
  --accent2:   #38bdf8;
  --accent3:   #7dd3fc;
  --success:   #22c55e;
  --danger:    #ef4444;
  --warning:   #f59e0b;
  --muted:     #7bacc8;
  --text:      #1e3a52;
  --text2:     #4a7a9b;
  --sans:      'Nunito', sans-serif;
  --display:   'Quicksand', sans-serif;
}

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

/* ========== Base ========== */
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Fixed full-page gradient — no repeat on scroll */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 15% 0%, rgba(56,189,248,.22) 0%, transparent 70%),
    radial-gradient(ellipse 60% 40% at 85% 5%, rgba(10,122,255,.13) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

body > * { position: relative; z-index: 1; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--accent3); border-radius: 3px; }

/* ========== Header ========== */
.main-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 24px;
  gap: 16px;
  flex-wrap: wrap;
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 16px rgba(10,122,255,.07);
}

/* ── Logo ── */
.logo a {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.logo-mark {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #0a7aff 0%, #38bdf8 100%);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 10px rgba(10,122,255,.3);
  flex-shrink: 0;
}

.logo-mark svg {
  width: 20px;
  height: 20px;
  fill: #fff;
}

.logo-text {
  display: flex;
  flex-direction: column;
}

.logo-text .logo-main {
  font-family: var(--display);
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.4px;
}

.logo-text .logo-main span { color: var(--accent); }

.logo-text .logo-sub {
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: .5px;
  text-transform: uppercase;
  margin-top: 2px;
}

/* ── Header search ── */
.header-search {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  max-width: 400px;
}

.header-search input[type="text"] {
  flex: 1;
  padding: 10px 16px;
  font-size: 14px;
  background: var(--surface);
  border: 1.5px solid var(--border2);
  border-radius: 12px;
  outline: none;
  color: var(--text);
  font-family: var(--sans);
  transition: border-color .2s, box-shadow .2s;
  box-shadow: 0 1px 4px rgba(10,122,255,.05);
}

.header-search input[type="text"]::placeholder { color: var(--muted); }

.header-search input[type="text"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(10,122,255,.1);
}

.header-search button {
  padding: 10px 18px;
  background: var(--accent);
  border: none;
  border-radius: 10px;
  color: #fff;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s, transform .1s;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(10,122,255,.25);
}

.header-search button:hover  { background: #0065d9; }
.header-search button:active { transform: scale(.97); }

/* ========== Main ========== */
main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 20px 40px;
}

h1 {
  font-family: var(--display);
  font-size: 48px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
  line-height: 1.2;
}

.slogan {
  font-size: 18px;
  color: var(--text2);
  margin-bottom: 30px;
  max-width: 540px;
  line-height: 1.6;
}

/* ========== Search Box ========== */
.search-box {
  width: 100%;
  max-width: 500px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.search-box input {
  flex: 1;
  padding: 14px 20px;
  font-size: 16px;
  font-family: var(--sans);
  background: var(--surface);
  border: 2px solid var(--border2);
  border-radius: 12px;
  outline: none;
  color: var(--text);
  transition: border-color .2s, box-shadow .2s;
  box-shadow: 0 2px 8px rgba(10,122,255,.06);
}

.search-box input::placeholder { color: var(--muted); }

.search-box input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(10,122,255,.12);
}

.search-box button {
  padding: 14px 24px;
  font-size: 16px;
  font-family: var(--sans);
  font-weight: 700;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: background .2s, transform .1s;
  box-shadow: 0 3px 12px rgba(10,122,255,.3);
}

.search-box button:hover  { background: #0065d9; }
.search-box button:active { transform: scale(.97); }

/* ========== Container ========== */
.container {
  width: 90%;
  max-width: 1200px;
  margin: 20px auto;
}

/* ========== User Cards ========== */
.user-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
  padding: 20px 0;
}

.user-info {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 2px 8px rgba(10,122,255,.05);
  transition: box-shadow .2s, transform .15s;
  overflow: hidden;
}

.user-info:hover {
  box-shadow: 0 6px 20px rgba(10,122,255,.12);
  transform: translateY(-2px);
}

.user-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.user-header img {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border2);
}

.user-meta { text-align: left; }

.user-meta strong {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.user-meta small a {
  color: var(--accent);
  text-decoration: none;
  font-size: 13px;
}

.user-meta small a:hover { text-decoration: underline; }

.bio {
  font-size: 13px;
  color: var(--text2);
  line-height: 1.5;
  text-align: left;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ========== Post Grid — Masonry ========== */
.post-grid {
  column-count: 3;
  column-gap: 16px;
  padding: 20px 0;
}

/* ========== Post Card ========== */
.post {
  display: inline-block;
  width: 100%;
  margin-bottom: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 2px 10px rgba(10,122,255,.06);
  break-inside: avoid;
  transition: box-shadow .2s, transform .15s;
}

.post:hover {
  box-shadow: 0 6px 24px rgba(10,122,255,.12);
  transform: translateY(-1px);
}

.post p {
  margin: 0 0 10px;
  line-height: 1.6;
  font-size: 14px;
  color: var(--text);
}

.post img {
  max-width: 100%;
  border-radius: 10px;
}

.post small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 6px;
}

.post a {
  color: var(--accent);
  text-decoration: none;
}

/* ========== Card Box (Embeds) ========== */
.card-box {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 12px;
  background: var(--surface2);
  box-shadow: 0 1px 4px rgba(10,122,255,.05);
  transition: box-shadow .2s, transform .15s;
}

.card-box:hover {
  box-shadow: 0 4px 14px rgba(10,122,255,.1);
  transform: scale(1.01);
}

.card-box img {
  width: 100%;
  height: auto;
  display: block;
}

.card-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.card-meta {
  padding: 10px 14px;
}

.card-meta small {
  color: var(--muted);
  display: block;
  margin-bottom: 4px;
  font-size: 13px;
}

.card-meta strong {
  font-size: 14px;
  display: block;
  color: var(--text);
}

/* ========== YouTube Thumb ========== */
.youtube-thumb {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  background: #000;
}

.youtube-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.youtube-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  color: #fff;
}

/* ========== Profile Hero ========== */
.profile-hero {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%);
  padding: 40px 20px;
  text-align: center;
  color: white;
}

.profile-hero-inner {
  display: inline-block;
  background: rgba(0,0,0,.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  padding: 28px 36px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,.15);
  text-shadow: 0 1px 4px rgba(0,0,0,.4);
}

.profile-nav-btn {
  display: inline-block;
  padding: 8px 18px;
  border-radius: 50px;
  color: #fff;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  margin: 0 4px;
  border: 1px solid rgba(255,255,255,.3);
  transition: background .15s;
}

.profile-nav-btn.active { background: rgba(255,255,255,.3); }
.profile-nav-btn:hover  { background: rgba(255,255,255,.2); }

/* ========== Load More ========== */
.load-more-btn {
  padding: 10px 28px;
  border-radius: 50px;
  border: 1.5px solid var(--border2);
  background: var(--surface);
  color: var(--accent);
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all .15s;
  box-shadow: 0 2px 8px rgba(10,122,255,.08);
}

.load-more-btn:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.load-more-btn:disabled {
  opacity: .5;
  cursor: not-allowed;
}

/* ========== Page Content (About / Privacy / Terms) ========== */
.page-content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 28px 32px;
  box-shadow: 0 2px 16px rgba(10,122,255,.06);
}

.page-content h2 {
  color: var(--text);
  font-family: var(--display);
}

.page-content p,
.page-content li {
  color: #446;
  line-height: 1.75;
}

.page-content a { color: var(--accent); text-decoration: none; }
.page-content a:hover { text-decoration: underline; }

/* ========== Footer ========== */
footer {
  text-align: center;
  padding: 24px 20px;
  font-size: 14px;
  color: var(--muted);
  border-top: 1px solid var(--border);
  margin-top: 20px;
  background: rgba(255,255,255,.6);
  backdrop-filter: blur(8px);
}

.footer-links {
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--text2);
  text-decoration: none;
  padding: 4px 10px;
  border-radius: 20px;
  transition: background .15s;
}

.footer-links a:hover {
  background: var(--bg2);
  text-decoration: none;
}

.footer-links .sep { color: var(--border2); }

/* ========== Responsive ========== */
@media (min-width: 992px) and (max-width: 1199px) {
  .post-grid { column-count: 3; }
}

@media (min-width: 768px) and (max-width: 991px) {
  .post-grid { column-count: 2; }
  .user-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
}

@media (max-width: 767px) {
  .post-grid  { column-count: 1; }
  .user-grid  { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  h1          { font-size: 32px; }
  .slogan     { font-size: 16px; }
  .main-header { padding: 10px 16px; }
  main        { padding: 40px 16px 28px; }
  .container  { padding: 0 16px 32px; }
  .profile-hero-inner { padding: 20px 16px; }
}
