/* ====================================================
   GoogolCatBook — Main Stylesheet
   Thiết kế thân thiện với người lớn tuổi & bà mẹ
   ==================================================== */

/* ---------- Google Fonts ---------- */
@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800;900&display=swap');

/* ---------- CSS Custom Properties (Design Tokens) ---------- */
:root {
  /* Brand Colors */
  --color-pink:       #FF6B8A;
  --color-pink-light: #FFB3C6;
  --color-pink-pale:  #FFF0F5;
  --color-orange:     #FFA85C;
  --color-orange-light: #FFD4A8;
  --color-mint:       #7ED8C8;
  --color-mint-light: #C5F0E8;
  --color-yellow:     #FFD966;

  /* Semantic Colors */
  --bg-page:          #FFF5F8;
  --bg-card:          #FFFFFF;
  --bg-nav:           rgba(255, 255, 255, 0.92);
  --color-primary:    #FF6B8A;
  --color-secondary:  #FFA85C;
  --color-accent:     #7ED8C8;
  --color-text:       #2C2C2C;
  --color-text-soft:  #666666;
  --color-text-muted: #999999;
  --color-border:     #F5DCE4;
  --color-danger:     #FF4757;
  --color-success:    #2ECC71;

  /* Typography */
  --font-family:    'Nunito', 'Segoe UI', Arial, sans-serif;
  --font-size-xs:   0.8rem;    /* 12.8px */
  --font-size-sm:   0.9375rem; /* 15px */
  --font-size-base: 1.0625rem; /* 17px */
  --font-size-md:   1.125rem;  /* 18px */
  --font-size-lg:   1.25rem;   /* 20px */
  --font-size-xl:   1.5rem;    /* 24px */
  --font-size-2xl:  1.875rem;  /* 30px */
  --font-size-3xl:  2.25rem;   /* 36px */
  --font-size-4xl:  3rem;      /* 48px */

  /* Spacing */
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.25rem;
  --sp-6: 1.5rem;
  --sp-8: 2rem;
  --sp-10: 2.5rem;
  --sp-12: 3rem;
  --sp-16: 4rem;
  --sp-20: 5rem;

  /* Border Radius */
  --radius-sm:   8px;
  --radius:      16px;
  --radius-lg:   24px;
  --radius-xl:   32px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm:    0 2px 8px rgba(255, 107, 138, 0.10);
  --shadow:       0 4px 20px rgba(255, 107, 138, 0.14);
  --shadow-md:    0 6px 28px rgba(255, 107, 138, 0.18);
  --shadow-lg:    0 10px 40px rgba(255, 107, 138, 0.22);
  --shadow-hover: 0 16px 48px rgba(255, 107, 138, 0.28);

  /* Layout */
  --container-max: 1280px;
  --nav-height:    72px;
  --sidebar-width: 160px;
  --card-gap:      20px;
}

/* ============================================
   RESET & BASE
   ============================================ */

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

html {
  font-size: 17px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  color: var(--color-text);
  background-color: var(--bg-page);
  line-height: 1.65;
  min-height: 100vh;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color 0.2s ease;
}
a:hover { color: var(--color-orange); }

button {
  font-family: var(--font-family);
  cursor: pointer;
  border: none;
  outline: none;
}

ul { list-style: none; }

:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* ============================================
   BACKGROUND DECORATION
   ============================================ */

body::before {
  content: '';
  position: fixed;
  top: -200px;
  right: -200px;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(255, 107, 138, 0.08) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

body::after {
  content: '';
  position: fixed;
  bottom: -200px;
  left: -200px;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(126, 216, 200, 0.07) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* ============================================
   LAYOUT CONTAINER
   ============================================ */

.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--sp-6);
}

.page-wrapper {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
  padding-top: calc(var(--nav-height) + var(--sp-4));
}

/* ============================================
   NAVIGATION HEADER
   ============================================ */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--nav-height);
  background: var(--bg-nav);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1.5px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}

.site-header .container {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
}

