/* ============================================================
   SpaceBar — MySpace-inspired, modern dark social network
   ============================================================ */

:root {
  --bg:        #0d0d1a;
  --bg2:       #12122a;
  --bg3:       #1a1a35;
  --pink:      #ff69b4;
  --purple:    #9b59b6;
  --cyan:      #00d4ff;
  --text:      #e0e0e0;
  --muted:     #7a7a9a;
  --border:    #2a2a4a;
  --danger:    #e74c3c;
  --success:   #27ae60;
  --nav-h:     52px;
  --radius:    6px;
  --glow-pink: 0 0 12px #ff69b455, 0 0 24px #ff69b422;
  --glow-pur:  0 0 12px #9b59b655, 0 0 24px #9b59b622;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Trebuchet MS', Arial, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--pink); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; display: block; }

textarea, input, select {
  background: #1a1a35;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.5rem 0.75rem;
  width: 100%;
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
textarea:focus, input:focus, select:focus {
  border-color: var(--pink);
  box-shadow: 0 0 0 2px #ff69b422;
}
select option { background: #1a1a35; }

/* ---- NAV ---- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  gap: 1.5rem;
  background: rgba(10, 10, 25, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-logo {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--pink);
  text-shadow: var(--glow-pink);
  letter-spacing: 0.05em;
  white-space: nowrap;
  text-decoration: none;
}
.nav-logo:hover { text-decoration: none; }
.nav-links {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  margin-left: auto;
  flex-wrap: wrap;
}
.nav-links a {
  color: var(--text);
  font-size: 13px;
  opacity: 0.85;
  transition: opacity 0.15s, color 0.15s;
  text-decoration: none;
}
.nav-links a:hover { opacity: 1; color: var(--pink); }
.nav-join {
  background: var(--pink);
  color: #000 !important;
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  font-weight: 700;
  opacity: 1 !important;
}
.nav-logout { color: var(--muted) !important; }

/* ---- BUTTONS ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.5rem 1.2rem;
  border-radius: 20px;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.2s;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary   { background: var(--pink); color: #000; }
.btn-primary:hover { box-shadow: var(--glow-pink); }
.btn-ghost     { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover { border-color: var(--pink); color: var(--pink); }
.btn-danger    { background: var(--danger); color: #fff; }
.btn-lg { padding: 0.7rem 1.8rem; font-size: 15px; }
.btn-sm { padding: 0.3rem 0.8rem; font-size: 12px; }
.btn-xs { padding: 0.15rem 0.5rem; font-size: 11px; border-radius: 4px; }
.btn-full { width: 100%; }

/* ---- ALERTS ---- */
.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-size: 13px;
}
.alert-error   { background: #3a0d0d; border: 1px solid var(--danger); color: #ff8080; }
.alert-success { background: #0d2a0d; border: 1px solid var(--success); color: #6effa0; }

/* ---- TEXT UTILITIES ---- */
.text-muted  { color: var(--muted); font-size: 12px; }
.section-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--pink);
  text-shadow: var(--glow-pink);
  margin-bottom: 1rem;
  letter-spacing: 0.05em;
}

/* ---- SITE FOOTER ---- */
.site-footer {
  text-align: center;
  padding: 2rem;
  color: var(--muted);
  font-size: 12px;
  border-top: 1px solid var(--border);
  margin-top: 4rem;
}

/* ======================================================
   LANDING PAGE
   ====================================================== */
.landing { max-width: 1100px; margin: 0 auto; padding: 2rem 1rem; }

.landing-hero {
  text-align: center;
  padding: 4rem 1rem 3rem;
}

.hero-title {
  font-size: clamp(2.5rem, 8vw, 5rem);
  font-weight: 900;
  color: var(--pink);
  text-shadow: 0 0 20px #ff69b4, 0 0 40px #ff69b488, 0 0 80px #ff69b433;
  letter-spacing: 0.1em;
  margin-bottom: 1rem;
  animation: pulseGlow 3s ease-in-out infinite;
}

@keyframes pulseGlow {
  0%, 100% { text-shadow: 0 0 20px #ff69b4, 0 0 40px #ff69b488, 0 0 80px #ff69b433; }
  50%       { text-shadow: 0 0 30px #ff69b4, 0 0 60px #ff69b4aa, 0 0 100px #ff69b455; }
}

.glitch {
  position: relative;
}
.glitch::before, .glitch::after {
  content: attr(data-text);
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
}
.glitch::before {
  color: var(--cyan);
  animation: glitch1 4s infinite;
  clip-path: polygon(0 0, 100% 0, 100% 45%, 0 45%);
}
.glitch::after {
  color: var(--purple);
  animation: glitch2 4s infinite;
  clip-path: polygon(0 55%, 100% 55%, 100% 100%, 0 100%);
}
@keyframes glitch1 {
  0%, 90%, 100% { transform: none; opacity: 0; }
  91% { transform: translate(-2px, -1px); opacity: 0.8; }
  93% { transform: translate(2px, 1px); opacity: 0; }
}
@keyframes glitch2 {
  0%, 94%, 100% { transform: none; opacity: 0; }
  95% { transform: translate(3px, 0); opacity: 0.8; }
  97% { transform: translate(-3px, 0); opacity: 0; }
}

.hero-sub {
  font-size: 1.1rem;
  color: var(--muted);
  margin-bottom: 2rem;
}
.hero-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; margin-bottom: 1.5rem; }
.hero-features {
  display: flex;
  gap: 1.2rem;
  justify-content: center;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 13px;
}
.hero-features span {
  background: var(--bg3);
  border: 1px solid var(--border);
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
}

.landing-section { margin: 2rem 0; }

/* ---- USER CARD GRID ---- */
.user-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}
.user-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1.2rem;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s;
  text-align: center;
}
.user-card:hover {
  border-color: var(--pink);
  box-shadow: var(--glow-pink);
  text-decoration: none;
}
.user-card-avatar img, .avatar-placeholder {
  width: 72px; height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--purple);
}
.avatar-placeholder {
  display: flex; align-items: center; justify-content: center;
  background: var(--bg3);
  color: var(--pink);
  font-size: 1.8rem;
  font-weight: 700;
}
.user-card-info { display: flex; flex-direction: column; gap: 0.2rem; }
.user-card-info .username { color: var(--muted); font-size: 12px; }
.user-card-info .tagline { color: var(--cyan); font-size: 12px; font-style: italic; }

