* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: #1a1a1a;
    color: #fff;
    font-family: Arial, sans-serif;
    overflow-x: hidden;
}

.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background-color: #333;
    padding: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
}

.filter-container {
    display: flex;
    gap: 10px;
}

.filter-container select {
    background-color: #555;
    color: #fff;
    border: none;
    padding: 8px;
    border-radius: 5px;
    cursor: pointer;
}

.nav-buttons {
    display: flex;
    gap: 10px;
    align-items: center;
}

.nav-btn {
    background-color: #555;
    color: #fff;
    border: none;
    padding: 8px 15px;
    cursor: pointer;
    font-size: 14px;
    border-radius: 5px;
    transition: background-color 0.3s;
}

.nav-btn:hover {
    background-color: #777;
}

.auth-buttons {
    display: flex;
    gap: 5px;
}

.vote-btn {
    position: fixed;
    top: calc(70px + 2px);
    left: 50%;
    transform: translateX(-50%);
    background-color: #ff4444;
    color: #fff;
    border: none;
    padding: 15px 30px;
    font-size: 18px;
    font-weight: bold;
    border-radius: 10px;
    cursor: pointer;
    z-index: 1000;
    transition: background-color 0.3s;
}

.vote-btn:hover {
    background-color: #cc3333;
}

.admin-section, .profile-section {
    display: none;
    padding: 70px 10px;
    text-align: center;
    min-height: 100vh;
    visibility: hidden;
}

.admin-section.active, .profile-section.active {
    display: block !important;
    visibility: visible !important;
    z-index: 100;
}

.admin-section table, .profile-section table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.admin-section th, .admin-section td, .profile-section th, .profile-section td {
    border: 1px solid #555;
    padding: 10px;
}

.sortable {
    cursor: pointer;
}

.sortable:hover {
    background-color: #444;
}

.pagination {
    margin: 20px 0;
    display: flex;
    justify-content: center;
    gap: 10px;
}

#image-search {
    padding: 10px;
    border: none;
    border-radius: 5px;
    margin-bottom: 10px;
    width: 100%;
    max-width: 300px;
}

.category-management, .category-settings, .duel-category-settings {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin: 20px 0;
}

.category-management div, .category-settings select, .duel-category-settings select {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.duel-category-settings select[multiple] {
    height: 150px;
    width: 200px;
}

#voting-history-message {
    margin: 20px 0;
    font-size: 16px;
    color: #888;
}

.gallery-section {
    display: none;
    padding: 120px 10px 10px;
}

.gallery-section.active {
    display: block;
}

.gallery {
    column-count: 2;
    column-gap: 10px;
    width: 100%;
}

.gallery-image-container, .gallery-ad-container {
    position: relative;
    break-inside: avoid;
    display: inline-block;
    width: 100%;
    margin-bottom: 5px;
}
.gallery-ad-container{
  width: 100%;
  padding-bottom: 74.25%; /* 16:9 aspect ratio (9/16 = 0.5625) */
  height: 0;
  overflow: hidden;
  border-radius: 5px;
}
.gallery-ad-container iframe{
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}
.gallery img {
    width: 100%;
    border-radius: 5px;
    cursor: pointer;
}

.gallery img:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(255, 68, 68, 0.7);
}

.image-tooltip {
    display: none;
    position: absolute;
    top: 66%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.5);
    color: #fff;
    padding: 10px;
    border-radius: 5px;
    font-size: 14px;
    white-space: pre;
    z-index: 100;
}

.gallery-image-container:hover .image-tooltip {
    display: block;
}

.vote-section {
    display: none;
    min-height: 100vh;
    padding: 70px 10px 10px;
}

.vote-section.active {
    display: block;
}

.duel-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 100px);
    gap: 10px;
    flex-wrap: wrap;
}

.image-container {
    position: relative;
    flex: 1;
    max-width: 45%;
    min-width: 250px;
    text-align: center;
    cursor: pointer;
}

.image-container img {
    width: 100%;
    height: auto;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 10px;
    transition: transform 0.3s, box-shadow 0.3s, opacity 0.3s;
}

.image-container:hover img {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(255, 68, 68, 0.7);
}

.voted img {
    animation: votedAnimation 0.5s ease-in-out;
}

.voted-none {
    animation: noneVotedAnimation 0.5s ease-in-out;
}

