/* ===== BASE & VARIABLES ===== */
:root {
  /* Pastel color scheme */
  --primary: #9aa2ff;        /* Soft blue-purple */
  --primary-dark: #0014fa;   /* Dark blue accent */
  --light-bg: #e6e8ff;       /* Light lavender background */
  --neutral-text: #73747f;   /* Gray for text */
  --pastel-pink: #f2d9ed;    /* Soft pink */
  --pastel-red: #ffe6e8;     /* Lighter pink/red */
  --warning: #FFB83D;        /* Orange for warnings */
  --success: #2ecc71;        /* Green for success */
  --red: #f44336;            /* Bold red for critical actions */
  --error: #e74c3c;          /* Softer red for errors */

  /* Layout */
  --border-radius: 8px;
  --box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  --gap: 1rem;
  --transition: all 0.2s ease;
}

/* Embed Open Sans locally */
@font-face {
  font-family: 'Open Sans';
  src: url('/fonts/opensans.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
}

@font-face {
  font-family: 'Open Sans';
  src: url('/fonts/opensans_b.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
}

/* ===== BASE STYLES ===== */
* {
  box-sizing: border-box;
}

body {
  font-family: 'Open Sans', Verdana, Tahoma, sans-serif;
  line-height: 1.5;
  color: var(--neutral-text);
  background-color: var(--light-bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3 {
  color: black;
  margin-bottom: 0.5em;
}

/* Screen-reader-only utility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

header {
  width: 100%;
  padding: 0;
  box-shadow: var(--box-shadow);
  border-bottom: 3px solid var(--primary-dark);
}

.header-banner {
  background-image: url('/img/Banner2.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  width: 100%;
  height: 40vh;
  display: block; /* Ensure visibility */
}

/* --- Main Content Layout --- */
main {
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  padding: 1em;
  text-align: center;
}

#checkForm {
  display: flex;
  flex-direction: column;
  align-items: center;
}

strong, b {
  font-weight: 700 !important;
  color: var(--primary-dark) !important;
  font-family: inherit;
}

#output strong,
.warning-message strong,
.modal-content strong {
  color: #000000 !important;
}

fieldset {
  border: none;
  padding: 0;
  margin: 0;
}

ol {
    list-style-type: decimal;
    list-style-position: outside;
    padding-left: 40px;
    margin-left: 0;
}

ol li {
    display: list-item;
}

#make-your-own-openalias {
  text-align: center;
  margin: 2rem auto;
  font-size: 1.2em;
}

#domainInput, #addressInput {
  margin-bottom: 1.5rem !important;
}

/* --- Tooltip Styles --- */
.tooltip-container {
  position: relative;
  display: block;
  margin-bottom: 1em;
}

.tooltip-container .tooltip-text {
  visibility: hidden;
  opacity: 0;
  background-color: #333;
  color: #fff;
  text-align: center;
  border-radius: 6px;
  padding: 8px 12px;
  width: 280px;
  position: absolute;
  z-index: 10;
  top: 100%;
  margin-top: 10px;
  left: 50%;
  margin-left: -140px;
  transition: opacity 0.3s;
}

.tooltip-container .tooltip-text::after {
  content: "";
  position: absolute;
  bottom: 100%;
  left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: transparent transparent #333 transparent;
}

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

.radio-container {
  margin-top: 1.5rem !important;
  margin-bottom: 1.5rem !important;
}

#output p, .warning-message p {
  margin: 1rem 0 !important;
  line-height: 1.6 !important;
}

/* Styles for Settings Icon and Tooltip */
#settings-container {
    position: relative; /* Establishes a positioning context for the tooltip */
    float: right;
    margin: 10px 10px 0 0;
}

#settings-button {
    background: none;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 1.5em;
    cursor: pointer;
    padding: 2px 8px;
    line-height: 1;
}

#settings-tooltip {
    display: none; /* Initially hidden */
    position: absolute;
    bottom: 0; 
    right: 0;
    margin-top: 5px;
    background-color: #333;
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    z-index: 100;
    width: max-content; /* Ensure it's wide enough for the text */
}

