/* table of contents */

/* 1. variables*/
/* 2. global styles */
/* 3. layout */
/* 4. components */
/* 5. utilities */

/* ================
	 1. variables
   ================ */

.body-light {
  --bg: #f5f6f7;
  --bg-alt: #fff;
  --fg: #444;
  --fg-alt: #222;
  --primary: #306cc4;
  --primary-alt: #185dc7;
  --primary-light: rgba(44, 93, 206, 0.1);
  --container-shadow: 0 2px 4px rgb(0 0 0 / 10%);
}

.body-dark {
  --bg: #000000;
  --bg-alt: rgba(97, 97, 97, 0.33);
  --fg: #bdbddd;
  --fg-alt: #ffffff;
  --primary: #ffffff;
  --primary-alt: #ffffff;
  --primary-light: rgba(0, 0, 0, 0.44);
  --container-shadow: rgba(0, 0, 0, 0.1) 0px 4px 6px -1px,
    rgba(0, 0, 0, 0.06) 0px 2px 4px -1px;
}

/* =====================
     2. global styles
   ===================== */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  border: 0;
  box-shadow: none;
}

::-moz-selection {
  background: var(--primary);
  color: var(--bg);
}

::-webkit-selection,
::selection {
  background: var(--primary);
  color: var(--bg);
}

::-webkit-scrollbar {
  width: 16px;
}

::-webkit-scrollbar-track {
  background-color: var(--bg-alt);
}

::-webkit-scrollbar-thumb {
  border: 4px solid var(--bg);
  background-color: var(--primary);
  border-radius: 0.5em;
}

::-webkit-scrollbar-thumb:hover {
  background-color: var(--primary-alt);
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0 auto;
  max-width: 1100px;
  width: 95%;
  background-color: var(--bg);
  color: var(--fg);
  font-family: "Poppins", sans-serif;
  line-height: 1.5;
  transition: background-color 0.1s linear;
}

h1,
h2,
h3,
h4 {
  color: var(--fg-alt);
  line-height: 1.1;
}

h1 {
  font-size: 5rem;
}

h2 {
  font-size: 1.8em;
}

ul {
  list-style-type: none;
}

button {
  cursor: pointer;
  font-family: inherit;
  background-color: inherit;
}

a {
  text-decoration: none;
}

.link {
  padding: 0 0 0.12em 0;
  position: relative;
  color: var(--primary);
}

.link:hover {
  color: var(--primary);
}

.link:active {
  color: var(--primary-alt);
}

.link::before {
  content: "";
  display: inline;
  width: 0%;
  height: 0.12em;
  position: absolute;
  bottom: 0;
  background-color: var(--primary);
  transition: width 0.2s ease-out;
}

.link:hover::before {
  width: 100%;
}

@media (max-width: 768px) {
  h1 {
    font-size: 4rem;
  }
}

@media (max-width: 580px) {
  h2 {
    font-size: 1.5rem;
  }
}

@media (max-width: 320px) {
  h1 {
    font-size: 3rem;
  }
}

/* =============
     3. layout
   ============= */

header,
nav,
nav ul,
.hero,
.contact ul,
footer {
  display: flex;
  align-items: center;
}

header {
  height: 5em;
  justify-content: space-between;
}

nav li {
  font-weight: 500;
  margin: 0 0.5em;
}

.hero {
  margin-top: 6em;
  justify-content: space-between;
}

.hero h1 {
  display: flex;
  flex-direction: column;
  flex-basis: 50%;
  min-height: 200px;
  height: 200px;
}

.hero-name {
  color: var(--primary);
}

.hero-about {
  flex-basis: 40%;
}

.hero-about p {
  font-size: 1.1rem;
}

.hero-about .btn {
  margin-top: 2.2em;
}

section {
  margin-top: 5em;
}

.section-title {
  padding-top: 0.5em;
  margin-bottom: 1.5em;
  text-align: center;
  text-transform: uppercase;
}

.section-title::after {
  content: "";
  margin: 0.3em auto 0 auto;
  display: block;
  width: 1.5em;
  border-bottom: 0.2em solid var(--primary);
  /* animate up/down to hint at scrolling */
  animation: scrollHint 1.4s ease-in-out infinite alternate;
}

/* animation for section underline to move down/up */
@keyframes scrollHint {
  0% {
    transform: translateY(0);
    opacity: 1;
  }
  100% {
    transform: translateY(6px);
    opacity: 0.6;
  }
}

.project-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: var(--bg-alt);
  max-width: 950px;
  width: 95%;
  margin: 2em auto;
  padding: 2em;
  text-align: center;
  box-shadow: var(--container-shadow);
  border-radius: 1em;
}

