/* root theme colours */
:root {
  --navbar-height: 3.96rem;
  --navbar-padding-y: 0.6rem;
}

:root.light {
  --bg: #ffffff;
  --bg-2: #f4f4f4;
  --panel: #fafafa;
  --muted: #555555;
  --text-rgb: 0, 0, 0;
  --accent: #000000;
  --radius: 12px;
  --shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
  --nav-bg: var(--bg);
  --nav-border: rgba(0, 0, 0, 0.1);
}

:root.dark {
  --bg: #121212;
  --bg-2: #2A2A2A;
  --panel: #1E1E1E;
  --muted: #aaaaaa;
  --text-rgb: 224, 224, 224;
  --accent: #E0E0E0;
  --radius: 12px;
  --shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
  --nav-bg: rgba(24, 24, 24, 0.7);
  --nav-border: rgba(255, 255, 255, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-padding-top: 80px;
}

body {
  margin: 0;
  font-family: 'JetBrains Mono', monospace;
  background: var(--bg);
  color: rgb(var(--text-rgb));
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background 0.3s, color 0.3s;
}

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 15px;
}


/* Intro section */
.intro-section {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: auto;
  padding: 250px 0 200px 0;
  text-align: center;
  background-image: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.4)), url('./images/ww-natural-scenery.jpg');
  background-size: cover;
  background-position: 50% 30%;
  position: relative;
  padding-top: 180px;
}

.intro-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}

.intro-name {
  font-size: clamp(2.0em, 5vw, 2.5rem);
  font-weight: 700;
  color: #FFFFFF;
  margin: 0;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
  font-family: 'JetBrains Mono', monospace;
}

.intro-role {
  font-size: 1.1rem;
  color: #E0E0E0;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.7);
}


/* Navbar */
.nav-bar {
  --navbar-line-height: calc(var(--navbar-height) - var(--navbar-padding-y) * 2);
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  backdrop-filter: blur(8px);
  background: var(--nav-bg);
  border-bottom: 1px solid var(--nav-border);
  z-index: 1000;
  transition: background 0.3s, border-color 0.3s;
}

.nav-container {
  width: min(1100px, 92%);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
}

.nav-logo {
  width: 50px;
  height: var(--navbar-line-height);
  background-image: url('./images/avatar-navbar.jpg');
  background-size: cover;
  background-position: center;
  /* border-radius: 50%;  */
}

.nav-links-container {
  display: flex;
  gap: 24px;
  align-items: center;
}

.nav-link {
  font-weight: 500;
  font-size: 16px;
  color: var(--muted);
  font-family: 'JetBrains Mono', monospace;
  font-weight: bolder;
  text-decoration: none;
  position: relative;
  padding-bottom: 4px;
  transition: color 0.2s ease;
}

.nav-link:hover {
  color: rgb(var(--text-rgb));
}

.nav-link.active {
  color: rgb(var(--text-rgb));
  font-weight: 600;
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: rgb(var(--text-rgb));
}

.nav-item {
  position: relative;
}

.nav-link i {
  margin-right: 6px;
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 0;
  background: var(--panel);
  border: 1px solid var(--nav-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  min-width: 180px;
  z-index: 1001;
  padding: 8px 0;
}

.nav-item.dropdown:hover .dropdown-menu {
  display: block;
}

.dropdown-menu a {
  display: block;
  padding: 10px 16px;
  color: var(--muted);
  text-decoration: none;
  font-size: 15px;
  font-family: 'JetBrains Mono', monospace;
  transition: background-color 0.2s, color 0.2s;
  font-weight: 500;
}

.dropdown-menu a.active,
.dropdown-menu a:hover {
  background-color: var(--bg-2);
  color: rgb(var(--text-rgb));
  font-weight: 600;
}

.theme-toggle {
  background: none;
  border: none;
  color: var(--muted);
  opacity: 0.9;
  font-size: 1.2rem;
  cursor: pointer;
  transition: transform 0.2s;
}

.theme-toggle:hover {
  transform: rotate(20deg);
}

.nav-toggle {
  display: none;
  /* Hidden from desktop view */
  background: none;
  border: none;
  color: var(--muted);
  opacity: 0.9;
  font-size: 1.2rem;
  cursor: pointer;
  transition: transform 0.2s;
}

.nav-toggle:hover {
  transform: scale(1.1);
  color: rgb(var(--text-rgb));
}


/* Sections */
.section {
  padding: 80px 0;
  max-width: 960px;
  margin: 0 auto;
}

h2 {
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  color: rgb(var(--text-rgb));
  text-align: left;
  margin-bottom: 32px;
  border-bottom: 1px solid rgba(var(--text-rgb), 0.2);
  padding-bottom: 10px;
}

.maintenance-title {
  font-size: 3em;
  margin-bottom: 20px;
}


/* About */
.about-card {
  background: var(--panel);
  border-radius: var(--radius);
  padding: 32px;
  border: 1px solid rgba(var(--text-rgb), 0.1);
  box-shadow: var(--shadow);
  max-width: 900px;
  margin: 0 auto;
}

.about-links {
  margin-top: 20px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--bg-2);
  font-weight: 600;
  border: 1px solid rgba(var(--text-rgb), 0.15);
  color: rgb(var(--text-rgb));
  text-decoration: none;
  transition: transform 0.2s ease-out, box-shadow 0.2s ease-out;
}

