body {
    font-family: 'Arial', sans-serif;
background-image: url(./img/bg.png);
background-size: cover;
background-repeat: no-repeat;
background-position: center;
background-attachment: fixed;

    color: #fff;
    margin: 0;
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    user-select: none;
    position: relative;
    overflow-x: hidden;
  }
  
  #moviesGrid {
    max-width: 100%;
  }

  #searchBox {
    display: flex;
    width: 100%;
    max-width: 600px;
    margin-bottom: 20px;
    gap: 10px;
  }

  #searchInput {
    flex: 1;
    padding: 12px 16px;
    border: none;
    border-radius: 8px;
    background: #111;
    color: #fff;
    font-size: 1rem;
    transition: box-shadow 0.3s ease;
  }

  #searchInput:focus {
    box-shadow: 0 0 12px rgba(255, 140, 0, 0.7);
  }
  @media (max-width: 600px) {
  #searchInput {
width: 100% !important;
flex: none !important;
box-sizing: border-box;
}}


  #searchBtn {
    padding: 12px 20px;
    background: #ff4500;
    border: none;
    border-radius: 8px;
    color: #fff;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.3s ease, transform 0.3s ease;
  }

  #searchBtn:hover {
    background: #e53d00;
    transform: scale(1.05);
  }

  /* —————— ADDED FILTER STYLES —————— */
  #filters {
    display: flex;
    width: 100%;
    max-width: 600px;
    gap: 10px;
    margin-bottom: 20px;
    justify-content: center;
  }
  #genreSelect,
  #typeSelect {
    flex: 1;
    padding: 12px 16px;
    border: none;
    border-radius: 8px;
    background: #111;
    color: #fff;
    font-size: 1rem;
    transition: box-shadow 0.3s ease;
    cursor: pointer;
  }
  #genreSelect:focus,
  #typeSelect:focus {
    box-shadow: 0 0 12px rgba(255, 140, 0, 0.7);
  }
  /* —————————————————————————————— */

  #loading {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: none;
    z-index: 9999;
  }

  #loading.show {
    display: block;
  }

  .loader-svg {
    animation: rotate 2s linear infinite;
    width: 64px;
    height: 64px;
  }

  .loader-circle-bg {
    fill: none;
    stroke: #333;
    stroke-width: 6;
  }

  .loader-circle-progress {
    fill: none;
    stroke: orange;
    stroke-width: 6;
    stroke-dasharray: 157;
    stroke-dashoffset: 0;
    animation: dash 1.5s ease-in-out infinite;
  }

  @keyframes rotate {
    100% {
      transform: rotate(360deg);
    }
  }

  @keyframes dash {
    0% {
      stroke-dashoffset: 157;
    }
    50% {
      stroke-dashoffset: 39;
      transform: rotate(45deg);
    }
    100% {
      stroke-dashoffset: 157;
      transform: rotate(360deg);
    }
  }

  #moviesGrid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 20px;
    width: 100%;
    max-width: 1200px;
  }

  .movie {
    max-width: 200px;
    background: #111;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
    transform: scale(0.95) translateY(20px);
    opacity: 0;
    animation: fadeSlide 0.8s forwards;
    animation-delay: calc(var(--i) * 0.1s);
  }

  @keyframes fadeSlide {
    to {
      opacity: 1;
      transform: scale(1) translateY(0);
    }
  }

  .poster {
    width: 100%;
    height: 240px;
    object-fit: cover;
    border-radius: 8px;
    background: #222;
    transition: transform 0.4s ease;
  }

  .movie:hover .poster {
    transform: scale(1.05);
  }

  .movie-info {
    padding: 10px 0;
    text-align: center;
  }

  .title {
    font-weight: bold;
    font-size: 1rem;
    margin-bottom: 4px;
    color: #fff;
  }

  .subinfo {
    font-size: 0.85rem;
    color: #bbb;
    margin-bottom: 4px;
  }

  .genre {
    font-size: 0.8rem;
    color: #ff7f50;
    font-style: italic;
  }

  .rating-circle {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #111;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: bold;
    box-shadow: 0 0 8px rgba(255, 69, 0, 0.6);
  }

  .circle-bg {
    fill: none;
    stroke: #444;
    stroke-width: 5;
  }

  .circle-progress {
    fill: none;
    stroke-width: 5;
    stroke-linecap: round;
    stroke: orange;
    transition: stroke 0.4s ease;
  }

  .rating-low .circle-progress {
    stroke: #e50914;
  }

  .rating-medium .circle-progress {
    stroke: #ff7f50;
  }

  .rating-high .circle-progress {
    stroke: #f3e116;
  }

  #pagination {
    margin-top: 20px;
    display: flex;
    gap: 8px;
    justify-content: center;
  }

  .page-btn {
    background: #111;
    border: none;
    color: #fff;
    border-radius: 6px;
    padding: 8px 12px;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.3s ease;
  }

  .page-btn:hover {
    background: #222;
    transform: scale(1.1);
  }

  .page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
  }

  .page-btn.active {
    background: #fefefe;
    color: #000;
    font-weight: bold;
    transform: scale(1.1);
  }

  footer {
    margin-top: auto;
    padding: 20px 0;
    text-align: center;
    font-size: 0.9rem;
    color: #ff7f50;
    letter-spacing: 1px;
    animation: fadeInFooter 2s ease forwards;
  }

  @keyframes fadeInFooter {
    from {
      opacity: 0;
      transform: translateY(20px);
    }

    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  @media(max-width:600px) {
    #searchBox {
      flex-direction: column;
      gap: 10px;
    }

    #filters {
      flex-direction: column;
    }

    #searchBtn,
    #genreSelect,
    #typeSelect {
      width: 100%;
    }

    .poster {
      height: 200px;
    }
  }
    
    .name {
      width: 100%;
      text-align: center;
      margin-bottom: 10px;
    }

    .name h2{
    color: #ff4500;
    font-size: 50px;
    font-weight: bold;
    }
    
    .name h2 span {
      color: rgb(255, 255, 255);
    }
    
    @media(max-width:600px){
.name h2 {
  font-size: 28px;
  line-height: 1.2;
  word-break: break-word;
}
}


    @media (max-width: 600px) {
.name h2 {
  font-size: 32px;
  text-align: center;
}

#searchBox {
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

#filters {
  flex-direction: column;
  width: 100%;
}