.project img {
  border-radius: 0.5em;
}

.project-content {
  flex-basis: 50%;
  margin-left: 2em;
}

.project-content p {
  margin: 1.2em 0;
}

.project-skill,
.project-link {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
}

.project-skill {
  margin: 0 auto;
}

.project-skill li {
  font-size: 0.8rem;
  font-weight: 700;
  margin: 0.3em 0.2em;
  padding: 0.4em 0.6em;
  border-radius: 5em;
  background-color: var(--primary-light);
  color: var(--primary-alt);
}

.project-link {
  margin-top: 1.2em;
}

.stack-container {
  margin: 0 auto;
  display: flex;
  gap: 1em;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
}

.tech-container {
  width: 10em;
  height: 10em;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: var(--bg-alt);
  border-radius: 1.5em;
  box-shadow: var(--container-shadow);
  overflow: hidden;
  font-size: 0.8rem;
  font-weight: 500;
}

.tech-container::before {
  content: "";
  position: absolute;
  bottom: 0px;
  left: 0px;
  transform: scaleX(0);
  width: 100%;
  height: 6px;
  border-radius: 1.5;
  background-color: var(--primary-alt);
  transition: all 0.2s linear;
}

.tech-container:hover::before {
  transform: scaleX(1);
}

.tech-container i {
  font-size: 3rem;
  margin-bottom: 0.2em;
}

.contact ul {
  flex-wrap: wrap;
  justify-content: center;
}

.contact .btn {
  margin-right: 0.5em;
  margin-top: 0.3em;
}

.contact .icon,
.hero .icon {
  margin-right: 0.2em;
}

footer {
  margin-top: 5em;
  height: 7em;
  flex-direction: column;
  justify-content: center;
  position: absolute;
  left: 0;
  right: 0;
  background-color: var(--bg-alt);
  box-shadow: 0 -0.1em 1em rgb(0, 0, 0, 0.1);
}

footer ul {
  display: flex;
}

footer small {
  font-weight: 500;
  margin-top: 0.5em;
}

@media (max-width: 950px) {
  .project-container {
    flex-direction: column;
    max-width: 450px;
    padding: 1.5em;
  }

  .project img {
    max-width: 100%;
    max-height: 100%;
    margin: 0 auto;
    margin-bottom: 2em;
  }

  .project-content {
    padding: 0;
    margin-left: 0;
  }
}

@media (max-width: 580px) {
  nav ul {
    flex-direction: column;
    padding: 4em 0;
    position: absolute;
    right: 0;
    top: 5em;
    background-color: var(--bg);
    width: 0;
    overflow: hidden;
    transition: width 0.2s ease-in-out;
  }
  .navOpen {
    width: 100%;
  }

  .display-nav-list {
    width: 100%;
  }

  nav li {
    margin: 0.5em 0;
  }

  .hero,
  .hero-about,
  section {
    margin-top: 2.5em;
  }

  .hero {
    padding-bottom: 1em;
    flex-direction: column;
  }

  .hero h1,
  .hero-about {
    width: 100%;
  }

  .hero h1 {
    min-height: 150px;
    height: 150px;
  }

  .project .section-title {
    margin-bottom: 0;
  }

  .stack-container i {
    font-size: 3rem;
  }
}

/* =================
     4. components
   ================= */

/* buttons */

.btn {
  display: inline-block;
  border-radius: 5em;
  font-size: 0.8rem;
  font-weight: 600;
  transition: transform 0.2s ease-in-out;
  padding: 1em 1.6em;
  background-color: var(--primary);
  color: var(--bg);
}

.btn:hover {
  background-color: var(--primary-alt);
}

.btn:active {
  transform: translateY(-0.4em);
}

/* icons */

.icon-normal,
.icon-border {
  margin: 0em;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
  cursor: pointer;
  border-radius: 0%;
  font-size: 1.2rem;
  border-width: 10px;
}

.icon-normal:hover,
.icon-border:hover {
  color: var(--bg);
  border-radius: 0.5em;
}

.icon-normal::after,
.icon-border::after {
  content: "";
  position: absolute;
  width: 0%;
  height: 0%;
  z-index: -1;
  background-color: var(--primary);
  border-radius: 0%;
  transition: all 0.25s ease-in-out;
  border-radius: 0.5em;
}

.icon-normal:hover::after,
.icon-border:hover::after {
  width: 100%;
  height: 100%;
  border: 0.2em solid var(--primary);
}

.icon-normal {
  width: 1.6em;
  height: 1.6em;
  color: var(--fg-alt);
}

.icon-border {
  width: 8.2em;
  height: 2.2em;
  color: var(--primary);
  border: 0.15em solid transparent; /* Set border color to transparent */
}

