/* ========== LOADING OVERLAY ========== */

html, body {
  min-height: 100%;
  background: var(--bg-color);
}



main {
    flex: 1;
    background-color: var(--bg-color);
}

/* Add to your existing styles.css */
#footer {
    background-color: var(--bg-color);
    padding: 20px 0;
    text-align: center;
}



/* Default Light Mode */
.title {
  color: var(--title-color);
  text-align: center;
}
.text {
  color: var(--text-color);
  text-align: center;
}
h1 {
  text-align: center;
}
h2 {
  text-align: center;
}
body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: var(--bg-color);
  color: var(--text-color);

}

/* Light Mode Variables */
:root {
  --bg-color: #f8f9fa;
  --text-color: #1a1a1a;
    --nav-textcolor: #862b2b;
  --title-color: #1a1a1a;
  --header-bg: linear-gradient(135deg, #2d5016, #1a3010);
  --box-bg: #ffffff;
  --box-border: #e0e0e0;
  --box-shadow: rgba(0, 0, 0, 0.1);
  --input-bg: #f8f9fa;
  --input-border: #4caf50;
  --form-bg: #ffffff;

  /* Button gradients - Light mode (green) */
  --home-gradient: linear-gradient(135deg, #a5d6a7, #81c784);
  --programming-gradient: linear-gradient(135deg, #81c784, #66bb6a);
  --games-gradient: linear-gradient(135deg, #66bb6a, #4caf50);
  --writing-gradient: linear-gradient(135deg, #4caf50, #388e3c);
  --art-gradient: linear-gradient(135deg, #388e3c, #2e7d32);
  --contact-gradient: linear-gradient(135deg, #2e7d32, #1b5e20);
  --submit-gradient: linear-gradient(135deg, #4caf50, #388e3c);
}

/* Dark Mode Variables */
body.dark-mode {
  --bg-color: #0f1115;
  --text-color: #eee;
  --nav-textcolor: #d1d1d1;
  --title-color: white;
  --header-bg: linear-gradient(135deg, #222, #111);
  --box-bg: #0f0c31;
  --box-border: transparent;
  --box-shadow: rgba(0, 0, 0, 0.4);
  --input-bg: #222;
  --input-border: transparent;
  --form-bg: #202023;

  /* Button gradients - Dark mode (blue) */
  --home-gradient: linear-gradient(135deg, #5e92f3, #4a7bc8);
  --programming-gradient: linear-gradient(135deg, #4a7bc8, #3d6ab0);
  --games-gradient: linear-gradient(135deg, #3d6ab0, #305a99);
  --writing-gradient: linear-gradient(135deg, #305a99, #234982);
  --art-gradient: linear-gradient(135deg, #234982, #1a3866);
  --contact-gradient: linear-gradient(135deg, #1a3866, #112749);
  --submit-gradient: linear-gradient(135deg, #4a90e2, #357abd);
}

header {
  background: #1a3010;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  width: 100%;
  position: relative;
}

body.dark-mode header {
  background: #111;
}

.wrap {
  max-width: 1000px;
  flex: 1;
  background-color: var(--bg-color);
  margin: auto;
  padding: 24px;
}
header nav {
  display: flex;
  justify-content: stretch;
  gap: 0;
  flex-wrap: nowrap;
}
header a {
  background: linear-gradient(135deg, #4caf50, #388e3c);
  color: var(--nav-text-color);;
  padding: 20px 10px;
  text-align: center;
  font-size: 1rem;
  text-decoration: none;
  font-weight: bold;
  letter-spacing: 0.8px;
  transition: transform 0s ease, box-shadow 0.3s ease;
  flex: 1 1 0;
  min-width: 0;
  border-radius: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.2);
  white-space: auto;
  overflow: hidden;
}
header a:last-child {
  border-right: none;
}
/* Navigation Header Variables*/
.nav-grid {
  display: grid;
  grid-template-columns: 160px repeat(5, 1fr);
  grid-template-rows: auto auto;
}

/* Ensure red stays on top buttons */
.nav-grid .top-btn {
  background: var(--top-red-gradient);
}


/* Home spans both rows on the left */
.home-btn {
  grid-row: 1 / span 2;
  grid-column: 1;
  text-align:center;
  line-height: 10;
}

/* Top row: tutoring + commissioning fill entire row */
.top-btn:nth-of-type(2) {
  grid-row: 1;
  grid-column: 2 / span 3;
}
.top-btn:nth-of-type(3) {
  grid-row: 1;
  grid-column: 5 / span 3;
}

/* Bottom row: everything else */
.nav-grid a:not(.home-btn):not(.top-btn) {
  grid-row: 2;
}


/* Light red */
:root {
  --top-red-gradient: linear-gradient(135deg, #e57373, #d32f2f);
}

/* Dark red */
body.dark-mode {
  --top-red-gradient: linear-gradient(135deg, #b71c1c, #7f0000);
}

/* Unique gradients using CSS variables */
#home {
  background: var(--home-gradient);
}
#programming {
  background: var(--programming-gradient);
}
#art {
  background: var(--art-gradient);
}
#games {
  background: var(--games-gradient);
}
#videos {
  background: var(--writing-gradient);
}
#writing {
  background: var(--writing-gradient);
}
#contact {
  background: var(--contact-gradient);
}
header a:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  opacity: 0.9;
  z-index: 1;
  position: relative;
}
header a:active {
  transform: translateY(0);
  box-shadow: none;
  opacity: 0.8;
}
@media (max-width: 800px) {
  header nav {
    flex-wrap: wrap;
  }

  header a {
    font-size: 0;
    padding: 15px 10px;
    letter-spacing: -1.8px;
    text-align: center;
    flex: 1 1 33.333%;
    border-right: 1px solid rgba(255, 255, 255, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  }

  header a:nth-child(3n) {
    border-right: none;
  }

  header a::first-letter {
    font-size: 1.5rem;
    font-weight: bold;
    display: inline-block;
    width: 100%;
    text-align: center;
  }
}
.box {
  background: var(--box-bg);
  color: var(--text-color);
  padding: 20px;
  border-radius: 15px;
  box-shadow: 0 4px 8px var(--box-shadow);
  border: 2px solid var(--box-border);
  margin: 17px auto;
  max-width: 800px;
  line-height: 1.6;
}
form.newsletter {
  background: var(--form-bg);
  color: var(--text-color);
  padding: 20px;
  border-radius: 15px;
  box-shadow: 0 4px 8px var(--box-shadow);
  border: 2px solid var(--input-border);
  margin: 20px auto;
  width: 50%;
  max-width: 500px;
  text-align: center;
  font-family: Arial, sans-serif;
}
form.newsletter input[type="text"] {
  width: 50%;
  padding: 10px;
  border: 2px solid var(--input-border);
  border-radius: 8px;
  margin: 10px 0;
  background: var(--input-bg);
  color: var(--text-color);
}
form.newsletter input[type="radio"] {
  margin: 0 6px;
  accent-color: #4caf50;
}
form.newsletter input[type="submit"] {
  background: var(--submit-gradient);
  border: none;
  color: #fff;
  padding: 10px 20px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: bold;
  transition: transform 0.15s ease, box-shadow 0.3s ease;
}
form.newsletter input[type="submit"]:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(76, 175, 80, 0.4);
}

/* Theme toggle button styling */
#theme-toggle {
  background: rgba(0, 0, 0, 0.2);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

body.dark-mode #theme-toggle {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

#theme-toggle:hover {
  transform: scale(1.05);
  background: rgba(0, 0, 0, 0.3);
}

body.dark-mode #theme-toggle:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* Timeline toggle button */
.expand-btn {
  width:100%;
  background: linear-gradient(135deg, #4caf50, #388e3c); /* green gradient */
  color: #fff;
  font-weight: bold;
  padding: 12px 20px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.3s ease, opacity 0.2s ease;
}

.expand-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.3);
  opacity: 0.9;
}

.expand-btn:active {
  transform: translateY(0);
  box-shadow: none;
  opacity: 0.8;
}

/* Dark mode override */
body.dark-mode .expand-btn {
  background: linear-gradient(135deg, #357abd, #234982);
}

#timeline-container {
  max-height: 0;
  overflow: hidden;
  transition: max-height 1s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

#timeline-container.show {
  max-height: 1200px; /* big enough to fit iframe */
}

.timeline-inner {
  padding-top: 20px; /* optional spacing */
}

.service-link {
    color: #2e7d32;
    font-weight: bold;
    text-decoration: none;
    border-bottom: 1px solid #2e7d32;
    transition: opacity 0.2s ease;
}

.service-link:hover {
    opacity: 0.8;
}

body.dark-mode .service-link {
    color: #5e92f3;
    border-bottom-color: #5e92f3;
}

/* ========== ART PAGE STYLES ========== */
#grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2%;
}
#grid img {
  width: 100%;
  aspect-ratio: 8 / 9;
  object-fit: cover;
  transition: transform 0.3s ease;
  cursor: pointer;
}
#grid img:hover { transform: scale(1.1); z-index: 2; }

#fullscreen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.9);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}
#fullscreen img { max-width: 90%; margin: 10px; }

#grid-container { max-width: 587px; margin: auto; }

@media (max-width: 587px) {
  #grid { grid-template-columns: 1fr; padding: 4vw; gap: 2vh; }
  #grid img { aspect-ratio: 2 / 3; }
}

.nav { text-align: center; padding: 10px; }


.page-btn {
  background: var(--submit-gradient);
  color: #fff;
  padding: 10px 20px;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: bold;
  border: none;
  cursor: pointer;
  margin: 0 5px;
  transition: transform 0.15s ease, box-shadow 0.3s ease;
}
.page-btn:hover { transform: translateY(-2px); box-shadow: 0 4px 8px rgba(0,0,0,0.4); }
.page-btn:active { transform: translateY(0); box-shadow: none; }

#pageInfo {
  color: var(--text-color);
  font-weight: bold;
  margin: 0 10px;
  display: inline-block;
}

@media (max-width: 587px) {
  .page-btn { font-size: 0; padding: 10px 12px; letter-spacing: -1.8px; }
  .page-btn .emoji { font-size: 1.2rem; display: inline-block; width: 1.5em; text-align: center; vertical-align: middle; }
  #pageInfo { font-size: 0; margin: 0; padding: 0; }
}

#fsWrap {
  display: flex;
  gap: 20px;
  padding: 20px;
  margin: 35px;
  max-width: 90%;
  max-height: 95%;
  align-items: flex-start;
  flex-wrap: wrap;
  justify-content: center;
  text-align: center;
}

#fsWrap img {
  max-width: 66vw;
  max-height: 66vh;
  height: auto;
  object-fit: contain;
}

#infoBox {
  flex: 1;
  max-width: 500px;
  color:#ffffff;
}

/* ========== CONTACT PAGE STYLES ========== */
.socials {
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
}

.socials a {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text-color);
  font-family: sans-serif;
  font-size: 16px;
  width: 50%;
  background: var(--box-bg);
  border: 2px solid var(--box-border);
  padding: 6px 12px;
  border-radius: 20px;
  transition: transform 0.15s, opacity 0.15s;
}

.socials a:hover {
  transform: translateX(4px);
  opacity: 0.9;
}

.socials img,
.socials svg {
  display: block;
  width: 22px;
  height: 22px;
}

/* ========== GAMES & WRITING PAGE STYLES ========== */
.list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 1000px;
  margin: auto;
  padding: 0 24px;
}

