@font-face {
  font-family: 'SilpoFontReg';
  src: url('fonts/Silpo-Regular.otf') format('otf');
  font-weight: normal;
  font-style: normal;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'SilpoFontReg', sans-serif;
  background: linear-gradient(135deg, #d4f3ff, #fffecf, #d4ffd8);
  background-size: 300% 300%;
  animation: flow 20s ease infinite;
  color: #222;
}

/* Анімація градієнта */
@keyframes flow {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

h1 {
  text-align: center;
  color: #064420;
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.subtitle {
  text-align: center;
  font-size: 1.1rem;
  color: #1b4332;
  background: #d8f3dc;
  padding: 1rem;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  max-width: 800px;
  margin: 0 auto 2rem;
}

.filter-buttons {
  display: flex;
  max-width: 800px;
  margin: 0 auto 2rem;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 2rem;
  border: 1px solid #b7e4c7;
  border-radius: 12px;
  padding: 4px;
  background: #e6f4f1;
}

.filter-button {
  padding: 0.5rem 1rem;
  border: none;
  background-color: transparent;
  color: #1b4332;
  border-radius: 8px;
  font-weight: 600;
  transition: all 0.3s ease;
  text-decoration: none;
}

.filter-button.active {
  background: linear-gradient(to right, #38b000, #70e000);
  color: white;
}

.filter-button:hover {
  background-color: #b7e4c7;
  color: #081c15;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 1.5rem;
}

.card {
  background: #fff;
  border: 2px solid #b7e4c7;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  display: flex;
  flex-direction: column;
  transition: transform 0.3s;
  animation: fadeInUp 0.4s ease-in-out;
}

@keyframes fadeInUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.card:hover {
  transform: translateY(-6px);
}

.card-image {
  width: 100%;
  height: 350px;
  object-fit: cover;
  background-color: #f0f0f0;
  transition: transform 0.3s ease;
  cursor: zoom-in;
}

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

.card-body {
  padding: 1rem;
}

.card-name {
  font-weight: bold;
  font-size: 1.1rem;
  color: #1b4332;
  margin-bottom: 0.3rem;
}

.card-info {
  font-size: 0.9rem;
  margin-bottom: 0.3rem;
  color: #2d6a4f;
}

.card-info i {
  margin-right: 6px;
}

.card-votes {
  font-size: 0.9rem;
  color: #2d6a4f;
  margin-bottom: 12px;
}

.vote-button {
  display: block;
  width: 300px;
  margin: auto;
  text-align: center;
  padding: 0.5rem;
  background: linear-gradient(to right, #38b000, #70e000);
  color: white;
  font-weight: bold;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.vote-button:hover {
  background: linear-gradient(to right, #2d6a4f, #1b4332);
}

.vote-button.voted {
  background: #e6f4e6;
  color: #4caf50;
  cursor: default;
  border: none;
  font-weight: bold;
  padding: 10px 16px;
  border-radius: 6px;
  opacity: 0.9;
  transition: background-color 0.3s;
}

.vote-button.voted:hover {
  background-color: #d3f3d3;
}

.vote-button.voted::before {
  content: "\2764\FE0F ";
  margin-right: 5px;
}


.vote-message.success {
  background: #e3fcec;
  color: #1f7a44;
  border: 1px solid #b5e3c9;
}

.vote-message.warning {
  background: #fff7e6;
  color: #8a6d1d;
  border: 1px solid #ffd966;
}

@media (max-width: 600px) {
  h1 {
    font-size: 2rem;
  }
  .subtitle {
    font-size: 1rem;
  }
}

.img-popup {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.7);
  justify-content: center;
  align-items: center;
  z-index: 999;
}

.img-popup-content {
  background: #fff;
  padding: 1rem;
  border-radius: 8px;
  max-width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}

.img-popup-content img {
  max-width: 100%;
  max-height: 80vh;
  height: auto;
}

.popup-close {
  position: absolute;
  top: 1px;
  right: 1px;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
}

.decor {
    position: absolute;
    z-index: 0;
    opacity: 0.6;
    animation: float 6s ease-in-out infinite;
    pointer-events: none;
  }
  
  @media (max-width: 768px) {
    .decor,
    .decor-flower,
    .decor-sun,
    .decor-dog,
    .decor-bug,
    .decor-girl,
    .decor-home {
      display: none !important;
    }
  }
  
  /* Верх ліворуч */
  .decor-flower {
    background: url('/public/decor/flower.png') no-repeat center/contain;
    width: 120px;
    height: 120px;
    top: 3%;
    left: 2%;
    animation-delay: 0s;
  }
  
  /* Верх праворуч */
  .decor-sun {
    background: url('/public/decor/sun.png') no-repeat center/contain;
    width: 150px;
    height: 150px;
    top: 5%;
    right: 2%;
    animation-delay: 1.5s;
  }
  
  /* Низ ліворуч */
  .decor-dog {
    background: url('/public/decor/dog.png') no-repeat center/contain;
    width: 130px;
    height: 130px;
    bottom: 4%;
    left: 3%;
    animation-delay: 3s;
  }
  
  /* Низ праворуч */
  .decor-bug {
    background: url('/public/decor/bug.png') no-repeat center/contain;
    width: 130px;
    height: 130px;
    bottom: 6%;
    right: 4%;
    animation-delay: 4.5s;
  }
  
  /* Центр правого краю */
  .decor-girl {
    background: url('/public/decor/girl.png') no-repeat center/contain;
    width: 130px;
    height: 130px;
    top: 40%;
    right: 0%;
    animation-delay: 2.5s;
  }
/* Центр лівого краю  */
    .decor-home {
        background: url('/public/decor/home.png') no-repeat center/contain;
        width: 110px;
        height: 110px;
        top: 40%;
        left: 0%;
        animation-delay: 2.5s;
      }
  
  @keyframes float {
    0%   { transform: translateY(0px); }
    50%  { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
  }
  
.vote-status-container {
      max-width: 600px;
      margin: 1rem auto;
      text-align: center;
    }
    .vote-message {
      margin: 0 auto 20px;
      padding: 12px 20px;
      border-radius: 12px;
      font-size: 16px;
      text-align: center;
      animation: fadeIn 0.5s ease-in-out;
      background: #f0f0f0;
      color: #333;
      border: 1px solid #ccc;
    }
    .vote-message.success {
      color: #2e7d32;
      font-weight: bold;
    }
    .vote-message.warning {
      color: #e53935;
      font-weight: bold;
    }

@media screen and (max-width: 1024px) {
  .container {
    padding: 1.5rem 1rem;
  }

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

  .card-image {
    height: 280px;
  }

  .vote-button {
    width: 90%;
    font-size: 1rem;
  }
}

@media screen and (max-width: 768px) {
  h1 {
    font-size: 1.8rem;
  }

  .subtitle {
    font-size: 0.95rem;
    padding: 0.8rem;
  }

  .filter-buttons {
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
    padding: 1rem;
  }

  .card {
    border-radius: 12px;
  }

  .card-body {
    padding: 0.8rem;
  }

  .card-image {
    height: 220px;
  }

  .card-name,
  .card-info,
  .card-votes {
    font-size: 0.95rem;
  }
}

@media screen and (max-width: 480px) {
  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .card-image {
    height: 200px;
  }

  .vote-button {
    font-size: 0.95rem;
    padding: 0.5rem 1rem;
  }

  .subtitle {
    margin-bottom: 1.5rem;
  }

  .popup-close {
    font-size: 20px;
    top: 4px;
    right: 8px;
  }
}

