/* 
-------------------------
TABLE OF CONTENTS
1. Light/Dark Mode Styles
2. Grid Styles
3. Global Text Styling
4. Media Styles
5. Button Styles
6. Specific Sections
7. Footer
8. Navbar
9. Mobile Functionality
-------------------------
*/

/*
-------------------------
1. Light/Dark Mode Styles
-------------------------
*/

/* Light Mode Styles */
:root[style*="--navy: #f2ede4"] {
  --navy: #f2ede4;
  --midnight: #c9bba5;
  --snow: #251a14;
  --denim: #5a5148;
}

:root[style*="--navy: #f2ede4"] .hero-banner {
  background-image: url('images/hero-bg-light.jpg') !important;
}

:root[style*="--navy: #f2ede4"] .hero-banner::before {
  background: linear-gradient(rgba(242, 237, 228, 0.6), rgba(242, 237, 228, 0.6)) !important;
}

:root[style*="--navy: #f2ede4"] .hero-title,
:root[style*="--navy: #f2ede4"] .hero-subtitle {
  color: #3a2518 !important;
}

/* Dark Mode Styles */
:root[style*="--navy: #141414"] {
  --navy: #141414;
  --midnight: #222126;
  --snow: #edeef0;
  --denim: #373740;
}

:root[style*="--navy: #141414"] .hero-banner {
  background-image: url('images/hero-bg-dark.jpg') !important;
}

:root[style*="--navy: #141414"] .hero-banner::before {
  background: linear-gradient(rgba(20, 20, 20, 0.85), rgba(20, 20, 20, 0.85)) !important;
}

:root[style*="--navy: #141414"] .hero-title,
:root[style*="--navy: #141414"] .hero-subtitle {
  color: var(--snow) !important;
}

/* Smooth Transition */
:root {
  --navy: #141414;
  --midnight: #222126;
  --snow: #edeef0;
  --denim: #373740;

  transition: background-color 0.5s ease,
    color 0.5s ease,
    border-color 0.5s ease,
    box-shadow 0.5s ease;
}

/* Add transitions to all elements that use theme colors */
body,
header,
footer,
.navbar,
.dropdown-content,
button,
a,
p,
h1,
h2,
h3,
h4,
h5,
h6,
.hero-banner::before,
.fullscreen-menu,
.mobile-menu,
.fancy1,
.fancy2,
.fancy3,
.text,
img,
video {
  transition: background-color 0.5s ease,
    color 0.5s ease,
    border-color 0.5s ease,
    box-shadow 0.5s ease;
}

/* Prevent transition on initial page load */
.no-transition,
.no-transition * {
  transition: none !important;
}

/*
---------------
2. Grid Styles
---------------
*/

.grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-gap: 0px;
}

.col-span-12,
.col-span-11,
.col-span-10,
.col-span-9,
.col-span-8,
.col-span-7,
.col-span-6,
.col-span-5,
.col-span-4,
.col-span-3,
.col-span-2,
.col-span-1 {
  padding: 10px;
}

.col-span-12 {
  grid-column: span 12;
}

.col-span-11 {
  grid-column: span 11;
}

.col-span-10 {
  grid-column: span 10;
}

.col-span-9 {
  grid-column: span 9;
}

.col-span-8 {
  grid-column: span 8;
}

.col-span-7 {
  grid-column: span 7;
}

.col-span-6 {
  grid-column: span 6;
}

.col-span-5 {
  grid-column: span 5;
}

.col-span-4 {
  grid-column: span 4;
}

.col-span-3 {
  grid-column: span 3;
}

.col-span-2 {
  grid-column: span 2;
}

.col-span-1 {
  grid-column: span 1;
}

@media screen and (max-width: 575px) {
  .grid {
    display: block;
  }
}

/*
----------------------
3. Global Text Styling
----------------------
*/

body,
html {
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Nunito', sans-serif;
  background: var(--navy);
  color: var(--snow);
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: 'DM Serif Text', serif;
  font-weight: 600;
  color: var(--snow);
}

h1 {
  text-align: center;
  font-size: 35px;
}

h2,
h3 {
  text-align: center;
}

span.regular {
  font-size: 17px;
}

