:root { --bg: #ffffff; --text: #111111; --muted: #eaeaea; }
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 18px/1.7 system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* --- Navigation --- */
nav {
  border-bottom: 1px solid var(--muted);
  background: #fff;
}
.nav-inner {
  max-width: 960px; margin: 0 auto; padding: 18px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  flex-wrap: wrap;
}
.brand { font-weight: 800; letter-spacing: .2px; font-size: 1.4rem; }
.menu { display: flex; gap: 20px; flex-wrap: wrap; }
.menu a {
  text-decoration: none;
  color: inherit;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 1.1rem;
  transition: color 0.2s ease, background 0.2s ease;
}

/* Hover and focus states */
.menu a:hover,
.menu a:focus {
  color: #1f6bb6;          /* brand blue */
  background: #f0f7ff;     /* soft blue background */
  outline: none;
}
    /* --- Main content --- */
    main { flex: 1; }
    .container { max-width: 780px; margin: 0vh auto; padding: 32px 20px; }
    header h1 { margin: 0 0 10px; font-size: 2.4rem; font-weight: 800; }
    header p { margin: 0; opacity: .8; font-size: 1.2rem; }

    form { margin-top: 32px; display: grid; gap: 20px; }

    label { font-weight: 600; font-size: 1.1rem; }

#keywords{
  width: 100%;
  padding: 18px 20px;
  font-size: 1.3rem;
  border: 2px solid #b3d4fc; /* soft blue border */
  border-radius: 12px;
  background: #f5f9ff; /* light blue background */
  color: var(--text);
  transition: all 0.25s ease;
}

#ARTICLE_BODY_FIELD {
  width: 100%;
  padding: 18px 20px;
  font-size: 1rem;
  border: 2px solid #b3d4fc; /* soft blue border */
  border-radius: 12px;
  background: #f5f9ff; /* light blue background */
  color: var(--text);
  transition: all 0.25s ease;

}

/* Highlight effect on focus */
input[type="text"]:focus {
  outline: none;
  border-color: #1f6bb6; /* your brand blue */
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(31,107,182,0.15);
}

.row {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-top: 10px;
  margin-bottom: 10px;
}

#spin, #AutoScroll, #use_html { width: 22px; height: 22px; }

#generate_article_btn {
  justify-self: start;
  padding: 14px 28px;
  border-radius: 9999px;
  border: 2px solid #1f6bb6;
  background: #1f6bb6;
  color: #ffffff;
  font-weight: 700;
  cursor: pointer;
  font-size: 1.2rem;
  transition: all 0.25s ease;
}

/* Hover and focus states */
#generate_article_btn:hover,
#generate_article_btn:focus {
  background: #155a9e;   /* darker blue on hover */
  border-color: #155a9e;
  box-shadow: 0 0 0 3px rgba(31,107,182,0.2);
}


    /* --- Footer at bottom --- */
    footer { border-top: 1px solid var(--muted); background: #fff; }
    .footer-inner { max-width: 960px; margin: 0 auto; padding: 20px; font-size: 14px; opacity: .7; }
    .footer-inner a { color: inherit; }

    /* --- Mobile tweaks --- */
    @media (max-width: 600px) {
      .container { margin: 0vh auto; padding: 20px; }
      .menu { width: 100%; justify-content: flex-start; }
      header h1 { font-size: 2rem; }
      #keywords{ font-size: 18px; } /* prevent iOS zoom */
      #generate_article_btn { padding: 14px 20px; font-size: 1rem; }
    }






/*-----*/


.close-section {
  color: #666;             /* slightly darker on hover */
  text-decoration: none;
}

.close-section:hover {
  color: #666;             /* slightly darker on hover */
  text-decoration: underline;
}



@media (max-width: 768px) {
  #home_link {
    display: none;
  }
}

@media (max-width: 400px) {
  #contact_link {
    display: none;
  }
}



#generate_article_btn {
	margin-top: 3px;
}





/* Spinner next to the button */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  margin-left: -4px;            /* space between button and spinner */
  border: 3px solid rgba(31,107,182,0.25);
  border-top-color: #1f6bb6;    /* brand blue */
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
  vertical-align: middle;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}






.btn-row-container {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 12px; /* ✅ adds space before the textarea */
}









.article-size {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.article-size label {
  font-size: 1rem;
}

.article-size select {
  padding: 6px 12px;
  border-radius: 8px;
  border: 2px solid #b3d4fc;     /* matches your input borders */
  background: #f5f9ff;           /* matches your input bg */
  color: var(--text);
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.25s ease;
}

.article-size select:focus {
  outline: none;
  border-color: #1f6bb6;         /* brand blue */
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(31,107,182,0.15);
}



#messages {
  margin-bottom: 12px;
}





/* Container for textarea and button */
.textarea-container {
  position: relative;
  display: inline-block;
  width: 100%;
}

/* Copy button styling */
.copy-btn {
  position: absolute;
  top: 10px;
  right: 12px;
  background: #1f6bb6;
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.25s ease;
  z-index: 2;
}

/* Hover/focus states */
.copy-btn:hover,
.copy-btn:focus {
  background: #155a9e;
  box-shadow: 0 0 0 3px rgba(31,107,182,0.15);
}









/* Secondary (outline) button to match site style */
.secondary-btn {
  justify-self: start;
  padding: 12px 20px;
  border-radius: 9999px;
  border: 2px solid #1f6bb6;
  background: #ffffff;
  color: #1f6bb6;
  font-weight: 700;
  cursor: pointer;
  font-size: 1.05rem;
  transition: all 0.25s ease;
}
.secondary-btn:hover,
.secondary-btn:focus {
  background: #f0f7ff;
  box-shadow: 0 0 0 3px rgba(31,107,182,0.2);
  outline: none;
}

/* --- Modal Styling --- */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 9999;
}
.modal.open { display: flex; }

.modal-dialog {
  width: min(960px, 95vw);
  height: min(80vh, 90vh);
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 10px 35px rgba(0,0,0,0.15);
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  background: transparent;
  border: none;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  color: #555;
  padding: 6px 10px;
  border-radius: 8px;
}
.modal-close:hover { background: #f5f5f5; }

.modal-body {
  flex: 1;
  padding: 0;
  display: flex;
  background: #fafafa;
}

.preview-frame {
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}


.secondary-btn {
  justify-self: start;
  padding: 12px 20px;
  border-radius: 9999px;
  border: 2px solid #1f6bb6;
  background: #ffffff;
  color: #1f6bb6;
  font-weight: 700;
  cursor: pointer;
  font-size: 1.05rem;
  transition: all 0.25s ease;
}
.secondary-btn:hover,
.secondary-btn:focus {
  background: #f0f7ff;
  box-shadow: 0 0 0 3px rgba(31,107,182,0.2);
  outline: none;
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 9999;
}
.modal.open { display: flex; }

.modal-dialog {
  width: min(960px, 95vw);
  height: min(80vh, 90vh);
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 10px 35px rgba(0,0,0,0.15);
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  background: transparent;
  border: none;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  color: #555;
  padding: 6px 10px;
  border-radius: 8px;
}
.modal-close:hover { background: #f5f5f5; }

.modal-body { flex: 1; padding: 0; display: flex; background: #fafafa; }
.preview-frame { width: 100%; height: 100%; border: 0; background: #fff; }