.game {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 16px;
  padding: 16px;
  background: var(--box-bg);
  border-radius: 15px;
  box-shadow: 0 6px 20px var(--box-shadow);
  border: 2px solid var(--box-border);
}

.thumb {
  width: 100%;
  aspect-ratio: 16/9;
  border-radius: 9px;
  object-fit: cover;
  border: 3px solid var(--box-border);
}

/* For book covers (writing page) */
.game .thumb[src*="Book"] {
  aspect-ratio: 6/9;
}

.content {
  min-width: 0;
}

.game .title {
  margin: 0 0 6px;
  font-size: 20px;
  line-height: 1.25;
  color: var(--text-color);
  text-align: left;
}

.game .title a {
  color: var(--text-color);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.game .title a:hover {
  opacity: 0.8;
  border-bottom-color: var(--text-color);
}

.meta {
  color: var(--text-color);
  opacity: 0.7;
  font-size: 14px;
  margin-bottom: 10px;
}

.bullets {
  margin: 0;
  padding-left: 18px;
  color: var(--text-color);
}

.bullets li {
  margin: 6px 0;
}

.bullets a {
  color: #2e7d32;
  text-decoration: underline;
}

.bullets a:hover {
  opacity: 0.8;
}

body.dark-mode .bullets a {
  color: #5e92f3;
}

.sep {
  height: 1px;
  background: var(--box-border);
  margin: 12px 0;
}

@media (max-width: 680px) {
  .game {
    grid-template-columns: 1fr;
  }
}

/* ========== POPUP/OVERLAY STYLES (Writing Page) ========== */
.overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.8);
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.popup {
  position: relative;
  background: var(--box-bg);
  width: 80%;
  height: 80%;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 5px 20px rgba(0,0,0,0.5);
  border: 2px solid var(--box-border);
}

