/* Basic Reset and Body Styling */
*, *::before, *::after {
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  background-color: #f4f4f4;
  color: #333;
  margin: 0;
  padding: 0;
}

/* Main Container */
.container {
  width: 80%;
  max-width: 1200px;
  margin: 20px auto;
  padding: 20px;
  background-color: #fff;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

/* Header and Footer */
header, footer {
  background-color: #2c3e50;
  color: #ecf0f1;
  padding: 1rem;
  text-align: center;
}

  header h1 {
    margin: 0;
  }

.site-title {
  font-size: 2.5rem;
  color: #ecf0f1;
  margin-bottom: 1rem;
  line-height: 1.1; /* Tighten line height */
}

.site-title a {
  text-decoration: none; /* Ensure no underline on hover */
}

.site-title a:visited {
  color: #ecf0f1; /* Ensure visited links have the same color */
}

nav a {
  color: #ecf0f1;
  text-decoration: none;
  margin: 0 15px;
}

  nav a:hover {
    text-decoration: underline;
  }

.user-name {
  font-weight: bold;
  color: #ecf0f1;
}

/* Article Styling for the Tracker */
article {
  border-bottom: 1px solid #ddd;
  margin-bottom: 20px;
  padding-bottom: 20px;
}

  article:last-child {
    border-bottom: none;
  }

  article h3 {
    color: #3498db;
    margin-top: 0;
  }

  article small {
    color: #7f8c8d;
  }

/* --- Article Page Styles --- */

.article-full .article-featured-image {
  margin-bottom: 20px;
}

  .article-full .article-featured-image img {
    width: 100%;
    height: auto;
    border-radius: 5px;
  }

  .article-full .article-featured-image figcaption {
    text-align: center;
    font-size: 0.9rem;
    color: #7f8c8d;
    margin-top: 5px;
  }

.article-content {
  line-height: 1.7;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

  .article-content h2 {
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
    margin-top: 30px;
  }

.media-heading {
  font-size: 1.2rem;
  font-weight: bold;
  text-align: center;
  margin-top: 20px;
  margin-bottom: 10px;
}

.youtube-container {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  height: 0;
  overflow: hidden;
  max-width: 100%;
}

  .youtube-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
  }

.author-aside {
  font-style: italic;
  color: #555;
  border-left: 3px solid #ccc;
  padding-left: 15px;
  margin: 15px 0;
}

/* Preview Banner */
.preview-banner {
  background-color: #f39c12;
  color: #fff;
  text-align: center;
  padding: 10px;
  font-weight: bold;
  margin-bottom: 20px;
}

  .preview-banner a {
    color: #fff;
    text-decoration: underline;
  }

/* Article Footer */
.article-footer-divider {
  margin-top: 40px;
  margin-bottom: 20px;
  border: 0;
  border-top: 1px solid #eee;
}

.article-footer-content {
  text-align: center;
  font-size: 0.9rem;
  color: #7f8c8d;
}

.social-links a {
  margin: 0 10px;
  color: #3498db;
  text-decoration: none;
}

  .social-links a:hover {
    text-decoration: underline;
  }

/* Table of Contents */
#toc-container {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 5px;
  padding: 15px 20px;
  margin-bottom: 10px;
  margin-right: 20px;
  width: 375px;
  float: left;
}

  #toc-container h3 {
    margin-top: 0;
    border-bottom: 1px solid #ddd;
    padding-bottom: 10px;
  }

  #toc-container ol {
    padding-left: 20px;
    margin: 0;
  }

  #toc-container li {
    margin-bottom: 8px;
  }

  #toc-container a {
    text-decoration: none;
    color: #3498db;
  }

    #toc-container a:hover {
      text-decoration: underline;
    }

/* Content Sections */
.content-section {
  background-color: #ffffff;
  padding: 20px;
  margin-bottom: 30px;
  border: 1px solid #e9ecef;
  border-radius: 8px;
}

  .content-section h3 {
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
    margin-top: 0;
  }

/* Category Grid */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 15px;
  margin-top: 20px;
}