/* The Course Section */
p.fancy1 {
  margin: 10px;
  position: relative;
  display: inline-block;
  width: 100%;
  box-sizing: border-box;
  background: var(--midnight);
  padding: 20px;
  font-size: 1.05em;
  font-family: 'Nunito', sans-serif;
  border-radius: 10px 10px 10px 10px;
}

p.fancy2 {
  margin: 10px;
  position: relative;
  display: inline-block;
  box-sizing: border-box;
  background: var(--midnight);
  padding: 20px;
  font-size: 1.05em;
  font-family: 'Nunito', sans-serif;
  border-radius: 10px 10px 10px 10px;
}

/* About Me Section */
p.fancy3 {
  margin: 10px;
  position: relative;
  display: inline-block;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  background: var(--midnight);
  padding: 20px;
  font-size: 1em;
  font-family: 'Nunito', sans-serif;
  border-radius: 10px 10px 10px 10px;
  text-align: center;
}

/* Regular Text Boxes */
p.text {
  margin: 10px;
  position: relative;
  display: inline-block;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  background: var(--midnight);
  padding: 20px;
  font-size: 1.23em;
  font-family: 'Nunito', sans-serif;
  border-radius: 10px 10px 10px 10px;
  text-align: center;
}

/*
---------------
4. Media Styles
---------------
*/

img {
  border-radius: 10px;
  transition: transform 0.3s ease, filter 0.3s ease;
  position: relative;
  border: 5px solid var(--snow);
  filter: brightness(0.9) contrast(1.1);
}

/* Image of Me */
img.me {
  margin-top: 10px;
  margin-right: 20px;
  margin-left: 20px;
  margin-bottom: 20px;
  height: 20%;
  width: 20%;
}

img:hover {
  transform: scale(1.08);
  /* Scales up by 3% */
  filter: brightness(1) contrast(1.1);
  /* Return to normal brightness on hover */
}

/* Regular Images */
img.regular {
  margin: 10px;
  height: 28.5%;
  width: 28.5%;
}

/* Gallery Images */
img.gallery {
  margin: 10px;
  height: 18%;
  width: 18%;
}

div.gallery {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 10px;
}

/* Skill Icons */
.skill-icon {
  margin-right: 10px;
  color: var(--denim);
  font-size: 2em;
  vertical-align: middle;
}

/* Videos */
video {
  margin: 10px;
  position: relative;
  height: 50%;
  width: 50%;
  border: 5px solid var(--snow);
  border-radius: 10px 10px 10px 10px;
}

/*
----------------
5. Button Styles
----------------
*/