/* icons */

.scroll-container {
  display: flex;
  justify-content: flex-end;
}

.scroll-up {
  display: none;
  position: fixed;
  font-size: 0.9rem;
  bottom: 3em;
  right: 2em;
  font-weight: 600;
  transition: transform 0.2s ease-in-out;
}

.scroll-up:active {
  transform: translateY(0.4em);
}

.scroll-up a {
  background-color: var(--primary);
  padding: 0.9em 1.2em;
  color: var(--bg);
  border-radius: 50%;
}

.scroll-up a:hover {
  background-color: var(--primary-alt);
}

@media (max-width: 1000px) {
  .scroll-container {
    display: none;
  }
}

/* ============
   5. utilities
   ============ */

.fa-bars {
  display: none;
}

.header-title {
  font-weight: 700;
  text-shadow: 0 4px 2px rgba(0, 0, 0, 0.2);
}

nav .link {
  color: var(--fg-alt);
}

@media (max-width: 580px) {
  .fa-bars {
    display: flex;
  }
}

.experience {
  padding: 40px 0;
  color: var(--fg); 
}

.experience-card {
  background-color: var(--bg-alt); 
  padding: 20px;
  border-radius: 10px;
  box-shadow: var(--container-shadow); 
  max-width: 950px; 
  width: 95%;
  margin: 2em auto;
  text-align: left;
}

.experience-item {
  display: flex;
  align-items: flex-start; 
  padding-bottom: 20px;
}

.experience-logo {
  flex-shrink: 0;
  margin-right: 20px; 
}

.experience-logo img {
  width: 60px;
  height: 60px;
  border-radius: 10px;
  object-fit: contain;
}

.experience-details {
  flex-grow: 1;
}

.experience-details h3 {
  margin: 0;
  font-size: 1.2rem; 
  color: var(--primary); 
}

.experience-details h4 {
  margin-top: 5px;
  font-size: 1rem; 
  color: var(--fg-alt); 
}

.experience-details p {
  margin: 5px 0;
  font-size: 0.9rem; 
  color: var(--fg); 
}

.experience-skills {
  list-style: none;
  padding: 0;
  margin: 10px 0 0 0;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-start; 
}

.experience-skills li {
  font-size: 0.8rem; 
  font-weight: 700;
  padding: 0.4em 0.8em; 
  border-radius: 5em;
  background-color: var(--primary-light);
  color: var(--primary-alt); 
  display: inline-block;
}

.experience-card hr {
  border: none;
  border-top: 1px solid var(--primary-light); 
  margin: 20px 0;
}

@media (max-width: 768px) {
  .experience-item {
    flex-direction: column;
  }

  .experience-logo img {
    margin-bottom: 10px;
  }
}

.tech-icon {
  width: 100px; 
  height: auto; 
  margin-top: 5px; 
}

.tech-icon-close {
  width: 50px; 
  height: auto; 
  margin-top: 5px; 
}

.copy-notification {
  display: none;
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-bottom: 10px;
  padding: 5px 10px;
  background-color: var(--bg-alt);
  color: var(--fg-alt);
  border-radius: 5px;
  font-size: 0.9em;
  white-space: nowrap;
  z-index: 1;
  box-shadow: var(--container-shadow);
}

/* Blinking final dot */
.blinking-dot {
  animation: dot-blink 1.5s infinite;
  color: var(--primary);
}

/* Blinking letter "y" in Dubey */
.blinking-y {
  animation: letter-blink 0.8s infinite;
  color: var(--primary) !important;
  font-weight: bold;
}

/* Blinking cursor after typing completes */
.blinking-cursor {
  color: var(--primary);
  animation: cursor-blink 1s infinite;
  font-size: 1em;
  display: inline-block;
  margin-left: 2px;
}

/* Legacy fallback blinking dots */
.blinking-dots {
  color: var(--primary);
  animation: cursor-blink 1s infinite;
  font-size: 1em;
  display: inline-block;
  margin-left: 0;
}

@keyframes dot-blink {
  0%, 50% {
    opacity: 1;
  }
  51%, 100% {
    opacity: 0;
  }
}

@keyframes letter-blink {
  0%, 50% {
    opacity: 1;
  }
  51%, 100% {
    opacity: 0;
  }
}

@keyframes cursor-blink {
  0%, 50% {
    opacity: 1;
  }
  51%, 100% {
    opacity: 0;
  }
}

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.8);
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal-content {
  background-color: var(--bg-alt);
  margin: 2vh auto;
  padding: 0;
  border-radius: 1em;
  width: 90%;
  max-width: 800px;
  height: 96vh;
  max-height: 96vh;
  overflow-y: auto;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  animation: slideDown 0.4s ease;
  position: relative;
}

