/* === Light Mode (Default) === */
:root {
  --background-color: #f8f9fa;
  --tile-background: #ffffff;
  --text-color: #000000;
  --invert-text-color: #ffffff;
  --navbar-bg: #00bcd4;
  --navbar-text: white;
  --sidebar-bg: #eaeaea;
  --link-hover: #83c5be;
  --link-default: #2222ff;
  --link-visited: #29297d;
  --accent-color: #00bcd4;
  --accent-hover: #0099a8;
  --success-color: #28a745;
  --success-hover: #218838;
  --border-color: #dee2e6;
  --border-hover: #adb5bd;
  --shadow-color: rgba(0, 0, 0, 0.1);
  --shadow-hover: rgba(0, 0, 0, 0.15);
  --border-radius: 12px;
  --border-radius-small: 4px;
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;
}

/* Dark Mode Variables */
.dark-mode {
  --background-color: #121212;
  --tile-background: #1e1e1e;
  --text-color: #ffffff;
  --invert-text-color: #000000;
  --navbar-bg: #18404b;
  --navbar-text: white;
  --sidebar-bg: #222222;
  --link-hover: #66b3a6;
  --link-default: #71e5ff;
  --link-visited: #2bb5ff;
  --accent-color: #00eaff;
  --accent-hover: #00d4e6;
  --success-color: #00ff88;
  --success-hover: #00e676;
  --border-color: #444;
  --border-hover: #666;
  --shadow-color: rgba(0, 0, 0, 0.3);
  --shadow-hover: rgba(0, 0, 0, 0.4);
  --border-radius: 12px;
  --border-radius-small: 4px;
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;
}

/* Body */
body {
  font-family: Arial, sans-serif;
  background: url("/static/background/tile.png") repeat, var(--background-color);
  padding: 1em; /* Padding around the entire page */
}

/* This could go somewhere else but, anything error-list can be styled with this */
.errorlist {
  color: red;
  font-weight: bold;
  margin-top: 0.25em;
}

/* Links */
a {
  color: var(--link-default);
}

a:visited {
  color: var(--link-visited);
}

/* My site is divided into chunks, they can inherit that style from here! */
.tile {
  background: var(--tile-background);
  border-radius: var(--border-radius);
  padding: var(--spacing-md);
  margin-bottom: var(--spacing-md);
  box-shadow: 0 5px 5px var(--shadow-color);
  color: var(--text-color);
}



/* ======
 * Header
 * ====== */
.header {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: flex-start;
  background: var(--navbar-bg);
  color: white;
  padding: 1em;
  border-radius: 12px;
  gap: 0.5em;
}
.header-left {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 1.5em;
}
.header-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5em;
}
.logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-left: 12px;
}
.logo img {
  height: 60px; /* Smaller logo */
  margin-bottom: 0.5rem; /* Space between logo and stats */
}

.live-stats {
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-color);
  opacity: 0.8;
}

.stat-box {
  display: inline-block;
  padding: 0.15rem var(--spacing-sm);
  margin: var(--spacing-xs);
  margin-top: 0;
  margin-bottom: 0;
  font-size: 0.9em;
  border-radius: var(--border-radius-small);
}

#active-users-count,
#server-offset {
  font-weight: bold;
  color: var(--link-default);
}

/* Clickable stat box styling */
.stat-box-link {
  text-decoration: none;
  color: inherit;
  display: inline-block;
}

.stat-box-link:hover .stat-box {
  background: var(--accent-color);
  color: white;
  transform: scale(1.05);
  transition: all 0.2s ease;
}

/* ==============
 * Navbar styles!
 * ============== */
.navbar {
  display: flex;
  justify-content: space-between; /* Spread links and login to edges */
  align-items: center;
  padding: 0;
  margin: 0;
}

/* User avatars */
.user-avatar {
  width: 45px;
  align-items: center;
}

/* Navbar Links - Big, Bold, and Classic */
.nav-links {
  display: flex;
  align-items: center; /* Align everything properly */
  white-space: nowrap;
}

.nav-links a {
  text-decoration: none;
  color: white;
  font-size: 1.5em; /* Make text big and bold */
  font-weight: bold;
  text-transform: uppercase; /* Retro all-caps */
  padding: 0 10px; /* Give spacing around the text */
}

