:root {
    /* Green Gradient Primary Colors */
    --primary-green: linear-gradient(135deg, #15803d, #4ade80);
    --primary-green-dark: #15803d;
    --primary-green-light: #4ade80;
    --primary-white: #ffffff;
    --primary-off-white: #f8fafc;

    /* Brown and Deep Brown Secondary Colors */
    --secondary-brown: #a16207;
    --secondary-brown-dark: #713f12;
    --secondary-brown-light: #ca8a04;
    --secondary-deep-brown: #451a03;

    /* Additional Colors */
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-light: #9ca3af;
    --border-color: #e5e7eb;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;

    /* Dark theme */
    --dark-bg: #111827;
    --dark-card-bg: #1f2937;
    --dark-text: #f9fafb;
    --dark-text-secondary: #d1d5db;
    --dark-border: #374151;

    /* NOTIFICATION COLOURS */
  --green: #16a34a;
  --white: #ffffff;

  /* light defaults */
  --bg: #f4f6f8;
  --text: #0f172a;
  --card: #ffffff;
  --overlay: rgba(0,0,0,0.45);
}

[data-theme="dark"] {
    --primary-off-white: #1f2937;
    --primary-white: #111827;
    --text-primary: #f9fafb;
    --text-secondary: #d1d5db;
    --text-light: #9ca3af;
    --border-color: #374151;
    --shadow-color: rgba(0, 0, 0, 0.3);
}

/* Notification Bar Dark theme overrides */
body[data-theme="dark"] {
  --bg: #0f172a;
  --text: #f8fafc;
  --card: #020617;
  --overlay: rgba(0,0,0,0.65);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--primary-off-white);
    color: var(--text-primary);
    line-height: 1.6;
    max-width: 100vw;
    overflow-x: hidden;
    transition: all 0.3s ease;

}

 @media (max-width: 600px) {
        /* CSS rules for phones go here */
        #aside {
        display: none;
        }
    }
    
/* Desktop Header */
.desktop-header {
    display: none;
    background: var(--primary-green);
    color: white;
    padding: 1rem 0;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 2px 10px var(--shadow-color);
}

.desktop-header .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.desktop-nav {
    display: flex;
    gap: 2rem;
}

.desktop-nav a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.desktop-nav a:hover,
.desktop-nav-active {
    background-color: rgba(255, 255, 255, 0.1);
    padding: 8px;
    border-radius: 10px;
}

/* Mobile Header */
.mobile-header {
    background: var(--primary-green);
    color: white;
    padding: 1rem;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 2px 10px var(--shadow-color);
}

.mobile-header .header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.theme-toggle {
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.5rem;
    margin: 1.5rem;
    border-radius: 0.5rem;
    transition: background-color 0.3s ease;
}

.theme-toggle:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.profile-icon {
    width: 120px;
    height: 120px;
    /*background-color: black;*/
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease;
    position: absolute;
    z-index: 10;
    right: 1%;
}

#mobiler-nav{
    position: absolute;
    right: 30%;
}

.profile-icon:hover {
    background-color: white;
}

/* Main Content */
.main-content {
    margin-top: 80px;
    margin-bottom: 80px;
    padding: 1rem;
    min-height: calc(100vh - 160px);
}

.desktop-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Page Container */
.page {
    display: none;
}

.page.active {
    display: block;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.dashboard-card {
    background: var(--primary-white);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px var(--shadow-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.dashboard-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--shadow-color);
}

.card-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}
.img-icon{
    height: 100px;
    width: 100px;
    border-radius: 100%;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.card-description {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.875rem;
}

.btn-primary {
    background: var(--primary-green);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #0f5132, #22c55e);
}

.btn-secondary {
    background-color: var(--secondary-brown);
    color: white;
}

.btn-secondary:hover {
    background-color: var(--secondary-brown-dark);
}

.btn-outline {
    background-color: transparent;
    color: var(--primary-green-dark);
    border: 2px solid var(--primary-green-dark);
}

.btn-outline:hover {
    background: var(--primary-green);
    color: white;
}

/* Form Styles */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

.form-input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-green-dark);
}

/* Mobile Navigation */
.mobile-nav {
    display: flex;
    background-color: var(--primary-white);
    position: fixed;
    bottom: 0;
    width: 100%;
    box-shadow: 0 -2px 10px var(--shadow-color);
    z-index: 1000;
}

.nav-item {
    flex: 1;
    text-align: center;
    padding: 0.75rem 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border-top: 3px solid transparent;
}

