/* Academy App CSS - Forest Green & Gold Theme
-------------------------------------- */

:root {
  /* Forest Green & Gold Theme Colors */
  --academy-primary: #1A3E2A;       /* Deep forest green */
  --academy-primary-dark: #0F2C1E;   /* Darker forest green */
  --academy-primary-light: #2A5C3E;  /* Lighter forest green */
  --academy-secondary: #6D4C31;      /* Earth tone */
  --academy-secondary-light: #8B5A2B; /* Lighter earth tone */
  --academy-success: #2A4C3A;        /* Forest success */
  --academy-info: #3A6EA5;           /* Blue info */
  --academy-warning: #D4AF37;        /* Gold warning */
  --academy-danger: #A65344;         /* Natural red */
  --academy-light: #F8F9FA;          /* Light background */
  --academy-dark: #2C2C2C;           /* Dark text */
  --academy-bg: #FFFCF5;             /* Cream background */
  --academy-text: #2C2C2C;           /* Text color */
  --academy-border: #E0D5C0;         /* Natural border color */
  
  /* Gold Accents */
  --gold: #D4AF37;                   /* Gold accent */
  --gold-light: #E6CA6E;             /* Light gold */
  --gold-dark: #B39020;              /* Dark gold */
  
  /* Nature Accents */
  --leaf-green: #507D2A;             /* Leaf green accent */
  --bark-brown: #5D4037;             /* Tree bark brown */
  --moss-green: #4B7F52;             /* Moss green */
  --sunlight: #FFF2CC;               /* Sunlight through leaves */
  
  /* Layout Variables */
  --academy-sidebar-width: 220px;
  --academy-sidebar-bg: var(--academy-primary);
  --academy-active-bg: rgba(26, 62, 42, 0.1);
  --academy-box-shadow: 0 .125rem .25rem rgba(0,0,0,.075);
  --header-height: 90px;             /* Height of the fixed header */
  --footer-height: 180px;            /* Approximate footer height */
  
  /* Typography Variables */
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  --font-serif: Georgia, 'Times New Roman', Times, serif;
  --font-display: var(--font-serif);
}

/* Base Styles */
body {
  /* Enable smooth scrolling at body level */
  scroll-behavior: smooth;
}

/* Layout
-------------------------------------- */
.academy-wrapper {
  width: 100%;
  height: calc(100vh - var(--header-height));
  background-color: var(--academy-bg);
  position: relative;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

/* Container that holds both sidebar and content */
.academy-container {
  display: flex;
  width: 100%;
  height: 100%;
  position: relative;
}

/* Add a first-child reset to prevent gaps */
.academy-wrapper > *:first-child {
  margin-top: 0;
  padding-top: 0;
}

/* Add a last-child reset to prevent gaps */
.academy-wrapper > *:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
}

/* Removed the square pattern background */

.academy-sidebar {
  width: var(--academy-sidebar-width);
  background: linear-gradient(to bottom, var(--academy-primary), var(--academy-primary-dark));
  padding: 0;
  position: relative;
  height: 100%;
  overflow: hidden; /* Hide overflow on parent */
  color: var(--academy-light);
  z-index: 10;
  margin: 0;
  flex-shrink: 0;
  border-right: none; /* Remove gold border */
  box-shadow: none; /* Remove shadow between sidebar and content */
}


/* Sidebar inner wrapper to ensure proper scrolling */
.academy-sidebar-inner {
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  /* Contain scroll within sidebar */
  overscroll-behavior: contain;
  /* Add scrollbar styling */
  scrollbar-width: thin;
  scrollbar-color: rgba(212, 175, 55, 0.3) transparent;
}

.academy-sidebar-inner::-webkit-scrollbar {
  width: 4px;
}

.academy-sidebar-inner::-webkit-scrollbar-track {
  background: transparent;
}

.academy-sidebar-inner::-webkit-scrollbar-thumb {
  background-color: rgba(212, 175, 55, 0.3);
  border-radius: 2px;
}

.academy-sidebar-inner::-webkit-scrollbar-thumb:hover {
  background-color: rgba(212, 175, 55, 0.5);
}

/* Removed sidebar dot pattern */

/* Content wrapper that sits alongside sidebar */
.academy-content-wrapper {
  flex: 1;
  position: relative;
  height: 100%;
  background: linear-gradient(to bottom, var(--academy-primary), var(--academy-primary-dark));
  overflow: hidden;
  /* Visual frame effect */
  padding: 20px;
  padding-left: 0; /* No padding on left where sidebar is */
}

/* Removed decorative frame corner accents */

