/* 1. DEFINE COLOR VARIABLES */
:root {
  --bg-color: #ffffff;
  --text-color: #222;
  --header-footer-bg-color: #f0f0f0;
  --card-bg-color: #f9f9f9;
  --border-color: #ccc;
  --link-color: #0077cc;
  --link-color-hover: #00487c;
  --aside-accent-color: #9d836b;
  --tag-bg-color: #e0e0e0;
  --tag-text-color: #333;
  --code-bg-color: #2d2d2d; /* The dark grey for light mode */
  --code-text-color: #f4f4f4; /* The dark grey for dark mode */
  --skill-bar-fill-color: #f3e4c6;
  --blockquote-bg-color: #f7fafc;
  --blockquote-accent-color: #4a5568;
  --blockquote-text-color: #4a5568;
  --spacing-inline: 0.5rem;
}

body.dark {
  --bg-color: #121212;
  --text-color: #e0e0e0;
  --header-footer-bg-color: #1e1e1e;
  --card-bg-color: #2a2a2a;
  --border-color: #444;
  --link-color: #66bfff;
  --link-color-hover: #99d6ff;
  --aside-accent-color: #bfa895;
  --tag-bg-color: #3a3a3a;
  --tag-text-color: #e0e0e0;
  --code-bg-color: #f4f4f4; /* A light grey for dark mode */
  --code-text-color: #2d2d2d; /* The light grey for light mode */
}

/* Base Styles */
body {
  font-family: "Nunito", "Segoe UI", "Helvetica Neue", Helvetica, Arial,
    sans-serif;
  font-weight: 400;
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 100vh;
  background-color: var(--bg-color);
  color: var(--text-color);
  font-size: 1.05rem;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0;
  font-family: "Montserrat", "Segoe UI", "Helvetica Neue", Helvetica, Arial,
    sans-serif;
  font-weight: 400;
  line-height: 1.2;
}

h1 {
  font-size: 2rem;
  font-weight: 600;
  text-transform: uppercase;
}

h2 {
  font-size: 1.4rem;
  font-weight: 500;
  text-transform: uppercase;
}

h3 {
  font-size: 1.1rem;
  font-weight: 500;
}

h4 {
  font-size: 1rem;
  font-weight: 500;
}

h5 {
  font-size: 1rem;
  font-weight: 500;
}

h6 {
  font-size: 1rem;
  font-weight: 500;
}

p {
  margin: 0.75rem 0;
}

a {
  color: var(--link-color) !important;
  text-decoration: none;
}

a:hover {
  color: var(--link-color-hover);
  text-decoration: underline;
}

address {
  font-style: normal;
}

figure,
ul {
  margin: 0;
  padding: 0;
}

header,
main,
aside,
footer {
  padding: 2rem;
}

header {
  padding-bottom: 0.5rem;
}

aside {
  border-top: 1px solid var(--border-color);
}

footer {
  text-align: center;
}

section {
  margin-bottom: 1.5rem;
}

/* Utility */
.block {
  display: block;
  margin: 0.25rem 0;
}