.chip:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 10px rgba(var(--text-rgb), 0.1);
}


/* Skills */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

.skill-category {
  background: var(--panel);
  padding: 24px;
  border-radius: var(--radius);
  border: 1px solid rgba(var(--text-rgb), 0.1);
  transition: transform 0.3s ease;
}

.skill-category:hover {
  transform: translateY(-6px);
}

.skill-category h4 {
  font-size: 1.25rem;
  margin-bottom: 16px;
  color: rgb(var(--text-rgb));
}


/* Projects */
.projects-grid,
.timeline {
  display: grid;
  gap: 24px;
}

.timeline-content {
  background: var(--panel);
  padding: 24px;
  border-radius: var(--radius);
  border: 1px solid rgba(var(--text-rgb), 0.1);
  transition: transform 0.3s ease;
}

.timeline-content:hover {
  transform: translateY(-6px);
}

.tools-title {
  font-size: 0.9rem;
  font-weight: 600;
  margin-top: 20px;
  margin-bottom: 10px;
  color: var(--muted);
}

.timeline-tools {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.tool-tag {
  background: var(--bg-2);
  color: var(--muted);
  font-size: 0.8rem;
  padding: 4px 10px;
  border-radius: 4px;
}


/* Project link Demo/Source */
.timeline-links {
  margin-top: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.timeline-links a {
  display: inline-flex;
  align-items: center;
  gap: 8px;

  text-decoration: none !important;
  font-size: 0.9rem;
  font-weight: 600;

  padding: 6px 14px;
  border-radius: 6px;
  border: 1px solid transparent;
  transition: all 0.2s ease-out;
}

/* Projects - For link YouTube */
.timeline-links a[href*="youtube.com"] {
  background-color: rgba(255, 0, 0, 0.1);
  border-color: rgba(255, 0, 0, 0.3);
  color: #FF3333;
}

.timeline-links a[href*="youtube.com"]:hover {
  background-color: rgba(255, 0, 0, 0.2);
  color: #FFFFFF;
  border-color: rgba(255, 0, 0, 0.5);
}

/* Projects - For link GitHub */
.timeline-links a[href*="github.com"] {
  background-color: var(--bg-2);
  border-color: rgba(var(--text-rgb), 0.2);
  color: rgb(var(--text-rgb));
}

.timeline-links a[href*="github.com"]:hover {
  background-color: var(--panel);
  border-color: rgba(var(--text-rgb), 0.4);
}

/* Experience list */
.exp-list {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 20px;
}

.exp-list li {
  background: var(--panel);
  padding: 24px 28px;
  border-radius: var(--radius);
  border: 1px solid rgba(var(--text-rgb), 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  line-height: 1.7;
}

.exp-list li:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow);
}

.exp-list li strong {
  display: flex;
  align-items: center;
  font-size: 1.2rem;
  color: rgb(var(--text-rgb));
  margin-bottom: 10px;
}

.exp-list li strong i {
  margin-right: 12px;
  font-size: 1.1rem;
  width: 20px;
  text-align: center;
  opacity: 0.8;
  color: var(--accent);
}


/* Footer */
.footer {
  background: var(--bg);
  padding: 100px 0 20px;
  border-top: 1px solid rgba(var(--text-rgb), 0.1);
}

.footer-content {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 40px;
  align-items: start;
  margin-bottom: 40px;
}

.footer-about h3,
.contact-details h3 {
  color: rgb(var(--text-rgb));
  margin-bottom: 12px;
}

.footer-about p,
.contact-details p {
  color: var(--muted);
}

.contact-details p a {
  text-decoration: none;
  color: var(--muted);
  transition: color 0.2s, text-decoration 0.2s;
}

.contact-details p a:hover {
  text-decoration: underline;
  color: rgb(var(--text-rgb));
}

.social-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--panel);
  color: rgb(var(--text-rgb));
  margin-right: 10px;
  text-decoration: none;
  transition: opacity 0.2s, transform 0.2s ease-out, box-shadow 0.2s ease-out;
}

