/* --- General & Body Styles --- */
* { 
  margin: 0; 
  padding: 0; 
  box-sizing: border-box; 
}

html {
  height: 100%;
}

body {
  font-family: 'IBM Plex Mono', monospace;
  display: flex;
  flex-direction: column;
  background: #fdfdff;
  color: #111;
  line-height: 1.6;
  min-height: 100vh;
}

/* --- Main Container --- */
.container {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 2rem;
}

h1 {
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 500;
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  margin-bottom: 1rem;
  color: #333;
}

#ip {
  font-family: 'Roboto Mono', monospace;
  font-weight: 700;
  color: #007BFF;
  word-break: break-all;
  line-height: 1.1; /* Adjusted for better responsiveness */
  min-height: 5rem; 
  padding: 0 1rem;
}

.ipv4-font { font-size: clamp(2.5rem, 10vw, 10rem); } /* Original: 10rem */
.ipv6-font { font-size: clamp(1.3rem, 7vw, 4.5rem); } /* Original: 4rem */
.ip-dynamic-text { font-size: clamp(1.5rem, 5vw, 2.5rem); color: #666; } /* For Loading/Error */


#latency-check {
  font-family: 'Roboto Mono', monospace;
  color: #555;
  font-size: 0.9rem;
  margin-top: 0.5rem;
  height: 1.2rem;
}

small {
  color: #666;
  margin-top: 1rem;
  font-family: 'Roboto Mono', monospace;
  font-size: clamp(0.8rem, 2vw, 1rem);
}

/* --- Buttons --- */
.button-container {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
}

