/* Wager Navigation Bar Styling */

:root {
  --primary-color: #50C878;
  --primary-dark: #3ca95f;
  --primary-light: #e0f5e9;
  --text-color: #333;
  --light-text: #555;
  --border-color: #e0e0e0;
  --hover-bg: #f5f5f5;
  --active-bg: #e0f5e9;
  --transition-speed: 0.2s;
}

/* Navigation Container */
.nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 20px;
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
  margin-bottom: 25px;
  position: relative;
}

/* Navigation Elements */
.nav-element {
  margin: 0;
  position: relative;
}

.nav-element a {
  display: inline-block;
  padding: 8px 16px;
  color: var(--text-color);
  text-decoration: none;
  font-weight: 500;
  border-radius: 6px;
  transition: all var(--transition-speed) ease;
}

.nav-element a:hover {
  background-color: var(--hover-bg);
  color: var(--primary-color);
}

/* Active state */
.nav-element a.active {
  background-color: var(--active-bg);
  color: var(--primary-dark);
}

/* Style for active based on current URL */
.nav-element a[href="{% url 'wagers:new-wager' %}"].active,
.nav-element a[href="{% url 'wagers:stats' %}"].active,
.nav-element a[href="{% url 'wagers:blogpost_list' %}"].active,
.nav-element a[href="{% url 'wagers:about' %}"].active,
.nav-element a[href="{% url 'login' %}"].active {
  background-color: var(--active-bg);
  color: var(--primary-dark);
  position: relative;
}

/* Active state indicator */
.nav-element a.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 16px;
  right: 16px;
  height: 3px;
  background-color: var(--primary-color);
  border-radius: 1.5px;
}

/* User Controls */
.user-controls {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 15px;
}

.username {
  color: var(--text-color);
  font-weight: 500;
  font-size: 14px;
}

/* Logout Button */
.nav form {
  margin: 0;
}

.nav button[type="submit"] {
  background-color: transparent;
  color: var(--light-text);
  border: 1px solid var(--border-color);
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  transition: all var(--transition-speed) ease;
}

.nav button[type="submit"]:hover {
  background-color: #f5f5f5;
  color: #e74c3c; /* Red color for logout */
  border-color: #e74c3c;
}

/* Push authentication to the right */
.login-link {
  margin-left: auto;
}

/* Icons in nav */
.nav-icon {
  margin-right: 6px;
  font-style: normal;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .nav {
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 10px;
  }
  
  .nav-element {
    width: 100%;
    border-bottom: 1px solid var(--border-color);
  }
  
  .nav-element:last-child {
    border-bottom: none;
  }
  
  .nav-element a {
    width: 100%;
    padding: 12px 10px;
    border-radius: 0;
  }
  
  .nav form {
    width: 100%;
    margin: 10px 0 0 0;
  }
  
  .nav button[type="submit"] {
    width: 100%;
    padding: 12px 10px;
  }
  
  /* Change active indicator for mobile */
  .nav-element a.active::after {
    left: 0;
    right: auto;
    bottom: auto;
    top: 0;
    width: 4px;
    height: 100%;
  }
  
  .user-controls {
    flex-direction: column;
    width: 100%;
    gap: 10px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border-color);
  }
}

/* Add a subtle animation for smoother interactions */
@keyframes fadeIn {
  from { opacity: 0.7; }
  to { opacity: 1; }
}

.nav-element a:active {
  animation: fadeIn 0.2s ease;
}