.academy-main {
  width: 100%;
  height: 100%;
  padding: 0;
  position: relative;
  z-index: 5;
  overflow-y: auto;
  overflow-x: hidden;
  /* Force white background */
  background: #ffffff !important;
  background-color: #ffffff !important;
  /* Allow scroll chaining to parent */
  overscroll-behavior: auto;
  -webkit-overflow-scrolling: touch;
  /* Add some scroll momentum */
  scroll-snap-type: y proximity;
  /* Visual styling - enhanced for dark background */
  border-radius: 15px;
  box-shadow: 
    0 8px 30px rgba(0, 0, 0, 0.4),
    0 2px 10px rgba(0, 0, 0, 0.2),
    inset 0 0 0 1px rgba(255, 255, 255, 0.8);
}

/* Inner content wrapper */
.academy-main-inner {
  padding: 1.5rem;
  min-height: calc(100vh - var(--header-height) - 40px);
  position: relative;
  /* Add bottom padding to create scroll runway */
  padding-bottom: calc(1.5rem + 100px);
  /* Force white background */
  background: #ffffff !important;
  background-color: #ffffff !important;
}

/* Scroll runway helper */
.academy-main-inner::after {
  content: '';
  display: block;
  height: 100px;
  margin-top: -100px;
  pointer-events: none;
  /* This creates a scroll "runway" that helps with momentum */
}

/* Force white background on content - override any inheritance */
.academy-container .academy-main {
  background: #ffffff !important;
  background-color: #ffffff !important;
}

.academy-container .academy-main-inner {
  background: #ffffff !important;
  background-color: #ffffff !important;
}

/* Removed the radial pattern background */

/* Sidebar
-------------------------------------- */
.sidebar-header {
  margin: 0;
  padding: 1.5rem 1rem 1rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1); /* Change to subtle black border */
  text-align: center;
  position: relative;
}

/* Hide toggle on desktop */
.sidebar-toggle-label {
  display: none;
}

/* Always hide the checkbox itself */
.sidebar-toggle-checkbox {
  display: none !important;
}

.sidebar-header h3 {
  margin: 0;
  color: var(--gold);
  font-weight: 600;
  font-family: var(--font-serif);
  letter-spacing: 1px;
}

.academy-nav {
  padding: 0 1rem;
}

.academy-nav .nav-items {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0 2rem 0;
}

.academy-nav .nav-item {
  margin-bottom: 0.5rem;
}

.academy-nav .nav-item a {
  display: block;
  padding: 0.75rem 1rem;
  border-radius: 0.25rem;
  color: var(--academy-light);
  text-decoration: none;
  transition: background-color 0.2s;
}

.academy-nav .nav-item a:hover {
  background-color: rgba(212, 175, 55, 0.1);
  color: var(--gold-light);
}

.academy-nav .nav-item.active a {
  background-color: rgba(212, 175, 55, 0.2);
  color: var(--gold);
  border-left: 3px solid var(--gold);
}

/* User Progress
-------------------------------------- */
.user-progress {
  background-color: rgba(0, 0, 0, 0.1); /* Darker background for contrast */
  border-radius: 0.5rem;
  padding: 1rem;
  margin: 0 1rem 1.5rem;
  box-shadow: var(--academy-box-shadow);
  border: 1px solid rgba(0, 0, 0, 0.2); /* Change to subtle black border */
  flex-shrink: 0; /* Prevent shrinking */
}

.user-level {
  display: flex;
  align-items: center;
  margin-bottom: 0.5rem;
}

.level-number {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  color: var(--academy-primary-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: bold;
  margin-right: 1rem;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.level-info {
  flex: 1;
}

.level-name {
  font-weight: bold;
  margin-bottom: 0.25rem;
  color: var(--gold-light);
}

.points {
  font-size: 0.875rem;
  color: var(--academy-light);
}

.progress-bar {
  height: 10px;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 5px;
  overflow: hidden;
  margin-top: 0.5rem;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold-dark), var(--gold));
  transition: width 0.3s ease;
}

.progress-text {
  font-size: 0.75rem;
  color: var(--gold-light);
  margin-top: 0.25rem;
  text-align: right;
}

.recent-badges {
  margin: 1.5rem 1rem 0;
}

.recent-badges h4 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
  color: var(--gold-light);
}

.badge-list {
  display: flex;
}

