/**
 * Styles for JWT Decoder tool
 *
 * Self-contained: each tool now loads only its own assets, so the shared
 * .cc-tool base classes are repeated here on purpose.
 */

.cc-tool {
  width: 100%;
  /* O shortcode entra como div cru no entry-content, sem wrapper do tema: sem esta
     margem o heading seguinte encosta na caixa. */
  margin: 0 auto 32px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.cc-tool-container {
  background: #f8f9fa;
  border-radius: 12px;
  padding: 40px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  border: 1px solid #e0e0e0;
  /* O espaçamento entre blocos vem de gap, não de margin-bottom nos filhos: assim
     não sobra margem depois do último bloco (o padding do container já fecha a caixa),
     e blocos com [hidden] não deixam buraco, porque não viram itens do flex. */
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.cc-tool-label {
  display: block;
  font-weight: 600;
  font-size: 16px;
  margin-bottom: 12px;
  color: #2c3e50;
}

.cc-tool-textarea {
  width: 100%;
  padding: 16px;
  border: 2px solid #d0d0d0;
  border-radius: 8px;
  font-family: 'Courier New', Courier, monospace;
  font-size: 15px;
  line-height: 1.6;
  resize: vertical;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-sizing: border-box;
  background: #ffffff;
  color: #2c3e50;
  height: initial;
}

.cc-tool-textarea:focus {
  outline: none;
  border-color: #0e7490;
  box-shadow: 0 0 0 3px rgba(14, 116, 144, 0.1);
}

.cc-tool-textarea::placeholder {
  color: #95a5a6;
}

.cc-tool-error {
  padding: 14px 18px;
  background: #f8d7da;
  border: 1px solid #f5c6cb;
  border-radius: 8px;
  color: #721c24;
  font-size: 15px;
}

/* Token input */

.cc-jwt-input {
  word-break: break-all;
}

.cc-jwt-privacy {
  margin: 10px 0 0;
  font-size: 14px;
  color: #5f6b76;
}

/* Decoded output */

.cc-jwt-output:not([hidden]) {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Token status */

.cc-jwt-status {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.cc-jwt-status-badge {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  background: #e2e8f0;
  color: #334155;
}

.cc-jwt-status-valid {
  background: #dcfce7;
  color: #166534;
}

.cc-jwt-status-expired {
  background: #fee2e2;
  color: #991b1b;
}

.cc-jwt-status-pending {
  background: #fef3c7;
  color: #92400e;
}

.cc-jwt-status-hint {
  font-size: 15px;
  color: #5f6b76;
}

/* Unsigned token warning */

.cc-jwt-warning {
  padding: 14px 18px;
  background: #fef3c7;
  border: 1px solid #fcd34d;
  border-radius: 8px;
  color: #92400e;
  font-size: 15px;
}

/* Decoded panels */

.cc-jwt-panel-head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 12px;
}

.cc-jwt-panel-head .cc-tool-label {
  margin-bottom: 12px;
}

.cc-jwt-meta {
  flex: 1;
  font-family: 'Courier New', Courier, monospace;
  font-size: 14px;
  color: #0e7490;
}

.cc-jwt-copy {
  padding: 6px 14px;
  background: #ffffff;
  border: 1px solid #d0d0d0;
  border-radius: 6px;
  font-size: 14px;
  color: #2c3e50;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.cc-jwt-copy:hover {
  background: #f1f5f9;
  border-color: #0e7490;
}

.cc-jwt-json {
  margin: 0;
  padding: 16px;
  background: #ffffff;
  border: 2px solid #d0d0d0;
  border-radius: 8px;
  font-family: 'Courier New', Courier, monospace;
  font-size: 15px;
  line-height: 1.6;
  color: #2c3e50;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-x: auto;
}

.cc-jwt-signature {
  color: #5f6b76;
}

.cc-jwt-notice {
  margin: 10px 0 0;
  font-size: 14px;
  color: #5f6b76;
}

/* Temporal claims */

.cc-jwt-claims {
  width: 100%;
  margin-top: 16px;
  border-collapse: collapse;
  font-size: 15px;
}

.cc-jwt-claims td {
  padding: 10px 12px;
  border-bottom: 1px solid #e0e0e0;
  vertical-align: top;
}

.cc-jwt-claims tr:last-child td {
  border-bottom: none;
}

.cc-jwt-claim-name {
  font-family: 'Courier New', Courier, monospace;
  font-weight: 600;
  color: #0e7490;
  width: 1%;
  white-space: nowrap;
}

.cc-jwt-claim-label {
  color: #5f6b76;
  white-space: nowrap;
}

.cc-jwt-claim-value {
  color: #2c3e50;
}

.cc-jwt-claim-relative {
  color: #5f6b76;
  white-space: nowrap;
}

/* Responsive design */

@media (max-width: 768px) {
  .cc-tool-container {
    padding: 24px;
  }

  .cc-tool-textarea,
  .cc-jwt-json {
    font-size: 14px;
  }

  .cc-jwt-claims,
  .cc-jwt-claims tbody,
  .cc-jwt-claims tr,
  .cc-jwt-claims td {
    display: block;
    width: auto;
  }

  .cc-jwt-claims tr {
    padding: 10px 0;
    border-bottom: 1px solid #e0e0e0;
  }

  .cc-jwt-claims td {
    padding: 2px 0;
    border-bottom: none;
  }
}
