/* =========================
   THEME ROOT (Sadece referans)
========================= */
/*
Bu dosya style.css içindeki :root'u KULLANIR
Burada renk TANIMLANMAZ, sadece var() ile çağrılır
*/
:root {
    /* Zemin */
    --bg-cream: #F6F4EE;

    /* İplik renkleri */
    --thread-sage:  #AEBCAF;
    --thread-lilac: #B7AECF;
    --thread-black: #2B2B2B;
    --thread-white: #FFFFFF;

    /* Metin */
    --text-main: #2B2B2B;
    --text-soft: #6F6F6F;

    /* UI */
    --border-soft: rgba(0,0,0,0.08);
    --grid-line: rgba(0,0,0,0.03);
    
    --purple: #7B5CFF;
    --purple-soft: #6a4fe0;
}
/* =========================
   BASE
========================= */
body {
  margin: 30px;
  font-family: 'Space Grotesk', system-ui, -apple-system, sans-serif;
  color: var(--text-main);
  background-image:
        radial-gradient(
          circle at center,
          transparent 70%
        ),
        radial-gradient(
          rgba(0,0,0,0.2) 1px,
          transparent 1px
        );

      background-size:
        100% 100%,
        24px 24px;

      background-repeat: no-repeat, repeat;
}

/* =========================
   TOP BAR
========================= */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
}

.search-input,
.category-select {
  padding: 12px 14px;
  font-size: 15px;
  border-radius: 12px;
  border: 1px solid var(--border-soft);
  background: var(--thread-white);
  color: var(--text-main);
  outline: none;
}

.search-input {
  width: 260px;
}

.search-input:focus,
.category-select:focus {
  border-color: var(--thread-black);
}

/* =========================
   GRID
========================= */
.design-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 22px;
}

/* =========================
   CARD
========================= */
.design-card {
  background: var(--thread-white);
  border-radius: 18px;
  padding: 14px;
  border: 1.5px solid var(--thread-black);
  box-shadow: 0 6px 18px rgba(0,0,0,0.08);
  display: flex;
  flex-direction: column;
  height: 340px;
  position: relative;
  transition: transform .2s ease, box-shadow .2s ease;
  content-visibility: auto;
  contain-intrinsic-size: 340px;
}

.design-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 26px rgba(0,0,0,0.12);
}

/* =========================
   CARD HEADER
========================= */
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* =========================
   USER INFO
========================= */
.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  --avatar-color: rgb(180,180,180);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: var(--avatar-color);
  background-image: url("/static/images/knitting.png");
  background-position: center;
  background-size: cover;
  background-blend-mode: multiply;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.1);
}

.user-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-main);
}

/* =========================
   LIKE BUTTON
========================= */
.like-button {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: var(--thread-black);
  display: flex;
  align-items: center;
  gap: 4px;
  transition: transform .15s ease;
}

.like-button:hover {
  transform: scale(1.15);
}

/* =========================
   IMAGE
========================= */
.preview-image {
  margin: 16px 0;
  width: 100%;
  height: 180px;
  object-fit: contain;
  border-radius: 12px;
  background: #f6f4ee;
}

*, *::before, *::after { box-sizing: border-box; }

@media (max-width: 640px) {
  body { margin: 12px; }
  .top-bar { gap: 10px; margin-bottom: 16px; }
  .search-input { min-width: 0; width: 100%; }
  .category-select { max-width: 110px; }
  .design-grid { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .design-card { width:100%; height:auto; min-height:360px; padding:12px; border-radius:16px; }
  .user-name { max-width:180px; overflow:hidden; font-size:13px; text-overflow:ellipsis; }
  .user-avatar { width: 28px; height: 28px; }
  .like-button { padding: 2px; font-size: 13px; }
  .preview-image { height:230px; margin:12px 0; }
}

@media (max-width: 360px) { .design-grid { grid-template-columns: 1fr; } }

/* =========================
   TITLE
========================= */
.design-card p {
  margin: 4px 0 10px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-main);
}

/* =========================
   USE BUTTON
========================= */
.use-button {
  margin-top: auto;
  padding: 12px;
  border: none;
  background: var(--thread-sage);
  color: var(--thread-black);
  font-size: 15px;
  font-weight: 600;
  border-radius: 14px;
  cursor: pointer;
  transition: opacity .2s ease, transform .15s ease;
}

.use-button:hover {
  opacity: .9;
  transform: translateY(-1px);
}

.pagination-controls {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 28px 0 12px;
}

#result-status {
  margin: 0;
  color: var(--text-soft);
  font-size: 13px;
}

#load-more-designs {
  min-width: 190px;
  padding: 12px 18px;
  border: 1px solid var(--thread-black);
  border-radius: 14px;
  background: var(--thread-white);
  color: var(--thread-black);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

#load-more-designs:hover:not(:disabled) { background: var(--thread-sage); }
#load-more-designs:disabled { cursor: wait; opacity: .55; }
#load-more-designs[hidden] { display: none; }
