/* Modernized CSS with Color Schemes */
:root {
  --primary-color: #562F00;
  --secondary-color: #F6EFBD;
  --accent-color: #E4C087;
  --text-color: #000000;
  --background-color: #FFFDF1;
  --card-bg: #FFCE99;
  --button-hover: #BC7C7C;
  --border-color: rgba(86, 47, 0, 0.2);
  /* Light mode gradient (peach/pink) */
  --gradient-start: #ffac81;
  --gradient-end: #ff928b;
}

[data-theme="dark"] {
  --primary-color: #91AC8F;
  --secondary-color: #4B5945;
  --accent-color: #B2C9AD;
  --text-color: #e0e0e0;
  --background-color: #2d332a;
  --card-bg: #66785F;
  --button-hover: #B2C9AD;
  --border-color: rgba(145, 172, 143, 0.2);
  /* Dark mode gradient (greenish) */
  --gradient-start: #70a388;
  --gradient-end: #0b6a2f5a; /* with alpha */
}

body[data-theme="dark"] {
  background-color: var(--background-color) !important;
}

/* Base */
body {
  font-family: 'Courier New', monospace;
  padding-top: 54px;
  background-color: var(--background-color) !important;
  color: var(--text-color);
  transition: all 0.3s ease;
  overflow-x: hidden;
  width: 100%;
  max-width: 100%;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Courier New', monospace;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--primary-color);
}

h1 {
  font-size: 3rem;
  line-height: 3.5rem;
}

.subheading {
  text-transform: uppercase;
  font-weight: 500;
  font-family: 'Courier New', monospace;
  font-size: 1.35rem;
  color: var(--text-color);
}

.container-fluid {
  overflow-x: hidden;
  width: 100%;
  max-width: 100%;
  padding-left: 0;
  padding-right: 0;
}

/* Navigation */
#sideNav {
  background-color: transparent !important;
  border-right: none !important;
}

#sideNav .navbar-nav .nav-item .nav-link {
  color: var(--text-color) !important;
  border: 2px solid var(--text-color);
  font-weight: 600;
  text-transform: uppercase;
  padding: 8px 15px;
  margin: 5px 0;
  border-radius: 8px;
  transition: all 0.3s ease;
}

#sideNav .navbar-nav .nav-item .nav-link:hover {
  color: black !important;
  border-color: var(--button-hover);
}

/* Sections */
.resume-section {
  border-bottom: 1px solid var(--border-color);
  padding: 5rem 0 !important;
  background-color: transparent !important;
}

.resume-item {
  background-color: var(--card-bg) !important;
  border: 1px solid var(--border-color);
  padding: 20px;
  border-radius: 10px;
  margin-bottom: 20px;
  transition: transform 0.3s ease;
}

.resume-item:hover {
  transform: translateY(-5px);
}

/* Skills Icons */
#skills .list-inline-item i {
  color: var(--primary-color);
  transition: color 0.3s ease;
}

#skills .list-inline-item i:hover {
  color: var(--button-hover);
}

/* Dark Mode Toggle */
.switch {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--primary-color);
  box-shadow: 0 0 8px var(--border-color);
  z-index: 1000;
  background-color: var(--card-bg);
  transition: all 0.3s ease;
}

.switch svg {
  width: 1.5em;
  height: 1.5em;
}

.switch path {
  fill: var(--text-color);
  transition: fill 0.3s ease;
}

#darkModeToggle:checked + .switch {
  background-color: var(--secondary-color);
  border-color: var(--accent-color);
  box-shadow: 0 0 15px var(--button-hover);
}

#darkModeToggle:checked + .switch path {
  fill: var(--button-hover);
}

/* ========== TYPING EFFECT - FIXED WIDTH ========== */
.automatic {
  font-size: 10px;
  font-weight: bold;
  color: var(--text-color) !important;
  font-family: 'Courier New', monospace;
  white-space: nowrap;
  overflow: hidden;
  display: inline-block;
  margin-left: 0.5rem;
  width: 9ch;
  min-width: 9ch;
  max-width: 9ch;
  text-align: left;
  vertical-align: middle;
  flex-shrink: 0;
  flex-grow: 0;
  line-height: 1;
  height: 1em;
}

h1.mb-0 {
  font-size: 3rem;
  white-space: nowrap;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.25rem;
}

/* ========== GLITCH BUTTONS ========== */
[class*="btn-glitch-"] {
  display: inline-block;
  font-family: "VT323", monospace;
  border: 1px solid rgb(0, 0, 0);
  color: rgb(0, 0, 0);
  padding: 10px 13px;
  min-width: 175px;
  line-height: 1.5em;
  white-space: nowrap;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 15px;
  background-color: transparent;
  text-decoration: none;
}