.popup iframe {
  width: 100%;
  height: 100%;
  border: none;
  margin: 0 auto;
  display: block;
}

.close-btn {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 24px;
  cursor: pointer;
  background: var(--submit-gradient);
  color: white;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: transform 0.15s ease, box-shadow 0.3s ease;
}

.close-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

/* ========== PROGRAMMING PAGE STYLES ========== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  margin: 24px auto;
  max-width: 1000px;
}

.project-card {
  background: var(--box-bg);
  border: 2px solid var(--box-border);
  border-radius: 15px;
  padding: 24px;
  box-shadow: 0 4px 8px var(--box-shadow);
  text-align: center;
}

.project-card h2 {
  margin: 0 0 12px 0;
  color: var(--text-color);
  font-size: 1.5rem;
}

.project-card p {
  color: var(--text-color);
  opacity: 0.8;
  margin: 0 0 20px 0;
  line-height: 1.6;
}

.project-btn {
  display: inline-block;
  background: var(--submit-gradient);
  color: #fff;
  padding: 12px 24px;
  border-radius: 12px;
  text-decoration: none;
  font-weight: bold;
  font-size: 1rem;
  transition: transform 0.15s ease, box-shadow 0.3s ease;
  border: none;
  cursor: pointer;
}

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

.project-btn:active {
  transform: translateY(0);
  box-shadow: none;
}

@media (max-width: 600px) {
  .projects-grid {
    grid-template-columns: 1fr;
  }
}

/* ========== PAGE TRANSITION ========== */
.page-transition {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-color);
  z-index: 10000;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.page-transition.active {
  opacity: 1;
}

/* Ensure transition has correct color immediately */
body.dark-mode .page-transition {
  background: #0f1115;
}

body:not(.dark-mode) .page-transition {
  background: #f8f9fa;
}



