/* ======================================================
   TOOLS-COMMON.CSS
   Shared layout & accessibility styles for all tools
====================================================== */

.tool-page {
  max-width: 520px;
  margin: 0 auto;
}

.tool-instructions {
  background-color: var(--bg-page);
  border-left: 4px solid var(--primary);
  padding: 16px 20px;
  border-radius: 10px;
  margin-bottom: 24px;
}

.tool-instructions h2 {
  font-size: 1.1rem;
  margin-bottom: 10px;
}

.tool-instructions ol {
  padding-left: 20px;
}

.tool-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
}

.actions {
  display: flex;
  gap: 12px;
  margin-top: 12px;
}

button {
  padding: 12px;
  border-radius: 8px;
  border: none;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
}

button:focus-visible,
input:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
}

.error {
  margin-top: 12px;
}

.result {
  margin-top: 14px;
}

/* Screen-reader-only text */
.sr-only {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* --- Shared Tool Utilities (Added) --- */

/* Tab Navigation */
.tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 20px;
}

.tabs button {
    flex: 1;
    padding: 12px;
    border: 1px solid var(--border);
    background: #f8fafc;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    border-radius: 8px 8px 0 0;
}

.tabs button[aria-selected="true"] {
    background: var(--bg-surface);
    border-bottom: 2px solid #2563eb;
    color: #2563eb;
}

/* Visibility */
.hidden {
    display: none !important;
}

.divider {
    border: 0;
    height: 1px;
    background: var(--border);
    margin-bottom: 30px;
}

/* Enhanced Button States */
.btn-main {
    background-color: #2563eb;
    color: white;
    width: 100%;
    transition: background 0.2s;
}

.btn-main:hover {
    background-color: #1d4ed8;
}

.btn-main:disabled {
    background-color: #94a3b8;
    cursor: not-allowed;
}

.btn-main.activated {
    background-color: #facc15 !important;
    color: #000 !important;
    border: 2px solid #eab308;
}

.btn-main.processing {
    background-color: #94a3b8 !important;
    cursor: wait;
    pointer-events: none;
}

.btn-link {
    background: none;
    border: none;
    color: #2563eb;
    text-decoration: underline;
    cursor: pointer;
    display: block;
    margin: 15px auto;
}

.btn-clear {
    background-color: #64748b;
    color: white;
    margin-top: 20px;
}

/* Success UI Layout */
.success-ui {
    text-align: center;
    padding: 20px;
}

.success-ui .icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 10px;
}