/* Tooltip fade-in and fade-out animation */
@keyframes fadeInOut {
    0% { opacity: 0; }
    20% { opacity: 1; } /* Fade in over 1s (20% of 5s) */
    80% { opacity: 1; } /* Stay visible for 3s (60% of 5s) */
    100% { opacity: 0; } /* Fade out over 1s (20% of 5s) */
}

.animate-tooltip {
    animation: fadeInOut 5s ease-in-out forwards;
}

/* Styles for the updated custom DNS modal */
.dns-protocol-fieldset {
    border: 1px solid #ccc;
    padding: 10px;
    margin-bottom: 15px;
}
.protocol-option {
    margin-bottom: 10px;
}
.dns-input {
    width: 95%;
    margin-top: 5px;
}

/* ===== OPENALIAS INPUT FIELD ===== */
#domainInput, #addressInput, #aliasInput {
  width: 100%;
  min-width: 300px;
  max-width: 600px;
  padding: 0.875rem 1rem;
  font-size: 1rem;
  border: 2px solid var(--neutral-text);
  border-radius: var(--border-radius);
  margin-bottom: 1.5rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}

#domainInput:focus, #addressInput:focus, #aliasInput:focus {
  outline: none;
  border-color: var(--primary-dark);
  box-shadow: 0 0 0 3px rgba(0, 20, 250, 0.15);
  background-color: white;
}

@media (max-width: 768px) {
  #domainInput {
    min-width: 100%;
    max-width: 100%;
  }
}

#domainInput::placeholder {
  color: #a0a0a0;
  opacity: 1;
  font-size: 0.95rem;
}

#domainInput.error {
  border-color: var(--error);
}

#domainInput.success {
  border-color: var(--success);
}

/* ===== RADIO BUTTONS (3 Columns) ===== */
.radio-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin: 1rem 0;
}

.radio-container > div {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.radio-container input[type="radio"] {
  accent-color: var(--primary-dark);
}

/* ===== MODALS ===== */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal-content {
  background-color: white;
  padding: 2rem;
  border-radius: var(--border-radius);
  border: 2px solid var(--primary);
  max-width: 90%;
  width: 500px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.modal-content h2 {
  color: var(--primary-dark);
  margin-bottom: 1rem;
  text-align: center;
}

.modal-content input[type="text"],
.modal-content input[type="password"] {
  width: 100%;
  padding: 0.75rem;
  margin: 0.5rem 0;
  border: 1px solid var(--neutral-text);
  border-radius: var(--border-radius);
  font-size: 1rem;
}

#password-error,
#dns-error {
  color: var(--error);
  font-weight: 600;
  margin-top: 0.5rem;
  display: none;
}

.modal-content button {
  margin: 0.5rem 0.25rem;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: var(--transition);
}

/* ===== CONNECTION STATUS ===== */
#connection-status {
  position: fixed;
  bottom: 10px;
  right: 10px;
  padding: 0.5rem 0.75rem;
  border-radius: 20px;
  color: white;
  font-weight: bold;
  z-index: 1000;
  box-shadow: var(--box-shadow);
  font-size: 0.8em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background-color: var(--primary-dark);
}

#connection-status > div:first-child {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: var(--success);
}

#connection-status.offline {
  background-color: var(--red);
}

#connection-status.offline > div:first-child {
  background-color: var(--red);
}

/* ===== QR CODE STYLES ===== */
#qrcode-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 1rem auto;
  padding: 1rem;
  width: fit-content;
  background: white;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  cursor: pointer;
}

#qrcode-container img {
  max-width: 300px;
  height: auto;
  border: 1px solid var(--neutral-text);
}

#qrcode-container p {
  margin-top: 0.5rem;
  font-size: 0.8em;
  color: var(--neutral-text);
}

#qrcode-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1001;
  cursor: pointer;
}

#enlarged-qrcode {
  max-width: 90%;
  padding: 2rem;
  background: white;
  border-radius: 10px;
  text-align: center;
}

/* ===== RESULTS & OUTPUT ===== */
#results-container {
  margin-top: 2rem;
  background: white;
  padding: 1.5rem;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
}

#output {
  text-align: left; !important
  margin-top: 2em;
  padding: 1em;
  border: 1px solid #ccc;
  border-radius: 6px;
  background-color: #f9f9f9;
}

