/* --- Global & Nav Styles --- */
body {
  background-color: #36393f;
  font-family: sans-serif;
  color: #dcddde;
  margin: 0;
}
.main-container {
  max-width: 1400px;
  margin: auto;
  padding: 20px;
}
.page-header {
  text-align: center;
}

/* --- Flavor Text Box Style --- */
.flavor-text-box { background-color: #2f3136; border: 1px solid #4f545c; border-radius: 8px; padding: 15px; margin: 20px auto; max-width: 600px; text-align: center; }
.flavor-text-box p { margin: 0; line-height: 1.6; font-size: 0.9em; color: #b9bbbe; }
.flavor-text-box strong { color: #ffffff; font-size: 1.1em; display: block; margin-bottom: 8px; }
.flavor-text-box .warning-text { color: #ffcc00; font-weight: bold; }

/* --- Leaderboard Styles --- */
.leaderboard-section { max-width: 800px; margin: 0 auto 30px auto; }
.leaderboard-toggle { width: 100%; padding: 12px 20px; font-size: 1.1em; font-weight: bold; color: #ffffff; background-color: #7289da; border: none; border-radius: 8px; cursor: pointer; transition: background-color 0.2s; text-align: center; }
.leaderboard-toggle:hover { background-color: #677bc4; }
.leaderboard-content { max-height: 0; overflow: hidden; background-color: #2f3136; border-radius: 0 0 8px 8px; transition: max-height 0.5s ease-in-out, padding 0.5s ease-in-out; padding: 0 20px; }
.leaderboard-content.visible { max-height: 1000px; padding: 15px 20px; border: 1px solid #4f545c; border-top: none; }
.leaderboard-item { display: grid; grid-template-columns: 30px 50px 1fr auto; gap: 15px; align-items: center; padding: 8px 0; border-bottom: 1px solid #40444b; }
.leaderboard-item:last-child { border-bottom: none; }
.leaderboard-rank { font-size: 1.1em; font-weight: bold; color: #b9bbbe; text-align: center; }
.leaderboard-image { width: 50px; height: 65px; object-fit: cover; border-radius: 4px; background-color: #202225; }
.leaderboard-details .skin-name { font-size: 1em; font-weight: bold; color: #ffffff; }
.leaderboard-details .char-name { font-size: 0.8em; color: #b9bbbe; }
.leaderboard-score { text-align: right; }
.leaderboard-score .avg-score { font-size: 1.1em; font-weight: bold; color: #ffc107; }
.leaderboard-score .total-votes { font-size: 0.75em; color: #8e9297; }

/* --- Filter Styles --- */
.filter-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  gap: 20px;
  padding: 20px;
  background-color: #2f3136;
  border-radius: 8px;
  margin-bottom: 30px;
}
.filter-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.filter-group label {
  font-weight: bold;
  color: #ffffff;
}
.filter-group select {
  font-size: 1em;
  padding: 8px;
  border-radius: 5px;
  border: 2px solid #2f3136;
  background-color: #40444b;
  color: #dcddde;
}

/* --- New Reusable Dropdown Styles --- */
.dropdown-container {
    position: relative;
    width: 200px; /* Adjust width as needed */
}
.dropdown-container input {
    font-size: 1em;
    padding: 8px;
    border-radius: 5px;
    border: 2px solid #2f3136;
    background-color: #40444b;
    color: #dcddde;
    width: 100%;
    box-sizing: border-box;
}
.dropdown-container input:focus {
    outline: none;
    border-color: #7289da;
}
.dropdown-content {
    display: none;
    position: absolute;
    background-color: #40444b;
    width: 100%;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 10; /* Ensure it appears above other elements */
    max-height: 250px;
    overflow-y: auto;
    border: 1px solid #2f3136;
    border-radius: 5px;
    margin-top: 4px;
}
.dropdown-content a {
    color: #dcddde;
    padding: 10px 12px;
    text-decoration: none;
    display: block;
    cursor: pointer;
}
.dropdown-content a:hover {
    background-color: #7289da;
    color: #ffffff;
}
.dropdown-content .no-results {
    color: #8e9297;
    padding: 10px 12px;
    font-style: italic;
    text-align: center;
}

.checkbox-group { display: flex; flex-wrap: wrap; gap: 10px; background-color: #40444b; padding: 8px 12px; border-radius: 5px; height: 100%; box-sizing: border-box; }
.checkbox-group label { display: flex; align-items: center; gap: 5px; font-weight: normal; cursor: pointer; }
.reset-button { padding: 8px 16px; font-size: 1em; font-weight: bold; color: #dcddde; background-color: #4f545c; border: 2px solid #2f3136; border-radius: 5px; cursor: pointer; transition: background-color 0.2s; height: 100%; }
.reset-button:hover { background-color: #5d636d; }

/* --- Poll Container --- */
.poll-container { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 20px; }
.poll-box { background-color: #2f3136; border-radius: 8px; overflow: hidden; border: 1px solid #40444b; display: flex; flex-direction: column; }
.poll-image { width: 100%; aspect-ratio: 3 / 4; object-fit: contain; background-color: #202225; }
.poll-info { padding: 12px; display: flex; flex-direction: column; flex-grow: 1; }
.poll-info h3 { margin: 0 0 4px 0; color: #ffffff; font-size: 1em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.poll-info .character-name { font-size: 0.8em; color: #b9bbbe; margin-bottom: 8px; }
.info-line { font-size: 0.8em; color: #b9bbbe; }
.info-line strong { color: #8e9297; }
.rating-area { margin-top: auto; border-top: 1px solid #40444b; padding-top: 10px; }
.vote-widget { display: flex; justify-content: center; align-items: center; gap: 8px; margin-bottom: 4px; }
.vote-label { font-size: 1em; font-weight: bold; color: #b9bbbe; position: relative; top: 3px; }
.star-rating { display: flex; flex-direction: row-reverse; justify-content: center; }
.star-rating input { display: none; }
.star-rating label { font-size: 2em; color: #444; cursor: pointer; transition: color 0.2s, text-shadow 0.2s; }
.star-rating:not(.voted):hover label:hover,
.star-rating:not(.voted):hover label:hover ~ label { color: #ffc107; }
.rating-area.voted .star-rating label { cursor: not-allowed; }
.rating-area.voted .star-rating input:checked ~ label { color: #03a9f4; }
.confirm-vote-message { text-align: center; font-size: 0.75em; color: #4caf50; margin-top: 4px; height: 0; opacity: 0; transition: all 0.3s; }
.rating-area.pending-vote .confirm-vote-message { height: 1em; opacity: 1; }
@keyframes pulse-glow { 0% { text-shadow: 0 0 4px #4caf50; } 50% { text-shadow: 0 0 12px #81c784, 0 0 20px #4caf50; } 100% { text-shadow: 0 0 4px #4caf50; } }
.rating-area.pending-vote .star-rating input:checked ~ label { color: #4caf50; animation: pulse-glow 1.5s ease-in-out infinite; }
@keyframes pop-effect { 0% { transform: scale(1); } 50% { transform: scale(1.15); } 100% { transform: scale(1); } }
.rating-area.voted-animation .star-rating { animation: pop-effect 0.3s ease-in-out; }
.poll-results { margin-top: 8px; text-align: center; }
.score-bar-visual { position: relative; display: inline-block; font-size: 1.4em; line-height: 1; color: #444; margin-bottom: 4px; }
.score-bar-foreground { position: absolute; top: 0; left: 0; white-space: nowrap; overflow: hidden; color: #ffc107; }
.score-bar-text { font-size: 0.9em; color: #b9bbbe; }
.score-bar-text strong { font-size: 1.1em; color: #ffffff; font-weight: bold; }
.loading-indicator, .no-results { color: #b9bbbe; text-align: center; grid-column: 1 / -1; font-size: 1.2em; padding: 40px; }

/* --- Skeleton Loader Styles --- */
.skeleton-card {
    background-color: #2f3136;
    border-radius: 8px;
    border: 1px solid #40444b;
    display: flex;
    flex-direction: column;
}

.skeleton-element {
    background: linear-gradient(90deg, #40444b 25%, #4f545c 50%, #40444b 75%);
    background-size: 200% 100%;
    border-radius: 4px;
    animation: shimmer 1.5s infinite linear;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-card .skeleton-image {
    width: 100%;
    aspect-ratio: 3 / 4;
    border-radius: 8px 8px 0 0;
}

.skeleton-card .skeleton-info {
    padding: 12px;
}

.skeleton-card .skeleton-line {
    height: 1em;
    margin-bottom: 8px;
}

.skeleton-card .skeleton-line.short {
    width: 60%;
}

/* --- Responsive Styles for Mobile --- */
@media (max-width: 768px) {
  html {
    font-size: 12px;
  }
}