/* Logo */
.site-logo {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  text-decoration: none;
  flex-shrink: 0;
}

.site-logo__img {
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  object-fit: cover;
}

.site-logo__text {
  font-size: var(--font-size-xl);
  font-weight: 900;
  background: linear-gradient(135deg, var(--color-pink) 0%, var(--color-orange) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}

.site-logo__tagline {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  font-weight: 600;
  display: block;
}

/* Navigation links */
.site-nav {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.nav-link {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--radius-full);
  font-size: var(--font-size-base);
  font-weight: 700;
  color: var(--color-text-soft);
  text-decoration: none;
  transition: all 0.25s ease;
  white-space: nowrap;
}

.nav-link:hover {
  color: var(--color-primary);
  background: var(--color-pink-pale);
  transform: translateY(-1px);
}

.nav-link.active {
  color: var(--color-primary);
  background: linear-gradient(135deg, rgba(255, 107, 138, 0.12), rgba(255, 168, 92, 0.08));
}

.nav-link__icon { font-size: 1.15em; }

/* Mobile menu toggle */
.mobile-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  background: var(--color-pink-pale);
  color: var(--color-primary);
  font-size: 1.4rem;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}
.mobile-menu-btn:hover { background: var(--color-pink-light); }

/* Mobile nav drawer */
.mobile-nav {
  display: none;
  position: fixed;
  top: var(--nav-height);
  left: 0;
  right: 0;
  background: var(--bg-nav);
  backdrop-filter: blur(16px);
  border-bottom: 1.5px solid var(--color-border);
  padding: var(--sp-4) var(--sp-6) var(--sp-6);
  flex-direction: column;
  gap: var(--sp-2);
  z-index: 99;
  box-shadow: var(--shadow-md);
  animation: fadeInDown 0.25s ease both;
}

.mobile-nav.open { display: flex; }

.mobile-nav .nav-link {
  padding: var(--sp-3) var(--sp-5);
  font-size: var(--font-size-md);
  justify-content: flex-start;
}

/* ============================================
   AD BANNER AREAS
   ============================================ */

.ad-banner {
  background: linear-gradient(135deg, #f8f0ff, #fff5fb);
  border: 2px dashed #e8b4c8;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
  font-weight: 600;
  text-align: center;
  overflow: hidden;
  position: relative;
}

.ad-banner::before {
  content: '📢 Quảng cáo';
  position: absolute;
  top: var(--sp-2);
  left: var(--sp-3);
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  opacity: 0.6;
}

/* Top leaderboard: 728x90 */
.ad-banner--top {
  width: 100%;
  max-width: 728px;
  height: 90px;
  margin: var(--sp-4) auto;
}

/* Sidebar: 160x600 */
.ad-banner--sidebar {
  width: 160px;
  height: 600px;
  flex-shrink: 0;
}

/* In-content: 300x250 */
.ad-banner--inline {
  width: 300px;
  max-width: 100%;
  height: 250px;
  margin: var(--sp-8) auto;
}

/* Mobile banner: 320x100 */
.ad-banner--mobile {
  display: none;
  width: 100%;
  max-width: 320px;
  height: 100px;
  margin: var(--sp-6) auto;
}

/* ============================================
   HERO SECTION
   ============================================ */

.hero {
  text-align: center;
  padding: var(--sp-12) var(--sp-6) var(--sp-8);
}

.hero__emoji {
  font-size: 4rem;
  display: block;
  margin-bottom: var(--sp-4);
  animation: float 3s ease-in-out infinite;
}

.hero__title {
  font-size: clamp(var(--font-size-2xl), 5vw, var(--font-size-4xl));
  font-weight: 900;
  line-height: 1.2;
  margin-bottom: var(--sp-4);
  background: linear-gradient(135deg, var(--color-pink) 0%, var(--color-orange) 60%, var(--color-mint) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero__subtitle {
  font-size: var(--font-size-lg);
  color: var(--color-text-soft);
  max-width: 560px;
  margin: 0 auto var(--sp-8);
  font-weight: 600;
}

/* ============================================
   CONTENT LAYOUT WITH SIDEBARS
   ============================================ */

.content-layout {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-8);
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--sp-6);
}

.sidebar-ad {
  position: sticky;
  top: calc(var(--nav-height) + var(--sp-6));
  flex-shrink: 0;
}

.content-main {
  flex: 1;
  min-width: 0;
}

/* ============================================
   FILTER BAR
   ============================================ */

.filter-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5);
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--sp-6);
  border: 1.5px solid var(--color-border);
}