/* ======================================================
   AUTH PAGES
   ====================================================== */
.auth-page {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: calc(100vh - var(--nav-h) - 80px);
  padding: 2rem 1rem;
}
.auth-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem 2.5rem;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 4px 40px rgba(0,0,0,0.4);
}
.auth-title {
  font-size: 1.4rem;
  color: var(--pink);
  text-shadow: var(--glow-pink);
  margin-bottom: 1.5rem;
  text-align: center;
}
.auth-switch { text-align: center; margin-top: 1.2rem; color: var(--muted); font-size: 13px; }

.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 0.3rem; text-transform: uppercase; letter-spacing: 0.05em; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

/* ======================================================
   HOME / FEED
   ====================================================== */
.home-layout {
  max-width: 800px;
  margin: 0 auto;
  padding: 1.5rem 1rem;
}

.friend-requests {
  background: var(--bg2);
  border: 1px solid var(--purple);
  box-shadow: var(--glow-pur);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  margin-bottom: 1.5rem;
}
.friend-requests h3 { color: var(--purple); margin-bottom: 0.8rem; font-size: 14px; }
.friend-req-card {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}
.friend-req-card:last-child { border-bottom: none; }

.feed-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }

.feed-post {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem;
  margin-bottom: 1rem;
  transition: border-color 0.2s;
}
.feed-post:hover { border-color: var(--purple); }
.post-author { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.6rem; }
.post-title { font-size: 1rem; margin-bottom: 0.4rem; }
.post-title a { color: var(--text); }
.post-title a:hover { color: var(--pink); }
.post-preview { color: var(--muted); font-size: 13px; line-height: 1.5; margin-bottom: 0.6rem; }
.post-time { margin-left: auto; }
.read-more { font-size: 12px; color: var(--pink); }
.empty-feed { text-align: center; padding: 3rem; color: var(--muted); }

