/* =========================================================================
   Wallet Analyzer Tool Styling
   ========================================================================= */

#wallet-analyzer-tool {
  max-width: 800px;
  margin: 2rem 0;
}

.tool-section {
  margin-bottom: 1.5rem;
}

.tool-section label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: #2c2c2c;
}

.tool-input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #e8e8e8;
  background-color: #ffffff;
  color: #000000;
  font-family: 'Roboto', sans-serif;
  font-size: 0.95rem;
  border-radius: 4px;
  box-sizing: border-box;
}

.tool-input:focus {
  outline: none;
  border-color: #666666;
}

.tool-input[type="password"] {
  font-family: monospace;
}

/* Wallet Address Input with History */
.wallet-address-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.wallet-address-wrapper .tool-input {
  flex: 1;
  padding-right: 3rem;
}

.wallet-history-icon {
  position: absolute;
  right: 0.5rem;
  background: none;
  border: none;
  padding: 0.5rem;
  cursor: pointer;
  color: #666666;
  transition: color 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wallet-history-icon:hover {
  color: #000000;
}

.wallet-history-icon svg {
  display: block;
}

/* API Key Input with Icons */
.api-key-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.api-key-input {
  flex: 1;
  padding-right: 3rem;
}

.api-key-icon {
  position: absolute;
  right: 0;
  background: none;
  border: none;
  padding: 0.5rem;
  cursor: pointer;
  color: #666666;
  transition: color 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.api-key-icon:hover {
  color: #000000;
}

.api-key-icon:first-of-type {
  right: 2.5rem;
}

.api-key-icon:last-of-type {
  right: 0.5rem;
}

.api-key-icon svg {
  display: block;
}

.tool-help {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: #666666;
}

.tool-help a {
  color: #000000;
  text-decoration: underline;
  text-decoration-color: #999999;
}

.tool-help a:hover {
  text-decoration-color: #000000;
}

.tool-actions {
  display: flex;
  gap: 1rem;
  margin: 1.5rem 0;
}

.tool-button {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 4px;
  font-family: 'Roboto', sans-serif;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tool-button.primary {
  background-color: #000000;
  color: #ffffff;
  border: 1px solid #000000;
}

.tool-button.primary:hover:not(:disabled) {
  background-color: #333333;
  border-color: #333333;
}

.tool-button.primary:disabled {
  background-color: #cccccc;
  border-color: #cccccc;
  cursor: not-allowed;
}

.tool-button.secondary {
  background-color: #ffffff;
  color: #000000;
  border: 1px solid #e8e8e8;
}

.tool-button.secondary:hover {
  background-color: #f5f5f5;
  border-color: #cccccc;
}

.tool-status {
  padding: 0.75rem;
  margin: 1rem 0;
  min-height: 1.5rem;
  color: #666666;
  font-size: 0.9rem;
  font-family: 'Roboto Mono', monospace;
}

.tool-progress {
  width: 100%;
  height: 4px;
  background-color: #f5f5f5;
  border-radius: 2px;
  overflow: hidden;
  margin: 1rem 0;
}

.progress-bar {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #666666 0%, #000000 50%, #666666 100%);
  background-size: 200% 100%;
  animation: progress-animation 1.5s linear infinite;
}

@keyframes progress-animation {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Activity Log */
.tool-log {
  margin-top: 1rem;
  border: 1px solid #e8e8e8;
  border-radius: 4px;
  background-color: #ffffff;
  max-height: 300px;
  display: flex;
  flex-direction: column;
}

.tool-log-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.75rem;
  background-color: #f5f5f5;
  border-bottom: 1px solid #e8e8e8;
  font-size: 0.85rem;
  font-weight: 500;
  color: #2c2c2c;
}

.tool-log-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid #e8e8e8;
  border-top-color: #666666;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-left: 0.5rem;
}

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

.tool-log-clear {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  background-color: #ffffff;
  color: #666666;
  border: 1px solid #e8e8e8;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-left: auto;
}

.tool-log-clear:hover {
  background-color: #fafafa;
  border-color: #cccccc;
}

.tool-log-output {
  padding: 0.75rem;
  font-family: 'Roboto Mono', monospace;
  font-size: 0.8rem;
  line-height: 1.5;
  color: #2c2c2c;
  overflow-y: auto;
  flex: 1;
  max-height: 250px;
}

.tool-log-entry {
  padding: 0.25rem 0;
  border-bottom: 1px solid #f5f5f5;
}

.tool-log-entry:last-child {
  border-bottom: none;
}

.tool-log-timestamp {
  color: #999999;
  font-size: 0.75rem;
  margin-right: 0.5rem;
}

.tool-log-type {
  font-weight: 500;
  margin-right: 0.5rem;
  text-transform: uppercase;
  font-size: 0.75rem;
}

.tool-log-type.info {
  color: #2196F3;
}

.tool-log-type.success {
  color: #4CAF50;
}

.tool-log-type.warning {
  color: #FF9800;
}

.tool-log-type.error {
  color: #F44336;
}

.tool-log-message {
  color: #2c2c2c;
}

.tool-log-done {
  padding: 0.5rem 0 0.25rem;
  font-weight: 500;
  color: #666666;
}

/* Report Output */
.report-pending {
  padding: 2rem;
  text-align: left;
  color: #999999;
  font-style: italic;
  font-size: 1rem;
}

.report-output {
  margin-top: 1rem;
  padding: 1.5rem;
  background-color: #fafafa;
  border: 1px solid #e8e8e8;
  border-radius: 4px;
  overflow-x: auto;
}

/* Override only what's needed - md-typeset handles the rest */
.report-output.md-typeset {
  max-width: none;
}

.report-output.md-typeset h2 {
  margin-top: 1rem;
}

.report-output.md-typeset h3 {
  margin-top: 1rem;
}

.report-output.md-typeset h4 {
  margin-top: 0.75rem;
}

/* Token Filter */
.token-filter-wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.token-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  min-height: 0;
}

.token-filter-chips:empty {
  display: none;
}

.token-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.5rem;
  background-color: #f5f5f5;
  border: 1px solid #e8e8e8;
  border-radius: 4px;
  font-size: 0.85rem;
  font-family: 'Roboto Mono', monospace;
  color: #2c2c2c;
}

.token-chip-remove {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: #999999;
  display: flex;
  align-items: center;
  transition: color 0.2s ease;
}

.token-chip-remove:hover {
  color: #000000;
}

.token-chip-remove svg {
  width: 14px;
  height: 14px;
}

.token-filter-clear {
  position: absolute;
  right: 0.5rem;
  bottom: 0.75rem;
  background: none;
  border: none;
  padding: 0.25rem;
  cursor: pointer;
  color: #666666;
  transition: color 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.token-filter-clear:hover {
  color: #000000;
}

.token-filter-clear svg {
  display: block;
}

/* Checkbox styling */
.tool-section label input[type="checkbox"] {
  margin-right: 0.5rem;
  cursor: pointer;
}
