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

:root {
  --primary-pink: #ec4899;
  --primary-dark: #be185d;
  --primary-rose: #f43f5e;
  --primary-light: #fdf2f8;
  --primary-gradient: linear-gradient(135deg, #fb7185 0%, #f43f5e 50%, #ec4899 100%);
  --btn-gradient: linear-gradient(135deg, #f43f5e 0%, #ec4899 100%);
  --btn-hover: linear-gradient(135deg, #e11d48 0%, #db2777 100%);
  
  --bg-page: #fff5f7;
  --card-bg: #ffffff;
  --text-main: #1e293b;
  --text-muted: #64748b;
  
  --border-pink: #fce7f3;
  --shadow-sm: 0 2px 8px rgba(244, 63, 94, 0.05);
  --shadow-md: 0 10px 25px -5px rgba(244, 63, 94, 0.08), 0 8px 10px -6px rgba(244, 63, 94, 0.04);
  --shadow-lg: 0 20px 30px -10px rgba(244, 63, 94, 0.2), 0 10px 10px -5px rgba(244, 63, 94, 0.04);
  --radius-card: 20px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Prompt', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-page);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* -------------------------------------------------------------
   Header Section (Pink Theme) - ไม่มีปุ่ม Admin ใดๆ
   ------------------------------------------------------------- */
.site-header {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-pink);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.header-container {
  max-width: 1360px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-icon-box {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--primary-light);
  border: 1.5px solid var(--border-pink);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(244, 63, 94, 0.15);
  flex-shrink: 0;
}

.brand-icon-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
}

.brand-texts {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 20px;
  font-weight: 700;
  color: #1e293b;
  line-height: 1.25;
}

.brand-subtitle {
  font-size: 13px;
  font-weight: 400;
  color: var(--text-muted);
}

/* Search Box */
.search-box-container {
  position: relative;
  width: 100%;
  max-width: 380px;
}

.search-input {
  width: 100%;
  padding: 10px 18px 10px 42px;
  border-radius: 999px;
  border: 1.5px solid var(--border-pink);
  background: #ffffff;
  font-family: inherit;
  font-size: 14px;
  color: var(--text-main);
  outline: none;
  transition: all 0.25s ease;
  box-shadow: var(--shadow-sm);
}

.search-input:focus {
  border-color: var(--primary-rose);
  box-shadow: 0 0 0 4px rgba(244, 63, 94, 0.15);
}

.search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--primary-rose);
  pointer-events: none;
  font-size: 15px;
}

/* -------------------------------------------------------------
   Main Container
   ------------------------------------------------------------- */
.main-wrapper {
  max-width: 1360px;
  margin: 0 auto;
  padding: 28px 24px;
  width: 100%;
  flex: 1;
}

.results-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  font-size: 14px;
  color: var(--text-muted);
}

.results-info strong {
  color: var(--primary-dark);
}

/* -------------------------------------------------------------
   CARDS GRID (Desktop: 4 cols, Tablet: 2 cols, Mobile: 1 col)
   ------------------------------------------------------------- */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

/* Card Item - ทั้งการ์ดสามารถคลิกเพื่อเปิดเว็บได้เลย */
.card-link-item {
  display: flex;
  flex-direction: column;
  background: var(--card-bg);
  border-radius: var(--radius-card);
  border: 1.5px solid var(--border-pink);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  cursor: pointer;
}

.card-link-item:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: #fbcfe8;
}

/* Thumbnail */
.card-media {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  background-color: #fdf2f8;
  overflow: hidden;
  display: block;
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.card-link-item:hover .card-media img {
  transform: scale(1.06);
}

/* Card Body (มีภาพ มีชื่อ กดแล้วไปยังลิงก์) */
.card-body {
  padding: 16px 20px 20px 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex: 1;
}

.card-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.4;
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.2s;
}

.card-link-item:hover .card-title {
  color: var(--primary-rose);
}

/* Action Button: ไปยังเว็บไซต์ */
.btn-open-link {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--btn-gradient);
  color: #ffffff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 11px 16px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(244, 63, 94, 0.28);
  transition: all 0.25s ease;
}

.card-link-item:hover .btn-open-link {
  background: var(--btn-hover);
  box-shadow: 0 6px 16px rgba(244, 63, 94, 0.42);
}

/* Empty State */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  background: #ffffff;
  border-radius: var(--radius-card);
  border: 1.5px dashed #fbcfe8;
}

.empty-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.empty-text {
  font-size: 16px;
  color: var(--text-muted);
}

/* Footer */
.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--border-pink);
  background: #ffffff;
  padding: 20px;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}

/* -------------------------------------------------------------
   RESPONSIVE DESIGN RULES
   ------------------------------------------------------------- */

/* Tablet (2 Columns) */
@media (max-width: 1024px) and (min-width: 641px) {
  .cards-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
}

/* MOBILE SCREEN (STRICTLY 1 COLUMN AS REQUIRED) */
@media (max-width: 640px) {
  .header-container {
    padding: 12px 16px;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .brand-title {
    font-size: 17px;
  }

  .brand-subtitle {
    font-size: 12px;
  }

  .search-box-container {
    max-width: 100%;
  }

  .main-wrapper {
    padding: 18px 16px;
  }

  /* FORCED SINGLE COLUMN ON MOBILE */
  .cards-grid {
    grid-template-columns: 1fr !important;
    gap: 16px;
  }

  .card-link-item {
    border-radius: 18px;
  }

  .card-body {
    padding: 14px 16px 18px 16px;
  }
}