/* Add vertical bars | between links */
.nav-links span.separator {
  color: white;
  font-size: 1.5em;
  font-weight: bold;
  padding: 0 5px; /* Space around the separator */
  user-select: none; /* Prevent it from being selectable */
}

/* Big Underline on Hover */
.nav-links a:hover {
  text-decoration: underline 4px solid white; /* Thick underline on hover */
}

/* Login Section */
.login-area a {
  text-decoration: none;
  color: white;
  font-size: 1.2em;
  font-weight: bold;
  text-transform: uppercase;
  border-bottom: 2px solid transparent; /* Invisible border */
  transition: border-bottom 0.1s ease-in-out;
}

.login-area a:hover {
  border-bottom: 2px solid white; /* Underline only on hover */
}

/* Login */
.login {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.discord-navbar-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  background: #5865F2;
  color: #fff;
  font-weight: 600;
  border-radius: 999px;
  padding: 0.35em 1em 0.35em 0.8em;
  font-size: 1em;
  text-decoration: none;
  margin-bottom: 0em;
  margin-right: 0;
  box-shadow: 0 2px 8px rgba(88,101,242,0.08);
  transition: transform 0.12s, box-shadow 0.12s, background 0.12s;
  animation: discord-bounce 1.2s infinite alternate;
}
.login .discord-navbar-btn {
  background: #5865F2;
  color: #fff;
  margin-bottom: 0.5em;
}
.login a:not(.discord-navbar-btn) {
  background: #d90429;
  color: #fff;
}
.login a:not(.discord-navbar-btn):hover {
  background: #ff616f;
}

/* =======================
 * Footer
 * ======================= */
