/* =========================================
   Glaura Feed — Pinterest-style
   Mobile-first with desktop sidebar
   ========================================= */

/* --- Layout --- */
.feed-content {
  min-height: 100vh;
  padding-bottom: 64px;
}

/* --- Feed Footer --- */
.feed-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
  padding: 40px 24px 24px;
  border-top: 1px solid #f0f0f0;
  margin-top: 24px;
  position: relative;
}

.feed-footer-col h4 {
  font-size: 13px;
  font-weight: 700;
  color: #7b2d3e;
  margin: 0 0 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.feed-footer-col a {
  display: block;
  font-size: 14px;
  color: #555;
  text-decoration: none;
  margin-bottom: 8px;
}

.feed-footer-col a:hover { color: #E50050; }

.feed-footer-copy {
  width: 100%;
  font-size: 12px;
  color: #aaa;
  padding-top: 8px;
  border-top: 1px solid #f0f0f0;
}

/* --- Mobile Header --- */
.feed-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--color-bg);
  position: sticky;
  top: 0;
  z-index: 100;
}

.feed-logo {
  flex-shrink: 0;
  display: flex;
}

.feed-logo img { height: 28px; width: auto; }

.feed-page-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text);
}

/* --- Pro CTA Button --- */
.feed-pro-btn {
  flex-shrink: 0;
  padding: 6px 12px;
  border-radius: 24px;
  background: #E50050;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: 0.02em;
  transition: opacity 0.15s;
}

.feed-pro-btn:hover { opacity: 0.88; color: #fff; }

/* --- Search --- */
.feed-search {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--color-surface);
  border-radius: var(--radius-full);
  padding: 9px 14px;
  transition: background 0.2s;
}

.feed-search:focus-within {
  background: var(--color-bg);
  box-shadow: inset 0 0 0 1.5px var(--color-border);
}

.feed-search-icon { flex-shrink: 0; color: var(--color-text-tertiary); }

.feed-search-input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  font-family: var(--font);
  font-size: 14px;
  color: var(--color-text);
}

.feed-search-input::placeholder { color: var(--color-text-tertiary); }

.feed-search-clear {
  display: none;
  width: 28px;
  height: 28px;
  border: none;
  background: var(--color-border);
  border-radius: 50%;
  color: var(--color-bg);
  font-size: 14px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.feed-search-clear.visible { display: flex; }

/* Desktop search (hidden on mobile) */
.feed-desktop-search { display: none; }

/* --- Category Pills --- */
.feed-pills {
  display: flex;
  gap: 6px;
  padding: 4px 12px 10px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.feed-pills::-webkit-scrollbar { display: none; }

.feed-pill {
  flex-shrink: 0;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  border: none;
  background: var(--color-surface);
  color: var(--color-text);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  min-height: 36px;
}

.feed-pill:active { transform: scale(0.95); }
.feed-pill.active { background: var(--color-text); color: var(--color-bg); }

/* --- Video Grid --- */
.feed-grid {
  columns: 2;
  column-gap: 8px;
  padding: 0 8px 20px;
}

.feed-grid-item {
  break-inside: avoid;
  margin-bottom: 8px;
  overflow: hidden;
  cursor: pointer;
  position: relative;
  background: var(--color-bg);
  border-radius: 12px;
}

.feed-grid-item:active { opacity: 0.85; }

/* Entrance animation */
.feed-grid-item {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.feed-grid-item.visible {
  opacity: 1;
  transform: translateY(0);
}

.feed-grid-item--skeleton {
  pointer-events: none;
  background: transparent;
  box-shadow: none;
}

.feed-grid-item--skeleton,
.feed-grid-item--skeleton.visible {
  opacity: 1;
  transform: none;
}

.feed-grid-item--skeleton .feed-card-thumb--skeleton {
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.03));
  overflow: hidden;
}

.feed-grid-item--skeleton-tall .feed-skeleton-media { aspect-ratio: 4 / 5; }
.feed-grid-item--skeleton-wide .feed-skeleton-media { aspect-ratio: 3 / 4; }

.feed-skeleton-media {
  width: 100%;
  aspect-ratio: 9 / 16;
  border-radius: 12px;
  background:
    linear-gradient(90deg, rgba(229, 229, 229, 0) 0%, rgba(229, 229, 229, 0.6) 50%, rgba(229, 229, 229, 0) 100%),
    linear-gradient(135deg, #ececec 0%, #f5f5f5 100%);
  background-size: 200% 100%, 100% 100%;
  animation: feed-shimmer 1.2s ease-in-out infinite;
}

.feed-card-info--skeleton {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 6px 2px;
  min-height: 34px;
}

.feed-skeleton-line {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #ececec 0%, #f5f5f5 100%);
}

.feed-skeleton-line::after,
.feed-skeleton-media::after {
  content: '';
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.55), transparent);
  animation: feed-shimmer-slide 1.2s ease-in-out infinite;
}

.feed-skeleton-line--avatar {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  flex-shrink: 0;
}

