/* Themeable via inline CSS variables on .lbsf-root */
:root{--card-bg:#ffffff;--border:#e5e7eb;--muted:#6b7280;--text:#111827}
.lbsf-root{font-family:var(--font, system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Helvetica,Arial,sans-serif);margin:0 auto;padding:8px}
.lbsf-title{font-size:var(--title-size,34px);line-height:1.2;margin:8px 0 6px;color:var(--text);text-align:center}
.lbsf-sub{font-size:var(--subtitle-size,16px);color:var(--muted);text-align:center;margin:0 0 16px}
.lbsf-card{background:var(--card-bg);border:1px solid var(--border);border-radius:12px;padding:16px;box-shadow:0 1px 3px rgba(0,0,0,.06)}

/* Puzzle layout */
.lbsf-puzzle{display:grid;grid-template-columns:1fr 160px 1fr;grid-template-rows:auto 160px auto;gap:16px;align-items:center;justify-items:center;margin-bottom:8px}
.lbsf-top{grid-column:2;grid-row:1}
.lbsf-left{grid-column:1;grid-row:2}
.lbsf-right{grid-column:3;grid-row:2}
.lbsf-bottom{grid-column:2;grid-row:3}
.lbsf-square{grid-column:2;grid-row:2;width:96px;height:96px;border:4px solid #9ca3af;border-radius:12px;display:flex;align-items:center;justify-content:center}
.lbsf-square span{display:block;width:36px;height:36px;border:4px solid #9ca3af;border-radius:8px}

/* Inputs + labels */
.lbsf-puzzle div{font-size:16px;color:#111827}
.lbsf-puzzle input{margin-left:8px;padding:10px 12px;border:1px solid var(--border);border-radius:var(--radius,10px);font-size:16px;letter-spacing:1px;text-transform:uppercase;background:#f9fafb;width:90px;text-align:center}

/* Actions */
.lbsf-actions{display:flex;align-items:center;justify-content:space-between;margin-top:8px;gap:12px}
.lbsf-len{border:0;padding:0;margin:0;display:flex;align-items:center;gap:12px}
.lbsf-len legend{font-weight:600;margin-right:8px}
.lbsf-len label{display:inline-flex;align-items:center;gap:6px;font-size:14px}
.lbsf-buttons{display:flex;gap:10px}
.lbsf-btn{padding:10px 14px;border:1px solid var(--border);background:#f3f4f6;border-radius:var(--radius,10px);cursor:pointer}
.lbsf-btn.primary{background:var(--primary,#0d6efd);color:#fff;border-color:var(--primary,#0d6efd)}
.lbsf-btn.primary:hover{background:var(--primary-hover,#0b5ed7);border-color:var(--primary-hover,#0b5ed7)}

/* Messages + results */
.lbsf-loading{margin:12px 2px;color:#2563eb}
.lbsf-error{margin:12px 2px;color:#b91c1c}
.lbsf-results{margin:12px 2px}

/* Emphasize the result headings. The plugin displays summary headings for common and uncommon solutions
   using the elements with IDs lbs-results-heading and lbs-uncommon-heading. Convert them to bold and
   increase their font size while leaving other styling untouched. */
#lbs-results-heading,
#lbs-uncommon-heading {
  font-weight: bold;
  font-size: 18px;
}
#lbs-solutions-list{margin:8px 0 0 0;padding-left:0;list-style-position:inside}
#lbs-solutions-list li{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:8px 10px;
  border:1px solid var(--border);
  border-radius:var(--radius,10px);
  margin-top:8px;
  background:#fff;
  flex-wrap: nowrap; /* Prevent wrapping of the entire list item */
}

/* Styles for the list of less common solutions. Mirrors the styling of the main solutions list */
#lbs-uncommon-list{
  margin: 8px 0 0 0;
  padding-left: 0;
  list-style-position: inside;
}
#lbs-uncommon-list li{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius, 10px);
  margin-top: 8px;
  background: #fff;
  flex-wrap: nowrap;
}
#lbs-uncommon-list .lbsf-sol{
  font-variant-ligatures: none;
  flex-grow: 1;
  flex-shrink: 1;
  min-width: 0;
}
#lbs-uncommon-list .lbsf-copy{
  background-color: var(--primary, #2B6CB0);
  border: none;
  border-radius: var(--radius, 10px);
  color: #fff;
  padding: 8px 16px;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.3s ease;
  white-space: nowrap;
  min-width: 60px;
  width: auto;
  flex-shrink: 0;
}
#lbs-uncommon-list .lbsf-copy:hover{
  background-color: var(--primary-hover, #215387);
}
#lbs-solutions-list .lbsf-sol{
  font-variant-ligatures:none;
  flex-grow: 1;
  flex-shrink: 1;
  min-width: 0; /* Allow content to shrink */
}
#lbs-solutions-list .lbsf-copy{
  padding:8px 16px;
  border:1px solid var(--border);
  border-radius:var(--radius,10px);
  background:#f8fafc;
  cursor:pointer;
  font-size:14px;
  white-space: nowrap; /* Prevent text wrapping */
  flex-shrink: 0; /* Prevent button from shrinking */
}
#lbs-solutions-list .lbsf-copy:hover{background:#eef2ff}
.lbsf-more{margin-top:8px;display:flex;justify-content:flex-end}

@media (max-width:640px){
  .lbsf-puzzle{grid-template-columns:1fr 120px 1fr;grid-template-rows:auto 120px auto}
  .lbsf-puzzle input{width:80px}
}


/* Updated button styles to match Kadence theme colors */
.lbsf-btn {
  background-color: var(--primary, #2B6CB0);
  border: none;
  border-radius: var(--radius, 10px);
  color: #fff;
  padding: 10px 20px;
  cursor: pointer;
  font-size: 16px;
  transition: background-color 0.3s ease;
}

.lbsf-btn:hover {
  background-color: var(--primary-hover, #215387);
}


/* Updated Copy button styles to match Kadence theme */
.lbsf-copy-btn {
  background-color: var(--primary, #2B6CB0);
  border: none;
  border-radius: var(--radius, 10px);
  color: #fff;
  padding: 6px 14px;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.3s ease;
}

.lbsf-copy-btn:hover {
  background-color: var(--primary-hover, #215387);
}


/* Corrected Copy button styles to match Kadence theme */
#lbs-solutions-list .lbsf-copy {
  background-color: var(--primary, #2B6CB0);
  border: none;
  border-radius: var(--radius, 10px);
  color: #fff;
  padding: 8px 16px;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.3s ease;
  white-space: nowrap; /* Prevent text wrapping */
  min-width: 60px; /* Ensure minimum width for the button */
  width: auto; /* Allow button to expand as needed */
  flex-shrink: 0; /* Prevent button from shrinking */
}

#lbs-solutions-list .lbsf-copy:hover {
  background-color: var(--primary-hover, #215387);
}


/* Force Copy button to use plugin theme colors (Kadence match) */
.lbsf-root #lbs-solutions-list .lbsf-copy {
  background-color: var(--primary, #2B6CB0) !important; /* Avoid theme override */
  border-color: var(--primary, #2B6CB0) !important;
  color: #fff !important;
  white-space: nowrap !important; /* Prevent text wrapping */
  min-width: 60px !important; /* Ensure minimum width for the button */
  width: auto !important; /* Allow button to expand as needed */
  flex-shrink: 0 !important; /* Prevent button from shrinking */
  padding: 8px 16px !important; /* Ensure adequate padding */
}

.lbsf-root #lbs-solutions-list .lbsf-copy:hover {
  background-color: var(--primary-hover, #215387) !important;
  border-color: var(--primary-hover, #215387) !important;
  color: #fff !important;
}

/* --- Responsive Fixes for Mobile --- */
@media (max-width: 600px) {
  .lbsf-puzzle {
    grid-template-columns: 1fr 100px 1fr; /* Adjusted central column width */
    grid-template-rows: auto 100px auto; /* Adjusted central row height */
    gap: 10px; /* Increased gap for better spacing */
    align-items: center;
    justify-items: center;
  }
  .lbsf-puzzle input {
    width: 110px; /* Increased input width for better mobile visibility */
    max-width: 90%;
    font-size: 18px; /* Increased font size for better readability */
    padding: 10px 8px; /* Increased padding for better touch targets */
    text-align: center;
  }
  .lbsf-puzzle label {
    white-space: nowrap;
    font-size: 13px; /* Slightly increased label font size */
  }
  .lbsf-square {
    width: 70px; /* Adjusted square size */
    height: 70px; /* Adjusted square size */
  }
  .lbsf-square span {
    width: 28px; /* Adjusted inner square size */
    height: 28px; /* Adjusted inner square size */
  }
  .lbsf-actions {
    flex-direction: column;
    align-items: center;
    gap: 12px;
  }
  .lbsf-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
  }
  .lbsf-buttons button {
    flex: 1 1 100px;
    min-width: 90px;
  }
  .lbsf-len {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
  }
  .lbsf-root h2 {
    font-size: 24px;
    text-align: center;
  }
  .lbsf-root p {
    font-size: 14px;
    text-align: center;
  }
}

/* --- Narrow screen adjustments (<400px) --- */
@media (max-width: 400px) {
  .lbsf-puzzle {
    grid-template-columns: 1fr 80px 1fr; /* Further adjusted central column width */
    grid-template-rows: auto 80px auto; /* Further adjusted central row height */
    gap: 8px; /* Further adjusted gap */
  }
  .lbsf-puzzle input {
    font-size: 12px;
    padding: 3px;
    width: 60px;
  }
  .lbsf-square {
    width: 60px; /* Further adjusted square size */
    height: 60px; /* Further adjusted square size */
  }
  .lbsf-square span {
    width: 24px; /* Further adjusted inner square size */
    height: 24px; /* Further adjusted inner square size */
  }
  .lbsf-root h2 {
    font-size: 20px;
  }
  .lbsf-root p {
    font-size: 12px;
  }
}



.lbsf-heading {
    font-size: 20px;
    font-weight: bold;
}
