:root {
  /* Theme Colors */
  --color-primary: #007bff;
  --color-primary-hover: #0056b3;
  --color-background: #f5f5f5;
  --color-surface: #ffffff;
  --color-text: #333333;
  --color-answer: #8f0707;
  --color-text-secondary: #666666;
  --color-border: #8f8f8f;
  --color-btn-text: #f8f8f8;
  --color-shadow: rgba(0, 0, 0, 0.1);

  /* Dark mode colors */
  --color-primary-dark: #95c5ff;
  --color-background-dark: #242d3c;
  --color-surface-dark: #243b4a;
  --color-text-dark: #ffffff;
  --color-answer-dark: #ff9c9c;
  --color-text-secondary-dark: #cbd5e0;
  --color-border-dark: #80a1d8;
  --color-btn-text-dark: #0d1b35;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
/*hide stuff*/
.hidden {
  display: none !important;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background-color: var(--color-background);
  color: var(--color-text);
  line-height: 1.6;
  transition: background-color 0.3s ease, color 0.3s ease;
  font-size: 1.2em;
  height: 100%;
}

body.dark-mode {
  --color-primary: var(--color-primary-dark);
  --color-background: var(--color-background-dark);
  --color-surface: var(--color-surface-dark);
  --color-text: var(--color-text-dark);
  --color-text-secondary: var(--color-text-secondary-dark);
  --color-border: var(--color-border-dark);
  --color-answer: var(--color-answer-dark);
  --color-btn-text: var(--color-btn-text-dark);
}

.container {
  /*max-width: 1300px;*/
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
.header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: 15px 0;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-left: 20px;
  margin-right: 20px;
}

.header__title {
  font-size: 2rem;
  font-weight: bold;
  margin-bottom: 5px;
}

.header__subtitle {
  color: var(--color-text-secondary);
  font-size: 0.9rem;
}

#theme-toggle {
  background: var(--color-primary);
  border: none;
  border-radius: 50px;
  padding: 10px 15px;
  color: white;
  cursor: pointer;
  font-size: 1.2rem;
  transition: background-color 0.3s ease;
  align-self: flex-end;
}

#theme-toggle:hover {
  background: var(--color-primary-hover);
}

/* Navigation */
.navigation {
  background: #6c757d;
  padding: 0;
}

.nav-list {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-link {
  display: block;
  padding: 5px 10px;
  color: white;
  text-decoration: none;
  transition: background-color 0.3s ease;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-link:hover,
.nav-link.active {
  background: rgba(0, 0, 0, 0.2);
}

/* Main Content */
.main {
  padding: 30px 0;
    min-height: 80vh;
}

/* Page Header */
.page-header {
  text-align: center;
  margin-bottom: 30px;
}

.page-header h2 {
  font-size: 2rem;
  margin-bottom: 10px;
}

.page-header p {
  color: var(--color-text-secondary);
  margin-bottom: 20px;
}

/* Activity Grid */
.activities-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr); /* Exactly 3 cards per row */
  gap: 20px;
  width: 100%; /* Span the entire container width */
  margin: 0 auto;
  max-width: 1850px; /* Optional: Prevent it from getting too wide on large screens */
}

/* Activity Cards */
.activity-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 4px;
  box-shadow: 0 8px 32px  var(--color-shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  height: fit-content;
  text-align: center;
}

.activity-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 36px  var(--color-shadow);
}
/*activity title is the main cards title*/
.activity-title {
  font-size: 1.2rem;
  font-weight: bold;
  margin-bottom: 10px;
  text-align: center;
  color: var(--color-primary);
}

.activity-content {
  font-size: 1.5rem;
  min-height: 60px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
  margin-bottom: 5px;
  color: var(--color-text);
}

.problem-answer {
  font-size: 1.5rem;
  color: var(--color-answer);
  margin-bottom: 8px;
  font-weight: bold;
}

problem-answer {
  font-size: 1.5rem;
  color: var(--color-answer);
  margin-bottom: 15px;
  font-weight: bold;
}

#date{
  width:320px;
  background: #0056b3;
  text-align: center;
  font-size: 1.2rem;
  font-weight: bold;
  color: var(--color-text-dark);
  border-radius: 15px;
}

/* Buttons */
.btn {
  background: var(--color-primary);
  width: 32%;
  color: var(--color-btn-text);
  border: none;
  padding: 8px 14px;
  min-width: 120px;
  border-radius: 30px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background-color 0.3s ease, transform 0.2s ease;
  margin: 10px auto 8px auto;
}

.btn:hover {
  background: var(--color-primary-hover);
  transform: translateY(-1px);
}

/* Buttons */
.big-btn {
  background: var(--color-primary);
  width: 25%;
  color: var(--color-text-dark);
  border: none;
  padding: 15px 18px;
  min-width: 120px;
  border-radius: 30px;
  cursor: pointer;
  font-size: 1.2rem;
  transition: background-color 0.3s ease, transform 0.2s ease;
  margin: 100px auto 8px auto;
}

