* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: #0b0d14;
  overflow-x: hidden;
}

/* =========================
   Animated gradient helper
   ========================= */
.anim-gradient{
  background-size: 220% 220%;
  background-position: 0% 50%;
  animation: gradientMove 8s ease-in-out infinite;
  will-change: background-position;
}

@keyframes gradientMove{
  0%{ background-position: 0% 50%; }
  50%{ background-position: 100% 50%; }
  100%{ background-position: 0% 50%; }
}

@media (prefers-reduced-motion: reduce){
  .anim-gradient{ animation: none !important; }
}

/* Verified badge icon */
.verified-icon{
  width: 16px;
  height: 16px;
  display: inline-block;
  vertical-align: middle;
  object-fit: contain;
  opacity: .95;
}

/* Bigger in user modal badges */
.usercard-badges .verified-icon{
  width: 18px;
  height: 18px;
}

/* Animated Background for Auth Screen */
.auth-screen {
  min-height: 100vh;
  width: 100vw;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 25%, #f093fb 50%, #f5576c 75%, #ffd93d 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  overflow: hidden;
}

.animated-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: 0;
}

.gradient-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.6;
  animation: float 20s infinite ease-in-out;
}

.orb-1 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(102, 126, 234, 0.8) 0%, transparent 70%);
  top: -250px;
  left: -250px;
  animation-delay: 0s;
}

.orb-2 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(245, 87, 108, 0.8) 0%, transparent 70%);
  bottom: -200px;
  right: -200px;
  animation-delay: 7s;
}

.orb-3 {
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, rgba(255, 217, 61, 0.7) 0%, transparent 70%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation-delay: 14s;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(50px, -50px) scale(1.1); }
  50% { transform: translate(-30px, 30px) scale(0.9); }
  75% { transform: translate(30px, 50px) scale(1.05); }
}

.auth-container {
  perspective: 1000px;
  width: 100%;
  max-width: 450px;
  z-index: 1;
  position: relative;
}

.auth-card {
  position: relative;
  width: 100%;
  height: 600px;
  transition: transform 0.7s;
  transform-style: preserve-3d;
}

.auth-card.flipped {
  transform: rotateY(180deg);
}

.auth-side {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 24px;
  padding: 40px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.3);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.login-side { transform: rotateY(0deg); }
.signup-side { transform: rotateY(180deg); }

.auth-header {
  text-align: center;
  margin-bottom: 26px;
}

.logo-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  color: white;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.2));
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.auth-header h1 {
  font-size: 32px;
  font-weight: 700;
  color: white;
  margin-bottom: 8px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.auth-header p {
  color: rgba(255, 255, 255, 0.95);
  font-size: 16px;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-input {
  width: 100%;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 12px;
  color: white;
  font-size: 16px;
  outline: none;
  transition: all 0.25s;
}

.auth-input::placeholder {
  color: rgba(255, 255, 255, 0.7);
}

.auth-input:focus {
  background: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.6);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.15);
}

.auth-note{
  margin-top: 6px;
  font-size: 12px;
  color: rgba(255,255,255,.85);
  text-align: center;
  line-height: 1.45;
}

.username-status {
  margin-top: 8px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  min-height: 20px;
}

.username-status.available {
  color: #6bcf7f;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.username-status.taken {
  color: #ff6b6b;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.error-message {
  padding: 12px;
  background: rgba(255, 107, 107, 0.3);
  border-radius: 8px;
  color: white;
  font-size: 14px;
  text-align: center;
  display: none;
  font-weight: 600;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  animation: shake 0.5s;
}

.error-message.show {
  display: block;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-10px); }
  75% { transform: translateX(10px); }
}

.btn-primary {
  width: 100%;
  padding: 14px;
  background: white;
  color: #667eea;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  position: relative;
  overflow: hidden;
}

.btn-primary:hover {
  background: rgba(255, 255, 255, 0.95);
  transform: translateY(-1px);
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.25);
}

.btn-primary:active { transform: translateY(0); }

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  width: 100%;
  padding: 14px;
  background: transparent;
  color: white;
  border: 2px solid white;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: scale(1.01);
}