.social-links a:hover {
  /* opacity: 0.6; */
  transform: scale(1.1);
  box-shadow: 0 0 10px rgba(var(--text-rgb), 0.5);
}

.footer-bottom {
  padding-top: 24px;
  margin-top: 40px;
  border-top: 1px solid rgba(var(--text-rgb), 0.1);
  text-align: center;
}

.footer-bottom p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 800px) {
  .footer-content {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .nav-toggle {
    display: block;
  }

  .theme-toggle {
    display: none;
  }

  .nav-links-container {
    display: none;
    position: absolute;
    top: var(--navbar-height);
    left: 0;
    width: 100%;
    /* background: var(--nav-bg); */
    background: var(--bg);
    border-bottom: 1px solid var(--nav-border);
    padding: 20px 0;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    z-index: 999;
  }

  .nav-links-container.show {
    display: flex;
  }

  .nav-item.dropdown .dropdown-menu {
    position: static;
    display: flex;
    flex-direction: column;
    align-items: center;
    border: none;
    box-shadow: none;
    background: transparent;
    min-width: auto;
    padding: 10px 0 0 0;
    gap: 15px;
  }

  .intro-section {
    padding: 120px 0 100px 0;
  }

  .section {
    padding: 60px 0;
  }

  h2 {
    text-align: center;
  }

  .skill-category h4 {
    text-align: center;
  }

  .maintenance-title {
    font-size: 2.2rem;
    line-height: 1.3;
  }
}


/* IP details section */
.ip-details-list {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 1.1em;
}

.ip-details-list li {
  padding: 14px 10px;
  border-bottom: 1px solid var(--nav-border);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.ip-details-list li:last-child {
  border-bottom: none;
}

.ip-details-list li strong {
  color: rgb(var(--text-rgb));
  min-width: 180px;
  font-weight: 600;
}

.ip-details-list li span {
  color: var(--muted);
  font-weight: 500;
  word-break: break-all; 
}

.ip-details-list li i {
  width: 24px;
  text-align: center;
  margin-right: 10px;
  color: var(--accent);
  opacity: 0.8;
  font-size: 1.1rem;
}

/* Styles for Ping Checker */
.ping-input-group {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.ping-input-group input[type="text"] {
  flex-grow: 1;
  padding: 12px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--nav-border);
  background: var(--bg-2);
  color: rgb(var(--text-rgb));
  font-family: 'JetBrains Mono', monospace;
  font-size: 1rem;
}

.ping-input-group button {
  padding: 12px 20px;
  border: none;
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--bg);
  font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
  cursor: pointer;
  transition: opacity 0.2s;
}

.ping-input-group button:hover {
  opacity: 0.8;
}

.ping-input-group button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.ping-results {
  font-size: 1.1em;
  text-align: center;
  font-weight: 600;
  color: var(--muted);
  min-height: 24px;
}

.ping-results .success {
  color: #4CAF50;
}

.ping-results .error {
  color: #F44336;
}

.tooltip {
  position: relative;
  display: inline-block;
  margin-left: auto;
}

.tooltip .fa-circle-info {
  font-size: 0.9em;
  color: var(--muted);
  cursor: help;
}

.tooltip .tooltip-text {
  visibility: hidden;
  width: 240px;
  background-color: var(--bg-2);
  color: rgb(var(--text-rgb));
  text-align: center;
  border-radius: var(--radius);
  padding: 8px 12px;
  position: absolute;
  z-index: 1;
  bottom: 130%;
  left: 50%;
  margin-left: -120px;
  opacity: 0;
  transition: opacity 0.3s;
  box-shadow: var(--shadow);
  border: 1px solid var(--nav-border);
  font-size: 0.9em;
  font-weight: 500;
  line-height: 1.4;
}

.tooltip:hover .tooltip-text {
  visibility: visible;
  opacity: 1;
}