.filter-bar__label {
  font-size: var(--font-size-md);
  font-weight: 800;
  color: var(--color-text);
  white-space: nowrap;
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  flex: 1;
}

.chip {
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--radius-full);
  font-size: var(--font-size-sm);
  font-weight: 700;
  cursor: pointer;
  border: 2px solid var(--color-border);
  background: var(--bg-page);
  color: var(--color-text-soft);
  transition: all 0.2s ease;
  white-space: nowrap;
  min-height: 40px;
  display: flex;
  align-items: center;
}

.chip:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: var(--color-pink-pale);
  transform: translateY(-2px);
}

.chip.active {
  background: linear-gradient(135deg, var(--color-pink), var(--color-orange));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 14px rgba(255, 107, 138, 0.35);
}

/* Breed select dropdown */
.breed-select {
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--radius-full);
  border: 2px solid var(--color-border);
  background: var(--bg-page);
  font-family: var(--font-family);
  font-size: var(--font-size-sm);
  font-weight: 700;
  color: var(--color-text);
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 44px;
  appearance: none;
  -webkit-appearance: none;
  padding-right: var(--sp-8);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23FF6B8A' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}

.breed-select:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(255, 107, 138, 0.15);
  outline: none;
}

/* ============================================
   GALLERY GRID
   ============================================ */

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--card-gap);
}

/* Cat Card */
.cat-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1.5px solid var(--color-border);
  transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.28s ease;
  cursor: pointer;
  position: relative;
}

.cat-card:hover {
  transform: translateY(-8px) scale(1.01);
  box-shadow: var(--shadow-hover);
  border-color: var(--color-pink-light);
}

.cat-card__image-wrap {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--color-pink-pale);
}

.cat-card__image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.cat-card:hover .cat-card__image-wrap img {
  transform: scale(1.06);
}

/* Skeleton placeholder while image loads */
.cat-card__skeleton {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #f5d9e2 25%, #ffe8f0 50%, #f5d9e2 75%);
  background-size: 400px 100%;
  animation: shimmer 1.4s ease-in-out infinite;
  position: absolute;
  inset: 0;
}

.cat-card__image-wrap img.loaded + .cat-card__skeleton,
.cat-card__image-wrap img.loaded ~ .cat-card__skeleton {
  display: none;
}

/* Card overlay with actions */
.cat-card__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.55) 0%, transparent 55%);
  opacity: 0;
  transition: opacity 0.3s ease;
  display: flex;
  align-items: flex-end;
  padding: var(--sp-4);
  gap: var(--sp-2);
}

.cat-card:hover .cat-card__overlay { opacity: 1; }

.cat-card__body {
  padding: var(--sp-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
}

.cat-card__breed {
  font-size: var(--font-size-sm);
  font-weight: 800;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cat-card__breed-tag {
  display: inline-block;
  font-size: var(--font-size-xs);
  background: var(--color-pink-pale);
  color: var(--color-primary);
  border-radius: var(--radius-full);
  padding: 2px 10px;
  font-weight: 700;
}

/* ============================================
   BUTTONS
   ============================================ */

/* Base button */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-6);
  border-radius: var(--radius-full);
  font-family: var(--font-family);
  font-size: var(--font-size-md);
  font-weight: 800;
  cursor: pointer;
  border: none;
  transition: all 0.25s ease;
  min-height: 48px;
  text-decoration: none;
  white-space: nowrap;
}

