@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap");

:root {
  --primary: #111;
  --text: #111;
  --gray: #767676;
  --light-gray: #f5f5f5;
  --border: #e1e1e1;
  --red: #e60023; /* Pinterest Red for likes */
  --blue: #007bfb;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Inter", sans-serif;
  text-decoration: none;
  list-style: none;
  transition: 0.2s ease;
}

body {
  background: white;
  color: var(--text);
  padding-top: 80px;
}

/* --- Navbar --- */
nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 80px;
  background: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 30px;
  z-index: 1000;
}

.logo {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -1px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--primary);
}
.logo i {
  font-size: 28px;
}

.search-bar {
  flex: 1;
  margin: 0 40px;
  background: var(--light-gray);
  border-radius: 30px;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid transparent;
}
.search-bar:focus-within {
  border-color: #ccc;
  background: white;
}
.search-bar input {
  background: transparent;
  border: none;
  outline: none;
  width: 100%;
  font-size: 15px;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}
.nav-link {
  color: var(--gray);
  font-weight: 500;
  font-size: 15px;
}
.nav-link:hover,
.nav-link.active {
  color: var(--primary);
}

.btn {
  padding: 10px 20px;
  border-radius: 30px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  border: none;
}
.btn-primary {
  background: var(--primary);
  color: white;
}
.btn-primary:hover {
  opacity: 0.9;
}
.btn-outline {
  border: 1px solid var(--border);
  background: white;
  color: var(--primary);
}
.btn-outline:hover {
  border-color: var(--primary);
}

/* --- Masonry Grid (The Magic) --- */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
}

.masonry-grid {
  column-count: 4; /* Desktop: 4 columns */
  column-gap: 20px;
}

.pin-card {
  break-inside: avoid;
  margin-bottom: 20px;
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  cursor: zoom-in;
}

.pin-card img {
  width: 100%;
  display: block;
  border-radius: 16px;
}

/* Hover Overlay */
.overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.3);
  opacity: 0;
  transition: 0.3s;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px;
}
.pin-card:hover .overlay {
  opacity: 1;
}

.overlay-top {
  text-align: right;
}
.overlay-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.save-btn {
  background: var(--red);
  color: white;
  border: none;
  padding: 10px 18px;
  border-radius: 30px;
  font-weight: 600;
  cursor: pointer;
}
.save-btn:hover {
  background: #ad081b;
}

.icon-btn {
  width: 35px;
  height: 35px;
  background: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: none;
}
.icon-btn:hover {
  background: var(--light-gray);
}

/* --- Profile Page --- */
.profile-header {
  text-align: center;
  margin-top: 20px;
  margin-bottom: 50px;
}
.profile-img {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 15px;
}
.stats {
  display: flex;
  justify-content: center;
  gap: 30px;
  margin: 15px 0;
  color: var(--gray);
  font-size: 14px;
}
.stats span {
  color: var(--primary);
  font-weight: 600;
}

/* FOLLOW BUTTON STATES */
.btn-follow {
  background: var(--blue);
  color: white;
  padding: 10px 25px;
  border-radius: 30px;
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 600;
}
.btn-follow.following {
  background: white;
  color: var(--primary);
  border-color: var(--border);
}
.btn-follow.following::after {
  content: "";
} /* Just to ensure no weird content issues */

/* --- Details Page --- */
.detail-layout {
  display: flex;
  gap: 40px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
  border-radius: 30px;
  padding: 20px;
  overflow: hidden;
  margin-top: 20px;
}
.detail-img {
  width: 50%;
  border-radius: 20px;
  object-fit: cover;
}
.detail-info {
  width: 50%;
  padding: 20px;
}

/* Responsive */
@media (max-width: 1024px) {
  .masonry-grid {
    column-count: 3;
  }
}
@media (max-width: 768px) {
  .masonry-grid {
    column-count: 2;
  }
  .detail-layout {
    flex-direction: column;
  }
  .detail-img,
  .detail-info {
    width: 100%;
  }
  nav {
    padding: 0 15px;
  }
  .search-bar {
    display: none;
  } /* Hide search on mobile for simplicity */
}
