/* General body styling */
body {
    font-family: Arial, sans-serif;
    background-color: #f4f4f9;
    margin: 0;
    padding: 20px;
}

/* Title Style */
.ranking-page-title h1 {
    text-align: center;
    font-size: 36px;
    color: #333;
    margin-bottom: 40px;
}

/* Vertical Layout */
.ranking-grid {
    display: flex;
    flex-direction: column;  /* Stack items vertically */
    align-items: center;     /* Center align items horizontally */
    gap: 20px;
}

/* Item Box Style */
.ranking-item {
    background-color: #fff;
    border-radius: 15px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    padding: 20px;
    display: flex;
    align-items: center;      /* Align image and text vertically */
    gap: 20px;                /* Space between the image and text */
    width: 100%;               /* Adjust to full width on small screens */
    max-width: 900px;         /* Set a max-width to avoid too large boxes */
    margin-bottom: 20px;      /* Space between items */
    position: relative;       /* To allow absolute positioning of the rank number */
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
    cursor: pointer;         /* Make it look clickable */
    flex-wrap: nowrap;        /* Prevent wrapping of content */
}

/* Hover Effects */
.ranking-item:hover {
    transform: translateY(-10px); /* Slight lift effect */
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2); /* Larger shadow for hover */
    background-color: #f7f7f7; /* Subtle background color change on hover */
}

/* Rank Number (Positioned on top-left of the image) */
.rank-number {
    font-size: 36px;
    color: #fff;
    background-color: #f39c12; /* Default gold */
    border-radius: 8px;        /* Change to square */
    padding: 12px;
    position: absolute;
    top: 10px;
    left: 10px;
    font-weight: bold;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2); /* Subtle shadow for elegance */
    width: 50px;
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Gold for First Place */
.rank-number.first {
    background-color: #f39c12;  /* Gold */
}

/* Silver for Second Place */
.rank-number.second {
    background-color: #bdc3c7;  /* Silver */
}

/* Elegant Blue for Remaining Places */
.rank-number.remaining {
    background-color: #5dade2; /* Light Elegant Blue */
}

/* Item Image */
/* Item Image */
.ranking-item img {
    width: 230px;           /* Fixed width of 230px */
    height: 230px;          /* Fixed height of 230px */
    object-fit: cover;      /* Maintain aspect ratio, cover the area */
    border-radius: 8px;
    transition: transform 0.3s ease;
    flex-shrink: 0;         /* Prevent image from shrinking */
}


/* Image Hover Effect */
.ranking-item:hover img {
    transform: scale(1.1);    /* Slight zoom effect on hover */
}

/* Item Text Section */
.item-text {
    flex-grow: 1;            /* Let the text section take up the remaining space */
}

/* Item Name */
.item-name {
    font-size: 24px;
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
    transition: color 0.3s ease;
}

/* Item Name Hover Effect */
.ranking-item:hover .item-name {
    color: #3498db;          /* Change text color on hover */
}

/* Description */
.description {
    font-size: 16px;
    color: #777;
    margin-bottom: 10px;
    transition: color 0.3s ease;
}

/* Description Hover Effect */
.ranking-item:hover .description {
    color: #555;             /* Darken the description text on hover */
}

/* Vote Buttons Container */
.vote-buttons {
    display: flex;
    justify-content: center;
    gap: 30px;               /* Increased space between like and dislike containers */
    align-items: center;
    flex-direction: row;     /* Place them side by side */
}

/* Unified Vote Button Styling */
.vote-buttons button {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f7f7f7; /* Light background for the button */
    border: 2px solid #3498db; /* Default border for both buttons */
    color: #3498db;
    padding: 10px;
    border-radius: 8px; /* Rounded corners for button */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); /* Subtle shadow */
    cursor: pointer;
    width: 50px; /* Fixed width */
    height: 50px; /* Fixed height */
    text-align: center;
    transition: background-color 0.3s ease, transform 0.3s ease, color 0.3s ease;
    font-size: 18px; /* Font size for icon */
}

/* Upvote Button Styling */
.vote-buttons .upvote {
    border-color: #3498db;
    color: #3498db;
}

/* Downvote Button Styling */
.vote-buttons .downvote {
    border-color: #e74c3c;
    color: #e74c3c;
}

/* Hover Effects */
.vote-buttons .upvote:hover {
    background-color: #3498db;
    color: #fff;
    transform: scale(1.05);
}

.vote-buttons .downvote:hover {
    background-color: #e74c3c;
    color: #fff;
    transform: scale(1.05);
}

/* Active State */
.vote-buttons .upvote.active {
    background-color: #3498db;
    color: #fff;
}

.vote-buttons .downvote.active {
    background-color: #e74c3c;
    color: #fff;
}

/* Vote Count Styling */
.vote-buttons .like-count,
.vote-buttons .dislike-count {
    font-size: 14px; /* Smaller size for the count */
    color: #333;
    margin-left: 8px; /* Space between the button and count */
    display: inline-block; /* Ensure the count stays beside the button */
    vertical-align: middle; /* Align with the center of the button */
}

/* Loader inside Buttons */
.vote-buttons .loader {
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
    display: none; /* Hidden by default */
}

/* Keyframes for Loader */
@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Mobile Responsive Adjustments */
@media (max-width: 768px) {
    .vote-buttons button {
        width: 45px;
        height: 45px;
        font-size: 16px;
    }
    .vote-buttons .like-count,
    .vote-buttons .dislike-count {
        font-size: 12px;
        margin-left: 6px;
    }
}

@media (max-width: 480px) {
    .vote-buttons button {
        width: 40px;
        height: 40px;
        font-size: 14px;
    }
    .vote-buttons .like-count,
    .vote-buttons .dislike-count {
        font-size: 10px;
        margin-left: 4px;
    }
}


.loader.show {
    display: inline-block; /* Show the loader when the 'show' class is added */
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.hidden {
    display: none;
}
.total-votes {
    font-weight: bold;
    margin-bottom: 10px;
}

/* Total Vote Count Styling */
.total-votes {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    display: flex;
    align-items: center;
    gap: 5px;
    background-color: #f0f4f8;
    border-radius: 25px;
    padding: 8px 15px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, background-color 0.3s ease;
}

/* Hover Effect for Total Votes */
.total-votes:hover {
    transform: scale(1.05);  /* Slightly enlarge on hover */
    background-color: #3498db; /* Change background color on hover */
    color: #fff;  /* Text color change on hover */
}

/* Animation for Count Change */
.total-votes span {
    transition: transform 0.3s ease-in-out;
}

/* Animated Count Number */
.total-votes span.update {
    transform: scale(1.2);  /* Slightly enlarge when count updates */
}


.total-votes {
    outline: 1px solid red; /* Debug outline */
}

.total-votes:hover {
    transform: none;
    background-color: inherit;
    color: inherit;
}