/* Main App */
.main-app {
  min-height: 100vh;
  background:
    radial-gradient(1200px 700px at 15% 10%, rgba(102,126,234,.22), transparent 60%),
    radial-gradient(900px 600px at 85% 20%, rgba(245,87,108,.16), transparent 55%),
    radial-gradient(800px 600px at 65% 95%, rgba(255,217,61,.12), transparent 55%),
    linear-gradient(180deg, #070913, #0b0d14 60%, #070913);
  display: none;
}

.header {
  background: rgba(10, 12, 18, 0.55);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255,255,255,.10);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-stack{ display:flex; flex-direction:column; gap: 2px; }

.header-logo {
  width: 32px;
  height: 32px;
  color: rgba(255,255,255,.92);
}

.header-title {
  font-size: 20px;
  font-weight: 900;
  color: rgba(255,255,255,.95);
  letter-spacing: .2px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.upload-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.25s;
  position: relative;
  overflow: hidden;
  box-shadow: 0 14px 30px rgba(102,126,234,.22);
}

.upload-btn svg {
  width: 16px;
  height: 16px;
}

.upload-btn:hover {
  box-shadow: 0 18px 40px rgba(102, 126, 234, 0.30);
  transform: translateY(-1px);
}

.profile-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.18);
  color: white;
  font-size: 18px;
  font-weight: 900;
  cursor: pointer;
  transition: all 0.25s;
  box-shadow: 0 14px 30px rgba(0,0,0,.28);
}

.profile-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.32);
}

/* Skeleton Loading */
.loading-state { display: block; }

.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}

.skeleton-post {
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 14px 40px rgba(0,0,0,.18);
}

.skeleton-image {
  width: 100%;
  height: 300px;
  background: linear-gradient(90deg, rgba(255,255,255,.06) 25%, rgba(255,255,255,.12) 50%, rgba(255,255,255,.06) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

.skeleton-info { padding: 16px; }

.skeleton-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.skeleton-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(90deg, rgba(255,255,255,.06) 25%, rgba(255,255,255,.12) 50%, rgba(255,255,255,.06) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  flex-shrink: 0;
}

.skeleton-text-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.skeleton-text {
  height: 12px;
  background: linear-gradient(90deg, rgba(255,255,255,.06) 25%, rgba(255,255,255,.12) 50%, rgba(255,255,255,.06) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 6px;
}

.skeleton-username { width: 120px; }
.skeleton-time { width: 80px; }
.skeleton-caption { width: 100%; margin-bottom: 8px; }
.skeleton-caption-short { width: 70%; }

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* Posts */
.posts-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px;
}

.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
}

.post-card {
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 14px 40px rgba(0,0,0,.26);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
  position: relative;
  animation: fadeInUp 0.35s ease-out;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

.post-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255,255,255,.16);
  box-shadow: 0 18px 60px rgba(0,0,0,.34);
}

/* Admin post theme (animated transform + aura) */
.post-card.admin-post{
  border-color: rgba(102,126,234,.24);
  box-shadow: 0 18px 70px rgba(0,0,0,.42);
  animation: adminPostFloat 4.8s ease-in-out infinite;
}
.post-card.admin-post::before{
  content:"";
  position:absolute;
  inset:-40px;
  background:
    radial-gradient(700px 420px at 15% 20%, rgba(102,126,234,.32), transparent 60%),
    radial-gradient(680px 420px at 90% 25%, rgba(245,87,108,.22), transparent 60%),
    radial-gradient(800px 520px at 50% 110%, rgba(255,217,61,.18), transparent 65%),
    conic-gradient(from 180deg at 50% 50%,
      rgba(102,126,234,.14),
      rgba(245,87,108,.10),
      rgba(255,217,61,.09),
      rgba(102,126,234,.14)
    );
  filter: blur(16px) saturate(1.15);
  opacity: .95;
  pointer-events:none;
  animation: adminPostAurora 9s ease-in-out infinite;
  z-index: 0;
}
.post-card.admin-post::after{
  content:"";
  position:absolute;
  inset:0;
  background: linear-gradient(120deg,
    rgba(255,255,255,0) 0%,
    rgba(255,255,255,.10) 45%,
    rgba(255,255,255,0) 70%
  );
  opacity: .55;
  transform: translateX(-50%) skewX(-12deg);
  pointer-events:none;
  mix-blend-mode: overlay;
  animation: adminPostSweep 3.6s ease-in-out infinite;
  z-index: 0;
}
.post-card.admin-post > *{ position: relative; z-index: 1; }