.mini-badge {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  overflow: hidden;
  margin-right: 0.5rem;
  border: 2px solid var(--gold);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.mini-badge img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sidebar-callout {
  background-color: rgba(0, 0, 0, 0.1); /* Darker background for contrast */
  border-radius: 0.5rem;
  padding: 1rem;
  margin: 2rem 1rem 1.5rem;
  box-shadow: var(--academy-box-shadow);
  text-align: center;
  border: 1px solid rgba(0, 0, 0, 0.2); /* Change to subtle black border */
}

.sidebar-callout h4 {
  color: var(--gold);
}

.sidebar-callout p {
  color: var(--academy-light);
  margin-bottom: 1rem;
}

/* Ensure specific content elements have proper backgrounds */
.academy-main .dashboard-card,
.academy-main .content-section,
.academy-main .card {
  background-color: #ffffff;
}

/* Messages
-------------------------------------- */
.academy-messages {
  margin-bottom: 1.5rem;
  background-color: transparent;
}

.message {
  padding: 1rem;
  border-radius: 0.25rem;
  margin-bottom: 0.5rem;
}

.message.success {
  background-color: rgba(42, 76, 58, 0.2);
  color: var(--academy-success);
  border-left: 4px solid var(--academy-success);
}

.message.error {
  background-color: rgba(166, 83, 68, 0.2);
  color: var(--academy-danger);
  border-left: 4px solid var(--academy-danger);
}

.message.info {
  background-color: rgba(58, 110, 165, 0.2);
  color: var(--academy-info);
  border-left: 4px solid var(--academy-info);
}

.message.warning {
  background-color: rgba(212, 175, 55, 0.2);
  color: var(--gold-dark);
  border-left: 4px solid var(--gold);
}

/* Home Page - Academy Header
-------------------------------------- */
.academy-header {
  text-align: center;
  margin-bottom: 2.5rem;
  padding: 45px 0 35px;
  background: linear-gradient(to bottom, rgba(26, 62, 42, 0.1), rgba(15, 44, 30, 0.05));
  border-bottom: 2px solid var(--gold);
  position: relative;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.academy-header::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(to right, transparent, var(--gold), transparent);
}

.academy-header h1 {
  font-family: var(--font-serif), 'Georgia', serif;
  font-size: 2.8rem;
  letter-spacing: 2px;
  font-weight: 800;
  color: var(--academy-primary);
  text-shadow: 2px 2px 3px rgba(0, 0, 0, 0.15), 0 0 10px rgba(212, 175, 55, 0.2);
  position: relative;
  display: inline-block;
  padding: 0 20px 10px;
  margin: 0 auto 5px;
  max-width: 90%;
  line-height: 1.1;
}

.academy-header h1::after {
  content: '';
  position: absolute;
  left: 20%;
  right: 20%;
  bottom: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: 0.8;
}

/* Nature-inspired decorative elements */
.academy-header h1 > span {
  position: relative;
  z-index: 1;
  display: inline-block;
}

.academy-header h1 > span::before,
.academy-header h1 > span::after {
  content: "❧";
  font-family: serif;
  position: absolute;
  font-size: 1.5rem;
  color: var(--gold);
  opacity: 0.7;
}

.academy-header h1 > span::before {
  top: -15px;
  left: -30px;
  transform: rotate(-15deg);
}

.academy-header h1 > span::after {
  bottom: -10px;
  right: -30px;
  transform: rotate(15deg);
}

.academy-subtitle {
  font-size: 1.15rem;
  font-family: var(--font-serif), 'Georgia', serif;
  font-weight: 500;
  font-style: italic;
  color: var(--gold-dark);
  margin-top: 12px;
  text-align: center;
  letter-spacing: 2px;
  text-transform: uppercase;
  display: block;
  position: relative;
  margin-bottom: 5px;
}

.academy-subtitle::before,
.academy-subtitle::after {
  content: '';
  position: absolute;
  height: 1px;
  background: linear-gradient(to right, rgba(212, 175, 55, 0.2), rgba(212, 175, 55, 0.8), rgba(212, 175, 55, 0.2));
  top: 50%;
  width: 70px;
}

.academy-subtitle::before {
  right: calc(50% + 100px);
}

.academy-subtitle::after {
  left: calc(50% + 100px);
}

.lead {
  font-size: 1.25rem;
  color: var(--academy-secondary);
  margin-top: 15px;
}

.academy-dashboard {
  display: flex;
  flex-direction: column;
}

.dashboard-row {
  display: flex;
  flex-wrap: wrap;
  margin: 0 -15px;
}

.dashboard-col {
  flex: 1;
  min-width: 0;
  padding: 0 15px;
}

.dashboard-sidebar {
  width: 320px;
  padding: 0 15px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.section-header h2 {
  margin: 0;
  font-size: 1.5rem;
  color: var(--academy-primary);
  font-weight: 600;
  font-family: var(--font-serif);
  position: relative;
  padding-left: 15px;
}

.section-header h2::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 5px;
  height: 80%;
  background: linear-gradient(to bottom, var(--gold), var(--academy-primary));
  border-radius: 2px;
}

.view-all {
  font-size: 0.875rem;
  color: var(--gold-dark);
  text-decoration: none;
  position: relative;
  padding-right: 20px;
  transition: all 0.3s ease;
}

.view-all::after {
  content: '→';
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  transition: transform 0.3s ease;
}

.view-all:hover {
  color: var(--gold);
}

.view-all:hover::after {
  transform: translate(5px, -50%);
}

/* Announcements
-------------------------------------- */
.announcements-section {
  margin-bottom: 2rem;
}

.announcement-card {
  background-color: rgba(212, 175, 55, 0.1);
  border-radius: 0.5rem;
  padding: 1.5rem;
  margin-bottom: 1rem;
  box-shadow: var(--academy-box-shadow);
  border-left: 4px solid var(--gold);
}

.announcement-title {
  margin-top: 0;
  margin-bottom: 0.5rem;
  font-size: 1.25rem;
}

.announcement-title a {
  color: var(--academy-primary);
  text-decoration: none;
}

.announcement-title a:hover {
  color: var(--gold-dark);
}

.announcement-meta {
  font-size: 0.875rem;
  color: var(--academy-secondary);
  margin-bottom: 1rem;
}

.announcement-date, .announcement-author {
  margin-right: 1rem;
}

.announcement-excerpt {
  color: var(--academy-text);
}

/* Categories
-------------------------------------- */
.category-section {
  margin-bottom: 2rem;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

.category-card {
  background-color: white;
  border-radius: 0.5rem;
  overflow: hidden;
  box-shadow: var(--academy-box-shadow);
  transition: transform 0.2s;
  border: 1px solid var(--academy-border);
}

.category-card:hover {
  transform: translateY(-2px);
  border-color: var(--gold);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.category-link {
  display: block;
  padding: 1.5rem;
  text-decoration: none;
  color: var(--academy-text);
}

.category-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 1rem;
}

.category-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.category-name {
  text-align: center;
  margin: 0 0 0.5rem;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--academy-primary);
}

.category-stats {
  text-align: center;
  font-size: 0.875rem;
  color: var(--academy-secondary);
}

/* Posts
-------------------------------------- */
.recent-posts-section, .recent-questions-section {
  margin-bottom: 2rem;
}

.post-list, .question-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.post-card, .question-card {
  display: flex;
  background-color: white;
  border-radius: 0.5rem;
  padding: 1rem;
  box-shadow: var(--academy-box-shadow);
  border: 1px solid var(--academy-border);
  transition: transform 0.2s, border-color 0.2s;
}

.post-card:hover, .question-card:hover {
  transform: translateY(-2px);
  border-color: var(--gold-light);
}

.post-meta, .question-meta {
  flex: 1;
  min-width: 0;
}

.meta-category, .meta-topics {
  display: inline-block;
  background-color: rgba(26, 62, 42, 0.05);
  border-radius: 0.25rem;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  margin-bottom: 0.5rem;
}

.meta-category a, .meta-topics a {
  color: var(--academy-primary);
  text-decoration: none;
  font-weight: 500;
}

.post-title, .question-title {
  margin: 0 0 0.5rem;
  font-size: 1.125rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.post-title a, .question-title a {
  color: var(--academy-primary);
  text-decoration: none;
}

.post-title a:hover, .question-title a:hover {
  color: var(--gold-dark);
}

.meta-author {
  font-size: 0.875rem;
  color: var(--academy-secondary);
}

.meta-author a {
  color: var(--academy-secondary);
  text-decoration: none;
  font-weight: 500;
}

.meta-date {
  color: var(--academy-secondary);
  font-size: 0.75rem;
  margin-left: 0.5rem;
}

.post-stats, .question-stats {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.5rem;
  padding-left: 1rem;
  border-left: 1px solid var(--academy-border);
}

.stat-item {
  display: flex;
  align-items: center;
  font-size: 0.875rem;
  color: var(--academy-secondary);
}

.stat-icon {
  margin-right: 0.25rem;
}

/* Sidebar Sections
-------------------------------------- */
.community-stats-section,
.top-contributors-section,
.active-users-section {
  background-color: white;
  border-radius: 0.5rem;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--academy-box-shadow);
  border: 1px solid var(--academy-border);
}

.community-stats-section h3,
.top-contributors-section h3,
.active-users-section h3 {
  margin-top: 0;
  margin-bottom: 1rem;
  font-size: 1.25rem;
  color: var(--academy-primary);
  position: relative;
  padding-bottom: 0.5rem;
  font-family: var(--font-serif);
  letter-spacing: 0.5px;
}

.community-stats-section h3::before,
.top-contributors-section h3::before,
.active-users-section h3::before {
  content: '•';
  position: absolute;
  left: -15px;
  color: var(--gold);
  font-size: 1.5rem;
  opacity: 0.7;
}

.community-stats-section h3::after,
.top-contributors-section h3::after,
.active-users-section h3::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 50px;
  height: 2px;
  background: linear-gradient(to right, var(--gold), var(--academy-primary-light));
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.stat-card {
  text-align: center;
}

.stat-number {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--academy-primary);
}