/* Modern Button Style */
.submit,
button:not(.dropbtn):not(.navlink),
.btn {
  background-color: var(--denim);
  color: var(--snow);
  border: none;
  border-radius: 6px;
  padding: 10px 20px;
  font-family: 'Nunito', sans-serif;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: none;
  letter-spacing: 0.3px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  width: auto;
  height: auto;
  display: inline-block;
  text-align: center;
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.submit:hover,
button:not(.dropbtn):not(.navlink):hover,
.btn:hover {
  background-color: var(--snow);
  color: var(--navy);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  transform: translateY(-2px);
}

.submit:active,
button:not(.dropbtn):not(.navlink):active,
.btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Light mode specific button styles */
:root[style*="--navy: #f2ede4"] .submit,
:root[style*="--navy: #f2ede4"] button:not(.dropbtn):not(.navlink),
:root[style*="--navy: #f2ede4"] .btn {
  background-color: #5a5148;
  color: #f2ede4;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

:root[style*="--navy: #f2ede4"] .submit:hover,
:root[style*="--navy: #f2ede4"] button:not(.dropbtn):not(.navlink):hover,
:root[style*="--navy: #f2ede4"] .btn:hover {
  background-color: #3a2518;
  color: #f2ede4;
}

/* Contact form specific button */
.submit-container .submit {
  min-width: 120px;
  padding: 12px 24px;
  font-weight: 600;
  border-radius: 8px;
  background-color: var(--denim);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.submit-container .submit:hover {
  background-color: var(--snow);
  color: var (--navy);
  box-shadow: 0 6px 10px rgba(0, 0, 0, 0.15);
}

/* Light mode specific contact form button */
:root[style*="--navy: #f2ede4"] .submit-container .submit {
  background-color: #5a5148;
  color: #f2ede4;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

:root[style*="--navy: #f2ede4"] .submit-container .submit:hover {
  background-color: #3a2518;
  color: #f2ede4;
}

/* Default link styles */
a:link,
a:visited,
a:active {
  position: relative;
  display: inline-block;
  color: #333333;
  padding: 5px;
  text-decoration: none;
  transition: all 0.5s ease;
}

/* Link on hover */
a:hover {
  color: var(--denim);
  text-decoration: none;
}

/* 
Hover animation on mail link
Source: https://css-tricks.com/css-link-hover-effects/ -> The Right-to-Left Color Swap Link Hover Effect
*/

/* Email link with right-to-left hover effect */
a.mail {
  position: relative;
  display: inline-block;
  background-image: linear-gradient(to left,
      var(--snow),
      var(--snow) 50%,
      var(--hover-color, #ffffff) 50%);
  background-size: 200% 100%;
  background-position: 100% 0;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--snow);
  /* fallback for older browsers */
  text-decoration: none;
  font-weight: 600;
  padding: 0 4px;
  transition: background-position 0.6s ease-in-out, opacity 0.3s ease;
  opacity: 1;
}

/* Hover: animate the gradient from right to left */
a.mail:hover {
  background-position: 0 0;
  opacity: 0.85;
  text-decoration: none;
}

a.mail:before,
a.mail:after {
  display: none;
}

/* Footer-specific style */
footer a.mail {
  font-weight: bold;
  padding: 0 4px;
}

/* Dark Mode */
:root[style*="--navy: #141414"] a.mail {
  --hover-color: #6c8aaf;
}

/* Light Mode */
:root[style*="--navy: #f2ede4"] a.mail {
  --hover-color: #ffffff;
}

/*
--------------------
6. Specific Sections
--------------------
*/

/* Grid Layout for Course and About Me Section */
div.course,
div.me {
  display: flex;
  width: 70%;
  margin: auto;
}

/* Title formatting for inside the boxes */
span.overview,
span.topic {
  font-size: 22.5px;
}

/* Contact Form Styling */
#contactForm {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  padding: 2rem;
  background-color: var(--midnight);
  border-radius: 10px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

#contactForm:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
}

.form-control {
  margin-bottom: 1.5rem;
  position: relative;
}

.form-control p {
  font-family: 'Nunito', sans-serif;
  font-weight: 400;
  font-style: normal;
  margin-bottom: 0.5rem;
  color: var(--snow);
  font-size: 1.1rem;
}

.form-control input,
.form-control textarea {
  width: 100%;
  padding: 12px 15px;
  border: 2px solid var(--denim);
  border-radius: 8px;
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--snow);
  font-family: 'DM Serif Text', serif;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.form-control input:focus,
.form-control textarea:focus {
  outline: none;
  border-color: var(--snow);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
  background-color: rgba(255, 255, 255, 0.1);
}

.form-control textarea {
  resize: vertical;
  min-height: 120px;
}

.error {
  color: #ff6b6b;
  font-size: 0.85rem;
  margin-top: 0.5rem;
  display: block;
  font-family: 'DM Serif Text', serif;
}

input.invalid,
textarea.invalid {
  border-color: #ff6b6b;
}

.submit-container {
  display: flex;
  justify-content: center;
  margin-top: 2rem;
}

/* Light mode specific form styles */
:root[style*="--navy: #f2ede4"] #contactForm {
  background-color: var(--midnight);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

:root[style*="--navy: #f2ede4"] .form-control input,
:root[style*="--navy: #f2ede4"] .form-control textarea {
  background-color: rgba(0, 0, 0, 0.05);
  color: var(--snow);
}

:root[style*="--navy: #f2ede4"] .form-control input:focus,
:root[style*="--navy: #f2ede4"] .form-control textarea:focus {
  background-color: rgba(0, 0, 0, 0.1);
}

/* Responsive adjustments */
@media screen and (max-width: 768px) {
  #contactForm {
    padding: 1.5rem;
    margin: 0 1rem;
  }

  .form-control p {
    font-size: 1rem;
  }

  .form-control input,
  .form-control textarea {
    padding: 10px 12px;
  }
}

/* Hero Banner */
.hero-banner {
  position: relative;
  height: 100vh;
  width: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--snow);
}

.hero-banner::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(rgba(20, 20, 20, 0.85), rgba(20, 20, 20, 0.85));
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 800px;
  padding: 2rem;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 1s ease forwards;
}

.hero-title {
  font-size: 3.5rem;
  margin-bottom: 1rem;
  font-family: "DM Serif Text", serif;
  font-weight: 400;
  font-style: normal;
}

.hero-subtitle {
  font-size: 1.5rem;
  margin-bottom: 2rem;
  font-family: "DM Serif Text", serif;
  font-weight: 400;
  font-style: normal;
}

.scroll-indicator {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  opacity: 0;
  animation: fadeIn 1s ease forwards 1s;
}

.scroll-indicator span {
  font-size: 1rem;
  font-family: "DM Serif Text", serif;
}

.scroll-indicator i {
  font-size: 1.5rem;
  animation: bounce 2s infinite;
}

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

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes bounce {
  0%,
  20%,
  50%,
  80%,
  100% {
    transform: translateY(0);
  }

  40% {
    transform: translateY(-20px);
  }

  60% {
    transform: translateY(-10px);
  }
}

/*
---------
7. Footer
---------
*/

footer {
  background-color: var(--midnight);
  text-align: center;
  color: var(--snow);
  padding: 50px;
}

footer p {
  margin: 0;
}

@media only screen and (max-width: 970px) {
  .course {
    flex-direction: column;
    align-items: center;
    width: 100%;
  }

  p.fancy1,
  p.fancy2 {
    width: 75%;
  }
}

/*
---------
8. Navbar
---------
*/

/* Header element */
header {
  background-color: var(--midnight);
  color: var (--snow);
  align-items: center;
  padding-top: 2em;
  padding-bottom: 2em;
  font-size: 16px;
  display: block;
  justify-content: space-evenly;
  text-align: center;
  position: relative;
  font-family: "DM Serif Text", serif;
  font-weight: 600;
  font-style: normal;
}

/* Home page specific navbar */
#home-page header {
  background-color: var(--navy);
}

