/* General Styles */
:root {
    /* Make blue tones even brighter */
    --main-bg-color: #0a348f; /* Even brighter blue background */
    --secondary-bg-color: #0d4fbf; /* More vibrant secondary blue */
    --accent-color: #4db8ff; /* Highly vibrant bright blue accent */
    --accent-gradient: linear-gradient(45deg, #4db8ff, #0078ff); /* More vibrant blue gradient */
    --error-gradient: linear-gradient(45deg, #ff5252, #ff0000); /* Brighter red for errors */
    --success-gradient: linear-gradient(45deg, #39ff87, #00ff62); /* Brighter green for success */
    --text-color: #ffffff; 
    --header-color: #ffffff;
    --border-radius: 8px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Base styles */
body {
    font-family: 'Arial', sans-serif;
    /* FIX: Change background to use the purple variable instead of black */
    background-color: var(--main-bg-color);
    /* Update gradient to even brighter blue tones */
    background-image: linear-gradient(to bottom right, #0a348f, #0d4fbf);
    background-attachment: fixed;
    color: #ffffff;
    margin: 0;
    padding: 0;
}

.wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    padding: 20px;
}

.container {
    max-width: 650px;
    width: 100%;
    margin: 0 auto;
    padding: 2rem;
}

/* Loading overlay */
#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--main-bg-color);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 1;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loading-container {
    text-align: center;
}

#loading-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Remove fallback loader styles that might be interfering */
/* Main content styles */
a {
    text-decoration: none;
    color: var(--text-color);
}

ul {
    list-style: none;
}

h1, h2, h3 {
    color: var(--header-color);
    margin-bottom: 1rem;
}

h1 {
    color: #f8f8f8;
    margin-bottom: 0.5rem;
}

section {
    padding: 4rem 0;
}

/* Header */
header {
    background-color: rgba(26, 26, 46, 0.8);
    backdrop-filter: blur(5px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    position: sticky;
    top: 0;
    z-index: 100;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
}

.logo h1 {
    font-size: 1.8rem;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 0;
}

nav ul {
    display: flex;
}

nav li {
    margin-left: 1.5rem;
}

nav a {
    font-weight: 500;
    transition: all 0.3s ease;
}

nav a:hover {
    color: var(--accent-color);
}

/* Main content */
main {
    width: 100%;
}

/* Generator Section */
#generator {
    text-align: center;
    width: 100%;
}

.generator-box {
    background-color: #1a3570; /* Brighter, more vibrant background */
    border-radius: 10px;
    padding: 2rem;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
    text-align: center;
    position: relative;
    /* FIX: Ensure the border is visible by adding overflow property */
    overflow: visible;
    transition: all 0.3s ease; /* Add transition for smooth color change */
}

.generator-box::before {
    content: '';
    position: absolute;
    inset: -2px; /* Creates border effect outside the box */
    background: var(--accent-gradient);
    border-radius: calc(var(--border-radius) + 2px);
    z-index: -1;
    /* FIX: Ensure the gradient border is visible */
    opacity: 1;
    transition: background 0.3s ease; /* Add transition for gradient change */
}

/* Add error state class */
.generator-box.error::before {
    background: var(--error-gradient);
}

/* Add success state class */
.generator-box.success::before {
    background: var(--success-gradient);
}

.subtitle {
    color: #c0c0c0; /* Brighter text color for better readability */
    margin-bottom: 2rem;
}

.result-box {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    margin: 1.5rem 0;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    min-height: 150px;
}

#godResult {
    text-align: center;
    width: 100%;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

#godName {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    color: #ffffff;
}

#godPantheon {
    font-size: 1.2rem;
    color: #d0d0d0;
}

/* Animation container */
.animation-container {
    display: flex;
    justify-content: center;
    margin-bottom: 10px;
    filter: drop-shadow(0 0 8px rgba(77, 184, 255, 0.5)); /* Add subtle glow effect */
}

/* Add hover effect for animation container */
.animation-container:hover {
    filter: drop-shadow(0 0 12px rgba(77, 184, 255, 0.7));
    transform: scale(1.05);
    transition: all 0.3s ease;
}

/* Permission button container */
.permission-button-container {
    margin-top: 1.5rem;
    text-align: center;
}

/* Style the permission button */
.btn-allow-messages {
    background-color: var(--accent-color);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 0.85rem 1.5rem;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(77, 184, 255, 0.5);
    gap: 0.5rem;
    font-weight: 500;
}

.btn-allow-messages:hover {
    background-color: #66c2ff;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(77, 184, 255, 0.6);
}

.btn-allow-messages:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(77, 184, 255, 0.4);
}

.btn-allow-messages i {
    font-size: 1.1rem;
}

/* Optional: add styles to show when permission is already granted */
.btn-allow-messages.granted {
    background-color: var(--success-gradient);
    pointer-events: none;
    opacity: 0.8;
}

/* Stats Section Styles */
#stats {
    text-align: center;
    width: 100%;
}

.stats-box {
    padding: 2.5rem;
}

.stats-container {
    margin: 2rem 0;
}

.stat-item {
    margin-bottom: 2rem;
}

.stat-label {
    font-size: 1.2rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent-color);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.stat-value-container {
    position: relative;
    margin: 1rem 0;
    padding: 1rem;
}

.stat-value {
    font-size: 5rem;
    font-weight: 700;
    color: #ffffff;
    text-shadow: 0 0 10px rgba(77, 184, 255, 0.7);
    display: inline-block;
    position: relative;
}

.counter-animation {
    display: inline-block;
    min-width: 2ch;
}