.stat-label {
  font-size: 0.875rem;
  color: var(--academy-secondary);
}

.action-buttons {
  margin-bottom: 1.5rem;
}

.btn {
  display: inline-block;
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
  vertical-align: middle;
  user-select: none;
  border: 1px solid transparent;
  padding: 0.375rem 0.75rem;
  font-size: 1rem;
  line-height: 1.5;
  border-radius: 0.25rem;
  transition: all 0.3s ease;
  text-decoration: none;
}

.btn-primary {
  color: var(--academy-primary-dark);
  background: linear-gradient(to right, var(--gold-dark), var(--gold));
  border-color: var(--gold-dark);
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.btn-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(to right, var(--gold), var(--gold-light));
  transition: left 0.3s ease;
  z-index: -1;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn-primary:hover::before {
  left: 0;
}

.btn-secondary {
  color: white;
  background-color: var(--academy-secondary);
  border-color: var(--academy-secondary);
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.btn-secondary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background-color: var(--academy-secondary-light);
  transition: left 0.3s ease;
  z-index: -1;
}

.btn-secondary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn-secondary:hover::before {
  left: 0;
}

.btn-block {
  display: block;
  width: 100%;
  margin-bottom: 0.5rem;
}

.contributor-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.contributor-card {
  background-color: rgba(26, 62, 42, 0.05);
  border-radius: 0.25rem;
  overflow: hidden;
  transition: transform 0.2s;
}

.contributor-card:hover {
  transform: translateY(-2px);
}

.contributor-link {
  display: flex;
  align-items: center;
  padding: 0.75rem;
  text-decoration: none;
  color: var(--academy-text);
}

.contributor-level {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  color: var(--academy-primary-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  margin-right: 0.75rem;
}

.contributor-name {
  font-weight: 500;
  color: var(--academy-primary);
}

.contributor-points {
  font-size: 0.75rem;
  color: var(--academy-secondary);
}

.active-users-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.active-user {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--academy-border);
}

.active-user:last-child {
  border-bottom: none;
}

.active-user a {
  color: var(--academy-primary);
  text-decoration: none;
  font-weight: 500;
}

.active-user a:hover {
  color: var(--gold-dark);
}

.active-time {
  font-size: 0.75rem;
  color: var(--academy-secondary);
}

/* CSS-only Tabs
-------------------------------------- */
.tabs-container {
  margin-bottom: 1.5rem;
}

.tabs-container input[type="radio"] {
  display: none;
}

.tabs-navigation {
  display: flex;
  border-bottom: 1px solid var(--academy-border);
  margin-bottom: 1rem;
}

.tabs-navigation label {
  padding: 0.75rem 1.5rem;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  color: var(--academy-text);
}

.tabs-navigation label:hover {
  color: var(--gold);
}

.tabs-container .tab-content {
  display: none;
}

#tab1:checked ~ .tabs-navigation label[for="tab1"],
#tab2:checked ~ .tabs-navigation label[for="tab2"],
#tab3:checked ~ .tabs-navigation label[for="tab3"] {
  border-bottom-color: var(--gold);
  color: var(--academy-primary);
}