.feed-skeleton-line--name {
  width: 58%;
  height: 12px;
  border-radius: 999px;
}

@keyframes feed-shimmer {
  0% { background-position: 0 0, 0 0; }
  100% { background-position: 200% 0, 0 0; }
}

@keyframes feed-shimmer-slide {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.feed-card-thumb {
  position: relative;
  width: 100%;
  background: var(--color-surface); /* fallback when thumbnail fails to load */
}

.feed-card-thumb img,
.feed-card-thumb video {
  width: 100%;
  display: block;
  object-fit: cover;
  aspect-ratio: 9 / 16; /* default: tall portrait */
}

/* Alternate card heights to create Pinterest-style stagger (no uniform row alignment) */
.feed-grid-item:nth-child(3n+2) .feed-card-thumb img,
.feed-grid-item:nth-child(3n+2) .feed-card-thumb video {
  aspect-ratio: 3 / 4;
}

.feed-grid-item:nth-child(3n+3) .feed-card-thumb img,
.feed-grid-item:nth-child(3n+3) .feed-card-thumb video {
  aspect-ratio: 4 / 5;
}

.feed-card-thumb video {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
}

.feed-grid-item:hover .feed-card-thumb video.playing,
.feed-grid-item.autoplay .feed-card-thumb video.playing {
  display: block;
}

/* --- Card info below image (Pinterest style) --- */
.feed-card-info {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 8px 9px;
}

.feed-card-info__avatar {
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--color-surface);
}

.feed-card-info__name {
  flex: 1;
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.feed-card-more {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border: none;
  background: none;
  color: var(--color-text-tertiary);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  -webkit-tap-highlight-color: transparent;
}

.feed-card-more:hover { background: var(--color-surface); }

/* --- States --- */
.feed-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  text-align: center;
  color: var(--color-text-tertiary);
  font-size: 14px;
  gap: 12px;
}

.feed-spinner {
  width: 28px;
  height: 28px;
  border: 2.5px solid var(--color-border);
  border-top-color: var(--color-text);
  border-radius: 50%;
  animation: feed-spin 0.7s linear infinite;
}

.feed-spinner--sm { width: 20px; height: 20px; border-width: 2px; }

@keyframes feed-spin { to { transform: rotate(360deg); } }

.feed-btn-retry {
  padding: 10px 24px;
  background: var(--color-text);
  color: var(--color-bg);
  border: none;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
}

.feed-sentinel {
  display: flex;
  justify-content: center;
  padding: 20px 0 80px;
}

/* --- Search Overlay --- */
.search-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--color-bg);
  z-index: 200;
  overflow-y: auto;
}

.search-overlay.active { display: block; }

.search-overlay-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  position: sticky;
  top: 0;
  background: var(--color-bg);
  z-index: 1;
  border-bottom: 1px solid var(--color-border-light);
}

.search-overlay-back {
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text);
  flex-shrink: 0;
}

/* Search sections */
.search-section {
  padding: 12px 16px 0;
}

.search-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
}

.search-section-clear {
  border: none;
  background: none;
  color: var(--color-text-tertiary);
  font-size: 12px;
  cursor: pointer;
}

/* Recent searches */
.search-recent-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.search-recent-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  background: var(--color-surface);
  border-radius: var(--radius-full);
  border: none;
  font-family: var(--font);
  font-size: 13px;
  color: var(--color-text);
  cursor: pointer;
}

.search-recent-item:hover {
  background: var(--color-border);
}

.search-recent-item svg {
  width: 14px;
  height: 14px;
  color: var(--color-text-tertiary);
}

/* Suggestions */
.search-suggestions-group {
  padding-bottom: 4px;
}

.search-suggestion-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: var(--font);
  font-size: 14px;
  color: var(--color-text);
}

.search-suggestion-item:hover {
  background: var(--color-surface);
}

.search-suggestion-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--color-text-tertiary);
}

.search-suggestion-icon img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

.search-suggestion-text {
  flex: 1;
  min-width: 0;
}

.search-suggestion-name {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-suggestion-type {
  font-size: 12px;
  color: var(--color-text-tertiary);
}

/* Salon results */
.search-salon-list {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 0 0 12px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.search-salon-list::-webkit-scrollbar { display: none; }

.search-salon-card {
  flex-shrink: 0;
  width: 140px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--color-surface);
  text-decoration: none;
  color: var(--color-text);
}

.search-salon-card img {
  width: 100%;
  height: 100px;
  object-fit: cover;
}

.search-salon-card-info {
  padding: 8px;
}

.search-salon-card-name {
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-salon-card-rating {
  font-size: 11px;
  color: var(--color-text-tertiary);
  margin-top: 2px;
}

.search-overlay-input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-family: var(--font);
  font-size: 16px;
  font-weight: 500;
  color: var(--color-text);
}

/* ===================================
   Mobile Bottom Nav
   =================================== */
.feed-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: stretch;
  justify-content: space-around;
  background: var(--color-bg);
  border-top: 1px solid var(--color-border-light);
  padding: 4px 0;
  padding-bottom: max(4px, var(--safe-bottom));
  z-index: 150;
}