.stat-description {
    font-size: 1rem;
    color: #c0c0c0;
    margin-top: 0.5rem;
}

.stats-refresh {
    margin-top: 2rem;
    text-align: center;
}

.btn-refresh {
    background-color: rgba(77, 184, 255, 0.2);
    color: #fff;
    border: 1px solid rgba(77, 184, 255, 0.4);
    border-radius: 8px;
    padding: 0.75rem 1.25rem;
    font-size: 0.9rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    gap: 0.5rem;
}

.btn-refresh:hover {
    background-color: rgba(77, 184, 255, 0.3);
    border-color: rgba(77, 184, 255, 0.6);
}

.btn-refresh.loading i {
    animation: spin 1s linear infinite;
}

.last-updated {
    font-size: 0.8rem;
    color: #a0a0a0;
    margin-top: 0.75rem;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Responsive styles for stats page */
@media (max-width: 600px) {
    .stat-value {
        font-size: 4rem;
    }
    
    .stats-box {
        padding: 1.5rem;
    }
}

/* Responsive Design */
@media (max-width: 900px) {
    .about-content {
        grid-template-columns: 1fr;
    }
    
    .features-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .about-image {
        order: -1;
    }
}

@media (max-width: 600px) {
    header .container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    footer .container {
        flex-direction: column;
        gap: 1rem;
    }
    
    #godName {
        font-size: 2rem;
    }

    .generator-box {
        padding: 2rem 1rem;
    }
    
    .btn-generate {
        padding: 0.8rem 1.5rem;
    }
}

/* Button styles might need updating if they use hardcoded purple values */
.btn-generate {
    background-color: #4db8ff; /* Even brighter blue button */
    /* ...existing code... */
}

.btn-generate:hover {
    background-color: #66c2ff; /* Super bright blue on hover */
    /* ...existing code... */
}

/* Any other elements using specific purple colors */
.feature i {
    font-size: 2.5rem;
    color: var(--accent-color); /* Use variable instead of hardcoded color */
    margin-bottom: 1rem;
}

/* Helper class for centering content */
.centered {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 80vh;
    width: 100%;
}

/* Winners List Styles */
.winners-container {
    max-height: 300px;
    overflow-y: auto;
    margin: 1.5rem 0;
    padding: 0.5rem;
    border-radius: var(--border-radius);
    background-color: rgba(255, 255, 255, 0.1);
    scrollbar-width: thin;
    scrollbar-color: var(--accent-color) rgba(255, 255, 255, 0.05);
}

.winners-container::-webkit-scrollbar {
    width: 6px;
}

.winners-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.winners-container::-webkit-scrollbar-thumb {
    background-color: var(--accent-color);
    border-radius: 3px;
}

.winner-item {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: background-color 0.2s ease;
    position: relative;
}

.winner-position {
    font-size: 1rem;
    font-weight: 700;
    color: var(--accent-color);
    margin-right: 0.75rem;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(77, 184, 255, 0.15);
    border-radius: 50%; /* Perfect circle */
    width: 28px; /* Fixed width */
    height: 28px; /* Must be identical to width */
    min-width: 28px; /* Force minimum width */
    min-height: 28px; /* Force minimum height */
    max-width: 28px; /* Force maximum width */
    max-height: 28px; /* Force maximum height */
    aspect-ratio: 1; /* Force 1:1 aspect ratio */
    box-shadow: 0 0 6px rgba(77, 184, 255, 0.2);
    padding: 0; /* Remove any padding that could distort shape */
    flex-shrink: 0; /* Prevent flexbox from squishing */
}

/* Add special styling for top 3 positions */
.winner-item:nth-child(1) .winner-position {
    background: linear-gradient(45deg, #ffd700, #ffcc00); /* Gold */
    color: #333;
    width: 30px; /* Fixed width */
    height: 30px; /* Must match width */
    min-width: 30px; /* Force minimum width */
    min-height: 30px; /* Force minimum height */
    max-width: 30px; /* Force maximum width */
    max-height: 30px; /* Force maximum height */
}

.winner-item:nth-child(2) .winner-position {
    background: linear-gradient(45deg, #c0c0c0, #e0e0e0); /* Silver */
    color: #333;
}

.winner-item:nth-child(3) .winner-position {
    background: linear-gradient(45deg, #cd7f32, #d3924b); /* Bronze */
    color: #333;
}

.winner-item:last-child {
    border-bottom: none;
}

.winner-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

/* Winner Avatar Styles with Loading State */
.winner-avatar-container {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 1rem;
    box-shadow: 0 0 8px rgba(77, 184, 255, 0.4);
    overflow: hidden;
    flex-shrink: 0; /* Prevent flexbox from squishing */
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid var(--accent-color);
}

.winner-avatar-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(110deg, rgba(255,255,255,0.05) 8%, rgba(255,255,255,0.15) 18%, rgba(255,255,255,0.05) 33%);
    background-size: 200% 100%;
    animation: shine 1.5s linear infinite;
    border-radius: 50%;
}

.winner-avatar {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 50%;
}

.winner-avatar.loaded {
    opacity: 1;
}

.winner-avatar.error {
    padding: 4px;
    background-color: rgba(255, 255, 255, 0.1);
}

@keyframes shine {
    to {
        background-position: -200% 0;
    }
}

.winner-name {
    font-size: 1rem;
    font-weight: 500;
}

.winners-title {
    margin: 1rem 0;
    color: var(--accent-color);
    font-size: 1.2rem;
    font-weight: 600;
}

.winners-count {
    display: block;
    font-size: 0.9rem;
    color: #c0c0c0;
    margin-bottom: 1rem;
}