@keyframes adminPostAurora{
  0%   { transform: translate3d(0,0,0) rotate(0deg) scale(1.00); }
  50%  { transform: translate3d(14px,-10px,0) rotate(8deg) scale(1.03); }
  100% { transform: translate3d(0,0,0) rotate(0deg) scale(1.00); }
}
@keyframes adminPostSweep{
  0%   { transform: translateX(-55%) skewX(-12deg); opacity: .35; }
  50%  { transform: translateX(18%)  skewX(-12deg); opacity: .70; }
  100% { transform: translateX(-55%) skewX(-12deg); opacity: .35; }
}
@keyframes adminPostFloat{
  0%,100%{ transform: translateY(0); }
  50%    { transform: translateY(-2px); }
}
@media (prefers-reduced-motion: reduce){
  .post-card.admin-post,
  .post-card.admin-post::before,
  .post-card.admin-post::after{
    animation: none !important;
  }
}

.post-image-wrapper {
  position: relative;
  width: 100%;
  height: 300px;
  overflow: hidden;
  display:flex;
  align-items:center;
  justify-content:center;
}

.post-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.2s;
}

.post-card:hover .post-image {
  transform: scale(1.01);
}

.post-info {
  padding: 16px;
  position: relative;
  z-index: 2;
}

.post-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.post-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 800;
  font-size: 14px;
  flex-shrink: 0;
  transition: transform 0.3s;
}

.post-card:hover .post-avatar { transform: rotate(360deg); }

.post-meta { flex: 1; }

.post-username {
  font-weight: 800;
  font-size: 14px;
  color: rgba(255,255,255,.92);
  display:flex;
  align-items:center;
  gap: 8px;
  flex-wrap:wrap;
}

.post-username .user-link,
.comment-username .user-link{
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
  color: inherit;
  cursor: pointer;
  font: inherit;
  font-weight: 900;
  text-decoration: none;
}

.post-username .user-link:hover,
.comment-username .user-link:hover{
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(255,255,255,.55);
}

.inline-badges{ display:flex; gap: 8px; align-items:center; flex-wrap:wrap; }

.user-desc {
  font-size: 11px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.78);
  letter-spacing: .2px;
  max-width: 170px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-badge {
  font-size: 11px;
  font-weight: 900;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.86);
  letter-spacing: .2px;
  display:inline-flex;
  align-items:center;
  gap: 6px;
}

.user-badge.verified{
  border-color: rgba(102,126,234,.35);
  background: rgba(102,126,234,.14);
}

.post-time {
  font-size: 12px;
  color: rgba(255,255,255,.55);
}

.post-caption {
  font-size: 1rem;
  color: rgba(255,255,255,.88);
  margin-bottom: 12px;
  line-height: 1.5;
  word-wrap: break-word;
}

.post-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.like-btn, .comment-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: 1px solid rgba(255,255,255,.12);
  cursor: pointer;
  font-size: 13px;
  color: rgba(255,255,255,.72);
  transition: transform .16s ease, border-color .16s ease, background .16s ease, color .16s ease;
  font-weight: 800;
  padding: 8px 10px;
  border-radius: 999px;
}

.like-btn svg, .comment-btn svg {
  width: 18px;
  height: 18px;
  transition: all 0.3s;
}

.like-btn:hover {
  color: #ff8a8a;
  transform: translateY(-1px);
  border-color: rgba(255,107,107,.35);
  background: rgba(255,107,107,.08);
}

.like-btn:active { transform: scale(0.98); }

.like-btn.liked {
  color: #ff6b6b;
  animation: likeAnimation 0.5s ease-out;
  border-color: rgba(255,107,107,.55);
  background: rgba(255,107,107,.10);
}