.category-grid-item {
  display: block;
  padding: 15px;
  background-color: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 5px;
  text-decoration: none;
  color: #333;
  transition: all 0.2s ease-in-out;
}

  .category-grid-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    color: #3498db;
  }

  .category-grid-item h4 {
    margin: 0 0 5px 0;
    color: #3498db;
  }

  .category-grid-item p {
    margin: 0;
    font-size: 0.9rem;
    color: #7f8c8d;
  }

/* Category Tags */
.category-tags {
  margin-top: 15px;
  font-size: 0.9rem;
  color: #555;
}

.category-tag {
  display: inline-block;
  background-color: #e0eafc; /* A light, pleasant blue */
  color: #3498db; /* A darker blue for the text */
  padding: 4px 10px;
  border-radius: 15px; /* Makes it pill-shaped */
  margin-right: 5px;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s ease-in-out;
}

  .category-tag:hover {
    background-color: #3498db; /* Darker blue on hover */
    color: #fff; /* White text on hover */
    text-decoration: none;
  }

/* --- Admin Area Styles --- */

/* Forms */
.admin-form {
  max-width: 700px;
}

.form-group {
  margin-bottom: 15px;
}

  .form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
  }

.form-control {
  width: 100%;
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

.form-check-inline {
  display: inline-flex;
  align-items: center;
  margin-right: 15px; /* Add some space between checkboxes */
}

.admin-section {
  background-color: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 30px;
}

/* Tables */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
}

  .admin-table th,
  .admin-table td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid #ddd;
  }

  .admin-table thead tr {
    background-color: #2c3e50;
    color: #fff;
  }

/* Striped Table Styling */
.table-striped tbody tr:nth-child(even) {
  background-color: #f8f9fa; /* A light grey for alternating rows */
}

/* Bordered Table Styling */
.table-bordered {
  border: 1px solid #ddd;
}

  .table-bordered th,
  .table-bordered td {
    border: 1px solid #ddd;
  }

/* Buttons and Links */
.btn {
  /* Reset button defaults */
  background: none;
  border: 1px solid transparent; /* Set a default border */
  margin: 0;
  font-family: inherit; /* Ensure buttons use the same font */
  /* Core styles */
  padding: 10px 20px;
  border-radius: 4px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex; /* Use inline-flex for better alignment control */
  justify-content: center; /* Center content horizontally */
  align-items: center; /* Center content vertically */
  text-align: center;
  vertical-align: middle;
}

.btn-sm {
  padding: 5px 10px;
  font-size: 0.9rem;
  min-width: 60px; /* Ensure consistent width for small buttons */
  height: 30px; /* Ensure consistent height for small buttons */
}

.btn-primary {
  background-color: #3498db;
  border-color: #3498db; /* Match border color */
  color: #fff;
}

.btn-secondary {
  background-color: #ccc;
  border-color: #ccc; /* Match border color */
  color: #333;
}

.btn-info {
  background-color: #3498db;
  border-color: #3498db;
  color: #fff;
}

.btn-danger {
  background-color: #e74c3c;
  border-color: #e74c3c; /* Match border color */
  color: #fff;
}

.btn-success {
  background-color: #2ecc71;
  border-color: #2ecc71; /* Match border color */
  color: #fff;
}

.btn-warning {
  background-color: #f39c12;
  border-color: #f39c12;
  color: #fff;
}

.btn-link {
  background: none;
  border: none;
  color: #3498db;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
  font-size: inherit;
  text-decoration: underline;
}

  .btn-link.btn-danger {
    color: #e74c3c;
  }

  .btn-link.btn-success {
    color: #2ecc71;
  }

  .btn-link.btn-warning {
    color: #f39c12;
  }


/* Utility Classes */
.text-danger {
  color: #c00;
}

.text-success {
  color: green;
  font-weight: bold;
}

.text-warning {
  color: #856404;
}

.text-info {
  color: #0c5460;
}

.ml-15 {
  margin-left: 15px;
}

.mt-10 {
  margin-top: 10px;
}

.mt-20 {
  margin-top: 20px;
}

/* Kickstarter Tracker Specific */
.kickstarter-table thead tr {
  background-color: #3498db;
  color: #fff;
}

/* Admin News Table Specific */
.news-table thead tr {
  background-color: #3498db;
  color: #fff;
}