#output div {
  word-wrap: break-word;
  overflow-wrap: break-word;
}

#output h3 {
  margin-top: 0;
  font-size: 1.1em;
  color: #333;
}

#output .error {
  color: var(--error);
  font-weight: 600;
}

.warning-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  overflow: hidden;
}

.warning-message {
  background-color: white;
  padding: 2rem;
  border: 3px solid var(--warning);
  border-radius: 10px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
  max-width: 80%;
  width: 500px;
  text-align: center;
  position: relative;
  margin: 0 auto;
}

.warning-message p {
  margin: 1rem 0;
  font-size: 1.1rem;
  line-height: 1.6;
}

.warning-message button {
  margin: 1rem 0.5rem;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
}

.warning-message .address-display {
    background-color: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
    margin: 15px auto;
    word-break: break-all;
    max-width: 100%;
    font-family: monospace;
    font-size: 0.9em;
    text-align: left;
}

.warning-message .button-container {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.5rem;
}

.warning-message p {
    margin: 0 0 10px;
    font-size: 1.1rem;
    line-height: 1.5;
}
.warning-close {
  position: absolute;
  top: 10px;
  right: 15px;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
}

.dnssec-warning {
    background-color: #fffbe6; /* A very light pastel yellow */
    color: #554400; /* Dark yellow/brown text for readability */
    border: 1px solid var(--warning);
    border-left: 5px solid var(--warning); 
    padding: 1rem;
    margin-top: 1.5rem;
    border-radius: var(--border-radius); 
    text-align: left;
    line-height: 1.4;
}

/* This overrides the global 'strong' style specifically within the warning box */
.dnssec-warning strong {
    color: #554400 !important;
}

#resultField {
  width: 100%;
  height: 100px;
  padding: 0.75rem;
  border: 1px solid var(--neutral-text);
  border-radius: var(--border-radius);
  resize: vertical;
  font-family: monospace;
  margin-top: 1rem;
  background-color: var(--pastel-red);
}

.checksum {
  color: white;
  background-color: var(--primary-dark);
  font-family: monospace;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  display: inline-block;
}

#md5-verify-link {
  color: var(--primary-dark);
  text-decoration: none;
  font-weight: 600;
}

/* ===== BUTTON STYLES ===== */
.common-button-style {
  padding: 1.6rem;
  font-size: 1.3rem;
  font-weight: 700;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  margin: 0.5rem;
  min-width: 140px;
  text-align: center;
  text-transform: none;
  letter-spacing: 0.5px;
}

.button-green {
  background-color: var(--success);
  color: white;
}

.button-green:hover {
  background-color: #218838;
}

.button-blue {
  background-color: var(--primary-dark);
  color: white;
}

.button-blue:hover {
  background-color: #0000d3;
}

.button-red {
  background-color: var(--red);
  color: white;
}

.button-red:hover {
  background-color: #c72e25;
}

.common-button-style:active {
  transform: translateY(1px);
  box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.common-button-style:focus {
  outline: 2px solid rgba(0, 0, 0, 0.2);
  outline-offset: 2px;
}

.common-button-style.large {
  padding: 1rem 2rem;
  font-size: 1.2rem;
}

#resetButton {
  display: none;
  margin-top: 1rem;
}



/* ===== PWA SAFE AREAS ===== */
@media (display-mode: standalone) {
  body {
    padding-top: env(safe-area-inset-top);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
    padding-bottom: env(safe-area-inset-bottom);
  }
}

/* ===== TOAST NOTIFICATIONS ===== */
.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  padding: 0.75rem 1.5rem;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  z-index: 1000;
  opacity: 1;
  transition: opacity 0.3s;
  font-size: 0.9em;
}

.toast.success {
  background-color: var(--success);
  color: white;
}

.toast.error {
  background-color: var(--error);
  color: white;
}

.toast-hide {
  opacity: 0;
}

/* ===== COPY SECTION ===== */
#copy-section {
  display: none;
  margin-top: 1rem;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

#copy-section.show {
  display: flex;
}

.copy-button-container {
  display: flex;
  justify-content: center;
  margin-top: 0.75rem;
}

#copyBtn.copy-button {
  background: none;
  border: none;
  padding: 0.25rem;
  cursor: pointer;
  transition: transform 0.1s, opacity 0.2s;
}

