/* =========================================================
   KiddieCove Social Feed — Frontend Styles
   ========================================================= */

/* ── Clear filter button ─────────────────────────────────── */

#kc-clear-filter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f5f3ff;
  color: #7b52e8;
  border: 1px solid #d4c8f9;
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 12px;
  transition:
    background 0.15s ease,
    color 0.15s ease;
}

#kc-clear-filter:hover {
  background: #7b52e8;
  color: #fff;
}

/* ── Posts Timeline ───────────────────────────────────────── */

.kc-posts-timeline {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.kc-post-card {
  background: #ffffff;
  border: 1px solid #e8eaed;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  transition: box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.kc-post-card:hover {
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.1);
}

.kc-inline-ad {
  padding: 12px;
  gap: 8px;
}

/* Image + overlay wrapper */
.kc-ad-image-wrap {
  position: relative;
  line-height: 0;
  border-radius: 8px;
  overflow: hidden;
}

.kc-ad-image-wrap .kc-ad-image {
  width: 100%;
  display: block;
  border-radius: 0;
}

.kc-ad-image-wrap .kc-ad-video {
  width: 100%;
  display: block;
}

.kc-sound-toggle {
  position: absolute;
  bottom: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  z-index: 10;
  transition: background 0.2s ease;
}

.kc-sound-toggle:hover {
  background: rgba(0, 0, 0, 0.8);
}

.kc-sound-toggle svg {
  width: 18px;
  height: 18px;
  pointer-events: none;
}

.kc-ad-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 14px 16px 16px;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.78) 0%,
    rgba(0, 0, 0, 0.4) 60%,
    transparent 100%
  );
}

.kc-ad-overlay-title {
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.35;
  margin-bottom: 4px;
}

.kc-ad-overlay-desc {
  font-size: 12px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.4;
}

/* Header row */
.kc-post-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

/* School avatar */
.kc-school-avatar {
  flex-shrink: 0;
  width: 68px;
  height: 68px;
  border-radius: 50px;
  overflow: hidden;
}

.kc-school-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.kc-avatar-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #7b52e8, #a47cf3);
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* School info */
.kc-school-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.kc-school-name {
  font-size: 16px;
  font-weight: 600;
  color: #1a1a2e;
  line-height: 1.6;
}

.kc-designation {
  font-size: 14px;
  color: #807e7e;
  line-height: 1.6;
}

.kc-timestamp {
  font-size: 12px;
  color: #807e7e;
  line-height: 1.6;
}

/* Post content */
.kc-post-content {
  font-size: 16px;
  color: #3e3e59;
  line-height: 1.65;
  word-wrap: break-word;
}

/* Post images */
.kc-post-images {
  border-radius: 8px;
  overflow: hidden;
}

.kc-post-images.kc-images-single img {
  width: 100%;
  object-fit: cover;
  border-radius: 8px;
  display: block;
}

.kc-post-images.kc-images-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
}

.kc-post-images.kc-images-grid img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: 4px;
  display: block;
}

/* Post footer */
.kc-post-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid #f3f4f6;
}

.kc-post-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.kc-action-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  color: #6b7280;
  font-size: 13px;
  padding: 4px 6px;
  border-radius: 6px;
  transition:
    color 0.15s ease,
    background 0.15s ease;
  line-height: 1;
}

.kc-action-btn:hover {
  color: #7b52e8;
  background: #f5f3ff;
}

.kc-comment-count {
  font-size: 13px;
  font-weight: 500;
  color: inherit;
}

/* Load more */
.kc-load-more-wrap {
  text-align: center;
  padding: 10px 0 4px;
  visibility: hidden;
  height: 1px;
  overflow: hidden;
}

.kc-load-more-btn {
  background: #7b52e8;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 10px 28px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s ease;
}

.kc-load-more-btn:hover {
  background: #6540d4;
}

.kc-load-more-btn:disabled {
  background: #c4b5fd;
  cursor: not-allowed;
}

/* Empty state */
.kc-empty-state {
  text-align: center;
  padding: 40px 20px;
  color: #9ca3af;
  font-size: 14px;
}

/* ── Trending Hashtags Sidebar ────────────────────────────── */

.kc-trending-hashtags {
  background: #ffffff;
  border: 1px solid #e8eaed;
  border-radius: 12px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.kc-trending-header {
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid #e8eaed;
}

.kc-trending-icon {
  width: 38px;
  height: 38px;
  background: #f5f3ff;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.kc-trending-title {
  font-size: 18px !important;
  font-weight: 700;
  color: #1a1a2e;
  margin: 0;
  line-height: 1.2;
  padding: 10px 20px;
}

.kc-hashtag-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  padding-inline: 20px;
  padding-bottom: 10px;
}

.kc-hashtag-item {
  display: flex;
  gap: 8px;
  padding: 15px 0;
  border-bottom: 1px solid #f3f4f6;
}