#tab1:checked ~ .tab-content.content1,
#tab2:checked ~ .tab-content.content2,
#tab3:checked ~ .tab-content.content3 {
  display: block;
}

/* CSS-only Dropdown Menu
-------------------------------------- */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-toggle {
  padding: 0.5rem 1rem;
  background-color: var(--academy-light);
  border: 1px solid var(--academy-border);
  border-radius: 0.25rem;
  cursor: pointer;
  color: var(--academy-text);
}

.dropdown-toggle::after {
  content: "▼";
  font-size: 0.75rem;
  margin-left: 0.5rem;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 1000;
  display: none;
  min-width: 10rem;
  padding: 0.5rem 0;
  margin: 0.125rem 0 0;
  background-color: white;
  border: 1px solid var(--academy-border);
  border-radius: 0.25rem;
  box-shadow: var(--academy-box-shadow);
}

.dropdown:hover .dropdown-menu {
  display: block;
}

.dropdown-item {
  display: block;
  width: 100%;
  padding: 0.25rem 1.5rem;
  clear: both;
  text-align: left;
  text-decoration: none;
  color: var(--academy-text);
}

.dropdown-item:hover {
  background-color: var(--academy-active-bg);
  color: var(--academy-primary);
}

/* Special styling to ensure the footer appears on top of sidebar 
   without causing gaps when not visible */