.feed-nav-item {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 24px;
  min-height: 44px;
  border: none;
  background: none;
  color: var(--color-text-tertiary);
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.15s;
}

.feed-nav-item span { display: none; }

.feed-nav-item.active { color: var(--color-text); }

/* Language switcher inside bottom nav */
.feed-nav-lang { padding: 0; }
.feed-nav-lang .language-btn {
  width: auto;
  height: 44px;
  padding: 8px 16px;
  gap: 0;
}
.feed-nav-lang .language-name { display: none; }
.feed-nav-lang .language-btn i { display: none; }
.feed-nav-lang .lang-dropdown-menu {
  bottom: 100%;
  top: auto;
  right: 0;
  margin-bottom: 6px;
  min-width: 100px;
}

.feed-nav-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--color-accent);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===================================
   Desktop Sidebar (hidden on mobile)
   =================================== */
.sidebar { display: none; }

@media (min-width: 768px) {
  /* Show sidebar, hide mobile nav + header */
  .sidebar { display: flex; }
  .feed-nav { display: none; }
  .feed-header { display: none; }
  .feed-desktop-search { display: block; }

  /* Sidebar */
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 56px;
    background: var(--color-bg);
    border-right: 1px solid var(--color-border-light);
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    z-index: 100;
  }

  .sidebar-top {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
  }

  .sidebar-bottom {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-bottom: 4px;
  }

  /* Compact sidebar language switcher: icon only, no name */
  .sidebar-bottom .language-btn .language-name { display: none; }
  .sidebar-bottom .language-btn i { display: none; }
  .sidebar-bottom .language-btn {
    width: 40px;
    height: 40px;
    padding: 8px;
    justify-content: center;
    border-radius: var(--radius-md);
  }
  .sidebar-bottom .lang-dropdown-menu {
    left: 100%;
    right: auto;
    top: auto;
    bottom: 0;
    margin-left: 8px;
    min-width: 120px;
  }

  .sidebar-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
  }

  .sidebar-logo img { height: 26px; width: auto; }

  .sidebar-item {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    border: none;
    background: none;
    color: var(--color-text-tertiary);
    text-decoration: none;
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: all 0.15s;
    width: 40px;
    height: 40px;
  }

  .sidebar-item span { display: none; }
  .sidebar-item:hover { background: var(--color-surface); color: var(--color-text); }
  .sidebar-item.active { color: var(--color-text); }

  .sidebar-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--color-accent);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* Main content pushed right */
  .feed-content {
    margin-left: 56px;
    padding-bottom: 40px;
  }

  /* Desktop search bar */
  .feed-desktop-search {
    padding: 12px 24px;
    position: sticky;
    top: 0;
    z-index: 99;
    background: var(--color-bg);
    display: flex;
    align-items: center;
    gap: 16px;
  }

  .feed-pro-btn { padding: 8px 16px; font-size: 13px; }

  .feed-desktop-search .feed-search {
    max-width: 480px;
    flex: 1;
    margin: 0;
  }


  /* Grid adjustments */
  .feed-grid {
    columns: 3;
    column-gap: 12px;
    padding: 0 16px 40px;
  }

  .feed-grid-item {
    margin-bottom: 12px;
    border-radius: 14px;
  }

  .feed-grid-item:hover { opacity: 0.9; }

  .feed-pills {
    padding: 4px 24px 12px;
    justify-content: center;
    flex-wrap: wrap;
  }

  /* Search overlay pushed right of sidebar */
  .search-overlay { left: 56px; }
}

@media (min-width: 1024px) {
  .feed-grid {
    columns: 4;
    column-gap: 10px;
    padding: 0 24px 40px;
  }

  .feed-desktop-search .feed-search { max-width: 560px; }
  .feed-card-thumb img { aspect-ratio: auto; }
}

@media (min-width: 1440px) {
  .feed-grid { columns: 5; column-gap: 12px; }
}

/* --- App download CTA card in feed --- */
.feed-app-banner {
  break-inside: avoid;
  margin-bottom: 12px;
}
.app-banner-card {
  position: relative;
  background: linear-gradient(135deg, #fdf2f8, #fce7f3);
  border-radius: 16px;
  padding: 24px 16px;
  text-align: center;
}
.app-banner-close {
  position: absolute;
  top: 8px;
  right: 12px;
  background: none;
  border: none;
  font-size: 22px;
  color: #999;
  cursor: pointer;
  line-height: 1;
  padding: 4px;
}
.app-banner-close:hover { color: #333; }
.app-banner-title {
  font-size: 18px;
  font-weight: 700;
  color: #75213e;
  margin: 0 0 4px;
}
.app-banner-sub {
  font-size: 13px;
  color: #888;
  margin: 0 0 16px;
}
.app-banner-btns {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}
.app-banner-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  color: #1a1a1a;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  padding: 10px 16px;
  border-radius: 50px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  transition: box-shadow 0.15s, transform 0.15s;
}
.app-banner-link:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.13);
  transform: translateY(-1px);
}