/* ======================================================
   AVATARS
   ====================================================== */
.mini-avatar, .mini-avatar-placeholder {
  width: 36px; height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.mini-avatar-placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg3);
  color: var(--pink);
  font-size: 14px;
  font-weight: 700;
}

/* ======================================================
   PROFILE PAGE
   ====================================================== */
.profile-wrap {
  min-height: calc(100vh - var(--nav-h));
}
.profile-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem 1rem;
}

/* Music Player */
.music-player {
  background: rgba(0,0,0,0.6);
  border: 1px solid var(--pink);
  border-radius: var(--radius);
  padding: 0.6rem 0.8rem;
  margin-bottom: 1rem;
  backdrop-filter: blur(8px);
}
.music-label {
  display: block;
  font-size: 11px;
  color: var(--pink);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.4rem;
}

/* Profile grid */
.profile-grid {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 1rem;
  align-items: start;
}

@media (max-width: 700px) {
  .profile-grid { grid-template-columns: 1fr; }
}

/* Section boxes */
.section-box {
  background: rgba(0, 0, 0, 0.65);
  border: 1px solid var(--purple);
  box-shadow: 0 0 12px rgba(155, 89, 182, 0.25);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  margin-bottom: 0.8rem;
  backdrop-filter: blur(6px);
}
.section-box h3 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--pink);
  margin-bottom: 0.8rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid rgba(255,105,180,0.2);
}

/* Profile ID card */
.profile-avatar-wrap { position: relative; display: inline-block; margin-bottom: 0.7rem; }
.profile-avatar {
  width: 130px; height: 130px;
  border-radius: 8px;
  object-fit: cover;
  border: 2px solid var(--pink);
  box-shadow: var(--glow-pink);
}
.profile-avatar-placeholder {
  width: 130px; height: 130px;
  border-radius: 8px;
  background: var(--bg3);
  display: flex; align-items: center; justify-content: center;
  font-size: 3rem; color: var(--pink);
  border: 2px solid var(--pink);
}
.online-badge {
  position: absolute;
  bottom: -8px; right: -8px;
  background: #27ae60;
  color: #fff;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 10px;
  font-weight: 700;
  white-space: nowrap;
}
.profile-name { font-size: 1.2rem; font-weight: 700; margin-bottom: 0.2rem; }
.profile-tagline { font-size: 12px; color: var(--muted); margin-bottom: 0.5rem; font-style: italic; }
.profile-mood { font-size: 12px; margin-bottom: 0.2rem; }
.profile-loc { font-size: 12px; color: var(--muted); margin-bottom: 0.2rem; }
.profile-views, .profile-since { font-size: 11px; color: var(--muted); margin-bottom: 0.2rem; }
.profile-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.8rem; }

/* Top Friends */
.top-friends-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}
.top-friend {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.3rem;
  color: inherit;
  text-decoration: none;
  padding: 0.4rem;
  border-radius: 4px;
  transition: background 0.15s;
  font-size: 11px;
}
.top-friend:hover { background: rgba(255,255,255,0.05); text-decoration: none; }
.top-friend img {
  width: 56px; height: 56px;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid var(--border);
}
.friend-avatar-placeholder {
  width: 56px; height: 56px;
  border-radius: 6px;
  background: var(--bg3);
  display: flex; align-items: center; justify-content: center;
  color: var(--pink);
  font-size: 1.4rem;
  font-weight: 700;
}
.top-friend span { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 70px; }

/* About / Interests */
.about-text { font-size: 14px; line-height: 1.7; white-space: pre-wrap; word-break: break-word; }

.interests-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
  font-size: 13px;
}
.interests-grid strong { display: block; color: var(--pink); font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.2rem; }
.interests-grid p { color: var(--muted); }