#searchInput, #searchBtn, #genreSelect, #typeSelect {
  width: 100%;
  font-size: 1rem;
}

.poster {
  height: auto;
  aspect-ratio: 2/3;
}

#moviesGrid {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
}

footer {
  padding: 12px;
  font-size: 0.8rem;
}
}

/* Works on Chrome, Edge, Safari */
::-webkit-scrollbar {
width: 10px;
}

::-webkit-scrollbar-track {
background: #111; /* track color */
}

::-webkit-scrollbar-thumb {
background: #ff4500; /* thumb color (orange) */
border-radius: 5px;
border: 2px solid #111; /* padding illusion */
}

::-webkit-scrollbar-thumb:hover {
background: #e53d00; /* on hover */
}

/* Works on Firefox */
* {
scrollbar-width: thin;
scrollbar-color: #ff4500 #111;
}

/* в style.css */
#suggestionCarousel {
  max-width: 1200px;
  width: 100%;
}
#suggestionCarousel .carousel-item img {
  height: 400px;
  object-fit: cover;
  border-radius: 15px;
}
@media (max-width: 768px) {
  #suggestionCarousel .carousel-item img {
    height: 200px;
  }
}
/* Делаем контейнер slide относительным */
#suggestionCarousel .carousel-item {
  position: relative;
  overflow: hidden;
}

/* Плавный переход для картинки */
#suggestionCarousel .carousel-item img {
  display: block;
  width: 100%;
  transition: filter 0.3s ease, transform 0.3s ease;
}

/* Затемняем картинку при hover */
#suggestionCarousel .carousel-item:hover img {
  filter: brightness(50%);
  transform: scale(1.02);
}

/* Скрываем подпись по умолчанию */
#suggestionCarousel .carousel-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 1rem 0;
  background: rgba(0, 0, 0, 0.6);
  text-align: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

/* Показываем подпись при hover на слайде */
#suggestionCarousel .carousel-item:hover .carousel-caption {
  opacity: 1;
}

/* Белый крупный заголовок */
#suggestionCarousel .carousel-caption h5 {
  color: #fff;
  font-size: 1.25rem;
  margin: 0;
}

/* Убираем мелкий текст, если он есть */
#suggestionCarousel .carousel-caption p {
  display: none;
}
/* ============================= */
/* Для тач-устройств (нет hover) */
@media (hover: none) and (pointer: coarse), (max-width: 768px) {
  /* затемняем картинку всегда */
  #suggestionCarousel .carousel-item img {
    filter: brightness(50%);
    transform: scale(1.02);
  }

  /* показываем подпись всегда */
  #suggestionCarousel .carousel-caption {
    opacity: 1 !important;
  }

  /* уменьшим переходы, чтобы не было дрожания */
  #suggestionCarousel .carousel-item img,
  #suggestionCarousel .carousel-caption {
    transition: none;
  }
}
/* Принудительно показываем подпись даже там, где Bootstrap её скрывает */
#suggestionCarousel .carousel-caption {
  display: block !important;  /* убираем d-none */
  opacity: 1 !important;      /* чтобы её сразу было видно */
}
@media (max-width: 767px) {
  #suggestionCarousel .carousel-caption {
    padding: 0.5rem;
    font-size: 0.9rem;
    background: rgba(0,0,0,0.7);
  }
}