/* Admin Login Form Specific */
.login-form {
  max-width: 400px;
  margin: 20px auto; /* Center the form */
  padding: 20px;
  border: 1px solid #ddd;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

  .login-form .form-control {
    width: calc(100% - 20px); /* Adjust width to be slightly less than 100% */
    max-width: 360px; /* A more specific max-width for the inputs */
    margin: 0 auto; /* Center the input fields */
    display: block; /* Ensure margin auto works */
  }

/* Generate Hash Specific */
.code-block {
  background-color: #eee;
  padding: 10px;
  border: 1px solid #ccc;
  word-wrap: break-word;
}

/* --- Lightbox Styles --- */
#lightbox-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  cursor: pointer;
}

#lightbox-image {
  max-width: 90%;
  max-height: 90%;
  box-shadow: 0 0 25px rgba(0,0,0,0.5);
}

#lightbox-close {
  position: absolute;
  top: 20px;
  right: 30px;
  font-size: 3rem;
  color: #fff;
  cursor: pointer;
}

/* --- Modal Styles --- */
.hidden {
  display: none !important;
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal {
  background-color: #fff;
  padding: 30px;
  border-radius: 8px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.3);
  width: 100%;
  max-width: 450px;
  position: relative;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #eee;
  padding-bottom: 15px;
  margin-bottom: 20px;
}

  .modal-header h2 {
    margin: 0;
  }

.modal-close {
  background: none;
  border: none;
  font-size: 2rem;
  font-weight: bold;
  cursor: pointer;
  color: #888;
}

/* --- Header Layout & Content --- */
.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem; /* Padding for spacing at edges */
}

/* The left and right columns act as spacers/containers */
.header-left, .header-right {
  flex: 1;
}

.header-center {
  /* This keeps your main block centered */
  flex-shrink: 0; /* Prevents this from shrinking */
  padding: 0 2rem; /* Adds some breathing room around the center block */
}

.header-right {
  display: flex;
  justify-content: flex-end; /* Pushes content to the far right */
}

.main-nav {
  padding-bottom: 1.25rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid #4a627a; /* Separator line between nav and auth */
}

/* Social Links */
.header-social-links a {
  display: flex;
  align-items: center; /* Vertically align the icon and the text block */
  text-decoration: none;
  color: #ecf0f1;
  transition: opacity 0.2s ease-in-out;
}

  .header-social-links a:hover {
    opacity: 0.8;
  }

.header-social-links img {
  height: 38px; /* A slightly larger icon */
  width: auto;
}

.social-link-text-container {
  display: flex;
  flex-direction: column; /* Stacks the two lines of text vertically */
  align-items: flex-start; /* Aligns the text to the left */
}

.header-social-links .social-link-text {
  font-size: 0.95rem; /* Slightly larger text */
  font-weight: 500;
  line-height: 1.3; /* Adjust line height for stacking */
}

.header-social-links .social-handle {
  font-size: 0.85rem;
  color: #bdc3c7;
}

/* --- Header Auth Links --- */
header .user-auth {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 15px; /* Consistent spacing between auth links */
}

  header .user-auth a,
  header .user-auth span {
    margin-left: 0; /* Remove old margin style */
    color: #bdc3c7; /* Dimmer color for less emphasis than main nav */
  }

    header .user-auth a:hover {
      color: #ecf0f1;
      text-decoration: none;
    }

  /* Ensure text on our new button is the correct color */
  header .user-auth .btn-info {
    color: #fff;
  }

/* --- Homepage Styles --- */
.hero-section {
  text-align: center;
  padding: 40px 20px;
  margin-bottom: 30px;
  background-color: #f8f9fa; /* A light, welcoming background */
  border-radius: 8px;
  border: 1px solid #e9ecef;
}

.lead {
  font-size: 1.2rem;
  color: #555;
}

.article-summary {
  border-bottom: 1px solid #ddd;
  padding-bottom: 15px;
  margin-bottom: 20px;
}

  .article-summary:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
  }

  .article-summary h4 {
    margin-bottom: 5px;
  }

.text-right {
  text-align: right;
}

/* --- Admin Table Actions --- */
.actions-cell {
  display: flex !important; /* Force flexbox layout */
  align-items: center;
  gap: 10px; /* Space between flex items */
  white-space: nowrap; /* Prevent wrapping */
}

  .actions-cell form,
  .action-form {
    display: inline-block;
    margin: 0; /* Remove any default form margin */
  }

  .actions-cell form {
    margin: 0; /* Remove any default form margin */
  }