/* Profile Posts */
.profile-post { padding: 0.5rem 0; border-bottom: 1px solid rgba(255,255,255,0.06); }
.profile-post:last-child { border-bottom: none; }
.profile-post p { color: var(--muted); font-size: 12px; margin-top: 0.2rem; }

/* Guestbook */
.guestbook-form textarea { margin-bottom: 0.5rem; }
.guestbook-entry {
  padding: 0.7rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.guestbook-entry:last-child { border-bottom: none; }
.gb-author { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.4rem; flex-wrap: wrap; }
.gb-content { font-size: 13px; color: var(--text); padding-left: 0.2rem; word-break: break-word; }

/* ======================================================
   EDIT PROFILE
   ====================================================== */
.edit-profile-page {
  max-width: 900px;
  margin: 0 auto;
  padding: 1.5rem 1rem;
}
.edit-section {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem 1.5rem;
  margin-bottom: 1.2rem;
}
.edit-section h3 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--pink);
  margin-bottom: 1rem;
}
.edit-form .form-group { margin-bottom: 0.9rem; }
.color-row { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.color-input-wrap { display: flex; gap: 0.5rem; align-items: center; }
.color-input-wrap input[type=color] { width: 48px; height: 38px; padding: 2px; cursor: pointer; border-radius: 4px; }
.color-input-wrap .color-hex { flex: 1; }
.checkbox-group label { display: flex; align-items: center; gap: 0.5rem; color: var(--text); text-transform: none; letter-spacing: 0; font-size: 13px; cursor: pointer; }
.checkbox-group input[type=checkbox] { width: auto; cursor: pointer; }
.edit-actions { display: flex; gap: 1rem; margin-top: 1rem; }

/* ======================================================
   POST / COMMENTS
   ====================================================== */
.post-page { max-width: 720px; margin: 0 auto; padding: 1.5rem 1rem; }
.post-full {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}
.post-meta { display: flex; align-items: center; gap: 0.7rem; margin-bottom: 0.8rem; flex-wrap: wrap; }
.post-full-title { font-size: 1.5rem; color: var(--pink); margin-bottom: 1rem; line-height: 1.3; }
.post-body { font-size: 14px; line-height: 1.8; word-break: break-word; }

.comments-section { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.2rem; }
.comments-section h3 { margin-bottom: 1rem; font-size: 14px; color: var(--pink); }
.comment-form textarea { margin-bottom: 0.5rem; }
.comment {
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--border);
}
.comment:last-child { border-bottom: none; }
.comment-author { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.3rem; }
.comment p { font-size: 13px; line-height: 1.6; word-break: break-word; }

/* ======================================================
   SEARCH
   ====================================================== */
.search-page { max-width: 900px; margin: 0 auto; padding: 1.5rem 1rem; }
.search-form { display: flex; gap: 0.5rem; margin-bottom: 1.5rem; }
.search-form input { flex: 1; }

/* ======================================================
   SPARKLE CURSOR
   ====================================================== */
.sparkle {
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  width: 8px; height: 8px;
  border-radius: 50%;
  animation: sparkleAnim 0.6s ease-out forwards;
  transform: translate(-50%, -50%);
}
@keyframes sparkleAnim {
  0%   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, calc(-50% - 30px)) scale(0); }
}

/* ======================================================
   ANIMATED BORDER UTILITY
   ====================================================== */
@keyframes borderPulse {
  0%   { border-color: #ff69b4; box-shadow: 0 0 12px #ff69b455; }
  33%  { border-color: #9b59b6; box-shadow: 0 0 12px #9b59b655; }
  66%  { border-color: #00d4ff; box-shadow: 0 0 12px #00d4ff55; }
  100% { border-color: #ff69b4; box-shadow: 0 0 12px #ff69b455; }
}
.animated-border { animation: borderPulse 4s linear infinite; }

/* ======================================================
   SCROLLBAR
   ====================================================== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--purple); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--pink); }