/* Header on site title */
h1.sitetitle {
  font-family: "DM Serif Text", serif;
  font-weight: 600;
  font-style: normal;
  color: var(--snow);
  margin: 0;
  flex-basis: 30%;
  margin-bottom: 2.5%;
  margin-top: 1%;
  font-size: 35px;
  text-align: center;
}

/* Navbar */
.navbar {
  overflow: hidden;
  font-family: "DM Serif Text", serif;
  font-weight: 600;
  font-style: normal;
  color: var(--navy);
  align-items: center;
  justify-content: space-between;
  font-family: monospace;
  display: flex;
  text-align: center;
  padding-right: 5%;
  padding-left: 7%;
  flex-direction: row;
}

/* Links inside the navbar */
.navbar a {
  align-items: center;
  justify-content: center;
  float: left;
  font-size: 20px;
  text-align: center;
  padding: 7px 16px;
  text-decoration: none;
  font-family: monospace;
  color: var(--snow);
  font-family: "DM Serif Text", serif;
  font-weight: 600;
  font-style: normal;
}

/* The dropdown container */
.dropdown {
  float: left;
  overflow: hidden;
  text-align: center;
  font-family: "DM Serif Text", serif;
  font-weight: 600;
  font-style: normal;
}

/* Dropdown button */
.dropdown .dropbtn {
  font-size: 20px;
  border: none;
  outline: none;
  color: var(--snow);
  padding: 7px 16px;
  background-color: inherit;
  margin: 0;
  font-family: "DM Serif Text", serif;
  font-weight: 600;
  font-style: normal;
}

/* Dropdown container section styling */
p.section {
  text-align: center;
  font-size: 18px;
  font-weight: bold;
  margin: 10px;
  color: var(--navy);
}

/* Navbar links on hover */
.navbar a:hover {
  font-family: "DM Serif Text", serif;
  font-weight: 600;
  font-style: normal;
  border-radius: 5px;
}

.dropdown:hover .dropbtn {
  background-color: var(--denim);
  font-family: "DM Serif Text", serif;
  font-weight: 600;
  font-style: normal;
  border-radius: 5px 5px 0 0;
}

/* Dropdown content (hidden by default) */
.dropdown-content {
  display: none;
  position: absolute;
  background-color: var(--midnight);
  color: var(--snow);
  min-width: 160px;
  box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
  z-index: 1;
  font-family: "DM Serif Text", serif;
  font-weight: 600;
  font-style: normal;
  padding: 5px;
  max-height: 450px;
  overflow: scroll;
  border-radius: 5px;
}