/* Primary gradient button */
.btn-primary {
  background: linear-gradient(135deg, var(--color-pink) 0%, var(--color-orange) 100%);
  color: #fff;
  box-shadow: 0 4px 16px rgba(255, 107, 138, 0.40);
}
.btn-primary:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 8px 24px rgba(255, 107, 138, 0.50);
  color: #fff;
}
.btn-primary:active {
  transform: translateY(0) scale(0.98);
}

/* Secondary outline button */
.btn-secondary {
  background: var(--bg-card);
  color: var(--color-primary);
  border: 2.5px solid var(--color-pink-light);
}
.btn-secondary:hover {
  background: var(--color-pink-pale);
  border-color: var(--color-primary);
  transform: translateY(-2px);
  color: var(--color-primary);
}

/* Mint accent button */
.btn-mint {
  background: linear-gradient(135deg, var(--color-mint) 0%, #5BC4B0 100%);
  color: #fff;
  box-shadow: 0 4px 16px rgba(126, 216, 200, 0.40);
}
.btn-mint:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 8px 24px rgba(126, 216, 200, 0.50);
  color: #fff;
}

/* Large CTA button */
.btn-lg {
  padding: var(--sp-5) var(--sp-10);
  font-size: var(--font-size-xl);
  border-radius: var(--radius-xl);
  min-height: 64px;
}

/* Icon-only round button */
.btn-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  padding: 0;
  font-size: 1.3rem;
  background: rgba(255, 255, 255, 0.9);
  color: var(--color-text);
  border: 1.5px solid rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(4px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.btn-icon:hover {
  transform: scale(1.15);
  background: #fff;
}

/* Favorite heart button */
.btn-fav {
  background: rgba(255, 255, 255, 0.92);
  color: var(--color-text-muted);
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.btn-fav:hover { transform: scale(1.2); }

.btn-fav.is-fav {
  color: var(--color-danger);
  background: #fff5f5;
  animation: heartPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}

@keyframes heartPop {
  0%   { transform: scale(1); }
  30%  { transform: scale(1.4); }
  60%  { transform: scale(0.9); }
  100% { transform: scale(1); }
}

/* Load more button */
.btn-load-more {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-3);
  width: 100%;
  max-width: 280px;
  margin: var(--sp-8) auto;
}

/* ============================================
   RANDOM CAT PAGE
   ============================================ */

.random-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--sp-8) var(--sp-6);
  gap: var(--sp-8);
  text-align: center;
}

.random-cat-display {
  width: 100%;
  max-width: 600px;
  aspect-ratio: 4 / 3;
  background: var(--color-pink-pale);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 3px solid var(--color-pink-light);
  position: relative;
  min-height: 320px;
}

.random-cat-display img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.random-cat-display .placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: var(--sp-4);
  color: var(--color-text-muted);
}

.random-cat-display .placeholder span {
  font-size: 5rem;
  animation: float 2.5s ease-in-out infinite;
}

.random-cat-display .placeholder p {
  font-size: var(--font-size-lg);
  font-weight: 700;
}

.random-cta-group {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-4);
  justify-content: center;
}

.cat-info-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: var(--sp-6);
  box-shadow: var(--shadow);
  border: 1.5px solid var(--color-border);
  max-width: 500px;
  width: 100%;
  text-align: left;
  animation: fadeInUp 0.4s ease both;
}

.cat-info-card__title {
  font-size: var(--font-size-xl);
  font-weight: 900;
  color: var(--color-primary);
  margin-bottom: var(--sp-3);
}

.cat-info-card__detail {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) 0;
  border-bottom: 1px solid var(--color-border);
  font-size: var(--font-size-base);
}

.cat-info-card__detail:last-child { border-bottom: none; }

.cat-info-card__detail .label {
  font-weight: 800;
  color: var(--color-text-soft);
  min-width: 100px;
}

/* ============================================
   FAVORITES PAGE
   ============================================ */