.btn {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-family: 'Roboto', sans-serif;
  font-weight: 500;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 1px solid #111;
  text-decoration: none; /* For 404 page link */
  display: inline-block; /* For 404 page link */
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.btn { background-color: #111; color: #fff; }
.btn-secondary { background-color: #fff; color: #111; }

/* --- Modal & Table Styles --- */
.modal {
  display: none; position: fixed; z-index: 1000;
  left: 0; top: 0; width: 100%; height: 100%;
  overflow-y: auto; background-color: rgba(0,0,0,0.6);
  animation: fadeIn 0.3s;
}
.modal-content {
  background-color: #fff; margin: 5% auto; padding: 25px;
  border-radius: 10px; width: 90%; max-width: 700px;
  text-align: left; box-shadow: 0 5px 15px rgba(0,0,0,0.3);
  animation: slideIn 0.3s;
}
.close {
  color: #aaa; float: right; font-size: 28px; font-weight: bold;
  cursor: pointer; /* Added for better UX */
}
.close:hover, .close:focus { color: black; }
.modal h2 { margin-bottom: 20px; font-family: 'Roboto', sans-serif; }
.info-subtitle {
  font-family: 'Roboto', sans-serif; font-size: 1.2rem; font-weight: 700;
  color: #333; margin-top: 25px; margin-bottom: 15px;
  border-bottom: 2px solid #007BFF; padding-bottom: 5px;
}
.info-table { width: 100%; border-collapse: collapse; }
.info-table td {
  padding: 12px 8px; border-bottom: 1px solid #eee;
  font-family: 'Roboto Mono', monospace; word-break: break-all;
  font-size: 0.9rem;
}
.info-table tr:last-child td { border-bottom: none; }
.info-table td:first-child { font-weight: 700; color: #007BFF; width: 35%; }

/* --- Footer --- */
footer {
  width: 100%;
  color: #444;
  padding: 1rem 2rem;
  border-top: 1px solid #e7e7e7;
  font-size: 0.8rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap; /* Allows wrapping on smaller screens */
  gap: 1rem;
}

.footer-center {
  text-align: center;
}

.footer-center a {
  color: #555;
  text-decoration: none;
  margin: 0 0.75rem;
  transition: color 0.2s;
}
.footer-center a:hover { color: #007BFF; }

.footer-right a {
  color: #007BFF;
  text-decoration: none;
  font-weight: 500;
}
.footer-right a:hover { text-decoration: underline; }

/* Responsive Footer */
@media(max-width: 768px) {
  footer {
    flex-direction: column; /* Stack elements vertically */
    justify-content: center;
    text-align: center;
  }
}

/* Other Sections */
#online-tools a {
  display: block; background-color: #f0f8ff; padding: 10px;
  margin-bottom: 8px; border-radius: 5px; text-decoration: none;
  color: #0056b3; font-family: 'Roboto', sans-serif; font-weight: 500;
  transition: background-color 0.2s ease;
}
#online-tools a:hover { background-color: #e0f0ff; }
#cookie-banner {
  display: none; position: fixed; bottom: 0; left: 0; width: 100%;
  background-color: #222; color: #fff; padding: 15px;
  z-index: 2000;
  justify-content: center; align-items: center; gap: 1rem;
}
#cookie-banner p { margin: 0; }
#cookie-banner a { color: #00aaff; text-decoration: underline; }
#accept-cookies {
  background-color: #007BFF; color: white; border: none;
  padding: 8px 16px; border-radius: 5px; cursor: pointer;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideIn { from { transform: translateY(-50px); } to { transform: translateY(0); } }

/* --- Sticky Footer Fix --- */
.main-content {
  flex: 1 0 auto;
}

/* === STYLING FOR STATIC & 404 PAGES === */
.static-page-container {
  max-width: 800px;
  margin: 3rem auto; /* Vertical spacing and horizontal centering */
  padding: 2rem 3rem;
  background-color: #ffffff;
  border: 1px solid #e7e7e7;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}
.static-page-container h1 {
  font-family: 'Roboto', sans-serif;
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: #111;
}
.static-page-container h2 {
  font-family: 'Roboto', sans-serif;
  font-size: 1.8rem;
  font-weight: 500;
  margin-top: 2rem;
  margin-bottom: 1rem;
  color: #333;
  border-bottom: 2px solid #f0f0f0;
  padding-bottom: 0.5rem;
}
.static-page-container p {
  line-height: 1.7;
  margin-bottom: 1rem;
  color: #333;
}
.static-page-container ul {
  list-style-position: inside;
  padding-left: 1rem;
}
.static-page-container li {
  margin-bottom: 0.5rem;
}
.static-page-container a {
  color: #007BFF;
  text-decoration: none;
}
.static-page-container a:hover {
  text-decoration: underline;
}
.static-page-container .back-link {
  display: inline-block;
  margin-top: 2rem;
  font-weight: 500;
}
.static-page-container .last-updated {
  font-style: italic;
  color: #666;
  font-size: 0.9rem;
}
.static-page-container .contact-email {
    font-size: 1.2rem;
    font-weight: 500;
    text-align: center;
    margin: 2rem 0;
}

.not-found-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 2rem;
}
.not-found-container h1 { font-size: 10rem; line-height: 1; color: #007BFF; font-family: 'IBM Plex Mono', monospace; }
.not-found-container p { font-size: 1.5rem; color: #333; margin: -1rem 0 2rem 0; }

@media(max-width: 768px) {
  .static-page-container {
    margin: 1rem auto;
    padding: 1.5rem;
  }
  .static-page-container h1 {
    font-size: 2rem;
  }
  .static-page-container h2 {
    font-size: 1.5rem;
  }
}
/* === ULTIMATE SMOOTH FAQ STYLES (v3 - using CSS Grid) === */

.faq-category-title {
    font-family: 'Roboto', sans-serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: #111;
    margin-top: 3rem;
    margin-bottom: 1rem;
    border-bottom: 3px solid #007BFF;
    padding-bottom: 0.5rem;
}

.faq-container {
    margin-top: 2rem;
}

.faq-item {
    border-bottom: 1px solid #e7e7e7;
}

.faq-question {
    width: 100%;
    background: none;
    border: none;
    text-align: left;
    padding: 1.5rem 1rem;
    font-family: 'Roboto', sans-serif;
    font-size: 1.2rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #111;
    transition: background-color 0.2s ease;
}

.faq-question:hover {
    background-color: #f7faff;
}

.faq-question::after {
    content: '+';
    font-size: 1.8rem;
    font-weight: 300;
    color: #007BFF;
    transition: transform 0.3s ease-out; /* Smoother easing */
}

.faq-item.active .faq-question {
    color: #007BFF;
}

.faq-item.active .faq-question::after {
    content: '−';
    transform: rotate(180deg);
}

/* === THE MAGIC PART FOR SMOOTH ANIMATION === */
.faq-answer {
    display: grid;
    /* Collapsed state */
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.4s ease-out; /* The key to smooth animation */
    line-height: 1.7;
    color: #333;
}

.faq-answer p {
    /* This prevents content from being squished during animation */
    overflow: hidden;
    padding: 0 1rem; /* Padding is now on the p tag */
}

/* Expanded state */
.faq-item.active .faq-answer {
    grid-template-rows: 1fr;
}

.faq-item.active .faq-answer p {
    padding: 0.5rem 1rem 1.5rem 1rem; /* Apply padding only when open */
}