.flex-responsive {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

/* Main Layout */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

.page-content .container {
  display: grid;
  grid-template-columns: 1fr;
}

.page-header,
.page-footer {
  background-color: var(--header-footer-bg-color);
  color: var(--text-color); /* This ensures text in header/footer also changes color */
  border-color: var(--border-color);
}

.page-header {
  border-bottom: 1px solid var(--border-color);
}

.page-header .container {
  display: flex;
  flex-direction: column;
}

.header-top {
  gap: 1rem;
}

.header-image {
  width: 100%;
  max-width: 256px;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid #999;
}

.header-info ul {
  margin: 1rem 0;
}

.link-with-icon {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.header-label {
  font-size: 1.3rem;
  color: var(--text-color);
  margin-top: 0.2rem;
  margin-bottom: 0.8rem;
}

.header-summary {
  margin: 1.25rem 0;
}

.page-footer {
  border-top: 1px solid var(--border-color);
}

.section-heading {
  display: flex;
  align-items: center;
  text-align: center;
  margin-bottom: 1rem;
}

.section-heading::before,
.section-heading::after {
  content: "";
  flex: 1;
  border-bottom: 1px solid var(--border-color);
  margin: 0 1rem;
}

aside .section-heading {
  align-items: flex-start;
  text-align: left;
  border-left: 1px solid var(--border-color);
  padding-left: 0.5rem;
  margin-bottom: 0.75rem;
}

aside .section-heading::before,
aside .section-heading::after {
  content: none;
}

.section-label {
  font-size: 0.9rem;
  color: #444;
  margin-top: 0.25rem;
  margin-bottom: 0.5rem;
}

/* Images */
img {
  max-width: 100%;
  height: auto;
}

.gallery {
  display: grid;
  gap: 1rem;
  justify-items: center;
  margin: 0.5rem 0;
}

.main-gallery {
  grid-template-columns: 1fr;
}

.side-gallery {
  grid-template-columns: 1fr;
}

figcaption {
  text-align: center;
  color: #666;
  font-size: 0.9rem;
  margin-top: 0.5rem;
  font-style: italic;
}

/* Lists */
main ul,
aside ul {
  list-style-type: disc;
  list-style-position: inside;
  padding-left: 0;
  margin: 0.75rem 0;
}

main li,
aside li {
  margin-bottom: 0.5rem;
}

.unstyled-list {
  list-style: none;
}

.inline-list {
  list-style: none;
  gap: 0.25rem;
}

.inline-list li {
  display: flex; /* This is for HTML Whitespace Issues */
}

/* Skillbars */
.skill-bar {
  width: 100%;
  height: 1.5rem;
  margin-top: 0.25rem;
  margin-bottom: 1rem;
  background: #eee;
  border: 1px solid #848484;
  border-radius: 2px;
  overflow: hidden;
}

.skill-bar-fill {
  height: 100%;
  background: var(--skill-bar-fill-color) !important;
  border-right: 1px solid #848484;
  border-radius: 2px;
  display: flex;
  align-items: center;
  padding-left: 0.5rem;
}

.skill-bar-label {
  color: #333;
  font-size: 0.9rem;
  white-space: nowrap;
}

.w-0 {
  width: 0%;
}

.w-10 {
  width: 10%;
}

.w-20 {
  width: 20%;
}

.w-25 {
  width: 25%;
}

.w-30 {
  width: 30%;
}

.w-40 {
  width: 40%;
}

.w-50 {
  width: 50%;
}

.w-60 {
  width: 60%;
}

.w-70 {
  width: 70%;
}

.w-75 {
  width: 75%;
}

.w-80 {
  width: 80%;
}

.w-90 {
  width: 90%;
}

.w-100 {
  width: 100%;
  border-right: none;
}

/* Blockquotes */
blockquote {
  margin: 1rem 2rem;
  padding: 1.5rem 2rem;
  background-color: var(--blockquote-bg-color);
  border-left: 4px solid var(--blockquote-accent-color);
  font-style: italic;
  color: var(--blockquote-text-color);
  line-height: 1.6;
  border-radius: 0 4px 4px 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

@media (min-width: 37.5rem) {
  .main-gallery {
    grid-template-columns: repeat(3, 1fr);
  }

  .side-gallery {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 48rem) {
  aside {
    border-top: none;
    border-left: 1px solid #ccc;
  }

  aside h1 {
    font-size: 1.4rem;
  }

  aside h2 {
    font-size: 1.1rem;
  }

  aside h3 {
    font-size: 1rem;
  }

  aside h4 {
    font-size: 1rem;
  }

  aside h5 {
    font-size: 1rem;
  }

  aside h6 {
    font-size: 1rem;
  }

  header {
    padding-bottom: 1.5rem;
  }

  .flex-responsive {
    flex-direction: row;
    align-items: flex-start;
    text-align: left;
  }

  .page-content .container {
    grid-template-columns: 2fr 1fr;
  }

  .header-top {
    gap: 2rem;
  }

  .header-image {
    max-width: 192px;
  }

  .header-info {
    margin-top: 0.5rem;
    padding-top: 1rem;
  }

  .page-header ul {
    margin: 0.5rem 0;
  }

  .inline-list {
    gap: var(--spacing-inline);
  }

  .inline-list li:not(:last-child)::after {
    content: "|";
    margin-left: var(--spacing-inline);
    color: #ccc;
  }

  .side-gallery {
    grid-template-columns: 1fr;
  }
}

@media print {
  .skill-bar-label {
    background: transparent !important;
    background-color: transparent !important;
    mix-blend-mode: darken;
  }

  body {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
}

.tech-stack {
    margin-top: 10px;
}

.tag {
    display: inline-block;
    background: var(--tag-bg-color); 
    color: var(--tag-text-color);
    padding: 5px 10px;
    margin-right: 5px;
    margin-bottom: 5px;
    border-radius: 3px;
    font-size: 0.9em;
}

.blog-post {
    margin-bottom: 20px;
    padding:20px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background-color: #f9f9f9;
}

.blog-post h3 {
    margin-top: 0;
    color: #333;
}

.blog-post p {
    color: #666;
    line-height: 1.6;
}

.post-meta {
    margin: 0;
    font-size: 1.2em;
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
}

.post-meta:hover {
    color: #3498db;
    text-decoration: none;
}

.degree-list {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

.degree-list li {
    padding: 8px;
    margin-bottom: 5px;
    background-color: #f9f9f9;
    border-left: 4px solid #3498db;
}

.degree-list li:hover {
    background-color: #e6f7ff;
}

.skill-category {
  margin-bottom: 0.75rem; /* Adds space between each category */
}

.skill-category-title {
  font-size: 1rem;
  font-weight: bold;
  color: #333;
  margin: 0 0 0.25rem 0; /* Removes default heading margins */
}

.skill-category-list {
  font-size: 0.9rem;
  color: #444;
  line-height: 1.4;
  margin: 0;
}

.competency-item {
  background-color: var(--card-bg-color);
  border: 1px solid var(--border-color);
  border-left: 4px solid #3498db; /* Uses the accent color from your theme */
  padding: 1.25rem;
  border-radius: 4px;
  transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.competency-item-sidebar:hover {
  transform: translateX(-5px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.competencies-sidebar {
  color: var(--text-color); 
  /* This class is a container, no special styles needed */
}

.competency-item-sidebar {
  /* APPLY THEME COLORS */
  background-color: var(--card-bg-color);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--aside-accent-color);
  
  /* Keep existing layout styles */
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  border-radius: 3px;
  transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.competency-title-sidebar {
  color: var(--text-color); /* Ensure title text changes color */
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.25rem 0;
}

.competency-description-sidebar {
  color: var(--text-color); /* Ensure description text changes color */
  opacity: 0.9;
  font-size: 0.85rem;
  line-height: 1.4;
  margin: 0;
}

/* Styling for new homepage sections */
.reading-list {
  list-style-type: none;
  padding-left: 0;
}

.reading-list li {
  margin-bottom: 0.75rem;
  padding-left: 0;
}

.sidebar-hr {
  border: 0;
  border-top: 1px solid var(--border-color, #ccc);
  margin: 0.75rem 0;
}

.competency-item-sidebar p {
    margin: 0.5rem 0;
}

/* STYLE THE TOGGLE SWITCH */
.theme-switch-wrapper {
  display: flex;
  align-items: center;
  margin-top: 1rem;
}
.theme-switch {
  display: inline-block;
  height: 24px;
  position: relative;
  width: 48px;
}
.theme-switch input {
  display: none;
}
.slider {
  background-color: #ccc;
  bottom: 0;
  cursor: pointer;
  left: 0;
  position: absolute;
  right: 0;
  top: 0;
  transition: .4s;
}
.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  -webkit-transition: .4s;
  transition: .4s;
  border-radius: 50%;
  /* Sun icon for light mode */
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="%23f2c500" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="5"></circle><line x1="12" y1="1" x2="12" y2="3"></line><line x1="12" y1="21" x2="12" y2="23"></line><line x1="4.22" y1="4.22" x2="5.64" y2="5.64"></line><line x1="18.36" y1="18.36" x2="19.78" y2="19.78"></line><line x1="1" y1="12" x2="3" y2="12"></line><line x1="21" y1="12" x2="23" y2="12"></line><line x1="4.22" y1="19.78" x2="5.64" y2="18.36"></line><line x1="18.36" y1="5.64" x2="19.78" y2="4.22"></line></svg>');
  background-repeat: no-repeat;
  background-position: center;
}
input:checked + .slider {
  background-color: var(--link-color);
}
input:checked + .slider:before {
  transform: translateX(24px);
  /* Moon icon for dark mode */
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"></path></svg>');
}
.slider.round {
  border-radius: 34px;
}
.slider.round:before {
  border-radius: 50%;
}

/* ===== FLOATING THEME TOGGLE ICON ===== */
.theme-toggle-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000; /* Ensures it stays on top of other content */
}

.theme-icon {
  width: 45px;
  height: 45px;
  background-color: var(--card-bg-color);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  cursor: pointer;
  
  /* Center the icon inside the circle */
  display: flex;
  justify-content: center;
  align-items: center;

  font-size: 20px;
  color: var(--text-color);
  transition: all 0.3s ease;
}

.theme-icon:hover {
  transform: scale(1.1) rotate(360deg);
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
}

.project-summary, 
.blog-post p {
    font-size: 1rem; /* Make summary text slightly larger */
    line-height: 1.7; /* Improve line spacing for readability */
    opacity: 0.9;       /* Slightly reduce contrast for softer text */
}

/* --- Social Icon Styling --- */
.link-with-icon {
  display: inline-flex; /* Use inline-flex for better alignment */
  align-items: center;
  gap: 0.5rem; /* Increased gap slightly for better spacing */
}

.social-icon-wrapper {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;  /* Define a fixed width */
  height: 16px; /* Define a fixed height */
}

/* This is the key: it targets any SVG inside our wrapper */
.social-icon-wrapper svg {
  width: 100%;  /* Make the SVG fill the wrapper */
  height: 100%; /* Make the SVG fill the wrapper */
  fill: currentColor; /* Make the SVG inherit the link color */
}