.like-btn.liked svg { fill: #ff6b6b; }

@keyframes likeAnimation {
  0% { transform: scale(1); }
  50% { transform: scale(1.12); }
  100% { transform: scale(1); }
}

.comment-btn:hover {
  color: #aab7ff;
  transform: translateY(-1px);
  border-color: rgba(102,126,234,.35);
  background: rgba(102,126,234,.08);
}

.empty-state {
  text-align: center;
  padding: 80px 20px;
  animation: fadeIn 0.35s;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.empty-state svg {
  width: 80px;
  height: 80px;
  color: rgba(255,255,255,.16);
  margin-bottom: 16px;
}

.empty-state p {
  font-size: 18px;
  color: rgba(255,255,255,.60);
}

/* Owner/admin delete post trigger */
.user-delete-trigger,
.admin-delete-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  margin: 10px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 12px;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
  position: absolute;
  top: 0;
  right: 0;
  overflow: hidden;
  z-index: 5;
}

.user-delete-trigger{
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: rgba(255,255,255,.92);
}

.admin-delete-trigger{
  background: rgba(255, 77, 77, 0.10);
  color: #ff4d4d;
  border: 1px solid rgba(255, 77, 77, 0.25);
}

.post-card:hover .user-delete-trigger,
.post-card:hover .admin-delete-trigger { opacity: 1; }

.user-delete-trigger:hover{
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 12px 20px rgba(0,0,0,.24);
}

.admin-delete-trigger:hover {
  background: #ff4d4d !important;
  color: white !important;
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 12px 20px rgba(255, 77, 77, 0.26);
  border-color: transparent;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
}

.modal.show {
  display: flex;
  animation: fadeIn 0.22s;
}

.modal-content {
  background: rgba(255,255,255,.94);
  border-radius: 20px;
  padding: 28px;
  max-width: 600px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: modalSlide 0.24s ease-out;
  max-height: 90vh;
  overflow-y: auto;
  color: #111;
}

.modal-large { max-width: 700px; }

@keyframes modalSlide {
  from { opacity: 0; transform: translateY(-14px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.modal-header h2 {
  font-size: 22px;
  font-weight: 900;
}

.close-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,.06);
  font-size: 24px;
  color: rgba(0,0,0,.60);
  cursor: pointer;
  transition: all 0.2s;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.close-btn:hover {
  background: rgba(0,0,0,.10);
  color: rgba(0,0,0,.80);
  transform: rotate(90deg);
}

.file-upload-label {
  display: block;
  border: 2px dashed rgba(0,0,0,.20);
  border-radius: 16px;
  padding: 60px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s;
}

.file-upload-label:hover {
  border-color: #667eea;
  background: rgba(102,126,234,.06);
  transform: scale(1.01);
}

.file-upload-label svg {
  width: 48px;
  height: 48px;
  color: rgba(0,0,0,.35);
  margin-bottom: 16px;
  transition: transform 0.25s;
}

.file-upload-label:hover svg { transform: translateY(-3px); }

.file-upload-label p {
  color: rgba(0,0,0,.60);
  font-size: 16px;
  font-weight: 800;
}

.image-preview {
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 14px;
  padding: 16px;
}

.image-preview img {
  width: 100%;
  height: 300px;
  object-fit: contain;
  border-radius: 12px;
  animation: fadeIn 0.35s;
}

.caption-input {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid rgba(0,0,0,.18);
  border-radius: 12px;
  font-size: 16px;
  outline: none;
  transition: all 0.25s;
  margin-bottom: 14px;
}

.caption-input:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.12);
}

.upload-actions {
  display: flex;
  gap: 12px;
}

.upload-actions button { flex: 1; }

/* Upload progress */
.upload-progress{
  margin: 10px 0 14px;
  border-radius: 14px;
  border: 1px solid rgba(0,0,0,.12);
  background: rgba(0,0,0,.03);
  padding: 10px 12px;
}

.upload-progress-top{
  display:flex;
  align-items:center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 900;
  color: rgba(0,0,0,.70);
  margin-bottom: 8px;
}

.upload-progress-bar{
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: rgba(0,0,0,.08);
  overflow:hidden;
}

.upload-progress-fill{
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  transition: width .18s ease;
}

/* Profile */
.profile-content { max-height: 70vh; overflow-y: auto; }

.profile-header {
  text-align: center;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(0,0,0,.08);
  margin-bottom: 20px;
}

.profile-avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 40px;
  font-weight: 900;
  transition: transform 0.25s;
}

.profile-avatar:hover { transform: scale(1.04); }

.profile-header h3 {
  font-size: 20px;
  margin-bottom: 4px;
  font-weight: 900;
}

.profile-header p {
  color: rgba(0,0,0,.55);
  font-size: 14px;
}

.profile-post-count {
  color: #667eea !important;
  font-weight: 900;
  margin-top: 8px;
}

.profile-field { margin-bottom: 18px; }

.profile-field label {
  display: block;
  font-size: 14px;
  font-weight: 900;
  color: rgba(0,0,0,.60);
  margin-bottom: 8px;
}

.profile-field p {
  font-size: 16px;
  color: rgba(0,0,0,.86);
}