.nav-item.active {
    color: var(--primary-green-dark);
    border-top-color: var(--primary-green-dark);
    background-color: rgba(21, 128, 61, 0.05);
}

a{
    text-decoration: none;
}

.nav-item a{
    color: black;
}

a.active {
    color: var(--primary-green-dark);
    border-top-color: var(--primary-green-dark);
    background-color: rgba(21, 128, 61, 0.05);
}

.nav-icon {
    font-size: 1.2rem;
    margin-bottom: 0.25rem;
}

.nav-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text);
    transition: color 0.3s ease;
}

/* Welcome Section */
.welcome-section {
    text-align: center;
    padding: 2rem 0;
    background: var(--primary-green);
    border-radius: 16px;
    color: white;
    margin-bottom: 2rem;
}

.welcome-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.welcome-subtitle {
    font-size: 1.125rem;
    opacity: 0.9;
}

/* Content Sections */
.content-section {
    background: var(--primary-white);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 10px var(--shadow-color);
}

.section-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-icon {
    font-size: 1.5rem;
}

/* Responsive Design */
@media (min-width: 768px) {
    .mobile-header {
        display: none;
    }

    .desktop-header {
        display: block;
    }

    .mobile-nav {
        display: none;
    }

    .main-content {
        margin-top: 100px;
        margin-bottom: 0;
    }

    .dashboard-grid {
        grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    }

    .welcome-title {
        font-size: 2.5rem;
    }

    .welcome-subtitle {
        font-size: 1.25rem;
    }
}

@media (min-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Login Form Styles */
.login-container {
    max-width: 400px;
    margin: 2rem auto;
    background: var(--primary-white);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 8px 25px var(--shadow-color);
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.login-subtitle {
    color: var(--text-secondary);
}

.role-selector {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.role-option {
    flex: 1;
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.role-option.active {
    border-color: var(--primary-green-dark);
    background-color: rgba(21, 128, 61, 0.05);
}

.role-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.role-label {
    font-weight: 500;
}

/*Link Menu*/
.link-decor{
    text-decoration: none;
}

/* 1. Prevent the container from expanding beyond the screen */
#questions-box {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden; /* Prevent horizontal scroll on the card */
    word-wrap: break-word;
}

.questionlist {
    padding: 25px;
    box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2);
    display: block;
    border-radius: 15px;
    border: 0.8px solid black;
    margin: 10px;
    color: var(--text);
    transition: color 0.3s ease;

    display: block;
    overflow-wrap: break-word;
    margin-bottom: 20px;
}

/* 3. Make MathJax responsive */
mjx-container {
    max-width: 100% !important;
    overflow-x: auto; /* Allow individual large formulas to scroll internally instead of breaking the app width */
    overflow-y: hidden;
    vertical-align: middle;
}

.view-ans{
    overflow-x : "scroll";
    white-space : "nowrap";
}

/* =========================
   NOTIFICATION BOX THEME VARIABLES
========================= */

/* =========================
   BUTTONS
========================= */
.actions button {
  padding: 10px 18px;
  border-radius: 6px;
  font-size: 15px;
  cursor: pointer;
  border: none;
}

.btn-green {
  background: var(--green);
  color: var(--white);
}

.btn-outline {
  background: transparent;
  color: var(--green);
  border: 2px solid var(--green);
}

/* =========================
   MODAL ALERT POPUP
========================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal {
  background: var(--card);
  width: 90%;
  max-width: 400px;
  border-radius: 10px;
  padding: 20px;
  position: relative;
  animation: scaleIn 0.25s ease;
}

.modal h3 {
  margin-top: 0;
}

.modal .icon {
  font-size: 40px;
  color: var(--green);
  margin-bottom: 10px;
}

.modal .actions {
  text-align: right;
  margin-top: 20px;
}

.modal .close {
  position: absolute;
  top: 10px;
  right: 12px;
  font-size: 18px;
  cursor: pointer;
  opacity: 0.7;
}

@keyframes scaleIn {
  from { transform: scale(0.85); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* =========================
   TOAST NOTIFICATION
========================= */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 2000;
}

.toast {
  background: var(--card);
  min-width: 260px;
  padding: 14px 16px;
  border-left: 6px solid var(--green);
  border-radius: 8px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.2);
  animation: slideIn 0.4s ease forwards;
}

.toast i {
  font-size: 22px;
  color: var(--green);
}

@keyframes slideIn {
  from { transform: translateX(120%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOut {
  to { transform: translateX(120%); opacity: 0; }
}

/* =========================
   CONTROLS
========================= */
.controls {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}