.favorites-header {
  text-align: center;
  padding: var(--sp-8) var(--sp-6) var(--sp-6);
}

.favorites-header h1 {
  font-size: var(--font-size-3xl);
  font-weight: 900;
  background: linear-gradient(135deg, var(--color-pink), var(--color-orange));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.favorites-header p {
  font-size: var(--font-size-md);
  color: var(--color-text-soft);
  margin-top: var(--sp-2);
}

.favorites-actions {
  display: flex;
  justify-content: center;
  gap: var(--sp-4);
  margin-bottom: var(--sp-6);
  flex-wrap: wrap;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: var(--sp-16) var(--sp-6);
  color: var(--color-text-muted);
}

.empty-state__emoji {
  font-size: 6rem;
  display: block;
  margin-bottom: var(--sp-5);
  animation: float 3s ease-in-out infinite;
}

.empty-state__title {
  font-size: var(--font-size-2xl);
  font-weight: 900;
  color: var(--color-text-soft);
  margin-bottom: var(--sp-3);
}

.empty-state__text {
  font-size: var(--font-size-md);
  max-width: 380px;
  margin: 0 auto var(--sp-8);
  line-height: 1.8;
}

/* ============================================
   LIGHTBOX / IMAGE MODAL
   ============================================ */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-6);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.lightbox.open {
  opacity: 1;
  pointer-events: all;
}

.lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.80);
  backdrop-filter: blur(6px);
  cursor: pointer;
}

.lightbox__content {
  position: relative;
  z-index: 1;
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  overflow: hidden;
  max-width: 800px;
  max-height: 90vh;
  width: 100%;
  box-shadow: 0 24px 80px rgba(0,0,0,0.4);
  transform: scale(0.85);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.lightbox.open .lightbox__content {
  transform: scale(1);
}

.lightbox__image-wrap {
  width: 100%;
  max-height: 60vh;
  overflow: hidden;
  background: var(--color-pink-pale);
}

.lightbox__image-wrap img {
  width: 100%;
  height: auto;
  max-height: 60vh;
  object-fit: contain;
}

.lightbox__info {
  padding: var(--sp-5) var(--sp-6);
}

.lightbox__actions {
  display: flex;
  gap: var(--sp-3);
  flex-wrap: wrap;
}

.lightbox__close {
  position: absolute;
  top: var(--sp-4);
  right: var(--sp-4);
  z-index: 2;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: rgba(0,0,0,0.5);
  color: #fff;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}
.lightbox__close:hover {
  background: rgba(0,0,0,0.75);
  transform: scale(1.1) rotate(90deg);
}

/* ============================================
   LOADING STATE
   ============================================ */

.loading-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-4);
  padding: var(--sp-12);
  color: var(--color-text-muted);
  font-size: var(--font-size-md);
  font-weight: 700;
}

.loading-indicator .spinner {
  font-size: 3rem;
  animation: pawSpin 1s linear infinite;
  display: inline-block;
}

/* ============================================
   TOAST NOTIFICATION
   ============================================ */

.toast-container {
  position: fixed;
  bottom: var(--sp-6);
  right: var(--sp-6);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  pointer-events: none;
}