.site-footer {
  position: relative;
  z-index: 20; /* Higher than sidebar z-index */
  background-color: #000; /* Ensure the background is solid */
}

/* CSS-only Accordions
-------------------------------------- */
.accordion {
  border: 1px solid var(--academy-border);
  border-radius: 0.25rem;
  overflow: hidden;
  margin-bottom: 1rem;
}

.accordion-item {
  border-bottom: 1px solid var(--academy-border);
}

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

.accordion-header {
  position: relative;
}

.accordion-toggle {
  display: block;
  width: 100%;
  padding: 1rem;
  background: none;
  border: none;
  text-align: left;
  font-weight: 500;
  cursor: pointer;
  color: var(--academy-primary);
}

.accordion-toggle::after {
  content: "+";
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
}

.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.2s ease-out;
  background-color: rgba(26, 62, 42, 0.03);
}

.accordion-toggle:focus + .accordion-content {
  max-height: 500px;
  padding: 1rem;
}

.accordion-toggle:focus::after {
  content: "-";
}

/* Form Styling
-------------------------------------- */
.form-group {
  margin-bottom: 1rem;
}

.form-label {
  display: inline-block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--academy-primary);
}

.form-control {
  display: block;
  width: 100%;
  padding: 0.375rem 0.75rem;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--academy-text);
  background-color: white;
  background-clip: padding-box;
  border: 1px solid var(--academy-border);
  border-radius: 0.25rem;
  transition: border-color 0.15s ease-in-out;
}

.form-control:focus {
  border-color: var(--gold);
  outline: 0;
  box-shadow: 0 0 0 0.2rem rgba(212, 175, 55, 0.25);
}

.form-text {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.875rem;
  color: var(--academy-secondary);
}

.form-check {
  position: relative;
  display: block;
  padding-left: 1.25rem;
}

.form-check-input {
  position: absolute;
  margin-top: 0.3rem;
  margin-left: -1.25rem;
}

.form-check-label {
  margin-bottom: 0;
}

/* Post Details Page
-------------------------------------- */
.post-header {
  margin-bottom: 2rem;
}

.post-header .post-title {
  font-size: 1.75rem;
  margin-bottom: 0.5rem;
  color: var(--academy-primary);
  font-family: var(--font-serif);
}

.post-content {
  margin-bottom: 2rem;
  line-height: 1.6;
}

.post-featured-image {
  max-width: 100%;
  border-radius: 0.5rem;
  margin-bottom: 1.5rem;
}

.post-actions {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--academy-border);
}

.like-button, .share-button {
  display: flex;
  align-items: center;
  padding: 0.5rem 1rem;
  border-radius: 0.25rem;
  background-color: var(--academy-light);
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
}

.like-button:hover, .share-button:hover {
  background-color: rgba(212, 175, 55, 0.1);
}

.like-button.active {
  background-color: var(--gold-light);
  color: var(--academy-primary);
}

.action-icon {
  margin-right: 0.5rem;
}

.comments-section h3 {
  margin-bottom: 1.5rem;
  color: var(--academy-primary);
  position: relative;
  padding-bottom: 0.5rem;
}

.comments-section h3::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 50px;
  height: 2px;
  background-color: var(--gold);
}

.comment-form {
  margin-bottom: 2rem;
}

.comment-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.comment {
  display: flex;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--academy-border);
}

.comment:last-child {
  border-bottom: none;
}

.comment-avatar {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  margin-right: 1rem;
  overflow: hidden;
  border: 2px solid var(--academy-border);
}

.comment-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.comment-body {
  flex: 1;
}

.comment-meta {
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
}

.comment-author {
  font-weight: 500;
  margin-right: 0.5rem;
  color: var(--academy-primary);
}

.comment-date {
  font-size: 0.875rem;
  color: var(--academy-secondary);
}

.comment-text {
  margin-bottom: 0.75rem;
  line-height: 1.5;
}

.comment-actions {
  display: flex;
  gap: 1rem;
}

.comment-actions button {
  background: none;
  border: none;
  color: var(--academy-secondary);
  font-size: 0.875rem;
  cursor: pointer;
  padding: 0;
}