.profile-input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid rgba(0,0,0,.18);
  border-radius: 12px;
  font-size: 16px;
  outline: none;
  transition: all 0.25s;
  font-family: inherit;
}

.profile-input:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.12);
}

.color-display {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}

.color-box {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  transition: transform 0.25s;
}

.color-box:hover { transform: rotate(8deg) scale(1.05); }

.color-display span {
  font-weight: 900;
  text-transform: capitalize;
}

.color-picker {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  margin-top: 8px;
}

.color-option {
  aspect-ratio: 1;
  border-radius: 12px;
  border: 3px solid transparent;
  cursor: pointer;
  transition: all 0.25s;
}

.color-option:hover { transform: scale(1.08) rotate(2deg); }

.color-option.selected {
  border-color: #667eea;
  box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.16);
  transform: scale(1.05);
}

.profile-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

.profile-actions button {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-danger {
  background: #ff6b6b;
  color: white;
  border: none;
  padding: 14px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 900;
  cursor: pointer;
  transition: all 0.25s;
  box-shadow: 0 12px 26px rgba(255, 107, 107, 0.22);
}

.btn-danger:hover {
  background: #ff5252;
  transform: translateY(-1px);
  box-shadow: 0 16px 34px rgba(255, 107, 107, 0.28);
}

/* Comments Section */
.comments-container {
  max-height: 70vh;
  display: flex;
  flex-direction: column;
}

.comments-list {
  flex: 1;
  overflow-y: auto;
  margin-bottom: 20px;
  min-height: 200px;
  max-height: 420px;
}

.comment-item {
  display: flex;
  gap: 12px;
  padding: 12px;
  border-radius: 14px;
  margin-bottom: 12px;
  background: rgba(71,146,78,0.5);
  background-image: linear-gradient(to right, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0));
  animation: fadeInUp 0.3s ease-out;
  position: relative;
}

.comment-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 900;
  font-size: 14px;
  flex-shrink: 0;
}

.comment-content { flex: 1; }

.comment-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}

.comment-username {
  font-weight: 900;
  font-size: 14px;
  color: rgba(0,0,0,.86);
  display:flex;
  align-items:center;
  gap: 8px;
  flex-wrap:wrap;
}

.comment-time {
  font-size: 12px;
  color: rgba(0,0,0,.45);
}

.comment-text {
  font-size: 14px;
  color: rgba(0,0,0,.70);
  line-height: 1.4;
  word-wrap: break-word;
}

.comment-input-wrapper {
  display: flex;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid rgba(0,0,0,.08);
}

.comment-input {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid rgba(0,0,0,.18);
  border-radius: 12px;
  font-size: 14px;
  outline: none;
  transition: all 0.25s;
  font-family: inherit;
}

.comment-input:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.12);
}

.btn-comment {
  width: 20vw;
  max-width: 120px;
  min-width: 80px;
  padding: 12px 20px;
  white-space: nowrap;
  flex-shrink: 0;
  font-size: 14px;
}