/* Links inside the dropdown */
.dropdown-content a {
  float: none;
  color: var(--snow);
  background-color: transparent;
  padding: 12px 16px;
  text-decoration: none;
  display: block;
  text-align: center;
  font-family: "DM Serif Text", serif;
  font-weight: 600;
  font-style: normal;
  border-radius: 5px;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Dropdown links on hover */
.dropdown-content a:hover {
  background-color: var(--denim);
  color: var(--snow);
  border-radius: 5px;
}

/* Show the dropdown menu on hover */
.dropdown:hover .dropdown-content {
  display: block;
  font-family: "DM Serif Text", serif;
  font-weight: 600;
  font-style: normal;
  border-radius: 0 5px 5px 5px;
}

/* Font size on drop down elements */
a.activity,
a.resource {
  font-size: 17px;
}

/* 
Hover animation on navbar links 
Source: https://www.sliderrevolution.com/resources/css-button-hover-effects/ -> Nav Hovers
*/

.hoverlink {
  position: relative;
}

.hoverlink:after {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  margin: auto;
  width: 0%;
  content: '.';
  color: transparent;
  background: var(--denim);
  height: 1px;
}

.hoverlink {
  transition: all 1s;
}

.hoverlink:after {
  text-align: left;
  content: '.';
  margin: 0;
  opacity: 0;
}

.hoverlink:hover {
  color: var(--snow);
  z-index: 1;
}

.hoverlink:hover:after {
  z-index: -10;
  animation: fill 1s forwards;
  -webkit-animation: fill 1s forwards;
  -moz-animation: fill 1s forwards;
  opacity: 1;
}

/* Keyframes for hover animation */
@-webkit-keyframes fill {
  0% {
    width: 0%;
    height: 1px;
  }

  50% {
    width: 100%;
    height: 1px;
  }

  100% {
    width: 100%;
    height: 100%;
    background: var(--denim);
    border-radius: 5px;
  }
}

/* Formatting of the different Navbar buttons */
.links {
  width: 60%;
  display: flex;
  justify-content: space-around;
}

.dropbtn {
  display: flex;
  justify-content: center;
  align-items: center;
}

/*
-----------------------
9. Mobile Functionality
-----------------------
*/

/* Menu Toggle */
.menu-toggle {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  width: 24px;
  height: 18px;
  display: none;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  z-index: 1001;
}

.menu-toggle .bar {
  width: 100%;
  height: 3px;
  background-color: var(--snow);
  border-radius: 2px;
  transition: all 0.3s ease-in-out;
}

.menu-toggle.active .bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.menu-toggle.active .bar:nth-child(2) {
  opacity: 0;
}

.menu-toggle.active .bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.mobile-menu {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--midnight);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transform: translateY(-100%);
  transition: transform 0.5s ease-in-out;
  z-index: 1000;
}

.mobile-menu.active {
  transform: translateY(0);
}

.mobile-menu a {
  font-size: 1.8rem;
  color: var(--snow);
  text-decoration: none;
  margin: 1rem 0;
  font-family: 'DM Serif Text', serif;
  font-weight: 600;
  transition: color 0.3s ease;
}

.mobile-menu a:hover {
  color: var(--denim);
}

/* Close Button */
.mobile-menu .close-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  font-size: 2rem;
  color: var(--snow);
  cursor: pointer;
  background: none;
  border: none;
  font-family: 'DM Serif Text', serif;
  font-weight: bold;
  transition: color 0.3s ease;
}

.mobile-menu .close-btn:hover {
  color: var(--denim);
}

/* Dropdown submenu styles */
.mobile-menu .submenu {
  display: none;
  flex-direction: column;
  align-items: center;
  margin-top: 1rem;
}

.mobile-menu .submenu.active {
  display: flex;
}

.mobile-menu .submenu a {
  font-size: 1.5rem;
  margin: 0.5rem 0;
  color: var(--snow);
  transition: color 0.3s ease;
}

.mobile-menu .submenu a:hover {
  color: var(--denim);
}