#copyBtn.copy-button:active {
  transform: scale(0.95);
}

#copyBtn.copy-button img {
  width: 5em;
  height: auto;
  display: block;
  transition: var(--transition);
}

#copyBtn.copy-button.success img {
  content: url('/img/checkmark.jpg');
  animation: pulse 0.5s ease;
}
#copyBtn.copy-button.success #copyIcon,
#copyBtn.copy-button.error #copyIcon {
    width: 5em; /* Match your desired size */
}

@keyframes pulse {
0% { transform: scale(1); }
50% { transform: scale(1.1); }
100% { transform: scale(1); }
}

copyBtn.copy-button[aria-label]:hover::after {

content: attr(aria-label);
position: absolute;
bottom: 100%;
left: 50%;
transform: translateX(-50%);
background: var(--primary-dark);
color: white;
padding: 0.25rem 0.5rem;
border-radius: 4px;
font-size: 0.8em;
white-space: nowrap;
margin-bottom: 0.5rem;
}


/* ===== FOOTER & INSTALL BUTTON ===== */
footer {
  text-align: center;
  padding: 2rem;
  background: linear-gradient(135deg, var(--pastel-pink), var(--pastel-red));
  border-top: 2px solid var(--primary);
  margin-top: 2rem;
  color: var(--neutral-text);
}

#install-container {
  margin: 1rem auto;
  max-width: 300px;
  padding: 1rem;
  background-color: rgba(255, 255, 255, 0.7);
  border-radius: var(--border-radius);
  border: 1px solid var(--primary);
}

.install-button {
  display: none;
  margin: 0.5rem auto;
  padding: 0.75rem 1rem;
  background-color: var(--success);
  color: white;
  border: none;
  border-radius: var(--border-radius);
  cursor: pointer;
  width: 100%;
}

.install-button.show {
  display: block;
}
/* ===== FONT SCALING ADDITIONS ===== / / Safe 20% font increase without breaking layouts / body { font-size: 104%; / Subtle base increase (4% to account for compounding) */
}

/* Target only text elements */
h1, h2, h3, h4, h5, h6,
p, li, ol, ul, dl, dt, dd,
label, legend, figcaption,
input:not([type="radio"]):not([type="checkbox"]),
textarea, select, button,

output, .modal-content, .warning-message,

.tooltip-text, .toast {
font-size: 1.2em; /* 20% increase */
}

/* Explicit exceptions to preserve layout */

copyBtn.copy-button img {

width: 2em; /* Keep original icon size */
}

#copyBtn.copy-button.success {
    animation: pulse 0.5s ease;
}

#copyBtn.copy-button.error {
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-3px); }
    40%, 80% { transform: translateX(3px); }
}

#copyIcon {
    width: 2.5em;
    height: auto;
    display: block;
    transition: all 0.2s ease;
}

/* Simple QR Fallback Styles */
.qr-fallback {
    background: #f8f8f8;
    padding: 15px;
    border-radius: 5px;
    text-align: center;
    margin: 10px 0;
    border: 1px solid #ddd;
}

.qr-fallback p {
    margin: 8px 0;
    color: #333;
    font-size: 14px;
}

.qr-fallback p:first-child {
    font-weight: bold;
    color: #d32f2f; /* Red-ish color to indicate a limitation */
}

/* "What next?" link styling */
#what-next-link {
    margin-top: 2em;
    font-size: 1.2em;
    font-style: italic;
    text-align: center;
}

#what-next-link a:hover {
    text-decoration: underline;
}

footer, footer * {
font-size: 1rem; /* Reset footer to original size */
}

.radio-container input[type="radio"] {
transform: scale(1.2); /* Scale radio buttons proportionally */
}

/* Ensure buttons maintain their styling / .common-button-style, .modal-content button, .install-button { font-size: inherit; / Inherit scaled size but keep button styling */
}

/* Prevent text overflow in fixed containers */

resultField, #domainInput, textarea, input[type="text"] {

font-size: 1em; /* Reset form inputs to prevent layout issues */
}

/* Scale tooltip text separately / .tooltip-text { font-size: 1.1em; / Slightly smaller increase for tooltips */
}

