/* Default theme variables */
:root {
  --bg-color: #fafafa;
  --text-color: #2d2d2d;
  --accent-color: #000000;
  --divider-color: rgba(0, 0, 0, 0.08);
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Custom selection */
::selection {
  background: rgba(74, 144, 164, 0.25);
  color: inherit;
}

/* Dark Mode colors */
.dark-mode {
  --bg-color: #161616;
  --text-color: #e8e8e8;
  --accent-color: #fefefe;
  --divider-color: rgba(255, 255, 255, 0.08);

  --picker-border: #555;
  --picker-bg: #222;
  --picker-text: #eee;
}

.dark-mode ::selection {
  background: rgba(255, 255, 255, 0.3);
}

/* Background color button */
.theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  transition: transform 0.3s ease, background-color 0.2s ease;
  z-index: 100;
}

.theme-toggle:hover {
  background-color: rgba(0, 0, 0, 0.06);
  transform: rotate(15deg);
}

.dark-mode .theme-toggle:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.theme-toggle img {
  width: 28px;
  height: 28px;
  transition: transform 0.4s ease;
}

.theme-toggle:active img {
  transform: scale(0.9);
}

/* colors for links */
a:hover {
  color: #0c47b7;
}

.dark-mode a {
  color: #90e0ef;
}

.dark-mode a:hover {
  color: #fcbf49;
}

/* MAIN BODY */
body {
  background-color: var(--bg-color);
  color: var(--text-color);
  font-family: Arial, sans-serif;
}

/* Profile section */
.profile {
  margin-top: 0px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.additionalinfo {
  margin-top: -15px;
  display: flex;
  align-items: center;
}

#locationIcon {
  width: 28px;
  height: 28px;
  margin-right: 4px;
}

.location-text {
  display: inline-block;  /* keep text on same line as icon */
  font-size: 0.9rem;
  color: var(--text-color);
  margin-right: 8px;
}

.profile-btn {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 20px;
  border: 1px solid var(--text-color);
  background-color: transparent;
  color: var(--text-color);
  font-size: 0.7rem;
  margin-left: 8px;       /* margin between buttons */
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.profile-btn:hover {
  background-color: rgba(0, 0, 0, 0.062);
}

.dark-mode .profile-btn:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

.btn-icon {
  width: 16px;
  height: 16px;
  margin-right: 6px;
}

/* Page Picker */
.page-picker {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 20px;
}

.page-btn {
  padding: 12px 20px;
  font-size: 1rem;
  background: transparent;
  border: none;
  color: var(--picker-text, rgba(0, 0, 0, 0.5));
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.page-btn:hover {
  color: var(--text-color, rgb(0, 0, 0));
  transform: translateY(-2px);
}

.page-btn::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) scale(0);
  width: 6px;
  height: 6px;
  background: var(--accent-color);
  border-radius: 50%;
  transition: transform 0.25s ease;
}

.page-btn.active::after {
  transform: translateX(-50%) scale(1);
}

.page-btn.active {
  color: var(--text-color);
  font-weight: 500;
}

/* Divider */
.divider {
  max-width: 1350px;
  margin: 15px auto; /* top margin */
  position: relative;
}

.divider::before {
  content: '';
  position: absolute;
  width: 100%;
  height: 1px;
  background: var(--divider-color);
  transform: translateY(-50%);
}

/* Page Content */
.page-content {
  max-width: 1300px;
  margin: 20px auto;
  padding: 20px;
}

.page {
  display: none;
  animation: fadeIn 0.3s ease;
}

.page.active {
  display: block;
}

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

/* Under Construction Splash */
.construction-splash {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  text-align: center;
  user-select: none;
}

.construction-emoji {
  font-size: 5rem;
  margin-bottom: 16px;
  animation: sway 2.5s ease-in-out infinite;
}

@keyframes sway {
  0%, 100% { transform: rotate(-8deg); }
  50%       { transform: rotate(8deg); }
}

.construction-title {
  font-size: 3rem;
  font-weight: 700;
  letter-spacing: -1px;
  margin: 0 0 12px 0;
  color: var(--text-color);
}

.construction-subtitle {
  font-size: 1rem;
  opacity: 0.5;
  margin: 0;
  color: var(--text-color);
}

/* Welcome page */
.welcome {
  color: var(--text-color);
}

.introduction {
  max-width: 600px;
  margin: -30px auto;
}

.introduction h2 {
  margin-top: 4rem;
}

.introduction p {
  font-size: 1rem;
  line-height: 1.3;
  text-align: justify;
}

.news {
  max-width: 600px;
  margin: 5rem auto 1rem auto;
}