.kc-hashtag-item:last-child {
  border-bottom: none;
}

.kc-hashtag-btn {
  background-color: #f5f3ff !important;
  border: none !important;
  font-size: 10px !important;
  font-weight: 800 !important;
  color: #121212 !important;
  border-radius: 10px !important;
  padding: 10px !important;
  font-family: "Satoshi", Poppins !important;
  white-space: normal !important;
  text-align: left !important;
  cursor: pointer;
  word-break: break-word;
  line-height: 1.4;
  transition: color 0.15s ease;
}

.kc-hashtag-btn.kc-active {
  color: #ffffff !important;
  text-decoration: underline;
  background: #6540d4 !important;
  text-decoration: none;
}

.kc-post-hashtags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.kc-post-hashtags .kc-hashtag-btn {
  font-size: 13px;
  padding: 2px 0;
}

.kc-hashtag-count {
  font-size: 12px;
  white-space: nowrap;
  color: #9ca3af;
  display: flex;
  align-items: center;
  margin-left: auto;
}

.kc-trending-empty {
  color: #9ca3af;
  font-size: 13px;
  margin: 0;
}

/* ── Advertisements Column ────────────────────────────────── */

.kc-advertisements {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.kc-ad-card {
  background: #ffffff;
  border: 1px solid #e8eaed;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.kc-ad-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: #9ca3af;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 10px 14px 6px;
}

.kc-ad-link {
  display: block;
  line-height: 0;
}

.kc-ad-link:focus-visible {
  outline: 2px solid #7b52e8;
  outline-offset: 2px;
}

.kc-ad-image {
  width: 100%;
  height: auto;
  display: block;
  transition: opacity 0.2s ease;
}

.kc-ad-link:hover .kc-ad-image {
  opacity: 0.92;
}

.kc-ads-empty {
  display: none;
}

/* ── Loading Spinner ──────────────────────────────────────── */

.kc-loading {
  text-align: center;
  padding: 30px;
  color: #9ca3af;
  font-size: 13px;
}

.kc-infinite-loader {
  text-align: center;
  padding: 20px 0;
}

.kc-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid #e5e7eb;
  border-top-color: #7b52e8;
  border-radius: 50%;
  animation: kc-spin 0.7s linear infinite;
  display: inline-block;
  vertical-align: middle;
  margin-right: 8px;
}

button.kc-load-more-btn {
  border-radius: 8px !important;
  background: #7333fc !important;
  border: none;
  font-family: "Satoshi", Poppins !important;
  font-weight: 800 !important;
}
button.kc-load-more-btn:hover {
  background: #121212 !important;
}
.kc-sound-toggle {
  background: #461f99 !important;
  width: 40px !important;
  height: 40px !important;
  padding: 0 !important;
  border: none !important;
  border-radius: 100% !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  box-shadow: none !important;
}
.kc-sound-toggle:hover {
  background: #8535f6 !important;
}
@media (max-width: 1024px) {
  .kc-trending-title {
    font-size: 14px !important;
  }
  .kc-hashtag-list {
    padding-inline: 10px;
  }
}
@media (min-width: 768px) and (max-width: 1024px) {
  .kc-hashtag-item {
    flex-wrap: wrap;
  }
  .kc-trending-icon {
    order: 1;
  }
  .kc-hashtag-item .kc-hashtag-btn {
    order: 3;
  }
  .kc-hashtag-count {
    order: 2;
  }
}
@media (max-width: 767px) {
  .kc-hashtag-list {
    max-height: 0;
    padding: 0;
    overflow: hidden;
    transition: max-height 1s;
  }
  .kc-hashtag-item {
    padding-inline: 10px;
  }
  .show-trends .kc-trending-header {
    border-bottom: none;
  }
  .show-trends .kc-hashtag-list {
    max-height: 640px;
    height: 100%;
    border-top: 1px solid #e8eaed;
  }
  h3.kc-trending-title {
    width: 100%;
    position: relative;
  }
  h3.kc-trending-title:before,
  h3.kc-trending-title:after {
    transform: translateY(-50%);
    content: "";
    display: block;
    background: #7b52e8;
    border-radius: 4px;
    position: absolute;
    top: 50%;
    transition: transform 0.4s;
  }
  h3.kc-trending-title:before {
    width: 16px;
    height: 3px;
    right: 18.5px;
  }
  h3.kc-trending-title:after {
    width: 3px;
    height: 16px;
    right: 25px;
  }
  .show-trends .kc-trending-header h3.kc-trending-title:before {
    transform: translateY(-50%) rotate(180deg);
  }
  .show-trends .kc-trending-header h3.kc-trending-title:after {
    transform: translateY(-50%) rotate(90deg);
  }
}
@keyframes kc-spin {
  to {
    transform: rotate(360deg);
  }
}