[class*="btn-glitch-"] .text,
[class*="btn-glitch-"] .decoration {
  display: inline-block;
}

[class*="btn-glitch-"] .decoration {
  float: right;
}

[class*="btn-glitch-"]:hover,
[class*="btn-glitch-"]:focus {
  animation-name: glitch;
  animation-duration: 0.2s;
  color: black;
  border: 1px solid rgb(252, 231, 94);
  background-color: var(--accent-color);
  border-color: var(--button-hover);
}

[class*="btn-glitch-"]:hover .text-decoration,
[class*="btn-glitch-"]:focus .text-decoration,
[class*="btn-glitch-"]:hover .decoration,
[class*="btn-glitch-"]:focus .decoration {
  animation-name: blink;
  animation-duration: 0.1s;
  animation-iteration-count: infinite;
}

[class*="btn-glitch-"]:active {
  background: none;
  color: rgb(205, 18, 18);
}

[class*="btn-glitch-"]:active .text-decoration,
[class*="btn-glitch-"]:active .decoration {
  animation-name: none;
}

@keyframes glitch {
  25% { background-color: red; transform: translateX(-10px); letter-spacing: 10px; }
  35% { background-color: green; transform: translateX(10px); }
  59% { opacity: 0; }
  60% { background-color: blue; transform: translateX(-10px); filter: blur(5px); }
  100% { background-color: yellow; filter: blur(5px); }
}

@keyframes blink {
  50% { opacity: 0; }
}

/* ========== GRADIENT CARD EFFECT (for resume items only) ========== */
.resume-item {
  position: relative;
  background: var(--card-bg);
  border-radius: 20px;
  z-index: 1;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: none;
}

.resume-item::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(315deg, var(--gradient-start) 0%, var(--gradient-end) 74%);
  border-radius: 22px;
  z-index: -1;
  transition: all 0.3s ease;
  opacity: 0;
}

.resume-item:hover::before {
  opacity: 1;
  box-shadow: 0px 0px 30px 1px var(--gradient-start);
}

.resume-item:hover {
  transform: scale(0.98);
}

.resume-item > * {
  position: relative;
  z-index: 2;
}

/* ========== ABOUT CARD (Black & Gold) ========== */
.about-card.card {
  width: 100%;
  max-width: 100%;
  height: auto;
  min-height: 500px;
  background: #243137;
  position: relative;
  display: block;
  border-radius: 10px;
  overflow: hidden;
  transition: all 0.5s ease-in-out;
  padding: 2.5rem;
  color: #fff;
  box-sizing: border-box;
  margin: 0;
}

/* Remove gradient from about card */
.about-card::before {
  display: none !important;
  content: none !important;
}

/* Dark mode about card */
[data-theme="dark"] .about-card.card {
  background: #1a1f23;
}

[data-theme="dark"] .about-card .subheading,
[data-theme="dark"] .about-card .subheading a,
[data-theme="dark"] .about-card p,
[data-theme="dark"] .about-card .list-social-icons a,
[data-theme="dark"] .about-card h1 .text-primary,
[data-theme="dark"] .about-card .automatic {
  color: #e0e0e0 !important;
}

[data-theme="dark"] .about-card .text-primary,
[data-theme="dark"] .about-card .automatic {
  color: #B2C9AD !important;
}

/* Light mode text colors (keep light on dark bg) */
[data-theme="light"] .about-card .subheading,
[data-theme="light"] .about-card .subheading a,
[data-theme="light"] .about-card p,
[data-theme="light"] .about-card .list-social-icons a {
  color: #f0f0f0 !important;
}

/* Border animation */
.about-card .border {
  position: absolute;
  inset: 0px;
  border: 2px solid #bd9f67;
  opacity: 0;
  transform: rotate(10deg);
  transition: all 0.5s ease-in-out;
  pointer-events: none;
  z-index: 2;
}

.about-card .bottom-text {
  position: absolute;
  left: 50%;
  bottom: 13px;
  transform: translateX(-50%);
  font-size: 12px;
  text-transform: uppercase;
  padding: 0px 5px 0px 8px;
  color: #bd9f67;
  background: #243137;
  opacity: 0;
  letter-spacing: 7px;
  transition: all 0.5s ease-in-out;
  pointer-events: none;
  z-index: 3;
}