@keyframes votedAnimation {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.8; }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes noneVotedAnimation {
    0% { background-color: #555; box-shadow: 0 0 0 rgba(255, 68, 68, 0); }
    50% { background-color: #777; box-shadow: 0 0 10px rgba(255, 68, 68, 0.7); }
    100% { background-color: #555; box-shadow: 0 0 0 rgba(255, 68, 68, 0); }
}

.none-btn {
    position: absolute;
    top: calc(70px + 2px);
    left: 50%;
    transform: translateX(-50%);
    background-color: #555;
    color: #fff;
    border: none;
    padding: 15px 40px;
    font-size: 20px;
    border-radius: 8px;
    cursor: pointer;
    z-index: 1000;
    transition: background-color 0.3s;
}

.none-btn:hover {
    background-color: #777;
}

.loader {
    text-align: center;
    padding: 20px;
    font-size: 16px;
    color: #888;
    display: none;
}

.gallery-section .loader {
    position: relative;
}
.vote-section .loader{
    position: fixed;
    width: 100%;
    bottom: 10px
}
.gallery-section .loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    background: rgba(0,0,0,.8);
    display: block;
}
.gallery-section .loader:before{
    display: inline-block;
    vertical-align: middle;
    width: 0;
    height: 100%;
    content: '';
}
.load-inner{
    display: inline-block;
    vertical-align: middle;
    background: rgba(0,0,0,.8);
    width: 60px;
    height: 60px;
    padding-top: 6px;
    border-radius: 100%;
}
.load-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: inline-block;
  position: relative;
  border: 3px solid;
  border-color: #FFF #FFF transparent;
  box-sizing: border-box;
  animation: rotation 1s linear infinite;
}
.load-icon::after {
  content: '';  
  box-sizing: border-box;
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  margin: auto;
  border: 3px solid;
  border-color: transparent #FF3D00 #FF3D00;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  animation: rotationBack 0.5s linear infinite;
  transform-origin: center center;
}

@keyframes rotation {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
} 
    
@keyframes rotationBack {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(-360deg);
  }
}
.keywords-popup{
    position: absolute;
    left: 0;
    bottom: 0;
    font-size: 14px;
    color: #fff;
    padding: 10px;
    text-align: center;
    background: rgba(0,0,0,.5);
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.modal-content {
    background-color: #333;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    max-width: 600px;
    width: 90%;
}

.modal-content p {
    white-space: normal;
    margin: 20px 0;
    font-size: 16px;
    line-height: 1.5;
}

.modal-content input, .modal-content textarea {
    display: block;
    width: 100%;
    margin: 10px 0;
    padding: 10px;
    border: none;
    border-radius: 5px;
}

.modal-btn {
    background-color: #ff4444;
    color: #fff;
    border: none;
    padding: 10px 20px;
    margin: 5px;
    border-radius: 5px;
    cursor: pointer;
}

.modal-btn:hover {
    background-color: #cc3333;
}

.celebration, .milestone {
    animation: celebrate 0.5s ease-in-out;
}

.about {
    max-width: 800px;
    text-align: left;
    animation: celebrate 0.5s ease-in-out;
}

@keyframes celebrate {
    0% { transform: scale(0); }
    100% { transform: scale(1); }
}

.image-popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    justify-content: center;
    align-items: center;
    z-index: 2000;
    flex-direction: column;
    gap: 10px;
}

.image-popup span{
    position: relative;
    display: inline-block;
}
.image-popup img {
    max-width: 90%;
    max-height: 90vh;
    object-fit: contain;
}

#ads-code-display a,
#ads-code-display a:visited,
#ads-code-display a:active {
    color: #FFFA99 !important;
    font-weight: bold !important;
}

@media (min-width: 600px) {
    .gallery {
        column-count: 2;
    }
}

@media (min-width: 900px) {
    .gallery {
        column-count: 3;
    }
}

@media (min-width: 1200px) {
    .gallery {
        column-count: 4; */
    }
}

@media (max-width: 600px) {
    .duel-container {
      align-items: flex-start;
        padding: 130px 10px 0;
    }

    .image-container {
      display: inline-block;
      width: 50%;
        max-width: 50%;
        margin-bottom: 20px;
        min-width: inherit;
    }

    .image-container img {
        max-height: 40vh;
    }

    .image-container:hover img {
        transform: scale(1.03);
    }

    .navbar {
        flex-direction: column;
        gap: 10px;
    }

    .category-management, .category-settings, .duel-category-settings {
        flex-direction: column;
    }

    .none-btn {
        top: calc(100px + 2px);
    }
    .vote-btn{display: none}
    .nav-btn:nth-child(2){background-color: #f00}
    .none-btn{top: 145px;font-size: 4vw;padding: 8px 25px;}
    .modal-content.about{height: 70vh;overflow: auto;}
    .modal-content.about::-webkit-scrollbar-track {
      -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
      border-radius: 10px;
      background-color: #eee;
    }
    .modal-content.about::-webkit-scrollbar {
      width: 8px;
      background-color: rgba(0, 0, 0, 0.5);
    }
    .modal-content.about::-webkit-scrollbar-thumb {
      border-radius: 10px;
      -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
      background-color: #999;
    }
    .modal-content.about h2{font-size: 6vw;}
    .modal-content.about p{font-size: 4vw;}
    .profile-section.active, .gallery-section{padding-top: 135px!important;}
    .duel-category-settings select[multiple]{width: 100%;}
}


