/* Import Google Font */
@import url('https://fonts.googleapis.com/css2?family=Roboto+Mono:wght@400;700&display=swap');

/* Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Body setup */
body {
  background: #000000; /* set to black as requested */
  color: #ffffff;
  font-family: 'Roboto Mono', monospace;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 20px;
  text-align: center;
}

/* Theme toggle button (minimal styling) */
.theme-toggle {
  position: fixed;
  top: 18px;
  right: 18px;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.12);
  color: #ffffff;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.95rem;
  z-index: 9999;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}
.theme-toggle:hover {
  background: rgba(255,255,255,0.03);
}

/* Light mode variants (when body has .light) */
body.light {
  background: #ffffff;
  color: #222222;
}
body.light .theme-toggle {
  color: #222222;
  border-color: rgba(0,0,0,0.08);
}

/* Main wrapper */
main {
  max-width: 650px;
  width: 100%;
}

/* Heading */
h1 {
  font-size: 2.2rem;
  margin-bottom: 1rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: #39ff14; /* defined green for H1 as requested */
}

/* About paragraph */
.about {
  font-size: 1rem;
  margin-bottom: 2rem;
  line-height: 1.6;
  color: #f5f5f5; /* off-white for about section as requested */
}

/* Links list */
.links {
  list-style: none;
  padding: 0;
  margin-bottom: 2rem;
}

.links li {
  margin: 12px 0;
}

/* Matrix-style lime green links - swapped */
.links a {
    background: #39ff14;       /* was hover background */
    color: rgb(0, 0, 0);       /* was hover text color */
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 500;
    transition: color 0.3s ease, background 0.3s ease;
  }
  
  /* Hover effect for nav links - swapped */
  .links a:hover {
    background: black;            /* was static background */
    color: #39ff14;             /* was static text color */
  }
  
  /* Email link styling - swapped */
  .email a {
    display: inline-block;
    color: #000000;             /* was hover text color */
    background: #39ff14;        /* was hover background */
    padding: 2px 4px;
    border-radius: 0px;
    text-decoration: none;
    font-weight: 400;
    font-size: 0.9rem;
    transition: color 0.3s ease, background 0.3s ease;
  }
  
  /* Hover effect for email link - swapped */
  .email a:hover {
    color: #39ff14;             /* was static text color */
    background: black;           /* was static background */
  }

  .links li.submenu {
    margin-top: 0;       /* remove extra space above parent link */
    margin-bottom: 12px; /* keep consistent spacing below */
}

/* Parent <li> shrink-wrapped with no extra top margin */
.submenu {
    display: inline-block;   /* shrink to fit the link */
    position: relative;
    margin-top: 0;           /* remove extra spacing above parent link */
    padding-top: 0;          /* remove any padding above */
}

/* Dropdown menu in normal flow */
.submenu .dropdown {
    display: block;             
    padding: 0;
    list-style: none;
    white-space: nowrap;

    /* hidden initially */
    max-height: 0;
    opacity: 0;
    overflow: hidden;

    /* smooth animation including margin */
    transition: max-height 0.3s ease, opacity 0.3s ease, margin-top 0.3s ease;
    text-align: center;         

    margin-top: 0;              /* no extra space when hidden */
}

/* When visible */
.submenu .dropdown.show {
    max-height: 500px;          
    opacity: 1;
    margin-top: 4px;            /* spacing only when visible */
}



/* Dropdown links styling */
.submenu .dropdown a {
    display: inline-block;       /* shrink to text */
    background: #39ff14;
    color: rgb(0,0,0);
    text-decoration: none;
    font-size: 0.8rem;           /* small for submenu */
    padding: 2px 8px;
    border-radius: 0px;
    margin: 2px 0;               /* small spacing between links */
    transition: color 0.3s ease, background 0.3s ease;
}

/* Hover effect for dropdown links */
.submenu .dropdown a:hover {
    color: #39ff14;
    background: black;
}

  
.highlight {
  text-decoration: underline;
  text-decoration-color: #39ff14;  /* optional: neon green underline */
  text-decoration-thickness: 2px;  /* optional: make it a bit thicker */
}

/* Copy button styled like email link */
.copy-btn {
  background: #39ff14;
  color: black;
  border: none;
  padding: 2px 6px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: color 0.3s ease, background 0.3s ease;
  margin-left: 6px;
  border-radius: 0px;
}