/* --- Admin Featured Article Management --- */

.featured-management-container {
  display: flex;
  flex-wrap: wrap; /* Allow wrapping on smaller screens */
  gap: 40px;
}

.featured-list,
.available-list {
  flex: 1;
  min-width: 300px; /* Prevent columns from getting too narrow */
}

  .featured-list .admin-table th:nth-child(1) {
    width: 60%;
  }

  .featured-list .admin-table th:nth-child(2) {
    width: 20%;
  }

  .featured-list .admin-table th:nth-child(3) {
    width: 20%;
  }

.order-input {
  width: 60px;
  padding: 5px;
}

.search-form-container {
  margin-bottom: 20px;
}

/* --- Featured Articles Carousel (Homepage) --- */
.featured-carousel-container {
  margin-top: 20px;
  background-color: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 20px;
  overflow: hidden; /* Hide overflow for now, for future carousel */
  position: relative; /* For positioning nav buttons */
}

.carousel-items {
  display: flex;
  flex-wrap: nowrap; /* Ensure items stay in a single line for carousel */
  gap: 20px; /* Space between items */
  transition: transform 0.5s ease-in-out;
  width: 100%; /* Ensure it takes full width for proper translation */
}

.carousel-item {
  flex: 0 0 calc(33.333% - 14px); /* Approx 3 items per row with gap */
  max-width: calc(33.333% - 14px);
  background-color: #fff;
  border: 1px solid #ddd;
  border-radius: 5px;
  overflow: hidden;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s ease-in-out;
}

  .carousel-item:hover {
    transform: translateY(-5px);
  }

.carousel-image-placeholder {
  width: 100%;
  height: 180px; /* Fixed height for images */
  background-color: #eee;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.carousel-image {
  width: 100%;
  height: 100%;
  object-fit: cover; /* Cover the area, cropping if necessary */
}

.carousel-content {
  padding: 15px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

  .carousel-content h4 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1.2rem;
    color: #3498db;
  }

  .carousel-content p {
    font-size: 0.9rem;
    color: #555;
    margin-bottom: 10px;
  }

  .carousel-content a {
    color: #3498db;
    text-decoration: none;
  }

    .carousel-content a:hover {
      text-decoration: underline;
    }

/* Carousel Navigation Buttons */
.carousel-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background-color: rgba(0, 0, 0, 0.7); /* Darker background */
  color: white;
  border: none;
  padding: 15px 20px; /* Larger padding */
  cursor: pointer;
  z-index: 10;
  font-size: 1.8rem; /* Larger font size */
  border-radius: 50%; /* Make them circular */
  width: 50px; /* Fixed width */
  height: 50px; /* Fixed height */
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1; /* Adjust line height for centering text */
  box-shadow: 0 2px 5px rgba(0,0,0,0.2); /* Add a subtle shadow */
  transition: background-color 0.3s ease;
}

  .carousel-nav:hover {
    background-color: rgba(0, 0, 0, 0.9); /* Darken on hover */
  }

.carousel-prev {
  left: 10px;
}

.carousel-next {
  right: 10px;
}

/* Responsive adjustments */
@media (max-width: 992px) {
  .carousel-item {
    flex: 0 0 calc(50% - 10px); /* 2 items per row */
    max-width: calc(50% - 10px);
  }
}

@media (max-width: 768px) {
  .carousel-items {
    flex-direction: column; /* Stack items vertically */
    align-items: center;
  }

  .carousel-item {
    flex: 0 0 90%; /* Full width on small screens */
    max-width: 90%;
  }
}

/* --- Dev Tracker Feed Importer --- */
.feed-item {
  border: 1px solid #ccc;
  padding: 15px;
  margin-bottom: 15px;
  border-radius: 5px;
}

.feed-content-preview {
  max-height: 100px;
  overflow-y: auto;
  border: 1px solid #eee;
  padding: 10px;
  background-color: #f8f9fa;
  margin-top: 10px;
  border-radius: 4px;
}

.youtube-container {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  height: 0;
  overflow: hidden;
  max-width: 100%;
}

  .youtube-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
  }

