/* Fonts */
@font-face {
    font-family: 'AC Line';
    src: local('AC Line'),
         url('fonts/acline.woff2') format('woff2'),
         url('fonts/acline.woff') format('woff'),
         url('fonts/acline.ttf') format('truetype');

    font-weight: 900;
    font-style: normal;
    font-stretch: expanded;
    text-transform: uppercase;
    letter-spacing: 2px;
}
@import url('https://fonts.googleapis.com/css2?family=Lato:wght@400;700&family=Montserrat:wght@500;700&display=swap');


.connection-error {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: #ff4444;
  color: white;
  padding: 10px;
  text-align: center;
  z-index: 1000;
}

.connection-error button {
  margin-left: 10px;
  padding: 5px 10px;
  background: white;
  color: #ff4444;
  border: none;
  border-radius: 3px;
  cursor: pointer;
}

#notifications {
  position: fixed;
  top: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 1000;
}

.notification {
  display: flex;
  flex-direction: column;
  background-color: #4caf50;
  color: white;
  padding: 15px;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  font-family: 'Roboto', sans-serif;
  font-size: 14px;
  animation: fadeIn 0.5s, fadeOut 0.5s 4.5s;
  position: relative;
  overflow: hidden;
}

.notification.error {
  background-color: #ff4d4f;
  color: #fff;
  border-left: 5px solid #d32f2f;
}

.notification .progress-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 4px;
  background-color: rgba(255, 255, 255, 0.8);
  animation: progress 5s linear;
  width: 100%;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

@keyframes progress {
    from {
        width: 100%;
    }
    to {
        width: 0%;
    }
}

::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: #222;
}

::-webkit-scrollbar-thumb {
  background: #333;
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: #555;
}

.scroll-container {
  position: fixed;
  width: 100%;
  height: 100%;
  overflow: hidden;
  top: 0;
  left: 0;
}

.scroll-content {
  position: absolute;
  width: 100%;
  top: 0;
  left: 0;
}
  
body {
  font-family: Arial, sans-serif;
  background-color: #222;
  color: #fff;
  overflow: hidden;
  margin: 0;
  padding: 0;
}

.preloader {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 100vh;
}

.film {
  display: flex;
  gap: 6px;
}

.film span {
  width: 15px;
  height: 50px;
  background: #ff4444;
  border-radius: 4px;
  animation: move 1s infinite ease-in-out;
}

.film span:nth-child(2) { animation-delay: 0.2s; }
.film span:nth-child(3) { animation-delay: 0.4s; }
.film span:nth-child(4) { animation-delay: 0.6s; }

@keyframes move {
  0%, 100% { transform: scaleY(1); }
  50% { transform: scaleY(0.3); }
}

#loader-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(51, 51, 51, 0.8);
  backdrop-filter: blur(5px);
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  z-index: 1000;
}

.auth-buttons {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  z-index: 100;
}

.auth-button {
  font-family: 'Poppins', sans-serif;
  font-size: 16px;
  background-color: #333;
  color: #fff;
  border: none;
  padding: 12px 18px;
  cursor: pointer;
  font-weight: bold;
  border-radius: 8px;
  text-decoration: none;
  position: relative;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.auth-button::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 300%;
  height: 300%;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.6s ease-out, height 0.6s ease-out, opacity 0.4s ease-out;
  opacity: 1;
}

.auth-button:hover::before {
  width: 0;
  height: 0;
  opacity: 0;
}

.auth-button:hover {
  box-shadow: 0px 6px 15px rgba(255, 255, 255, 0.2);
}

.auth-button:active {
  transform: scale(0.97);
  transition: transform 0.2s ease-out;
}

.username-highlight {
  position: relative;
  display: inline-block;
  padding: 10px 20px;
  border-radius: 30px;
  width: 100%;
  background-color: #3b4b6b;
  color: white;
  font-weight: bold;
  display: flex;
  text-align: center;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  transition: box-shadow 0.3s ease;

  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;

  z-index: 100;
}

.username-highlight:hover {
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.6); 
}

.dropdown-menu {
  --main-color: #ff0000;
  --main-color-opacity: #f7e4791c;

  --total-radio: 4;

  display: none;
  flex-direction: column;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  padding-left: 0.5rem;
  background: #333;
}

.dropdown-menu.show {
  display: flex;
}

.dropdown-menu input {
  cursor: pointer;
  appearance: none;
}

.dropdown-menu .glider-container {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  background: linear-gradient(
      0deg,
      rgba(0, 0, 0, 0) 0%,
      rgba(27, 27, 27, 1) 50%,
      rgba(0, 0, 0, 0) 100%
  );
  width: 1px;
}