.copy-btn:hover {
  background: black;
  color: #39ff14;
}



/* Center email + copy button together */
.email {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px; /* space between button and link */
}


/* Position "Copied!" below the email group */
.copy-msg {
  display: block;                  /* force it onto its own line */
  font-size: 0.8rem;
  color: #000000;
  opacity: 0;
  transition: opacity 0.25s ease;
  margin-top: 6px;                 /* space below the buttons */
  text-align: center;              /* center under the whole group */
}

.copy-msg.show {
  opacity: 1;
}

/* Email group: keep the row centered but allow wrapping so the message can sit below */
.email {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;    /* allows the copied message to wrap to the next line */
}

/* Ensure top row items don't grow or stretch */
.email > a,
.email > .copy-btn {
  flex: 0 0 auto;
}

/* Copied message: hidden by default (no reserved vertical space) and centered below */


.copy-msg {
  display: block;
  width: 100%;
  text-align: center;
  font-size: 0.8rem;
  color: #000000;
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  margin-top: 28px;       /* increased space to clear tooltip */
  transition: opacity 0.25s ease, max-height 0.25s ease, margin-top 0.25s ease;
}

.copy-msg.show {
  opacity: 1;
  max-height: 40px;
}

/* Tooltip container for email and copy buttons */
.email-link[data-tooltip],
.copy-btn[data-tooltip] {
  position: relative; /* needed for tooltip positioning */
  cursor: pointer;
}

/* Tooltip text */
.email-link[data-tooltip]::after,
.copy-btn[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: -24px;       /* appear below the element */
  left: 50%;
  transform: translateX(-50%);
  background: black;
  color: #39ff14;
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 3px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 10;
}

/* Show tooltip on hover */
.email-link[data-tooltip]:hover::after,
.copy-btn[data-tooltip]:hover::after {
  opacity: 1;
}

/* Ensure email link and copy button have the same size and style */
.email a,
.copy-btn {
  display: inline-flex;       /* makes both respect height and padding */
  align-items: center;        /* vertical centering */
  justify-content: center;    /* horizontal centering */
  padding: 3px 8px;           /* smaller padding */
  font-size: 0.75rem;         /* slightly smaller text */
  line-height: 1.3;           /* vertical alignment consistency */
  border-radius: 0px;
  text-decoration: none;
  background: #39ff14;
  color: black;
  cursor: pointer;
  transition: color 0.3s ease, background 0.3s ease;
}



/* Maintain consistent sizing on mobile */
@media (max-width: 480px) {
  .email a,
  .copy-btn {
    padding: 3px 8px;         /* keep consistent smaller padding on mobile */
    font-size: 0.75rem;       /* ensure text size matches */
  }
}


/* === Disable tooltips on small screens (mobile) === */
@media (max-width: 768px) {
  /* hide pseudo-element tooltips (if you used data-tooltip::after) */
  [data-tooltip]::after,
  [data-tooltip]::before {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
  }

  /* hide any JS-created tooltip elements (use the class name used in JS below) */
  .js-tooltip {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
  }
}



/* Mobile responsiveness */
@media (max-width: 480px) {
  h1 {
    font-size: 1.7rem;
  }

  .about {
    font-size: 0.95rem;
  }

  .links a,
  .email a {
    font-size: 1rem;
    padding: 6px 10px;
  }

  .email a { font-size: .75rem;
  }

  .email a,
  .copy-btn {
    padding: 3px 8px;         /* keep consistent smaller padding on mobile */
    font-size: 0.75rem;       /* ensure text size matches */
  }

   /* Make dropdown links a bit taller for easier tapping */
   .submenu .dropdown a {
    padding: 6px 12px;
    font-size: 0.6rem;
  }

  /* Optional: increase spacing between main links for mobile */
  .links li {
    margin: 16px 0;
  }
}

/* Mobile: make pressed links/buttons reset to normal style immediately */
@media (max-width: 480px) {
  a:active, button:active {
    background: #39ff14; /* normal background */
    color: black;        /* normal text color */
  }
  a, button {
    -webkit-tap-highlight-color: transparent; /* remove gray overlay on tap */
  }
}

/* ---------- OVERRIDES FOR LIGHT MODE COLORS (placed last to ensure they win) ---------- */

/* Make H1 and .about black in light mode as requested */
body.light h1 {
  color: #000000 !important;
}
body.light .about {
  color: #000000 !important;
}