.footer-content {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.footer-main {
  text-align: center;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.footer-credit-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--link-default);
  color: var(--invert-text-color);
  text-decoration: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.footer-credit-link:visited {
  color: var(--invert-text-color);
}

.footer-credit-link:hover {
  background: var(--link-hover);
  color: white;
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.footer-credit-icon {
  font-size: 1.1rem;
}

/* =======================
 * Main Layout and sidebar
 * ======================= */
.main-layout {
  display: flex; /* Flexbox for side-by-side layout */
  gap: 1em; /* Space between content and sidebar */
}

/* Mobile-only left padding override */
@media (max-width: 768px) {
  .main-layout {
    margin-left: 3em; /* Add left padding only on mobile */
  }
}

/* Content Section */
.content {
  flex: 3; /* Take up more space compared to the sidebar */
  background: var(--background-color); /* White background for content */
  min-height: 60vh;
}

/* Sidebar Section */
.sidebar {
  flex: 1;
  max-width: 15vw;
  background: var(--sidebar-bg); /* Light grey background for sidebar */
  overflow: hidden; /* Prevent content from overflowing */
  word-wrap: break-word; /* Break long words */
}

/*
 * Apps! not all apps need to register css here, some can use their own, but for some apps
 * its easy enough to just, squish in here
 * */

/* For the character images in apps/characters */
.character-content img {
  max-width: 100%; /* Ensures images fit inside their container */
  height: auto; /* Maintains aspect ratio */
  display: block;
  margin: 0 auto; /* Centers the image */
}

/* === Responsive Sidebar Fix === */

/* Completely hide sidebar on very small screens (phones) */
@media (max-width: 900px) {
  .sidebar {
    display: none;
  }
}

/* Move sidebar below content for slightly larger screens (small tablets) */
@media (max-width: 1200px) and (min-width: 901px) {
  .main-layout {
    flex-direction: column; /* Stack content and sidebar vertically */
  }

  .sidebar {
    max-width: 100%; /* Make sidebar take full width */
    order: 1; /* Ensures sidebar appears after content */
  }
}

/* Remove old banner styles if present */
.discord-invite-banner, .discord-animated-link, .discord-icon, .discord-text {
  display: none !important;
}

.discord-navbar-btn:hover {
  background: #4752c4;
  transform: scale(1.06);
  box-shadow: 0 4px 16px rgba(88,101,242,0.18);
  text-decoration: none;
}
.discord-navbar-icon {
  font-size: 1.2em;
  margin-right: 0.2em;
  animation: discord-pulse 1.2s infinite alternate;
}
@keyframes discord-bounce {
  0% { transform: translateY(0); }
  100% { transform: translateY(-2px); }
}
@keyframes discord-pulse {
  0% { filter: brightness(1); }
  100% { filter: brightness(1.4); }
}

/* Responsive Navbar */
.nav-hamburger {
  display: none;
  background: none;
  border: none;
  font-size: 2em;
  color: white;
  cursor: pointer;
  margin-left: 0.2em;
}

.nav-mobile-links {
  display: none;
  flex-direction: column;
  background: var(--navbar-bg);
  position: absolute;
  top: 70px;
  left: 0;
  width: 100%;
  z-index: 1000;
  border-radius: 0 0 12px 12px;
  box-shadow: 0 5px 10px rgba(0,0,0,0.2);
}
.nav-mobile-links a {
  color: white;
  padding: 1em;
  border-bottom: 1px solid #fff2;
  text-align: left;
  font-size: 1.2em;
}
.nav-mobile-links a:last-child {
  border-bottom: none;
}

@media (max-width: 800px) {
  .header {
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
  }
  .header-left {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5em;
    width: 100%;
  }
  .logo {
    margin-right: 0;
  }
  .navbar {
    width: 100%;
  }
  .nav-links {
    display: none;
  }
  .nav-hamburger {
    display: block;
  }
  .nav-mobile-links {
    display: none;
  }
  .nav-mobile-links.open {
    display: flex;
  }
  .header-right {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-left: 0;
  }
  .login {
    width: auto;
    flex-direction: row;
    align-items: flex-start;
    gap: 0.5em;
    margin-top: 0.5em;
    flex-wrap: wrap;
  }
  .user-auth-btn {
    width: auto !important;
    min-width: 0 !important;
    max-width: 80px;
    display: inline-block;
    box-sizing: border-box;
    padding-left: 0.4em;
    padding-right: 0.4em;
    font-size: 0.95em;
    flex-shrink: 1;
  }
  .user-auth-btn {
    display: none !important;
  }
  .content {
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: 0;
    border-radius: 0;
    box-sizing: border-box;
  }
}

/* User Auth Buttons (login/register) */
.user-auth-btn {
  background: #1e6f9c;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 0.4em 1.1em;
  font-size: 1em;
  font-weight: 600;
  margin: 0 0.2em;
  text-decoration: none;
  transition: background 0.15s, box-shadow 0.15s;
  box-shadow: 0 2px 8px rgba(30,111,156,0.08);
  cursor: pointer;
  display: inline-block;
}
.user-auth-btn:hover, .user-auth-btn:focus {
  background: #155a7a;
  color: #fff;
  text-decoration: none;
  box-shadow: 0 4px 16px rgba(30,111,156,0.18);
}

/* Latest Blog Post Section */
.latest-blog-post {
  margin-top: 2em;
  margin-bottom: 2em;
}

.latest-blog-post h2 {
  color: var(--text-color);
  margin-bottom: 1em;
  font-size: 1.5em;
}

.blog-preview {
  background: var(--tile-background);
  border-radius: 12px;
  padding: 1.5em;
  box-shadow: 0 5px 5px rgba(0, 0, 0, 0.5);
  display: flex;
  gap: 1.5em;
  align-items: flex-start;
}

.blog-preview-image {
  flex-shrink: 0;
  width: 200px;
  height: 150px;
  overflow: hidden;
  border-radius: 8px;
}

.blog-preview-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.blog-preview-content {
  flex: 1;
  min-width: 0;
}

.blog-preview-content h3 {
  margin: 0 0 0.5em 0;
  font-size: 1.3em;
}

.blog-preview-content h3 a {
  color: var(--link-default);
  text-decoration: none;
}

.blog-preview-content h3 a:hover {
  color: var(--link-hover);
}

.blog-meta {
  display: flex;
  gap: 1em;
  margin-bottom: 1em;
  font-size: 0.9em;
  color: var(--text-color);
  opacity: 0.8;
}

.blog-date {
  font-weight: 500;
}

.blog-tags {
  display: flex;
  gap: 0.5em;
}

.tag {
  background: var(--sidebar-bg);
  color: var(--text-color);
  padding: 0.2em 0.6em;
  border-radius: 12px;
  font-size: 0.8em;
  font-weight: 500;
}

.blog-excerpt {
  margin: 0 0 1em 0;
  line-height: 1.5;
  color: var(--text-color);
}

.read-more {
  display: inline-block;
  color: var(--link-default);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

.read-more:hover {
  color: var(--link-hover);
}

/* Multiple blog posts layout */
.latest-blog-posts h2 {
  color: var(--text-color);
  margin-bottom: 1em;
  font-size: 1.5em;
}

.blog-post-divider {
  margin: 2em 0;
  border: none;
  height: 1px;
  background: var(--border-color, #444);
  opacity: 0.3;
}

.blog-section-footer {
  margin-top: 1.5em;
  text-align: center;
}

.blog-section-footer a {
  color: var(--link-default);
  text-decoration: none;
  font-weight: 500;
  padding: 0.5em 1em;
  border: 2px solid var(--link-default);
  border-radius: 8px;
  transition: all 0.2s ease;
}

.blog-section-footer a:hover {
  color: var(--link-hover);
  border-color: var(--link-hover);
  background: var(--link-hover);
  color: white;
}

/* Home page specific styling */
.page-header {
  text-align: center;
  margin-bottom: 2em;
  padding: 2em 0;
  background: linear-gradient(135deg, var(--tile-background), var(--sidebar-bg));
  border-radius: 12px;
  border: 1px solid var(--border-color, #444);
}

.page-header h1 {
  font-size: 2.5em;
  margin: 0 0 0.5em 0;
  color: var(--text-color);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.page-header .lead {
  font-size: 1.3em;
  color: var(--text-color);
  opacity: 0.9;
  margin: 0;
  font-weight: 300;
}

.intro-section {
  margin-bottom: 3em;
  padding: 1.5em;
  background: var(--tile-background);
  border-radius: 12px;
  border: 1px solid var(--border-color, #444);
  line-height: 1.6;
}

.intro-section p {
  margin: 0 0 1em 0;
  color: var(--text-color);
}

.intro-section p:last-child {
  margin-bottom: 0;
}

.discord-link {
  color: var(--link-default);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.discord-link:hover {
  color: var(--link-hover);
}

/* Responsive design for blog preview */
@media (max-width: 768px) {
  .blog-preview {
    flex-direction: column;
    gap: 1em;
  }
  
  .blog-preview-image {
    width: 100%;
    height: 200px;
  }
  
  .blog-meta {
    flex-direction: column;
    gap: 0.5em;
  }
}

/* Responsive design for home page */
@media (max-width: 768px) {
  .page-header {
    padding: 1.5em 1em;
    margin-bottom: 1.5em;
  }
  
  .page-header h1 {
    font-size: 2em;
  }
  
  .page-header .lead {
    font-size: 1.1em;
  }
  
  .intro-section {
    padding: 1em;
    margin-bottom: 2em;
  }
}

/* Centralized Notification System Styling */
.notifications-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  max-width: 400px;
  width: 100%;
}

.notification {
  margin-bottom: 10px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  animation: slideInRight 0.3s ease-out;
  overflow: hidden;
  transform: translateX(100%);
  opacity: 0;
  transition: all 0.3s ease;
}

.notification.show {
  transform: translateX(0);
  opacity: 1;
}

.notification.hiding {
  transform: translateX(100%);
  opacity: 0;
}

.notification-content {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  gap: 12px;
}

.notification-icon {
  font-size: 1.2em;
  flex-shrink: 0;
}

.notification-text {
  flex: 1;
  font-size: 0.95em;
  line-height: 1.4;
}

.notification-close {
  background: none;
  border: none;
  font-size: 1.5em;
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.2s ease;
  flex-shrink: 0;
}

.notification-close:hover {
  background-color: rgba(0, 0, 0, 0.1);
}

/* Notification Types */
.notification-success {
  background: linear-gradient(135deg, #28a745, #20c997);
  color: white;
}

.notification-error {
  background: linear-gradient(135deg, #dc3545, #e83e8c);
  color: white;
}

.notification-warning {
  background: linear-gradient(135deg, #ffc107, #fd7e14);
  color: #212529;
}

.notification-info {
  background: linear-gradient(135deg, #17a2b8, #6f42c1);
  color: white;
}

/* Notification Animations */
@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOutRight {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

/* Responsive Notifications */
@media (max-width: 768px) {
  .notifications-container {
    left: 20px;
    right: 20px;
    max-width: none;
  }
  
  .notification {
    margin-bottom: 8px;
  }
  
  .notification-content {
    padding: 10px 14px;
    gap: 10px;
  }
  
  .notification-text {
    font-size: 0.9em;
  }
}
