:root {
  --simpson-yellow: #FFD90F;
  --simpson-blue: #74D7EE;
  --donut-pink: #F560AA;
  --text-primary: #333333;
  --text-secondary: #555555;
  --card-bg: #ffffff;
  --card-border: #000000;
  --font-heading: 'Bangers', cursive;
  --font-body: 'Fredoka', sans-serif;
}

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

body {
  background-color: var(--simpson-blue);
  color: var(--text-primary);
  font-family: var(--font-body);
  overflow-x: hidden;
  min-height: 100vh;
  position: relative;
}

/* Clouds Background */
body::before,
body::after {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
  background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M25 60a15 15 0 0 1-15-15 15 15 0 0 1 25-10 20 20 0 0 1 35 5 15 15 0 0 1 10 25z' fill='%23ffffff' fill-opacity='0.4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: 200px 100px, 300px 150px, 150px 80px;
  background-position: 10% 20%, 80% 10%, 40% 60%;
  animation: floatClouds 60s linear infinite;
}

body::after {
  background-position: 90% 40%, 20% 80%, 60% 30%;
  animation-duration: 80s;
  opacity: 0.7;
}

@keyframes floatClouds {
  0% {
    background-position: 110% 20%, 120% 10%, 130% 60%;
  }

  100% {
    background-position: -20% 20%, -30% 10%, -40% 60%;
  }
}

#app {
  max-width: 1600px;
  margin: 0 auto;
  padding: 2rem;
}

/* Header */
.glass-header {
  margin-bottom: 3rem;
  padding: 3rem 2rem;
  background: rgba(255, 255, 255, 0.9);
  border: 4px solid var(--card-border);
  border-radius: 24px;
  box-shadow: 8px 8px 0px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  gap: 2rem;
  text-align: center;
}

.brand-container h1 {
  font-family: var(--font-heading);
  font-size: 5rem;
  color: var(--simpson-yellow);
  text-shadow:
    3px 3px 0 #000,
    -1px -1px 0 #000,
    1px -1px 0 #000,
    -1px 1px 0 #000,
    1px 1px 0 #000;
  letter-spacing: 2px;
  margin-bottom: 0.5rem;
  transform: rotate(-2deg);
  display: inline-block;
}

.brand-container p {
  font-family: var(--font-body);
  font-size: 1.5rem;
  color: var(--text-primary);
  font-weight: 600;
}

/* Controls */
.controls-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  align-items: center;
  width: 100%;
}

.search-wrapper {
  position: relative;
  width: 100%;
  max-width: 600px;
}

#search-input {
  width: 100%;
  padding: 1rem 1rem 1rem 3.5rem;
  background: #fff;
  border: 3px solid var(--card-border);
  border-radius: 50px;
  color: var(--text-primary);
  font-size: 1.2rem;
  font-family: var(--font-body);
  transition: all 0.2s;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.1);
}

#search-input:focus {
  outline: none;
  border-color: var(--donut-pink);
  box-shadow: 4px 4px 0 var(--donut-pink);
  transform: translateY(-2px);
}

.search-icon {
  position: absolute;
  left: 1.2rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-primary);
  pointer-events: none;
}

.photo-count {
  font-family: var(--font-body);
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 1.1rem;
  margin-top: -0.5rem;
  margin-bottom: 0.5rem;
}

.category-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  justify-content: center;
}

.filter-chip {
  padding: 0.5rem 1.2rem;
  background: #fff;
  border: 2px solid var(--card-border);
  border-radius: 100px;
  color: var(--text-primary);
  cursor: pointer;
  font-size: 1rem;
  font-family: var(--font-heading);
  letter-spacing: 0.5px;
  transition: all 0.2s;
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.1);
}

.filter-chip:hover {
  transform: translateY(-2px);
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.1);
  background: var(--simpson-yellow);
}

.filter-chip.active {
  background: var(--donut-pink);
  color: white;
  border-color: #000;
  box-shadow: 4px 4px 0 #000;
  transform: translateY(-2px) rotate(-1deg);
}

.model-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: center;
  margin-top: 0.5rem;
  padding-top: 1rem;
  border-top: 2px dashed rgba(0, 0, 0, 0.1);
  width: 100%;
}

.model-chip {
  padding: 0.4rem 1rem;
  background: rgba(255, 255, 255, 0.8);
  border: 2px solid var(--card-border);
  border-radius: 8px;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.9rem;
  font-family: var(--font-body);
  font-weight: 600;
  transition: all 0.2s;
}

.model-chip:hover {
  background: var(--simpson-blue);
  color: #000;
  transform: translateY(-1px);
}

.model-chip.active {
  background: var(--simpson-blue);
  color: #000;
  border-color: #000;
  box-shadow: 3px 3px 0 #000;
  transform: translateY(-1px);
}

/* Grid */
.grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2.5rem;
  padding-bottom: 4rem;
}

/* Card */
.card {
  background: var(--card-bg);
  border: 3px solid var(--card-border);
  border-radius: 20px;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  height: 100%;
  box-shadow: 8px 8px 0 rgba(0, 0, 0, 0.15);
  position: relative;
}

.card:hover {
  transform: translateY(-10px) rotate(1deg);
  box-shadow: 12px 12px 0 rgba(0, 0, 0, 0.2);
  border-color: var(--donut-pink);
}

.card-image-container {
  width: 100%;
  aspect-ratio: 1/1;
  /* Square for portraits */
  overflow: hidden;
  position: relative;
  background: #ffffff;
  border-bottom: 3px solid var(--card-border);
}

.card-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  /* Changed to contain to show full character */
  padding: 1rem;
  transition: transform 0.4s ease;
}

.card:hover .card-image {
  transform: scale(1.1);
}

.card-content {
  padding: 1.5rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  background: #fff;
}

.card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.8rem;
}

.card-category {
  font-size: 0.9rem;
  text-transform: uppercase;
  font-family: var(--font-heading);
  color: var(--donut-pink);
  letter-spacing: 1px;
}

.model-badge {
  font-size: 0.7rem;
  padding: 0.2rem 0.6rem;
  background: var(--simpson-yellow);
  border: 2px solid #000;
  border-radius: 12px;
  color: #000;
  font-weight: bold;
  font-family: var(--font-body);
}

.card-title {
  font-size: 1.5rem;
  font-family: var(--font-heading);
  margin-bottom: 0.5rem;
  line-height: 1.2;
  color: #000;
  letter-spacing: 0.5px;
}

.card-description {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.5;
  display: -webkit-box;
  line-clamp: 3;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: auto;
  font-family: var(--font-body);
}

/* Loader */
.loading-trigger {
  display: flex;
  justify-content: center;
  padding: 2rem;
  width: 100%;
}

.loader {
  width: 50px;
  height: 50px;
  border: 5px solid #fff;
  border-radius: 50%;
  border-top-color: var(--donut-pink);
  border-right-color: var(--simpson-yellow);
  border-bottom-color: var(--simpson-blue);
  animation: spin 0.8s linear infinite;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

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

/* Responsive */
@media (max-width: 768px) {
  .brand-container h1 {
    font-size: 3rem;
  }

  .brand-container p {
    font-size: 1rem;
  }

  #app {
    padding: 1rem;
  }

  .grid-container {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }

  .card-image-container {
    aspect-ratio: 1/1;
  }

  .card-content {
    padding: 1rem;
  }

  .card-title {
    font-size: 1.1rem;
  }

  .filter-chip {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
  }

  .model-badge {
    display: none;
  }
}