.author-aside {
  font-style: italic;
  color: #555;
  border-left: 3px solid #ccc;
  padding-left: 15px;
  margin: 15px 0;
}

.tldr {
  font-weight: bold;
  font-style: italic;
}

.tldr-block {
  background-color: #f8f9fa;
  border-left: 5px solid #3498db;
  padding: 15px 20px;
  margin: 20px 0;
}

  .tldr-block .tldr {
    font-size: 1.2rem;
    color: #3498db;
    margin-top: 0;
    margin-bottom: 10px;
  }

  .tldr-block p,
  .tldr-block ul {
    font-size: 0.95rem;
  }

.article-body {
  display: flex;
  flex-direction: row;
  gap: 20px;
}

  .article-body > .article-content {
    order: 1; /* Make main content the first item */
    flex-grow: 1; /* Allow main content to take remaining space */
  }

/* --- Main Layout --- */
.main-layout {
  display: flex;
  gap: 30px; /* Add space between the columns */
}

  .main-layout .sidebar {
    width: 220px; /* Fixed width for the sidebar */
    flex-shrink: 0; /* Prevent the sidebar from shrinking */
  }

  .main-layout .main-content {
    flex-grow: 1; /* Allow the main content to take up the rest of the space */
  }

/* --- Sidebar Styles --- */
.sidebar {
  background-color: #f8f9fa;
  padding: 20px;
  border-radius: 8px;
  border: 1px solid #e9ecef;
}

  .sidebar h3 {
    margin-top: 0;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
    color: #3498db;
  }

  .sidebar ul {
    list-style-type: none;
    padding-left: 0;
    margin: 0;
  }

  .sidebar li {
    margin-bottom: 10px;
  }

  .sidebar a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
  }

    .sidebar a:hover {
      color: #3498db;
      text-decoration: underline;
    }

/* hide h1s to use image as title */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}
/* --- Admin Login Page --- */
.admin-login-page {
    background-color: #eef2f7; /* A light, neutral background */
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh; /* Full viewport height */
}