.about-card .content {
  transition: all 0.5s ease-in-out;
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Text sizing */
.about-card h1 {
  font-size: 2.5rem;
  line-height: 4rem;
  margin-bottom: 1.5rem;
}

.about-card .subheading {
  font-size: 1.5rem;
  line-height: 2rem;
  margin-bottom: 2rem;
}

.about-card p {
  font-size: 1.2rem;
  line-height: 1.8rem;
  margin-bottom: 2rem;
}

/* Override automatic inside about card */
.about-card .automatic {
  font-size: 2.5rem;
  width: 11ch;
  min-width: 11ch;
  max-width: 11ch;
  color: #bd9f67 !important;
  margin-left: 0.25rem;
  line-height: 1;
  height: 1em;
}

.about-card .text-primary {
  color: #bd9f67 !important;
}

/* Social icons */
.about-card .list-social-icons .fa-stack .fa-circle {
  color: #bd9f67;
}

.about-card .list-social-icons .fa-stack .fa-inverse {
  color: #243137;
}

[data-theme="dark"] .about-card .list-social-icons .fa-stack .fa-circle {
  color: #91AC8F;
}

[data-theme="dark"] .about-card .list-social-icons .fa-stack .fa-inverse {
  color: #2d332a;
}

/* Hover */
.about-card.card:hover {
  border-radius: 0;
  transform: scale(1.02);
}

.about-card.card:hover .border {
  inset: 15px;
  opacity: 1;
  transform: rotate(0);
}

.about-card.card:hover .bottom-text {
  letter-spacing: 3px;
  opacity: 1;
  transform: translateX(-50%);
}

/* ========== MOBILE FIXES ========== */
@media (max-width: 768px) {
  body {
    padding-left: 0 !important;
  }

  .switch {
    left: 15px;
    right: auto;
    top: 15px;
    width: 50px;
    height: 50px;
    z-index: 1100;
  }

  #sideNav .navbar-collapse {
    background-color: var(--card-bg);
    padding: 1rem;
    border-radius: 0 0 10px 10px;
    margin-top: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  }

  #sideNav .navbar-nav .nav-item .nav-link {
    margin: 8px 0;
    text-align: center;
  }

  h1 {
    font-size: 2.5rem;
    line-height: 3rem;
  }

  .img-profile {
    width: 80px !important;
    height: 80px !important;
    top: 10px;
    left: 10px;
  }

  .container-fluid {
    padding-left: 15px;
    padding-right: 15px;
  }

  .resume-section {
    padding: 3rem 15px !important;
  }

  .resume-item {
    padding: 15px;
    width: 100%;
  }

  .row, [class*="col-"] {
    margin-left: 0;
    margin-right: 0;
    padding-left: 0;
    padding-right: 0;
  }

  /* About card mobile */
  .about-card.card {
    padding: 1.5rem;
    min-height: auto;
  }

  .about-card h1.mb-0 {
    flex-direction: column;
    align-items: flex-start;
    font-size: 2rem;
    line-height: 2.2rem;
  }

  .about-card .text-primary {
    font-size: 2rem;
    display: block;
    width: 100%;
    white-space: normal;
    word-break: keep-all;
    margin-bottom: 0.25rem;
  }

  .about-card .automatic {
    font-size: 2rem;
    width: 9ch !important;
    min-width: 9ch !important;
    max-width: 9ch !important;
    margin: 0;
  }

  .about-card .subheading {
    font-size: 1rem;
    line-height: 1.4rem;
    word-break: break-word;
  }

  .about-card .subheading a {
    word-break: break-all;
  }

  .about-card p {
    font-size: 0.95rem;
    line-height: 1.4rem;
  }

  .about-card .list-social-icons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
  }

  .about-card.card:hover .border {
    inset: 10px;
  }

  .about-card .bottom-text {
    font-size: 10px;
    bottom: 8px;
    letter-spacing: 5px;
  }

  .about-card.card:hover .bottom-text {
    letter-spacing: 2px;
  }

  /* Global automatic on mobile */
  .automatic {
    width: 9ch !important;
    min-width: 9ch !important;
    max-width: 9ch !important;
    line-height: 1;
    height: 1em;
  }
}

@media (max-width: 400px) {
  .about-card h1,
  .about-card .text-primary,
  .about-card .automatic {
    font-size: 1.6rem;
  }
  .about-card .automatic {
    width: 9ch !important;
    min-width: 9ch !important;
    max-width: 9ch !important;
  }
  .automatic {
    width: 9ch !important;
    min-width: 9ch !important;
    max-width: 9ch !important;
  }
}

@media (max-width: 320px) {
  .about-card h1,
  .about-card .text-primary,
  .about-card .automatic {
    font-size: 1.4rem;
  }
  .about-card .automatic {
    width: 9ch !important;
    min-width: 9ch !important;
    max-width: 9ch !important;
  }
  .automatic {
    width: 9ch !important;
    min-width: 9ch !important;
    max-width: 9ch !important;
  }
}

@media (hover: none) {
  .resume-item:hover {
    transform: none;
  }
}