/* Ensure modal is opaque in dark mode */
.body-dark .modal-content {
  background-color: #1a1a1a;
}

/* Ensure text is white in dark mode, not blue */
.body-dark .modal-body,
.body-dark .modal-body p,
.body-dark .modal-body h2,
.body-dark .modal-body h3,
.body-dark .modal-body strong {
  color: #ffffff;
}

/* Dark mode: darker background for metadata and example boxes */
.body-dark .modal-body .project-meta {
  background-color: #2a2a2a;
  border-left-color: #4a9eff;
}

/* Dark mode: darker background for example/solution boxes */
.body-dark .modal-body div[style*="background-color: rgba(240, 242, 245"] {
  background-color: rgba(42, 42, 42, 0.8) !important;
}

/* Bot label styling - blue in both light and dark mode */
.bot-label {
  color: #0066cc !important;
}

/* Bot label in dark mode - lighter blue (needs !important to override strong color) */
.body-dark .bot-label {
  color: #4a9eff !important;
}

/* Phase label styling - blue in light mode */
.phase-label {
  color: #0066cc !important;
}

/* Phase label in dark mode - lighter blue */
.body-dark .phase-label {
  color: #4a9eff !important;
}

@keyframes slideDown {
  from {
    transform: translateY(-50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-close {
  color: var(--fg);
  position: sticky;
  top: 0;
  right: 0;
  float: right;
  font-size: 2.5rem;
  font-weight: 300;
  line-height: 1;
  padding: 0.5rem 1rem;
  cursor: pointer;
  background-color: var(--bg-alt);
  border-radius: 0 1em 0 0;
  z-index: 10;
  transition: color 0.2s ease;
}

.modal-close:hover,
.modal-close:focus {
  color: var(--primary);
}

.modal-body {
  padding: 2rem 3rem 3rem 3rem;
  color: var(--fg);
  line-height: 1.9;
  font-size: 1rem;
  font-family: Charter, Georgia, 'Times New Roman', serif;
  max-width: 680px;
  margin: 0 auto;
}

.modal-body h2 {
  color: var(--fg-alt);
  font-size: 2.25rem;
  margin-bottom: 1.5rem;
  margin-top: 0.5rem;
  font-weight: 700;
  line-height: 1.25;
  font-family: 'Fell', Georgia, serif;
  letter-spacing: -0.02em;
}

.modal-body h3 {
  color: var(--fg-alt);
  font-size: 1.5rem;
  margin-top: 2.5rem;
  margin-bottom: 1.25rem;
  font-weight: 600;
  line-height: 1.3;
  font-family: 'Söhne', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  letter-spacing: -0.01em;
}

.modal-body p {
  margin-bottom: 1.5rem;
  color: var(--fg);
  font-size: 1rem;
  line-height: 1.9;
  text-align: justify;
  hyphens: auto;
}

.modal-body strong {
  color: var(--fg-alt);
  font-weight: 600;
  font-family: 'Söhne', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

.modal-body .project-meta {
  background-color: var(--primary-light);
  padding: 1.5rem 2rem;
  border-radius: 0.75rem;
  margin-bottom: 2.5rem;
  margin-top: 1rem;
  font-size: 1rem;
  font-family: 'Söhne', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  line-height: 1.8;
  border-left: 4px solid var(--primary);
}

.modal-body .project-meta p {
  margin-bottom: 0.75rem;
  text-align: left;
  line-height: 1.8;
}

.modal-body .project-meta p:last-child {
  margin-bottom: 0;
}

.project-clickable {
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.project-clickable:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.click-to-view {
  margin-top: 1rem;
  font-size: 0.9rem;
  color: var(--primary);
  font-weight: 500;
  font-style: italic;
}

@media (max-width: 768px) {
  .modal-content {
    width: 95%;
    margin: 2vh auto;
    height: 96vh;
    max-height: 96vh;
  }

  .modal-body {
    padding: 2rem 1.5rem 3rem 1.5rem;
    font-size: 1.0625rem;
    line-height: 1.9;
  }

  .modal-body h2 {
    font-size: 2rem;
    margin-bottom: 1.25rem;
  }

  .modal-body h3 {
    font-size: 1.5rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
  }

  .modal-body p {
    font-size: 1.0625rem;
    margin-bottom: 1.5rem;
    text-align: left;
  }

  .modal-body .project-meta {
    padding: 1.25rem 1.5rem;
    margin-bottom: 2rem;
  }

  .modal-close {
    font-size: 2rem;
    padding: 0.4rem 0.8rem;
  }
}

