/* ==========================================================================
   Free tools hub (/Tools)
   Palette follows the main theme: #009788 / #508d8e / #133133
   RTL is the default direction of the site, LTR overrides are grouped at the
   bottom of each block.
   ========================================================================== */

.tools-intro {
  max-width: 760px;
  margin: 0 auto 3rem;
  text-align: center;
}

.tools-intro p {
  color: #6b7a7a;
  font-size: 1.05rem;
  line-height: 2;
}

/* --- Tool cards on /Tools ------------------------------------------------ */

.tool-card {
  display: block;
  height: 100%;
  padding: 30px 25px;
  margin-bottom: 30px;
  background: #fff;
  border: 1px solid #e8eeee;
  border-radius: 10px;
  transition: all .25s ease;
  text-align: center;
}

.tool-card:hover {
  text-decoration: none;
  border-color: transparent;
  box-shadow: 0 14px 34px rgba(19, 49, 51, .13);
  transform: translateY(-4px);
}

.tool-card .tool-icon {
  width: 62px;
  height: 62px;
  line-height: 62px;
  margin: 0 auto 18px;
  border-radius: 50%;
  color: #fff;
  font-size: 24px;
  background: linear-gradient(to right, #508d8e 0%, #009788 100%);
}

.tool-card h3 {
  font-size: 1.15rem;
  color: #133133;
  margin-bottom: 12px;
}

.tool-card p {
  font-size: .95rem;
  color: #6b7a7a;
  line-height: 1.9;
  margin-bottom: 0;
}

/* --- Tool workspace ------------------------------------------------------ */

.tool-panel {
  background: #fff;
  border: 1px solid #e8eeee;
  border-radius: 10px;
  padding: 30px;
  margin-bottom: 30px;
  box-shadow: 0 6px 24px rgba(19, 49, 51, .05);
}

.tool-panel h2,
.tool-panel h3 {
  color: #133133;
}

.tool-panel .form-group {
  margin-bottom: 20px;
}

.tool-panel label {
  display: block;
  font-weight: 600;
  color: #133133;
  margin-bottom: 8px;
}

.tool-panel .form-hint {
  display: block;
  font-size: .85rem;
  color: #8b9898;
  margin-top: 6px;
}

.tool-panel .form-control,
.tool-panel select.form-control,
.tool-panel textarea.form-control {
  height: auto;
  padding: 12px 15px;
  border: 1px solid #dde6e6;
  border-radius: 6px;
  box-shadow: none;
  font-size: .98rem;
}

.tool-panel .form-control:focus {
  border-color: #009788;
  box-shadow: 0 0 0 .15rem rgba(0, 151, 136, .15);
}

.tool-panel textarea.form-control {
  min-height: 150px;
  line-height: 1.9;
}

.tool-panel .form-control[dir="ltr"] {
  text-align: left;
}

/* --- Output blocks ------------------------------------------------------- */

.tool-output {
  position: relative;
  background: #f5f9f9;
  border: 1px dashed #cfdedd;
  border-radius: 6px;
  padding: 16px 18px;
  min-height: 56px;
  word-break: break-all;
  font-size: .95rem;
  color: #133133;
}

.tool-output.is-empty {
  color: #9aa8a8;
  border-style: dashed;
}

.tool-output pre,
.tool-output code {
  display: block;
  margin: 0;
  padding: 0;
  background: none;
  border: 0;
  white-space: pre-wrap;
  word-break: break-word;
  direction: ltr;
  text-align: left;
  font-family: Consolas, Monaco, "Courier New", monospace;
  font-size: .85rem;
  line-height: 1.8;
  color: #133133;
}

.tool-actions {
  margin-top: 18px;
}

.tool-actions .btn,
.btn-tool {
  display: inline-block;
  padding: 10px 22px;
  margin: 0 0 8px 8px;
  border: 0;
  border-radius: 30px;
  color: #fff;
  font-size: .92rem;
  cursor: pointer;
  background: linear-gradient(to right, #508d8e 0%, #009788 100%);
  transition: opacity .2s ease;
}

.btn-tool:hover,
.btn-tool:focus {
  color: #fff;
  opacity: .88;
  text-decoration: none;
}

.btn-tool.btn-tool-ghost {
  background: none;
  color: #009788;
  border: 1px solid #009788;
}

.btn-tool.btn-tool-ghost:hover {
  background: #009788;
  color: #fff;
}

.btn-tool[disabled] {
  opacity: .5;
  cursor: not-allowed;
}

.copy-feedback {
  display: inline-block;
  margin: 0 10px;
  font-size: .88rem;
  color: #009788;
  opacity: 0;
  transition: opacity .2s ease;
}

.copy-feedback.is-visible {
  opacity: 1;
}

/* --- WhatsApp-style chat preview ---------------------------------------- */

.chat-preview {
  background: #e6ddd4 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40'%3E%3Ccircle cx='6' cy='6' r='1.2' fill='%23d9cec3'/%3E%3Ccircle cx='26' cy='22' r='1.2' fill='%23d9cec3'/%3E%3C/svg%3E");
  border-radius: 8px;
  padding: 22px 18px;
  min-height: 160px;
}

.chat-bubble {
  position: relative;
  max-width: 85%;
  margin-inline-start: auto;
  padding: 10px 14px 22px;
  background: #dcf8c6;
  border-radius: 8px;
  box-shadow: 0 1px 1px rgba(0, 0, 0, .12);
  font-size: .96rem;
  line-height: 1.8;
  color: #303030;
  white-space: pre-wrap;
  word-break: break-word;
}

.chat-bubble .chat-time {
  position: absolute;
  bottom: 5px;
  inset-inline-end: 12px;
  font-size: .72rem;
  color: #7d8b7d;
}

.chat-bubble em {
  font-style: italic;
}

.chat-bubble strong {
  font-weight: 700;
}

.chat-bubble del {
  text-decoration: line-through;
}

.chat-bubble code {
  background: rgba(0, 0, 0, .06);
  padding: 1px 4px;
  border-radius: 3px;
  font-family: Consolas, Monaco, monospace;
}

/* --- Formatting toolbar -------------------------------------------------- */

.format-toolbar {
  margin-bottom: 10px;
}

.format-toolbar button {
  min-width: 42px;
  padding: 7px 12px;
  margin: 0 0 6px 6px;
  background: #f2f7f7;
  border: 1px solid #dde6e6;
  border-radius: 5px;
  color: #133133;
  cursor: pointer;
  transition: all .2s ease;
}

.format-toolbar button:hover {
  background: #009788;
  border-color: #009788;
  color: #fff;
}

/* --- Stat tiles (counter, calculator, risk checker) ---------------------- */

.stat-tiles {
  display: flex;
  flex-wrap: wrap;
  margin: 0 -8px;
}

.stat-tile {
  flex: 1 1 120px;
  margin: 0 8px 16px;
  padding: 18px 10px;
  background: #f5f9f9;
  border-radius: 8px;
  text-align: center;
}

.stat-tile .stat-value {
  display: block;
  font-size: 1.7rem;
  font-weight: 700;
  color: #009788;
  line-height: 1.3;
}

.stat-tile .stat-label {
  display: block;
  font-size: .85rem;
  color: #6b7a7a;
}

/* --- QR output ----------------------------------------------------------- */

.qr-canvas-wrap {
  display: inline-block;
  padding: 16px;
  background: #fff;
  border: 1px solid #e8eeee;
  border-radius: 8px;
}

.qr-canvas-wrap canvas,
.qr-canvas-wrap img {
  display: block;
}

/* --- Template library ---------------------------------------------------- */

.template-filter {
  margin-bottom: 26px;
  text-align: center;
}

.template-filter button {
  padding: 7px 18px;
  margin: 0 4px 8px;
  background: #f2f7f7;
  border: 1px solid #dde6e6;
  border-radius: 30px;
  color: #4a5a5a;
  font-size: .9rem;
  cursor: pointer;
  transition: all .2s ease;
}

.template-filter button.is-active,
.template-filter button:hover {
  background: linear-gradient(to right, #508d8e 0%, #009788 100%);
  border-color: transparent;
  color: #fff;
}

.template-item {
  background: #fff;
  border: 1px solid #e8eeee;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 22px;
  height: calc(100% - 22px);
}

.template-item h4 {
  font-size: 1rem;
  color: #133133;
  margin-bottom: 10px;
}

.template-item .template-body {
  background: #f5f9f9;
  border-radius: 6px;
  padding: 14px;
  font-size: .92rem;
  line-height: 1.9;
  color: #445;
  white-space: pre-wrap;
  margin-bottom: 14px;
}

/* --- Risk / result banners ----------------------------------------------- */

.risk-banner {
  padding: 16px 20px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-weight: 600;
}

.risk-low {
  background: #e8f7ee;
  color: #1c7a45;
}

.risk-medium {
  background: #fff5e2;
  color: #996a00;
}

.risk-high {
  background: #fdeaea;
  color: #a32020;
}

.risk-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.risk-list li {
  padding: 10px 0;
  border-bottom: 1px solid #eef3f3;
  font-size: .95rem;
  color: #4a5a5a;
}

.risk-list li:last-child {
  border-bottom: 0;
}

.risk-list li .fa {
  margin-inline-end: 8px;
}

/* --- Related tools / how-to sections ------------------------------------- */

.tool-howto {
  background: #f5f9f9;
  border-radius: 10px;
  padding: 30px;
  margin-bottom: 30px;
}

.tool-howto ol,
.tool-howto ul {
  padding-inline-start: 20px;
  margin-bottom: 0;
}

.tool-howto li {
  margin-bottom: 10px;
  line-height: 1.9;
  color: #4a5a5a;
}

.related-tools {
  list-style: none;
  padding: 0;
  margin: 0;
}

.related-tools li {
  border-bottom: 1px solid #eef3f3;
}

.related-tools li:last-child {
  border-bottom: 0;
}

.related-tools a {
  display: block;
  padding: 12px 0;
  color: #4a5a5a;
  font-size: .95rem;
}

.related-tools a:hover {
  color: #009788;
  text-decoration: none;
}

.related-tools .fa {
  color: #009788;
  margin-inline-end: 8px;
}

/* --- Blog category pills (used by blogs.tpl) ----------------------------- */

.blog-cats {
  margin: 0;
  padding: 0;
}

.blog-cats li {
  margin: 0 3px 8px;
}

.blog-cats a {
  display: inline-block;
  padding: 7px 18px;
  border: 1px solid #dde6e6;
  border-radius: 30px;
  color: #4a5a5a;
  font-size: .9rem;
}

.blog-cats a:hover,
.blog-cats a.active {
  background: linear-gradient(to right, #508d8e 0%, #009788 100%);
  border-color: transparent;
  color: #fff;
  text-decoration: none;
}

/* --- DB-managed page bodies (tblpages, rendered by page.tpl) ------------- */

.page-content {
  padding: 10px 0 20px;
  color: #5a6a6a;
  line-height: 2;
}

.page-content > h2,
.page-content > h3 {
  color: #133133;
  margin-top: 1.8rem;
  margin-bottom: 1rem;
}

.page-content p {
  margin-bottom: 1.1rem;
}

.page-content > ul,
.page-content > ol {
  padding-inline-start: 22px;
  margin-bottom: 1.4rem;
}

.page-content > ul > li,
.page-content > ol > li {
  margin-bottom: 10px;
}

.page-content img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

.page-content table {
  width: 100%;
  margin-bottom: 1.5rem;
}

.page-content a {
  color: #009788;
}

/* --- Static marketing pages (features / solutions / integrations) -------- */

.page-lead {
  max-width: 820px;
  margin: 0 auto 3.5rem;
  text-align: center;
  color: #6b7a7a;
  font-size: 1.05rem;
  line-height: 2;
}

.anchor-nav {
  list-style: none;
  padding: 0;
  margin: 0 0 3rem;
  text-align: center;
}

.anchor-nav li {
  display: inline-block;
  margin: 0 3px 8px;
}

.anchor-nav a {
  display: inline-block;
  padding: 8px 20px;
  background: #f2f7f7;
  border-radius: 30px;
  color: #4a5a5a;
  font-size: .92rem;
}

.anchor-nav a:hover {
  background: linear-gradient(to right, #508d8e 0%, #009788 100%);
  color: #fff;
  text-decoration: none;
}

.sector-block {
  padding: 45px 0;
  border-bottom: 1px solid #eef3f3;
}

.sector-block:last-of-type {
  border-bottom: 0;
}

.sector-block h2 {
  font-size: 1.6rem;
  color: #133133;
  margin-bottom: 18px;
}

.sector-block h2 .fa {
  color: #009788;
  margin-inline-end: 10px;
}

.sector-block p,
.sector-block li {
  color: #5a6a6a;
  line-height: 2;
}

.check-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.check-list li {
  position: relative;
  padding-inline-start: 28px;
  margin-bottom: 12px;
}

.check-list li:before {
  content: "\f00c";
  font-family: FontAwesome;
  position: absolute;
  inset-inline-start: 0;
  top: 2px;
  color: #009788;
}

.flow-sample {
  background: #f5f9f9;
  border-inline-start: 3px solid #009788;
  border-radius: 6px;
  padding: 18px 22px;
  color: #445;
  font-size: .95rem;
  line-height: 2;
}

.flow-sample strong {
  color: #133133;
}

.integration-card {
  height: calc(100% - 30px);
  background: #fff;
  border: 1px solid #e8eeee;
  border-radius: 10px;
  padding: 26px 22px;
  margin-bottom: 30px;
  transition: all .25s ease;
}

.integration-card:hover {
  box-shadow: 0 14px 34px rgba(19, 49, 51, .12);
  transform: translateY(-4px);
}

.integration-card .integration-icon {
  width: 54px;
  height: 54px;
  line-height: 54px;
  border-radius: 12px;
  text-align: center;
  color: #fff;
  font-size: 22px;
  margin-bottom: 16px;
  background: linear-gradient(to right, #508d8e 0%, #009788 100%);
}

.integration-card h3 {
  font-size: 1.1rem;
  color: #133133;
  margin-bottom: 10px;
}

.integration-card p {
  font-size: .93rem;
  color: #6b7a7a;
  line-height: 1.9;
  margin-bottom: 12px;
}

.integration-badge {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 20px;
  font-size: .78rem;
  font-weight: 600;
}

.integration-badge.is-live {
  background: #e8f7ee;
  color: #1c7a45;
}

.integration-badge.is-api {
  background: #eaf1fb;
  color: #2a5ba8;
}

.integration-badge.is-soon {
  background: #f3f0fa;
  color: #6144a8;
}

/* --- Comparison table ---------------------------------------------------- */

.compare-table {
  width: 100%;
  background: #fff;
  border: 1px solid #e8eeee;
  border-radius: 10px;
  overflow: hidden;
}

.compare-table th,
.compare-table td {
  padding: 14px 18px;
  border-bottom: 1px solid #eef3f3;
  font-size: .95rem;
  color: #4a5a5a;
  vertical-align: middle;
}

.compare-table thead th {
  background: #f5f9f9;
  color: #133133;
  font-weight: 700;
}

.compare-table tbody tr:last-child td {
  border-bottom: 0;
}

/* --- Small screens ------------------------------------------------------- */

/* --- Generated code output ----------------------------------------------- */

/* Long machine-readable output: vCard bodies, Base64, snippets. Always shown
   left-to-right, since the content is never Arabic even on the Arabic pages. */
.tool-code {
  font-family: "Courier New", Consolas, Menlo, monospace;
  font-size: .86rem;
  line-height: 1.7;
  color: #2c4a4b;
  background: #f7fafa;
  word-break: break-all;
  white-space: pre-wrap;
}

.tool-error {
  margin: 0 0 18px;
  padding: 12px 16px;
  border: 1px solid #f0c9c4;
  border-radius: 8px;
  background: #fdf3f2;
  color: #96382c;
  font-size: .92rem;
  line-height: 1.8;
}

/* --- File drop zone ------------------------------------------------------ */

.tool-dropzone {
  position: relative;
  padding: 34px 20px;
  border: 2px dashed #cfdcdc;
  border-radius: 10px;
  background: #f9fbfb;
  text-align: center;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease;
}

.tool-dropzone:hover,
.tool-dropzone.is-dragover {
  border-color: #508d8e;
  background: #f1f7f7;
}

.tool-dropzone > .fa {
  font-size: 2.4rem;
  color: #8fb0b0;
  margin-bottom: 10px;
}

.tool-dropzone.is-dragover > .fa {
  color: #508d8e;
}

.tool-dropzone-text {
  margin: 0;
  color: #2c4a4b;
  font-weight: 600;
  font-size: .98rem;
}

.tool-dropzone-hint {
  margin: 6px 0 0;
  color: #9aa8a8;
  font-size: .86rem;
}

/* Covers the whole zone so a click anywhere opens the picker. */
.tool-file-input {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

/* --- Image preview and stats -------------------------------------------- */

.b64-preview-wrap {
  display: inline-block;
  max-width: 100%;
  padding: 12px;
  border: 1px solid #e8eeee;
  border-radius: 8px;
  background:
    linear-gradient(45deg, #eef3f3 25%, transparent 25%, transparent 75%, #eef3f3 75%) 0 0/18px 18px,
    linear-gradient(45deg, #eef3f3 25%, transparent 25%, transparent 75%, #eef3f3 75%) 9px 9px/18px 18px,
    #fff;
}

.b64-preview {
  display: block;
  max-width: 100%;
  max-height: 190px;
  margin: 0 auto;
}

.b64-stats {
  margin: 0;
  padding: 0;
  list-style: none;
}

.b64-stats li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid #eef3f3;
  font-size: .92rem;
}

.b64-stats li:last-child {
  border-bottom: 0;
}

.b64-stats span {
  color: #8b9898;
}

.b64-stats strong {
  color: #2c4a4b;
  font-weight: 600;
}

@media (max-width: 767px) {
  .tool-panel,
  .tool-howto {
    padding: 22px 18px;
  }

  .stat-tile {
    flex: 1 1 45%;
  }

  .chat-bubble {
    max-width: 100%;
  }

  .b64-preview-wrap {
    margin-bottom: 20px;
  }
}