/* Media query for mobile devices */
@media screen and (max-width: 768px) {
  header {
    position: relative;
    padding: 1.5em 40px 1.5em 1.5em;
    padding-top: 1em;
    padding-bottom: 1em;
  }

  /* Media Toggle */
  .menu-toggle {
    display: flex;
    position: absolute !important;
    top: 50% !important;
    right: 10px !important;
    transform: translateY(-50%) !important;
    background: transparent;
    padding: 0;
  }

  /* Navbar */
  .navbar .links {
    display: none;
  }

  .navbar {
    justify-content: space-between;
    padding-left: 5%;
    padding-right: 5%;
    position: relative;
  }

   /* Link Styles */
  .links {
    position: fixed;
    top: 0;
    right: -100%;
    height: 100vh;
    width: 70%;
    background-color: var(--midnight);
    flex-direction: column;
    padding-top: 80px;
    transition: all 0.5s ease;
    z-index: 1000;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.3);
    overflow-y: auto;
  }

  .links.active {
    right: 0;
  }

  .navbar a,
  .dropdown .dropbtn {
    width: 100%;
    text-align: left;
    padding: 15px;
    font-size: 18px;
  }

  .dropdown {
    width: 100%;
  }

  .dropdown-content {
    position: static;
    width: 100%;
    box-shadow: none;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    display: none;
  }

  .dropdown-content.show {
    max-height: 500px;
    display: block;
  }

  .dropdown-content a {
    padding-left: 30px;
  }

  .navbar a:hover,
  .dropdown:hover .dropbtn {
    background-color: transparent;
  }

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

  .dropdown-content.show {
    display: block;
  }

  a.sitetitle {
    font-size: 24px;
    margin-bottom: 0;
  }

  .hoverlink:after {
    display: none;
  }

  /* Universal media styles */
  img,
  video {
    width: 70% !important;
    height: auto !important;
    margin: 10px auto 20px auto !important;
    display: block !important;
  }

  /* About Me Section */
  .me {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  /* Image of Me */
  img.me {
    width: 70% !important;
  }

  /* Gallery Section */
  div.gallery {
    flex-direction: column;
    align-items: center;
  }

  div.gallery img.gallery {
    width: 50% !important;
  }

  .gallery br,
  .me br {
    display: none;
  }

  /* Text Boxes */
  p.fancy1,
  p.fancy2,
  p.fancy3,
  .course .fancy3,
  .resume-content,
  .page-content {
    width: 90% !important;
    font-size: 1.1em;
    margin: 0 auto;
  }

  /* Skills Section */
  .course {
    flex-direction: column;
    align-items: center;
  }

  /* Resume Section */
  img.resume {
    width: 70% !important;
  }

  /* Resume Section */
  div.course>div#container {
    width: 100%;
    margin: 0 auto;
  }

  div.course>div#container>.grid {
    display: block;
    width: 95%;
    margin: 0 auto;
  }

  .col-span-4 {
    width: 100% !important;
    max-width: 95%;
    margin: 0 auto 15px auto;
    float: none;
    display: block;
    box-sizing: border-box;
  }
  .col-span-4>p.text {
    text-align: center;
    width: 100%;
    box-sizing: border-box;
    padding: 15px;
    margin: 0;
  }

  /* About Me Section */
  h2+.course,
  h2+div.gallery,
  h2+.me {
    width: 95% !important;
    margin: 0 auto 20px !important;
    box-sizing: border-box;
    padding: 10px;
  }

  .col-span-4>p.text,
  .col-span-4>p.fancy3 {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
    padding: 15px;
    margin: 0 auto;
  }

  body>div.me:first-of-type,
  h2+div.me,
  div.me[style*="display: flex"] {
    width: 90% !important;
    margin: 0 auto 15px auto !important;
  }
}