.comment-actions button:hover {
  color: var(--gold-dark);
}

.comment-replies {
  margin-top: 1.5rem;
  margin-left: 4rem;
  border-left: 2px solid rgba(212, 175, 55, 0.2);
  padding-left: 1rem;
}

/* Course List
-------------------------------------- */
.course-filters {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  align-items: center;
}

.filter-label {
  margin-right: 0.5rem;
  font-weight: 500;
  color: var(--academy-primary);
}

.course-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.course-card {
  background-color: white;
  border-radius: 0.5rem;
  overflow: hidden;
  box-shadow: var(--academy-box-shadow);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--academy-border);
  position: relative;
}

.course-card::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(45deg, var(--leaf-green), var(--gold), var(--bark-brown), var(--academy-primary));
  z-index: -1;
  border-radius: 0.6rem;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.course-card:hover {
  transform: translateY(-3px) scale(1.01);
  border-color: transparent;
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.12);
}

.course-card:hover::before {
  opacity: 1;
}

.course-image {
  height: 160px;
  position: relative;
}

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

.course-badge {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  border-radius: 0.25rem;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
}

.badge-premium {
  background-color: var(--gold);
  color: var(--academy-primary-dark);
}

.course-info {
  padding: 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.course-title {
  font-size: 1.25rem;
  margin: 0 0 0.75rem;
  color: var(--academy-primary);
}

.course-title a {
  color: var(--academy-primary);
  text-decoration: none;
}

.course-title a:hover {
  color: var(--gold-dark);
}

.course-meta {
  font-size: 0.875rem;
  color: var(--academy-secondary);
  margin-bottom: 0.75rem;
}

.meta-instructor, .meta-level, .meta-duration {
  margin-right: 0.75rem;
}

.course-description {
  margin-bottom: 1rem;
  color: var(--academy-text);
  font-size: 0.875rem;
  flex: 1;
  line-height: 1.5;
}

.course-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--academy-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: rgba(26, 62, 42, 0.03);
}

.course-stats {
  display: flex;
  gap: 1rem;
  font-size: 0.875rem;
  color: var(--academy-secondary);
}

.course-difficulty {
  display: flex;
}

.difficulty-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 3px;
}

.difficulty-dot.filled {
  background-color: var(--gold);
}

.difficulty-dot.empty {
  border: 1px solid var(--gold-dark);
}

.course-progress {
  margin-top: 0.75rem;
}

.enrollment-status {
  margin-top: 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
}

.status-enrolled {
  color: var(--academy-success);
}

.status-completed {
  color: var(--gold-dark);
}