/* Delete comment buttons */
.admin-delete-comment,
.user-delete-comment{
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 4px 12px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
  opacity: 0;
  transition: all 0.25s;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.user-delete-comment{
  background: rgba(0,0,0,0.06);
  border: 1px solid rgba(0,0,0,0.16);
  color: rgba(0,0,0,.70);
}

.admin-delete-comment{
  background: rgba(255, 77, 77, 0.10);
  border: 1px solid rgba(255, 77, 77, 0.26);
  color: #ff4d4d;
}

.comment-item:hover .admin-delete-comment,
.comment-item:hover .user-delete-comment { opacity: 1; }

.user-delete-comment:hover{
  background: rgba(0,0,0,0.10);
  transform: translateY(-1px);
}

.admin-delete-comment:hover {
  background: #ff4d4d;
  color: white;
  transform: translateY(-1px);
}

/* Links inside caption/comment */
.post-caption a,
.comment-text a{
  color: rgba(102,126,234,0.95);
  font-weight: 900;
  text-decoration: underline;
  text-decoration-color: rgba(102,126,234,.45);
  text-underline-offset: 3px;
}
.post-caption a:hover,
.comment-text a:hover{
  text-decoration-color: rgba(245,87,108,.55);
}

/* User modal card */
.usercard{
  display:flex;
  flex-direction:column;
  gap: 16px;
}

.usercard-top{
  display:flex;
  gap: 14px;
  align-items:flex-start;
}

.usercard-avatar{
  width: 92px;
  height: 92px;
  border-radius: 50%;
  display:flex;
  align-items:center;
  justify-content:center;
  color:#fff;
  font-weight: 1000;
  font-size: 38px;
  flex-shrink:0;
  box-shadow: 0 18px 40px rgba(0,0,0,.18);
  position: relative;
  overflow: hidden;
}

.usercard-meta{ flex:1; }

.usercard-name-row{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 10px;
}

.usercard-fullname{
  font-size: 22px;
  font-weight: 1000;
  color: rgba(0,0,0,.90);
  line-height: 1.15;
}

.usercard-badges{
  display:flex;
  gap: 8px;
  flex-wrap:wrap;
  justify-content:flex-end;
}

.usercard-handle-row{
  display:flex;
  align-items:center;
  gap: 10px;
  flex-wrap:wrap;
  margin-top: 6px;
}

.usercard-handle{
  font-weight: 1000;
  color: rgba(0,0,0,.70);
}

.usercard-desc{
  font-size: 12px;
  font-weight: 900;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,.12);
  background: rgba(0,0,0,.03);
  color: rgba(0,0,0,.70);
  max-width: 240px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.usercard-bio{
  margin-top: 10px;
  font-size: 14px;
  color: rgba(0,0,0,.72);
  line-height: 1.45;
  word-wrap: break-word;
}

.usercard-stats{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.userstat{
  border-radius: 14px;
  border: 1px solid rgba(0,0,0,.10);
  background: rgba(0,0,0,.02);
  padding: 12px 12px;
}

.userstat-label{
  font-size: 12px;
  font-weight: 900;
  color: rgba(0,0,0,.55);
  margin-bottom: 4px;
}

.userstat-value{
  font-size: 14px;
  font-weight: 1000;
  color: rgba(0,0,0,.85);
}

.usercard-actions{
  display:flex;
  gap: 12px;
}

.badge{
  text-align: center;
  font-size: 11px;
  font-weight: 1000;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,.12);
  background: rgba(0,0,0,.03);
  color: rgba(0,0,0,.78);
  white-space: nowrap;
  display:inline-flex;
  align-items:center;
  gap: 8px;
}

.badge.verified{
  border-color: rgba(102,126,234,.35);
  background: rgba(102,126,234,.12);
  color: rgba(56,82,200,.95);
}

/* Admin theme for user modal */
.user-modal-content.admin-theme{
  position: relative;
  overflow: hidden;
  border-radius: 22px;
  border: 1px solid rgba(255,255,255,.14);
  box-shadow:
    0 28px 90px rgba(0,0,0,.40),
    0 0 0 1px rgba(102,126,234,.10) inset;
  transform: translateZ(0);
}
.user-modal-content.admin-theme::before{
  content:"";
  position:absolute;
  inset:-40px;
  background:
    radial-gradient(900px 550px at 10% 15%, rgba(102,126,234,.35), transparent 60%),
    radial-gradient(850px 520px at 90% 20%, rgba(245,87,108,.22), transparent 60%),
    radial-gradient(900px 650px at 50% 95%, rgba(255,217,61,.18), transparent 60%),
    conic-gradient(from 180deg at 50% 50%,
      rgba(102,126,234,.18),
      rgba(245,87,108,.12),
      rgba(255,217,61,.10),
      rgba(102,126,234,.18)
    );
  filter: blur(18px) saturate(1.15);
  opacity: .95;
  animation: adminAurora 10s ease-in-out infinite;
  pointer-events:none;
}
.user-modal-content.admin-theme::after{
  content:"";
  position:absolute;
  inset:0;
  background:
    linear-gradient(120deg,
      rgba(255,255,255,.00) 0%,
      rgba(255,255,255,.08) 45%,
      rgba(255,255,255,.00) 70%
    );
  opacity: .55;
  transform: translateX(-40%) skewX(-12deg);
  animation: adminSweep 3.8s ease-in-out infinite;
  pointer-events:none;
  mix-blend-mode: overlay;
}
.user-modal-content.admin-theme .modal-header,
.user-modal-content.admin-theme .usercard{
  position: relative;
  z-index: 2;
}
.user-modal-content.admin-theme .usercard-avatar{
  box-shadow:
    0 18px 45px rgba(0,0,0,.22),
    0 0 0 3px rgba(255,255,255,.25) inset,
    0 0 22px rgba(102,126,234,.22);
  animation: adminAvatarPulse 2.6s ease-in-out infinite;
}
@keyframes adminAurora{
  0%   { transform: translate3d(0,0,0) rotate(0deg) scale(1.00); }
  40%  { transform: translate3d(18px,-10px,0) rotate(10deg) scale(1.03); }
  70%  { transform: translate3d(-10px,16px,0) rotate(-8deg) scale(1.02); }
  100% { transform: translate3d(0,0,0) rotate(0deg) scale(1.00); }
}
@keyframes adminSweep{
  0%   { transform: translateX(-55%) skewX(-12deg); opacity: .35; }
  50%  { transform: translateX(15%)  skewX(-12deg); opacity: .70; }
  100% { transform: translateX(-55%) skewX(-12deg); opacity: .35; }
}
@keyframes adminAvatarPulse{
  0%,100% { transform: translateY(0) scale(1); filter: saturate(1); }
  50%     { transform: translateY(-2px) scale(1.02); filter: saturate(1.12); }
}

/* Admin console */
.admin-console{
  border-radius: 16px;
  border: 1px solid rgba(0,0,0,.10);
  background: rgba(0,0,0,.02);
  padding: 14px;
}

.admin-console-head{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.admin-console-title{
  font-size: 14px;
  font-weight: 1000;
  color: rgba(0,0,0,.80);
}

.admin-console-actions{
  display:flex;
  gap: 10px;
}

.admin-console-actions .btn-secondary{
  background: transparent;
  border: 2px solid rgba(0,0,0,.40);
  color: rgba(0,0,0,.85);
  padding: 10px 12px;
  font-size: 14px;
}

.admin-console-actions .btn-primary{
  padding: 10px 12px;
  font-size: 14px;
}

.admin-console-grid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.admin-metric{
  border-radius: 14px;
  border: 1px solid rgba(0,0,0,.10);
  background: rgba(255,255,255,.65);
  padding: 12px;
}

.admin-metric-wide{
  grid-column: 1 / -1;
}

.admin-metric-label{
  font-size: 12px;
  font-weight: 1000;
  color: rgba(0,0,0,.55);
  margin-bottom: 4px;
}

.admin-metric-value{
  font-size: 15px;
  font-weight: 1000;
  color: rgba(0,0,0,.85);
}

.admin-console-foot{
  margin-top: 10px;
  font-size: 12px;
  font-weight: 900;
  color: rgba(0,0,0,.60);
}

/* Toasts */
#toastHost{
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 20000;
  display:flex;
  flex-direction:column;
  gap: 10px;
  pointer-events:none;
  width: min(92vw, 420px);
}

.toast{
  pointer-events:none;
  opacity: 0;
  transform: translateY(12px) scale(.98);
  transition: opacity .2s ease, transform .2s ease;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(10,12,18,.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,.14);
  box-shadow: 0 14px 40px rgba(0,0,0,.30);
  color: rgba(255,255,255,.92);
  font-weight: 900;
  text-align:center;
}

.toast.show{
  opacity: 1;
  transform: translateY(0) scale(1);
}

.toast-success{ border-color: rgba(107,207,127,.35); }
.toast-error{ border-color: rgba(255,107,107,.35); }
.toast-info{ border-color: rgba(102,126,234,.35); }

#right-name p {
  margin: 2px 0 0 0;
  font-size: 12px;
  color: rgba(255,255,255,.62);
  letter-spacing: 0.5px;
}

/* Ensure Admin modal behaves like your other modals */
#adminConfirmModal.modal {
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(5px);
}

@media (max-width: 768px) {
  .posts-grid,
  .skeleton-grid { grid-template-columns: 1fr; }

  .header-title { font-size: 18px; }

  .upload-btn span { display: none; }

  .auth-card { height: auto; min-height: 500px; }

  .auth-side { padding: 30px 25px; }

  .color-picker { grid-template-columns: repeat(7, 1fr); }

  .orb-1, .orb-2, .orb-3 { width: 300px; height: 300px; }

  .comment-input-wrapper { flex-direction: column; }

  .btn-comment { width: 100%; max-width: none; }

  .usercard-top{ flex-direction: column; align-items: center; text-align:center; }
  .usercard-name-row{ justify-content:center; }
  .usercard-handle-row{ justify-content:center; }
  .usercard-stats{ grid-template-columns: 1fr; }
}