/* Force mobile styles to apply properly on specific small devices */
@media screen and (max-width: 480px) {
  html {
    overflow-x: hidden;
    width: 100%;
  }

  body {
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
  }

  .hero-title {
    font-size: 2.5rem !important;
  }

  .hero-subtitle {
    font-size: 1.2rem !important;
  }

  .menu-toggle {
    display: flex !important;
    position: absolute !important;
    top: 50% !important;
    right: 10px !important;
    transform: translateY(-50%) !important;
    z-index: 9999 !important;
  }

  .navbar .links {
    display: none !important;
  }

  img {
    max-width: 100% !important;
    height: auto !important;
  }

  /* Grid Syles Stacks */
  .col-span-1,
  .col-span-2,
  .col-span-3,
  .col-span-4,
  .col-span-5,
  .col-span-6,
  .col-span-7,
  .col-span-8,
  .col-span-9,
  .col-span-10,
  .col-span-11,
  .col-span-12 {
    grid-column: 1 / -1 !important;
    width: 100% !important;
  }

  /* Make Sure Theme Toggle Isn't Hidden */
  button[style*="position: fixed"][style*="bottom:"][style*="right:"] {
    bottom: 20px !important;
    right: 20px !important;
    width: 40px !important;
    height: 40px !important;
    font-size: 20px !important;
    opacity: 0.95 !important;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.3) !important;
    z-index: 9999 !important;
  }

  /* Dark/Light Mode Icon Centering */
  button[style*="position: fixed"][style*="bottom:"][style*="right:"] {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }
  .menu-toggle {
    position: absolute !important;
    top: 50% !important;
    right: 10px !important;
    transform: translateY(-50%) !important;
    z-index: 9999 !important;
  }
}

.dropdown-content.show {
  display: block;
}

/* Ensure the navbar is always on top */
#navbar {
  position: relative;
  z-index: 999;
}

.fullscreen-menu {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--midnight);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  transform: translateY(-100%);
  opacity: 0;
  transition: transform 0.5s ease, opacity 0.5s ease;
}

.fullscreen-menu.active {
  transform: translateY(0);
  opacity: 1;
}

.fullscreen-menu a {
  font-size: 1.5rem;
  color: var(--snow);
  text-decoration: none;
  margin: 1rem 0;
  font-family: 'DM Serif Text', serif;
  font-weight: 600;
  transition: color 0.3s ease;
}

.fullscreen-menu a:hover {
  color: var(--denim);
}

.fullscreen-menu .close-btn {
  position: absolute;
  top: 30px;
  right: 30px;
  width: 40px;
  height: 40px;
  font-size: 1.5rem;
  color: var(--snow);
  cursor: pointer;
  background: var(--denim);
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'DM Serif Text', serif;
  font-weight: bold;
  transition: all 0.3s ease;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  z-index: 1001;
}

.fullscreen-menu .close-btn:hover {
  background-color: var(--snow);
  color: var(--denim);
  transform: scale(1.1);
}

.fullscreen-menu .submenu {
  display: none;
  flex-direction: column;
  align-items: center;
  margin-top: 0.5rem;
}

.fullscreen-menu .submenu.active {
  display: flex;
}

.fullscreen-menu .submenu a {
  font-size: 1rem;
  margin: 5px 0;
  background-color: var(--midnight);
  color: var(--snow);
  border-radius: 5px;
  padding: 10px 15px;
  transition: color 0.3s ease;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.fullscreen-menu .submenu a:hover {
  background-color: var(--denim);
  color: var(--snow);
}

.fullscreen-menu .close-btn i {
  font-size: 1.2rem;
}

/* Fix  width on all content pages for fancy3 paragraphs */
body > div.me:first-of-type,
.section-container > div.me:first-of-type {
    width: 70%;
    margin: 0 auto 20px auto;
    box-sizing: border-box;
}

h2 + div.me,
div.me.project-container {
    width: 70%;
    margin: 0 auto 20px auto;
    box-sizing: border-box;
}

div.me > div {
    width: 100%;
    box-sizing: border-box;
}

div.me p.fancy3,
div.me > div > p.fancy3,
div.me > div > div > p.fancy3 {
    width: 100% !important;
    margin: 10px 0;
    box-sizing: border-box;
}

div.me[style*="display: flex"] {
    width: 70% !important;
    margin: 0 auto 20px auto !important;
}

/* Mobile adjustments for all .me containers */
@media screen and (max-width: 768px) {
    body > div.me:first-of-type,
    .section-container > div.me:first-of-type,
    h2 + div.me,
    div.me.project-container,
    div.me[id="second-research"],
    body.research div.me:nth-of-type(3),
    div.me[style*="display: flex"] {
        width: 90% !important;
        margin: 0 auto 15px auto !important;
    }
    
    /* Ensure mobile fancy3 paragraphs have correct padding/margin */
    div.me p.fancy3,
    div.me > div > p.fancy3,
    div.me > div > div > p.fancy3 {
        padding: 15px;
        margin: 10px auto;
    }
}