.toast {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: var(--sp-4) var(--sp-5);
  box-shadow: var(--shadow-lg);
  border-left: 4px solid var(--color-primary);
  font-size: var(--font-size-base);
  font-weight: 700;
  color: var(--color-text);
  max-width: 320px;
  animation: slideInRight 0.35s ease both;
  pointer-events: all;
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.toast--success { border-color: var(--color-success); }
.toast--error   { border-color: var(--color-danger); }
.toast--info    { border-color: var(--color-mint); }

.toast.removing {
  animation: fadeInUp 0.3s ease reverse both;
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(40px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ============================================
   FOOTER
   ============================================ */

.site-footer {
  background: var(--bg-card);
  border-top: 1.5px solid var(--color-border);
  padding: var(--sp-10) var(--sp-6) var(--sp-6);
  margin-top: var(--sp-16);
  text-align: center;
}

.footer-logo {
  font-size: var(--font-size-2xl);
  font-weight: 900;
  background: linear-gradient(135deg, var(--color-pink), var(--color-orange));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: var(--sp-3);
}

.footer-tagline {
  font-size: var(--font-size-md);
  color: var(--color-text-muted);
  margin-bottom: var(--sp-6);
}

.footer-nav {
  display: flex;
  justify-content: center;
  gap: var(--sp-6);
  flex-wrap: wrap;
  margin-bottom: var(--sp-6);
}

.footer-nav a {
  color: var(--color-text-soft);
  font-weight: 700;
  font-size: var(--font-size-sm);
  transition: color 0.2s ease;
}

.footer-nav a:hover { color: var(--color-primary); }

.footer-copy {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
}

/* ============================================
   SECTION TITLES
   ============================================ */

.section-title {
  font-size: var(--font-size-2xl);
  font-weight: 900;
  color: var(--color-text);
  margin-bottom: var(--sp-6);
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.section-title__emoji { font-size: 1.3em; }

/* Counter badge */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  padding: 0 var(--sp-2);
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--color-pink), var(--color-orange));
  color: #fff;
  font-size: var(--font-size-xs);
  font-weight: 900;
}

/* ============================================
   SCROLL TO TOP
   ============================================ */

.scroll-top-btn {
  position: fixed;
  bottom: var(--sp-6);
  left: var(--sp-6);
  width: 52px;
  height: 52px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--color-pink), var(--color-orange));
  color: #fff;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  cursor: pointer;
  border: none;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 500;
}

.scroll-top-btn.visible {
  opacity: 1;
  pointer-events: all;
}

.scroll-top-btn:hover {
  transform: translateY(-4px) scale(1.1);
}

/* ============================================
   DARK MODE
   ============================================ */

@media (prefers-color-scheme: dark) {
  :root {
    --bg-page:    #1a1014;
    --bg-card:    #261820;
    --bg-nav:     rgba(26, 16, 20, 0.92);
    --color-text: #F5E6EA;
    --color-text-soft: #C4A0B0;
    --color-text-muted: #8A6878;
    --color-border: #3D2535;
    --color-pink-pale: rgba(255, 107, 138, 0.08);
  }

  .cat-card { border-color: #3D2535; }
  .filter-bar { border-color: #3D2535; }
  .skeleton {
    background: linear-gradient(90deg, #3D2535 25%, #4a2e3f 50%, #3D2535 75%);
  }
  .ad-banner {
    background: linear-gradient(135deg, #261820, #1a1014);
    border-color: #3D2535;
  }
}

/* ============================================
   RESPONSIVE — TABLET
   ============================================ */

@media (max-width: 1024px) {
  .ad-banner--sidebar { display: none; }
  .sidebar-ad { display: none; }
}

@media (max-width: 768px) {
  :root { --nav-height: 64px; }

  .site-nav { display: none; }
  .mobile-menu-btn { display: flex; }

  .hero { padding: var(--sp-8) var(--sp-4) var(--sp-6); }
  .hero__emoji { font-size: 3rem; }

  .content-layout {
    padding: 0 var(--sp-4);
    flex-direction: column;
  }

  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
  }

  .ad-banner--top { display: none; }
  .ad-banner--mobile { display: flex; }

  .lightbox { padding: var(--sp-3); }

  .btn-lg {
    padding: var(--sp-4) var(--sp-8);
    font-size: var(--font-size-lg);
    min-height: 56px;
  }

  .toast-container {
    bottom: var(--sp-4);
    right: var(--sp-4);
    left: var(--sp-4);
  }

  .toast { max-width: 100%; }

  .scroll-top-btn {
    bottom: var(--sp-4);
    left: var(--sp-4);
    width: 46px;
    height: 46px;
  }
}

@media (max-width: 480px) {
  html { font-size: 16px; }

  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .filter-bar { padding: var(--sp-3) var(--sp-4); }
  .random-cat-display { max-width: 100%; }
  .cat-info-card { padding: var(--sp-4); }
  .random-cta-group { flex-direction: column; align-items: stretch; }
  .random-cta-group .btn { justify-content: center; }
}

/* ============================================
   FILTER BAR — SCROLLABLE CHIPS (NEW LAYOUT)
   ============================================ */

.filter-bar {
  flex-direction: column;
  align-items: stretch;
  gap: var(--sp-3);
}

.filter-bar__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  flex-wrap: wrap;
}

.filter-chips-scroll {
  width: 100%;
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  width: 100%;
}

/* ============================================
   LANGUAGE SELECTOR
   ============================================ */

.lang-selector {
  position: relative;
  flex-shrink: 0;
}

.lang-btn {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--radius-full);
  background: var(--color-pink-pale);
  border: 1.5px solid var(--color-border);
  color: var(--color-text);
  font-family: var(--font-family);
  font-size: var(--font-size-sm);
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  min-height: 40px;
}

.lang-btn:hover {
  background: var(--color-pink-light);
  border-color: var(--color-primary);
}

.lang-arrow {
  font-size: 0.7em;
  opacity: 0.6;
  transition: transform 0.2s ease;
}

.lang-btn[aria-expanded="true"] .lang-arrow {
  transform: rotate(180deg);
}

.lang-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--bg-card);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  min-width: 200px;
  max-height: 320px;
  overflow-y: auto;
  z-index: 200;
  display: none;
  animation: fadeInDown 0.2s ease both;
  scrollbar-width: thin;
  scrollbar-color: var(--color-pink-light) transparent;
}