/* Featured Container */
.featured-container {
  display: flex;
  gap: 24px;
  margin-top: 20px;
  padding: 6px;
  border-radius: 16px;
  border: 1px solid rgba(0, 0, 0, 0.22);
  transition: all 0.3s ease;
  text-decoration: none;
  cursor: pointer;
}

ul li {
  margin-bottom: 1rem;
}

ul li:last-child {
  margin-bottom: 0;
}

.dark-mode .featured-container {
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.featured-container:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
}

.dark-mode .featured-container:hover {
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.4);
}

.featured-image {
  width: 80px;
  height: 80px;
  object-fit: cover;
  margin-left: 12px;
}

.featured-content h3 {
  font-size: 1rem;
  color: var(--text-color);
}

.featured-content p {
  color: var(--text-color);
  opacity: 0.85;
  font-size: 0.9rem;
  margin-top: -8px;
  padding-right: 1rem;
}

/* ABOUT TAB */
.about {
   max-width: 600px;
   text-align: left;
   margin: -8px auto;
}

.about p {
  line-height: 1.3;
  text-align: justify;
}

/* Timeline */
.timeline {
  position: relative;
  margin: 20px 0 40px 0;
  padding-left: 24px;
}

/* the actual line */
.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: linear-gradient(to bottom, transparent, var(--text-color), transparent);
  opacity: 0.3;
}

.timeline-item {
  position: relative;
  padding: 12px 0 12px 20px;
  transition: transform 0.2s ease;
}

.timeline-item:hover {
  transform: translateX(4px);
}

.timeline-item:hover::before {
  background: var(--accent-color);
  border-color: var(--accent-color);
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -5px;
  top: 18px;
  width: 10px;
  height: 10px;
  background: var(--bg-color);
  border: 2px solid var(--text-color);
  border-radius: 50%;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.timeline-title {
  color: var(--text-color);
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 2px;
}

.timeline-subtitle {
  font-size: 0.85rem;
  color: var(--text-color);
  opacity: 0.7;
}

.timeline-date {
  font-size: 0.75rem;
  opacity: 0.5;
  padding: 2px 8px;
}

.timeline-details {
  font-size: 0.85rem;
  line-height: 1.4;
  color: var(--text-color);
  opacity: 0.7;
  margin-top: 6px;
}

/* PROJECTS TAB */
.projects {
  max-width: 800px;
  margin: -8px auto;
}

.projects h2 {
  text-align: left;
  margin-bottom: 8px;
}

.projects-intro {
  text-align: justify; 
  margin-bottom: 40px;
}

.projects-grid {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.projects-grid-secondary {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-top: 25px;
  max-width: 1000px;
  margin-left: -100px;
  margin-right: -100px;
  width: calc(100% + 200px);
}

.project-card {
  display: flex;
  flex-direction: column;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: rgba(0, 0, 0, 0.02);
  transition: all 0.3s ease;
  text-decoration: none;
  cursor: pointer;
}

.dark-mode .project-card {
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
}

.project-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.12);
  border-color: rgba(0, 0, 0, 0.2);
}

.dark-mode .project-card:hover {
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.4);
  border-color: rgba(255, 255, 255, 0.2);
}

/* Highlighted Project Card */
.project-card.highlighted {
  position: relative;
  flex-direction: row;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border: 2px solid #a7d8de;
  background: linear-gradient(135deg, rgba(167, 216, 222, 0.15) 0%, rgba(199, 206, 234, 0.12) 100%);
}

.project-card.highlighted .project-image {
  width: 200px;
  height: 200px;
  margin: 0;
  flex-shrink: 0;
}

.project-card.highlighted .project-content h3 {
  font-size: 1.5rem;
  margin-top: 15px;
}

.project-card.highlighted .project-description {
  text-align: left;
}

.dark-mode .project-card.highlighted {
  border: 2px solid #88c4ca;
  background: linear-gradient(135deg, rgba(136, 196, 202, 0.12) 0%, rgba(167, 176, 210, 0.1) 100%);
}

.project-card.highlighted:hover {
  border-color: #7ec8cf;
  box-shadow: 0 16px 32px rgba(167, 216, 222, 0.25);
}

.dark-mode .project-card.highlighted:hover {
  border-color: #a7d8de;
  box-shadow: 0 16px 32px rgba(136, 196, 202, 0.2);
}

