/* Custom Font */
@font-face { 
  font-family: "Broken15";
  src: url("BROKEN15.TTF") format("truetype");
}
@font-face { 
  font-family: "PREFIX";
  src: url("PREFIX.TTF") format("truetype");
}
/* Root Variables */
:root {
  --heart-color: red;
  --heart-unliked: black;
}

/* Reset + Centering */
html, body {
  margin: 0;
  padding: 0;
  font-family: Arial, sans-serif;
  background: #111;
  height: 100%;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow-x: hidden;
}

/* Blur Background for Lightbox */
body.blur-bg .app {
  filter: blur(12px);
}

/* App Wrapper */
.app {
  width: 100%;
  max-width: 720px;
  height: 100vh;
  max-height: 1240px;
  background: #fff;
  border: 1px solid #ddd;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Top Bar */
.top-bar {
  flex: none;
  width: 100%;
  padding: 0;
  background: #000;
}

.top-bar .logo {
  display: block;
  width: 100%;
  height: auto;
}

/* Profile Header */
.profile-header {
  display: flex;
  align-items: center;
  padding: 20px;
}

.profile-pic { 
  width: 170px; 
  height: 170px; 
  margin-right: 30px; 
  object-fit: cover;
  border-radius: 0; /* Square */
}

.profile-details { 
  flex: 1; 
}

.username { 
  font-family:"PREFIX", Arial, sans-serif; 
  margin: 10px 0; 
  font-size: 25px; 
}

.profile-stats { 
  display: flex; 
  justify-content: space-between; 
  margin: 16px 0; 
}

.profile-stats div { 
  font-family:"PREFIX", Arial, sans-serif; 
  text-align: center; 
  font-size: 22px; 
}

.stat-number { 
  font-family:"PREFIX", Arial, sans-serif; 
  font-weight: bold; 
  font-size: 24px; 
}

/* Bio Section */
.bio-section { 
  padding: 20px; 
  border-top: 1px solid #eee; 
}

.bio { 
  font-family:"PREFIX", Arial, sans-serif; 
  font-size: 24px; 
  margin-bottom: 15px; 
}

.bio-links { 
  display: flex; 
  gap: 10px; 
}

.bio-link { 
  flex: 1; 
  text-align: center; 
  padding: 12px; 
  background: #fafafa; 
  border: 1.5px solid #ddd; 
  border-radius: 6px; 
  font-family:"PREFIX", Arial, sans-serif; 
  font-weight: bold; 
  font-size: 21px; 
  text-decoration: none; 
  color: #000; 
}

.bio-link:hover { 
  background: #f0f0f0; 
}

/* Posts Grid 3x3 */
.posts-grid { 
  display: grid; 
  grid-template-columns: repeat(3, 1fr); 
  gap: 3px; 
  padding: 3px; 
}

.post { 
  aspect-ratio: 1 / 1; 
  overflow: hidden; 
  background: #fff; 
  border: 1px solid #eee; /* Instagram-style border */
  cursor: pointer; 
}

.post img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.post img:hover {
  transform: scale(1.05);
}

/* Lightbox */
.lightbox {
  display: none;
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.6);
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.lightbox-inner {
  background: #fff;
  border-radius: 4px;
  width: 95%;
  max-width: 720px;
  max-height: 1080px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Lightbox Header */
.lightbox-header { 
  display: flex; 
  align-items: center; 
  padding: 10px; 
  background: #fff; 
}

.lightbox-pfp { 
  width: 40px; 
  height: 40px; 
  border-radius: 0; /* Square */
  margin-right: 10px; 
  object-fit: cover; 
}

.lightbox-username { 
  font-weight: bold; 
  flex: 1; 
}

.close-btn { 
  font-size: 28px; 
  cursor: pointer; 
}

/* Lightbox Media */
.lightbox-media {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #000;
  position: relative;
}

.lightbox-img-fill, 
.lightbox-media video,
#lightbox-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Popup Heart Animation */
.popup-heart {
  color: var(--heart-color);
  position: absolute;
  font-size: 100px;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0);
  pointer-events: none;
  transition: transform 0.3s ease, opacity 0.3s ease;
  top: 50%;
  left: 50%;
}

.popup-heart.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1.5);
  animation: heart-bounce 0.6s forwards;
}

@keyframes heart-bounce {
  0% { transform: translate(-50%, -50%) scale(0); }
  50% { transform: translate(-50%, -50%) scale(2); }
  100% { transform: translate(-50%, -50%) scale(1.5); }
}

/* Lightbox Actions */
.lightbox-actions { 
  display: flex; 
  gap: 15px; 
  padding: 10px; 
  font-size: 24px; 
  background: #fff; 
}

.lightbox-actions button { 
  background: none; 
  border: none; 
  font-size: 28px; 
  cursor: pointer; 
  transition: transform 0.2s ease, color 0.2s ease;
}

#like-btn {
  color: var(--heart-unliked);
  font-size: 32px;
}

#like-btn.liked {
  color: var(--heart-color);
  transform: scale(1.2);
}

.like-count { 
  padding: 10px; 
  font-size: 16px; 
  font-weight: bold; 
  background: #fff; 
}

/* Click Zones for Lightbox Navigation */
.lightbox-clickzones { 
  position: relative; 
  width: 100%; 
  height: 100%; 
}

.zone { 
  position: absolute; 
  top: 0; 
  width: 50%; 
  height: 100%; 
  cursor: pointer; 
}

.left-zone { left: 0; } 
.right-zone { right: 0; }