.dropdown-menu .glider-container .glider {
  position: relative;
  height: calc(100% / var(--total-radio));
  width: 100%;
  background: linear-gradient(
      0deg,
      rgba(0, 0, 0, 0) 0%,
      var(--main-color) 50%,
      rgba(0, 0, 0, 0) 100%
  );
  transition: transform 0.5s cubic-bezier(0.37, 1.95, 0.66, 0.56);
}

.dropdown-menu .glider-container .glider::before {
  content: "";
  position: absolute;
  height: 60%;
  width: 300%;
  top: 50%;
  transform: translateY(-50%);
  background: var(--main-color);
  filter: blur(10px);
}

.dropdown-menu .glider-container .glider::after {
  content: "";
  position: absolute;
  left: 0;
  height: 100%;
  width: 150px;
  background: linear-gradient(
      90deg,
      var(--main-color-opacity) 0%,
      rgba(0, 0, 0, 0) 100%
  );
}

.dropdown-menu label {
  cursor: pointer;
  padding: 1rem;
  margin-top: -1rem;
  position: relative;
  color: grey;
  transition: all 0.3s ease-in-out;
}

.dropdown-link {
  display: block;
  padding: 1rem;
  color: grey;
  text-decoration: none;
  transition: background-color 0.3s ease, color 0.3s ease;
  border: 2px solid transparent;
  border-radius: 5px;
}

