@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700&display=swap');

body {
    margin: 0;
    font-family: 'Orbitron', sans-serif;
    background-color: #001f3f;
    color: #ffffff;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

nav {
    flex-shrink: 0; /* Prevent navbar from shrinking */
}

nav ul {
    list-style-type: none;
    margin: 0;
    padding: 0;
    background-color: #023;
    display: flex;
    align-items: center;
}

nav ul li a {
    display: block;
    color: white;
    text-align: center;
    padding: 14px 16px;
    text-decoration: none;
}

nav ul li a:hover {
    text-decoration: underline;
    /* border-bottom: 2px solid #000098; */
    background-color: #111;
}
.menu-right {
    margin-left: auto;
}

.menu-right ul {
    background: none;
    display: flex;
    margin: 0;
    padding: 0;
}

.menu-right li {
    margin: 0;
    padding: 0;
}

nav ul li.right {
    margin-left: auto;
    right: 5px; 
}

main {
    flex-grow: 1; /* Allow main content to grow and fill space */
    background-image: url('../img/home_background.jpg'); 
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    display: flex; /* Use flexbox for main content */
    flex-direction: row; /* Display children horizontally */
    gap: 2rem;
    padding: 1rem;
}

.nav-link {
    background: none;
    border: none;
    color: white;
    text-align: center;
    padding: 14px 16px;
    text-decoration: none;
    cursor: pointer;
    display: block;
    font-family: 'Orbitron', sans-serif;
}

/* The container <li> - needed to position the dropdown content */
.dropdown {
    position: relative;
    display: inline-block;
}

/* Dropdown Content (Hidden by Default) */
.dropdown-content {
    display: none;
    position: absolute;
    background-color: #333; /* Match nav background */
    min-width: 160px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 100; /* Increased z-index */
    right: 0; /* Align to the right */
}

/* Links inside the dropdown */
.dropdown-content a,
.dropdown-content .logout-button {
    color: white;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    text-align: left;
    background: none;
    border: none;
    width: 100%;
    cursor: pointer;
    font-family: 'Orbitron', sans-serif; /* Ensure font consistency */
    font-size: inherit; /* Inherit font size */
}

/* Change color of dropdown links on hover */
.dropdown-content a:hover,
.dropdown-content .logout-button:hover {
    background-color: #111;
}

/* Show the dropdown menu on hover */
.dropdown:hover .dropdown-content {
    display: block;
} 

/********************* Homepage Leaderboard */
.main-content {
    flex: 1;
    background: rgba(37, 37, 37, 0.5);
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.leaderboard-sidebar {
    width: 400px;
    background: rgba(37, 37, 37, 0.5);
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.leaderboard-tabs {
    display: flex;
    margin-bottom: 1rem;
    border-bottom: 1px solid #ddd;
}

.tab-button {
    flex: 1;
    background: none;
    border: none;
    cursor: pointer;
    font-weight: bold;
    color: white;
}

.tab-button.active {
    border-bottom: 3px solid #007bff;
    color: #007bff;
}

/* Home page leaderboard specific styles */
.home-leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.home-leaderboard-table th,
.home-leaderboard-table td {
    padding: 0.5rem;
    text-align: left;
    border-bottom: 1px solid #ddd;
    background: rgba(200, 200, 200, 0.7);
}

.home-leaderboard-table th {
    background: rgba(200, 200, 200, 0.7);
    font-weight: bold;
}

.home-current-user {
    color: #0515f7;
}

.game-modes {
    margin-bottom: 2rem;
}

.mode-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.btn {
    padding: 0.5rem 1rem;
    border-radius: 4px;
    text-decoration: none;
    font-weight: bold;
}

.btn-primary {
    background: #007bff;
    color: white;
}

.btn-primary:hover {
    background: #0056b3;
}

/****************** Celebration Page Styles ************/
.celebration-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
    text-align: center;
}

.celebration-title {
    font-size: 3rem;
    color: gold;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    margin-bottom: 2rem;
}

.user-achievement {
    background-color:  rgba(37, 37, 37, 0.5);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.highlight {
    font-size: 1.5rem;
    font-weight: bold;
    color: gold;
}

/* Celebration page leaderboard styles */
.celebration-leaderboard {
    margin-bottom: 2rem;
    background-color:  rgba(37, 37, 37, 0.5);
}

.celebration-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
}

.celebration-table th,
.celebration-table td {
    padding: 0.75rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.celebration-table th {
    background-color: rgba(0,0,0,0.2);
}

.celebration-user-row {
    background-color: rgba(255,215,0,0.1);
    font-weight: bold;
}

.new-high-score {
    border: 2px solid #4CAF50;
}

.action-buttons {
    margin-top: 2rem;
}

/* Common button styles that can be shared */
.btn {
    display: inline-block;
    padding: 0.5rem 1.5rem;
    margin: 0 0.5rem;
    border-radius: 4px;
    text-decoration: none;
    font-weight: bold;
}

.btn-primary {
    background-color: #4CAF50;
    color: white;
}

.btn-secondary {
    background-color: #607D8B;
    color: white;
}

/* Django messages styling */
.messages {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
    width: 100%;
    max-width: 500px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none; /* Allow clicks to pass through the container */
}

.message {
    padding: 15px 50px 15px 20px;
    border-radius: 8px;
    color: white;
    font-weight: bold;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    position: relative;
    pointer-events: auto; /* Make the message itself clickable */
    animation: message-fade-in 0.3s ease-in-out;
    background-color: rgba(37, 37, 37, 0.9);
}

.message-success {
    border: 2px solid rgba(76, 175, 80, 0.9);
}

.message-error {
    border: 2px solid rgba(244, 67, 54, 0.9);
}

.message-info, .message-debug {
    border: 2px solid rgba(33, 150, 243, 0.9);
}

.message-warning {
    border: 2px solid rgba(255, 152, 0, 0.9);
}

.message .close-btn {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s;
}

.message .close-btn:hover {
    background-color: rgba(255, 255, 255, 0.5);
}

.message .close-btn::before, 
.message .close-btn::after {
    content: '';
    position: absolute;
    width: 12px;
    height: 2px;
    background-color: white;
    border-radius: 1px;
}

.message .close-btn::before {
    transform: rotate(45deg);
}

.message .close-btn::after {
    transform: rotate(-45deg);
}

@keyframes message-fade-in {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}