.activity-btn {
  display: inline-flex;
  align-items: center;
  margin: 5px auto;
}

/* Flag Display */
.flag-display {
  text-align: center;
  margin: 4px 0;
}

.wiki-link{
  font-size: 0.7em !important;
  margin-top: 0 ;
}

/* News Grid */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 30px;
}

.news-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 2px 4px var(--color-shadow);
}

.news-title {
  font-size: 1.1rem;
  margin-bottom: 10px;
}

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

.news-title a:hover {
  text-decoration: underline;
}

.news-summary {
  color: var(--color-text-secondary);
  margin-bottom: 10px;
}

.news-date {
  color: var(--color-text-secondary);
  font-size: 0.8rem;
}

.mindful-card{
  width: 70%;
  background: #6c757d;
}

#mindful-title{
  font-size: 1.1em;
  margin-bottom: 20px;
}

#mindful-description{
  font-size: 1.8em;
  padding: 20px 10px;
  margin-left: 20px;
  margin-right: 20px;
}

/*dropdown key stage selector*/
.dropdown-label {
  margin-right: 6px;
  font-weight: 500;
  color: var(--color-text-secondary);
  font-size: 1em;
  vertical-align: middle;
}

/* Minimal themed dropdown */
.nice-dropdown {
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-primary);
  border-radius: 6px;
  padding: 6px 25px 6px 10px;
  font-size: 1em;
  font-family: inherit;
  transition: border-color 0.2s, background 0.2s;
  margin-bottom: 13px;
  cursor: pointer;
  min-width: 170px;
}

.nice-dropdown:focus {
  border-color: var(--color-primary-hover);
  outline: none;
}

body.dark-mode .nice-dropdown {
  background: var(--color-surface-dark);
  color: var(--color-text-dark);
  border-color: var(--color-primary-dark);
}

.nice-dropdown option {
  background: var(--color-surface);
  color: var(--color-text);
}
body.dark-mode .nice-dropdown option {
  background: var(--color-surface-dark);
  color: var(--color-text-dark);
}
/*END DROPDOWN*/

/* Numeracy Grid */
.numeracy-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}
/*Numeracy Text in the card */

.numeracy-problem-text{
  font-size: 1.6rem;
}

.numeracy-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 2px 4px var(--color-shadow);
  text-align: center;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/*large content cards*/
.large-card {
  background: var(--color-surface);
  box-shadow: 0 2px 12px var(--color-shadow);
  border-radius: 16px;
  padding: 28px 26px 20px 26px;
  min-height: 360px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}
.card-title {
  font-size: 1.45em;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 10px;
}
.card-content {
  color: var(--color-text);
  font-size: 1em;
}


/* Responsive Design */
@media (max-width: 768px) {
  .header-content {
    flex-direction: column;
    text-align: center;
  }

  #theme-toggle {
    margin-top: 10px;
  }

  .nav-list {
    flex-direction: column;
  }

  .nav-link {
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  .activities-grid {
    grid-template-columns: 1fr;
  }

  .flags-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  }

  .flag-actions {
    flex-direction: column;
    align-items: center;
  }
}

/* Refresh button */
.refresh-btn {
  background: #28a745;
  padding: 10px;
}

/* Refresh button */
.refresh-btn-all {
  background: #28a745;
  width: 150px;
  padding: 10px;
    display: block;
  margin-left: auto;
  margin-right: auto;
  margin-top: 20px;
}

.refresh-btn:hover {
  background: #146523;
}

.refresh-btn:hover {
  background: #146523;
}



/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.activity-card,
.news-card,
.flag-card,
.numeracy-card,
.fact-card {
  animation: fadeIn 0.5s ease forwards;
  min-height: 180px; /* or any value you prefer */
}

/* Ensure 12 cards display properly on different screen sizes */
@media (max-width: 1200px) {
  .activities-grid {
    grid-template-columns: repeat(2, 1fr); /* 2 cards per row on smaller screens */
  }
}

@media (max-width: 768px) {
  .activities-grid {
    grid-template-columns: 1fr; /* 1 card per row on mobile */
  }
}

/* Optional: Add some variety to card colors for the 12 cards */
.activity-card:nth-child(4n+1) {
  border-left: 4px solid #007bff;
}

.activity-card:nth-child(4n+2) {
  border-left: 4px solid #28a745;
}

.activity-card:nth-child(4n+3) {
  border-left: 4px solid #ffc107;
}

.activity-card:nth-child(4n+4)   {
  border-left: 4px solid #dc3545;
}

.activity-card:nth-child(4n+1) button:hover {
  background: #003cff;
}

.activity-card:nth-child(4n+2) button:hover  {
  background: #28a745;
}

.activity-card:nth-child(4n+3) button:hover  {
  background: #ffc107;
}

.activity-card:nth-child(4n+4) button:hover  {
  background: #dc3545;
}

footer{
  text-align: center;
  background: var(--color-background-dark);
  color: var(--color-text-dark);
}