.highlight-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  padding: 6px 12px;
  font-size: 0.75rem;
  background: rgba(255, 255, 255, 0.85);
  color: #5a7a7e;
  border: 1px solid rgba(167, 216, 222, 0.5);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.dark-mode .highlight-badge {
  background: rgba(45, 45, 45, 0.8);
  color: #a7d8de;
  border: 1px solid rgba(167, 216, 222, 0.3);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.project-image {
  width: 100%;
  height: 180px;
  object-fit: contain;
  object-position: center;
  border-radius: 10px;
  margin-bottom: 16px;
}

/* Secondary projects */
.projects-grid-secondary .project-card {
  flex-direction: row;
  align-items: flex-start;
  gap: 40px;
  padding: 40px 0;
  min-height: auto;
  border: none;
  background: transparent;
  border-bottom: 1px solid var(--divider-color);
}

.projects-grid-secondary .project-card:first-child {
  border-top: 1px solid var(--divider-color);
}

.projects-grid-secondary .project-card:hover {
  transform: none;
  box-shadow: none;
  border-color: var(--divider-color);
  background: transparent;
}

.dark-mode .projects-grid-secondary .project-card {
  border-color: var(--divider-color);
  background: transparent;
}

.dark-mode .projects-grid-secondary .project-card:hover {
  box-shadow: none;
  border-color: var(--divider-color);
}

.projects-grid-secondary .project-image {
  width: 320px;
  height: auto;
  max-height: 160px;
  border-radius: 8px;
  object-fit: contain;
  margin: 0;
  flex-shrink: 0;
  transition: transform 0.3s ease;
}

.projects-grid-secondary .project-card:hover .project-image {
  transform: scale(1.02);
}

.projects-grid-secondary .project-content {
  flex: 1;
  padding-top: 4px;
}

.projects-grid-secondary .project-content h3 {
  font-size: 1.3rem;
  margin-bottom: 12px;
  margin-top: -10px;
  transition: color 0.2s ease;
}

.projects-grid-secondary .project-card:hover .project-content h3 {
  color: #0c47b7;
}

.dark-mode .projects-grid-secondary .project-card:hover .project-content h3 {
  color: #90e0ef;
}

.projects-grid-secondary .project-description {
  line-height: 1.3;
  margin-bottom: 0;
  text-align: left;
}

.project-content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.project-content h3 {
  font-size: 1.25rem;
  color: var(--text-color);
  margin: 0 0 8px 0;
}

.project-description {
  color: var(--text-color);
  opacity: 0.75;
  font-size: 0.9rem;
  margin: 0 0 16px 0;
  flex: 1;
}

/* RANDOM TAB */
.random {
   max-width: 800px;
   text-align: left;
   margin: auto;
   margin-top: -30px;
}

/* Food  */
.food {
  display: flex;
  align-items: flex-start;
  gap: 20px;
}

.char-siu {
  width: 150px;
  height: 150px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
}

.food-content {
  flex: 1;
}

.food-content h3 {
  margin: 0 0 8px 0;
  font-size: 1.2rem;
  color: var(--text-color);
}

.food-content p {
  margin: 0;
  color: var(--text-color);
  opacity: 0.85;
  line-height: 1.5;
  text-align: justify;
}

/* Footer */
.footer {
  text-align: center;
  color: var(--text-color);
  opacity: 0.6;
  font-size: 0.85rem;
  margin-top: 60px;
  padding: 30px 20px;
  border-top: 1px solid var(--divider-color);
}

.footer a {
  opacity: 0.8;
  transition: opacity 0.2s ease;
}

.footer a:hover {
  opacity: 1;
}

/* Responsive Styles - Mobile */
@media (max-width: 760px) {

  /* About section */
  .about {
    margin: -8px auto;
    padding: 0 20px;
  }

  /* Projects section */
  .projects {
    padding: 0 20px;
  }

  .projects-intro {
    margin-bottom: 32px;
  }

  .project-card {
    padding: 12px;
    border-radius: 12px;
  }

  .project-card.highlighted {
    flex-direction: column;
    padding: 12px;
  }

  .project-card.highlighted .project-image {
    width: 100%;
    height: 140px;
  }

  .project-card.highlighted .project-content h3 {
    margin-top: -16px;
    text-align: center;
  }


  .project-card.highlighted .project-content p {
    text-align: center;
  }

  .project-image {
    height: 140px;
    border-radius: 8px;
  }

  .projects-grid-secondary {
    margin-left: 0;
    margin-right: 0;
    width: 100%;
    margin-top: 20px;
  }

  .projects-grid-secondary .project-card {
    flex-direction: column;
    gap: 16px;
    padding: 24px 0;
  }

  .projects-grid-secondary .project-image {
    width: 100%;
    height: 160px;
  }

  .projects-grid-secondary .project-content h3 {
    margin-bottom: 8px;
    margin-top: 12px;
  }

  .random {
    padding: 0 20px;
  }

}