.login-container {
    background-color: #fff;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

    .login-container h1 {
        margin-top: 0;
        margin-bottom: 20px;
        color: #2c3e50;
    }

    .login-container .form-group label {
        text-align: left;
    }

/* --- Articles Page - Two-Column Layout --- */

/**
 * Creates the main container for our two-column layout.
 * - display: flex; establishes the flexible box layout model.
 * - gap: defines the space between the sidebar and the main content.
 * - margin-top: adds some space below the page title.
 */
.articles-layout {
  display: flex;
  gap: 30px;
  margin-top: 20px;
}

/**
 * Defines the style for the left-hand sidebar.
 * - width: sets a fixed width for the sidebar.
 * - flex-shrink: 0; prevents the sidebar from shrinking if the window gets
 * too narrow.
 * - background-color: sets the dark background to match the game's UI.
 * - padding: provides vertical spacing at the top and bottom of the
 * sidebar, but no horizontal padding so the buttons can fill the space.
 * - border-radius: rounds the corners of the sidebar container.
 */
.articles-sidebar {
  width: 250px;
  flex-shrink: 0;
  background-color: #1a252f;
  padding: 20px 0;
  border-radius: 8px;
}

/**
 * Defines the style for the right-hand main content area.
 * - flex-grow: 1; allows this column to grow and take up any remaining
 * horizontal space.
 * - overflow: hidden; is a critical fix to contain elements inside it
 * (like the featured articles carousel) and prevent them from breaking
 * the page layout.
 */
.articles-main-content {
  flex-grow: 1;
  overflow: hidden;
}

/**
 * A simple reset for the navigation list (<ul>) to remove default
 * browser styling like bullet points and padding.
 */
.sidebar-nav {
  list-style-type: none;
  padding: 0;
  margin: 0;
}

/**
 * Provides spacing between each navigation item (<li>) in the sidebar.
 */
.sidebar-nav-item {
  margin-bottom: 10px;
}

/**
 * Styles the category navigation links, creating the hexagonal shape.
 * This is the core of our new button style.
 * - position: relative; makes this a positioning context for its ::before
 * pseudo-element, which is essential for our border technique.
 * - z-index: 1; ensures the link's text content appears above the
 * ::before pseudo-element we're adding.
 * - margin: provides horizontal space so the hexagon's points aren't
 * clipped by the edge of the sidebar.
 * - clip-path: defines the custom hexagonal shape.
 * - background-color: in this technique, the link's background acts as the
 * "outline" or "border" color (teal).
 * - border: none; we remove the standard border as it does not work
 * correctly with clip-path.
 * - transition: adds a smooth animation when colors change on hover.
 */
.sidebar-nav-link {
  display: block;
  position: relative;
  z-index: 1;
  margin: 0 10px;
  padding: 12px 20px;
  clip-path: polygon(0% 50%, 8% 0%, 92% 0%, 100% 50%, 92% 100%, 8% 100%);
  background-color: #00c8c8;
  border: none;
  text-decoration: none;
  text-align: center;
  text-transform: uppercase;
  color: #ecf0f1;
  font-weight: bold;
  letter-spacing: 1px;
  transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out;
}

  /**
 * This pseudo-element creates the dark "fill" inside the button.
 * - content: ''; is required to generate the pseudo-element.
 * - position: absolute; allows us to place it precisely within the parent
 * <a> tag.
 * - top, left, right, bottom: 2px; insets the element by 2px on all
 * sides, which creates the 2px "border" effect.
 * - z-index: -1; positions this fill *behind* the link's text.
 * - clip-path: must be identical to the parent's to maintain the shape.
 * - background-color: sets the dark fill color to match the sidebar.
 * - transition: allows the fill color to animate smoothly on hover.
 */
  .sidebar-nav-link::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    right: 2px;
    bottom: 2px;
    z-index: -1;
    clip-path: polygon(0% 50%, 8% 0%, 92% 0%, 100% 50%, 92% 100%, 8% 100%);
    background-color: #1a252f;
    transition: background-color 0.2s ease-in-out;
  }

  /**
 * Defines the style for a link when it is hovered over or active.
 * We change the parent's background to gold, which makes the "outline"
 * gold, and change the text color to dark for contrast.
 */
  .sidebar-nav-link:hover,
  .sidebar-nav-link.active {
    background-color: #ffc107;
    color: #1a252f;
  }

    /**
 * When the link is hovered or active, we also change the ::before
 * pseudo-element's background to gold. This makes the "fill" match
 * the "outline", creating a single, solid gold button.
 */
    .sidebar-nav-link:hover::before,
    .sidebar-nav-link.active::before {
      background-color: #ffc107;
    }

/**
 * Styles the "Categories" title at the top of the sidebar.
 * We add horizontal padding here specifically to keep this title aligned
 * with the other page content, since we removed the padding from the
 * main sidebar container.
 */
.sidebar-title {
  margin-top: 0;
  margin-bottom: 20px;
  font-size: 1.5rem;
  border-bottom: 2px solid #3498db;
  padding-bottom: 10px;
  color: #ecf0f1;
  padding-left: 20px;
  padding-right: 20px;
}

/* --- Admin Actions and Messaging --- */

/* Provides consistent spacing for action button containers */
.admin-actions {
  margin-bottom: 20px;
}

/* Basic styling for flash messages */
.alert {
  padding: 15px;
  margin-bottom: 20px;
  border: 1px solid transparent;
  border-radius: 4px;
}

.alert-success {
  color: #155724;
  background-color: #d4edda;
  border-color: #c3e6cb;
}

.alert-danger {
  color: #721c24;
  background-color: #f8d7da;
  border-color: #f5c6cb;
}

.alert-warning {
  color: #856404;
  background-color: #fff3cd;
  border-color: #ffeeba;
}

.alert-info {
  color: #0c5460;
  background-color: #d1ecf1;
  border-color: #bee5eb;
}

/* --- Admin Dashboard Styles --- */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.dashboard-card {
  background-color: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 20px;
}

.dashboard-card h3 {
  margin-top: 0;
  border-bottom: 2px solid #3498db;
  padding-bottom: 10px;
  color: #3498db;
}

.dashboard-card ul {
  list-style-type: none;
  padding-left: 0;
  margin: 0;
}

.dashboard-card li {
  margin-bottom: 10px;
}

.dashboard-card a {
  text-decoration: none;
  color: #333;
  font-weight: 500;
}

.dashboard-card a:hover {
  color: #3498db;
  text-decoration: underline;
}