.lang-dropdown.open {
  display: block;
}

.lang-option {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  width: 100%;
  padding: var(--sp-3) var(--sp-4);
  background: none;
  border: none;
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  font-weight: 600;
  color: var(--color-text);
  cursor: pointer;
  text-align: left;
  transition: background 0.15s ease;
}

.lang-option:hover {
  background: var(--color-pink-pale);
  color: var(--color-primary);
}

.lang-option.active {
  background: linear-gradient(135deg, rgba(255,107,138,0.1), rgba(255,168,92,0.06));
  color: var(--color-primary);
  font-weight: 800;
}

.lang-flag {
  font-size: 1.2em;
  flex-shrink: 0;
}

.lang-name { flex: 1; }

/* Mobile lang selector */
.lang-selector--mobile {
  margin-top: var(--sp-2);
  padding: var(--sp-2) 0;
  border-top: 1px solid var(--color-border);
}

.lang-selector--mobile .lang-btn {
  width: 100%;
  justify-content: flex-start;
  border-radius: var(--radius);
  background: var(--color-pink-pale);
}

.lang-selector--mobile .lang-dropdown {
  position: static;
  box-shadow: none;
  border: 1.5px solid var(--color-border);
  margin-top: var(--sp-2);
  max-height: 200px;
}

/* ============================================
   CAT BACKGROUND LAYER
   ============================================ */

.cat-bg-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  user-select: none;
}

.cat-bg-layer span {
  position: absolute;
  pointer-events: none;
  user-select: none;
  line-height: 1;
}

/* ============================================
   AD BANNER — English label
   ============================================ */

.ad-banner::before {
  content: '📢 Advertisement';
}

/* ============================================
   RTL SUPPORT (Arabic)
   ============================================ */

[dir="rtl"] .site-nav { flex-direction: row-reverse; }
[dir="rtl"] .filter-bar__top { flex-direction: row-reverse; }
[dir="rtl"] .filter-chips { direction: rtl; }
[dir="rtl"] .lang-dropdown { right: auto; left: 0; }
[dir="rtl"] .fav-empty__step { flex-direction: row-reverse; text-align: right; }
[dir="rtl"] .cat-card__body { flex-direction: row-reverse; }
[dir="rtl"] .toast { flex-direction: row-reverse; }