/* Responsive Adjustments
-------------------------------------- */
@media (max-width: 992px) {
  .academy-wrapper {
    height: auto;
  }
  
  .academy-container {
    flex-direction: column;
  }
  
  .academy-content-wrapper {
    padding: 0; /* No padding on mobile */
    background: var(--academy-bg); /* Use light background on mobile */
    box-shadow: none;
  }
  
  /* CSS-only collapsible sidebar for mobile */
  .academy-sidebar {
    width: 100%;
    position: relative;
    top: auto;
    height: auto;
    min-height: auto;
    border-right: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    overflow: hidden; /* Hide content when collapsed */
    padding: 0;
    box-shadow: none;
    max-height: 60px; /* Collapsed height - just show header */
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  }
  
  /* Hidden checkbox */
  .sidebar-toggle-checkbox {
    display: none;
  }
  
  /* Toggle label styling - hamburger menu */
  .sidebar-toggle-label {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 0.75rem;
    right: 1rem;
    width: 36px;
    height: 36px;
    cursor: pointer;
    z-index: 100;
    background-color: rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    transition: background-color 0.3s ease;
  }
  
  .sidebar-toggle-label:hover {
    background-color: rgba(0, 0, 0, 0.2);
  }
  
  /* Animated hamburger lines */
  .sidebar-toggle-label::before,
  .sidebar-toggle-label::after,
  .sidebar-toggle-label span {
    content: '';
    position: absolute;
    width: 20px;
    height: 2px;
    background-color: var(--gold);
    border-radius: 1px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }
  
  .sidebar-toggle-label::before {
    top: 11px;
  }
  
  .sidebar-toggle-label span {
    display: block;
    top: 17px;
    position: absolute;
    width: 20px;
    height: 2px;
    background-color: var(--gold);
    border-radius: 1px;
  }
  
  .sidebar-toggle-label::after {
    bottom: 11px;
  }
  
  /* When checkbox is checked, expand sidebar */
  .sidebar-toggle-checkbox:checked ~ .academy-wrapper .academy-container .academy-sidebar {
    max-height: 500px; /* Expanded height - reduced since we have 2 columns */
    overflow-y: auto;
    transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  }
  
  /* Transform hamburger to X */
  .sidebar-toggle-checkbox:checked ~ .academy-wrapper .academy-container .academy-sidebar .sidebar-toggle-label::before {
    transform: rotate(45deg);
    top: 17px;
  }
  
  .sidebar-toggle-checkbox:checked ~ .academy-wrapper .academy-container .academy-sidebar .sidebar-toggle-label span {
    opacity: 0;
    transform: scale(0);
  }
  
  .sidebar-toggle-checkbox:checked ~ .academy-wrapper .academy-container .academy-sidebar .sidebar-toggle-label::after {
    transform: rotate(-45deg);
    bottom: 17px;
  }
  
  /* Add smooth fade for sidebar content */
  .academy-sidebar-inner {
    transition: opacity 0.3s ease;
  }
  
  .academy-sidebar .academy-nav,
  .academy-sidebar .user-progress,
  .academy-sidebar .recent-badges,
  .academy-sidebar .sidebar-callout {
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transition-delay: 0s;
  }
  
  .sidebar-toggle-checkbox:checked ~ .academy-wrapper .academy-container .academy-sidebar .academy-nav,
  .sidebar-toggle-checkbox:checked ~ .academy-wrapper .academy-container .academy-sidebar .user-progress,
  .sidebar-toggle-checkbox:checked ~ .academy-wrapper .academy-container .academy-sidebar .recent-badges,
  .sidebar-toggle-checkbox:checked ~ .academy-wrapper .academy-container .academy-sidebar .sidebar-callout {
    opacity: 1;
    transform: translateY(0);
  }
  
  .sidebar-toggle-checkbox:checked ~ .academy-wrapper .academy-container .academy-sidebar .academy-nav {
    transition-delay: 0.1s;
  }
  
  .sidebar-toggle-checkbox:checked ~ .academy-wrapper .academy-container .academy-sidebar .user-progress {
    transition-delay: 0.15s;
  }
  
  .sidebar-toggle-checkbox:checked ~ .academy-wrapper .academy-container .academy-sidebar .recent-badges {
    transition-delay: 0.2s;
  }
  
  .sidebar-toggle-checkbox:checked ~ .academy-wrapper .academy-container .academy-sidebar .sidebar-callout {
    transition-delay: 0.25s;
  }
  
  .academy-nav {
    padding: 0 1rem;
  }
  
  /* Grid layout for nav items on mobile */
  .academy-nav .nav-items {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    margin: 1rem 0;
  }
  
  .academy-nav .nav-item {
    margin-bottom: 0;
  }
  
  .academy-nav .nav-item a {
    padding: 0.5rem;
    font-size: 0.875rem;
    text-align: center;
    border-radius: 0.5rem;
    background-color: rgba(0, 0, 0, 0.1);
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .sidebar-header {
    padding: 1rem;
    margin-bottom: 0.5rem;
    padding-right: 3rem; /* Space for menu icon */
  }
  
  .academy-main {
    width: 100%;
    max-width: 100%;
    padding: 0;
    height: auto;
    min-height: calc(100vh - 200px);
    border-radius: 0; /* No radius on mobile */
    box-shadow: none; /* No shadow on mobile */
  }
  
  .academy-main-inner {
    padding: 1rem;
    min-height: auto;
    padding-bottom: calc(1rem + 50px);
  }
  
  .dashboard-row {
    flex-direction: column;
  }
  
  .dashboard-sidebar {
    width: 100%;
    margin-top: 1.5rem;
  }
  
  .academy-header h1 {
    font-size: 2.2rem;
    padding: 5px 15px 10px;
  }
  
  .academy-subtitle {
    font-size: 0.9rem;
  }
  
  .academy-subtitle::before,
  .academy-subtitle::after {
    width: 30px;
  }
  
  .academy-subtitle::before {
    right: calc(50% + 60px);
  }
  
  .academy-subtitle::after {
    left: calc(50% + 60px);
  }
}

@media (max-width: 768px) {
  .category-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }
  
  .post-stats, .question-stats {
    display: none;
  }
}

@media (max-width: 576px) {
  .academy-header h1 {
    font-size: 1.8rem;
    letter-spacing: 1px;
  }
  
  .academy-subtitle {
    font-size: 0.8rem;
    letter-spacing: 1px;
  }
  
  .academy-subtitle::before,
  .academy-subtitle::after {
    display: none;
  }
}