.dropdown-link:hover,
.dropdown-link:focus {
  background-color: var(--main-color-opacity, #f7e4791c);
  color: var(--main-color, #f7e479);
  border: 2px solid var(--main-color);
}


.dropdown-menu input:checked + label {
  color: var(--main-color);
}

.dropdown-menu input:nth-of-type(1):checked ~ .glider-container .glider {
  transform: translateY(0);
}

.dropdown-menu input:nth-of-type(2):checked ~ .glider-container .glider {
  transform: translateY(100%);
}

.dropdown-menu input:nth-of-type(3):checked ~ .glider-container .glider {
  transform: translateY(200%);
}

.dropdown-menu input:nth-of-type(4):checked ~ .glider-container .glider {
  transform: translateY(300%);
}

.dropdown-menu input:nth-of-type(5):checked ~ .glider-container .glider {
  transform: translateY(400%);
}

.dropdown-menu input:nth-of-type(6):checked ~ .glider-container .glider {
  transform: translateY(500%);
}

.dropdown-menu input:nth-of-type(7):checked ~ .glider-container .glider {
  transform: translateY(600%);
}

.dropdown-menu input:nth-of-type(8):checked ~ .glider-container .glider {
  transform: translateY(700%);
}

.dropdown-menu input:nth-of-type(9):checked ~ .glider-container .glider {
  transform: translateY(800%);
}

.dropdown-menu input:nth-of-type(10):checked ~ .glider-container .glider {
  transform: translateY(900%);
}

.bell-button {
  background-color: transparent;
  border: none;
  padding: 10px;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 50%;
  transition: background-color 0.3s ease;
}

.bell-button:hover {
  background-color: rgba(83, 78, 78, 0.362);
}

.bell-icon {
  width: 25px;
  height: 25px;
  pointer-events: none;
}

header {
  text-align: center;
  top: 0px;    
}

h1 {
  position: relative;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  color: #f00;
  height: 94px;
}

h1 img {
  height: 94px;
}

nav {
  display: flex;
  justify-content: space-between;
  background-color: #444;
  padding: 10px;
  margin-top: -57px;
}

.categories {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  max-width: 1000px;
  justify-content: center;
  gap: 0px;
}

.categories li {
  position: relative;
  overflow: hidden;
  margin-right: 20px;
  margin-top: 5px;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100px;
  height: 50px;
  background-color: #333;
  color: #fff;
  border: 1px solid #000;
  text-align: center;
  font-size: 14px;
  cursor: pointer;
  border-radius: 8px;
}

.categories li.active {
  border: 2px solid #ff0000; 
}

.categories li.active::before {
  content: "";
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: radial-gradient(circle, #ff0000 60%, transparent 70%);
  box-shadow: 0 0 10px #ff0000, 0 0 20px #ff0000;
  
  top: -4px;
  left: -4px;

  animation: fuse 2s linear infinite;
}

@keyframes fuse {
  0% {
    top: -4px; 
    left: -4px; 
  }
  25% {
    top: -4px; 
    left: calc(100% - 4px); 
  }
  50% {
    top: calc(100% - 4px); 
    left: calc(100% - 4px); 
  }
  75% {
    top: calc(100% - 4px); 
    left: -4px; 
  }
  100% {
    top: -4px; 
    left: -4px; 
  }
}

.categories li:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(255, 0, 0, 0.4);
}

.categories a {
  display: block;
  width: 100%; 
  height: 100%; 
  color: #fff;
  text-decoration: none;
  font-weight: bold;
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: 'AC Line', sans-serif;
  font-size: 18px;
}

.search-container {
  width: 90%;
  max-width: 600px;
  padding: 20px;
}

.search-bar {
  display: flex;
  border-radius: 30px;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.search-bar input {
  flex: 1;
  padding: 15px 20px;
  border: none;
  font-size: 16px;
  outline: none;
}

.search-bar button {
  background-color: #ff0000;
  border: none;
  color: #fff;
  font-size: 16px;
  padding: 15px 20px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.search-bar button:hover {
  background-color: #e60000;
}

.container {
  padding: 20px;
}

.movies-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 20px;
  padding: 20px;
}

.movie-card {
  background: #1a1a1a;
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.2s ease;
}

.movie-card:hover {
  transform: translateY(-5px);
}

.movie-poster {
  width: 100%;
  height: 250px;
  object-fit: cover;
  border-bottom: 2px solid #333;
}

.movie-info {
  padding: 12px;
}

.movie-title {
  font-size: 14px;
  margin: 0 0 4px 0;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.movie-meta {
  font-size: 12px;
  color: #888;
  margin: 0;
}

.movie-card a {
  text-decoration: none;
}

.movie-card a:hover,
.movie-card a:focus {
  text-decoration: none;
}

.loading {
  text-align: center;
  padding: 40px;
  color: #666;
  font-size: 16px;
}

.no-movies {
  text-align: center;
  padding: 30px;
  color: #666;
}

.error {
  color: #ff4444;
  text-align: center;
  padding: 30px;
}

.pagination {
  display: flex;
  justify-content: center;
  margin-top: 20px;
}

.pagination button {
  background-color: #007bff;
  color: white;
  border: none;
  padding: 10px 15px;
  margin: 0 5px;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s;
}

.pagination button:hover {
  background-color: #0056b3;
}

.pagination button:disabled {
  background-color: #ccc;
  cursor: not-allowed;
}

button.active {
  background-color: red;
}

footer {
  font-family: 'Lato', sans-serif;
  background-color: #333;
  padding: 20px;
  width: 97.5%;
  margin-top: 60px;
  color: #fff;
  transition: opacity 0.5s ease;
}

.footer-top {
  text-align: left;
  font-size: 20px;
  font-weight: bold;
  margin-bottom: 20px;
}

.footer-top h2 {
  font-family: 'Montserrat', sans-serif;
  font-size: 30px;
  margin-top: 0px;
}

.footer-columns {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
}

.footer-col {
  flex: 1;
  padding: 5px;
}

.footer-col:nth-child(1) {
  text-align: left;
}

.footer-col:nth-child(2) {
  text-align: center;
}

.footer-col:nth-child(3) {
  text-align: right;
}


.footer-col ul {
  list-style: none;
  padding: 0;   
}

.footer-col li {
  margin-bottom: 10px;
}

.footer-col a {
  font-family: 'Lato', sans-serif;
  font-size: 16px;
  color: #fff;
  text-decoration: none;
  transition: color 0.3s;
}

.footer-col a:hover {
  color: #ff4081;
}

.footer p {
  font-family: 'Lato', sans-serif;
  font-size: 14px;
  color: #ccc;
  text-align: center;
  margin: 10px 0 0;
}

/* Адаптация для экранов с разрешением 932x430 */
@media (max-width: 932px) and (min-height: 430px) {
    h1 {
        font-size: 26px;
    }

    .movie-card h3 {
        font-size: 13px;
    }

    .auth-button, .admin-button button {
        width: 100%;
    }

    .container {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Мобильная адаптация */
@media (max-width: 768px) {
    h1 {
        font-size: 28px;
    }

    .auth-buttons {
        justify-content: center;
        padding-right: 0;
    }

    .search-bar {
        flex-direction: column;
        align-items: center;
    }

    .search-bar input, .search-bar button {
        width: 100%;
        margin: 5px 0;
    }

    nav ul {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
    }

    nav ul li {
        display: block;
        margin: 5px 0;
    }

    .container {
        grid-template-columns: repeat(2, 1fr);
    }

    .movie-card h3 {
        font-size: 14px;
    }
}

/* Адаптация для маленьких экранов (мобильные телефоны) */
@media (max-width: 480px) {
    h1 {
        font-size: 22px;
    }

    nav ul li a {
        padding: 5px 10px;
        font-size: 14px;
    }

    .container {
        grid-template-columns: 1fr;
    }

    .auth-buttons {
        flex-direction: column;
        align-items: center;
    }

    .auth-button, .admin-button button {
        padding: 8px;
        margin: 5px 0;
    }

    .movie-card {
        padding: 5px;
    }

    .movie-card h3 {
        font-size: 12px;
    }

    .search-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .search-bar input, .search-bar button {
        width: 100%;
    }
}