/* Superball Shared Styles */

/* Apply theme variables and classes */
:root {
  /* Core Variables (6) */
  --primary-color: #000000;
  --secondary-color: #ffffff;
  --accent-color: #ff0000;
  --muted-color: #666666;
  --font-family: "Courier New", Courier, monospace;
  --border-radius: 15px;
  --border-width: 3px;
  
  /* Floating Tab Variables (8) - from theme.css */
  --tab-bg-logged-out: #ffffff;
  --tab-bg-logged-in: #ffffff;
  --tab-bg-opacity-logged-out: 0.9;
  --tab-bg-opacity-logged-in: 0.2;
  --tab-color-logged-out: #000000;
  --tab-color-logged-in: #ffffff;
  --tab-border-logged-out: #000000;
  --tab-border-logged-in: #ff0000;
  --tab-border-opacity-logged-out: 1.0;
  --tab-border-opacity-logged-in: 0.1;
}

body {
  font-family: var(--font-family);
  margin: 0;
  padding: 20px;
  background: var(--secondary-color);
  min-height: 100vh;
  color: var(--primary-color);
}

.section {
  margin: 20px 0;
  border: var(--border-width) solid var(--primary-color);
  padding: 15px;
  border-radius: var(--border-radius);
  background: var(--secondary-color);
}

.section h2 {
  margin: 0 0 15px 0;
  font-size: 18px;
  font-family: var(--font-family);
  color: var(--primary-color);
}

input,
textarea,
select {
  width: 100%;
  padding: 8px;
  margin: 5px 0;
  border: var(--border-width) solid var(--primary-color);
  border-radius: var(--border-radius);
  font-family: var(--font-family);
  background: var(--secondary-color);
  color: var(--primary-color);
  box-sizing: border-box;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent-color);
  outline: none;
}

button {
  background: var(--secondary-color);
  color: var(--primary-color);
  border: var(--border-width) solid var(--primary-color);
  border-radius: var(--border-radius);
  font-family: var(--font-family);
  cursor: pointer;
  width: auto;
  padding: 10px 20px;
  margin: 5px 0;
  transition: all 0.2s ease;
}

button:hover {
  border-color: var(--accent-color);
}

button:active {
  background: var(--accent-color);
  color: var(--secondary-color);
}

#main-content button {
  background: var(--secondary-color);
  color: var(--primary-color);
  border: var(--border-width) solid var(--primary-color);
  border-radius: var(--border-radius);
  font-family: var(--font-family);
  cursor: pointer;
  width: auto;
  padding: 10px 20px;
  margin: 5px 0;
  transition: border-color 0.2s ease;
  height: 40px;
  box-sizing: border-box;
}

#main-content button:hover {
  border-color: var(--accent-color);
}

#main-content button:active {
  background: var(--accent-color);
  color: var(--secondary-color);
}

#main-content .button-primary {
  background: var(--secondary-color);
  color: var(--primary-color);
  border-color: var(--primary-color);
}

#main-content .button-primary:hover {
  border-color: var(--accent-color);
}

#main-content .button-danger {
  background: var(--accent-color);
  color: var(--secondary-color);
  border-color: var(--accent-color);
}

#main-content .button-danger:hover {
  border-color: var(--primary-color);
}

.input-group {
  margin: 10px 0;
}

label {
  display: block;
  font-weight: bold;
  margin-bottom: 3px;
  font-family: var(--font-family);
  color: var(--primary-color);
}

.relay-item {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 5px 0;
  padding: 8px;
  border: var(--border-width) solid var(--primary-color);
  border-radius: var(--border-radius);
  background: var(--secondary-color);
}

.relay-url {
  flex: 1;
  font-family: var(--font-family);
  font-size: 12px;
  word-break: break-all;
  color: var(--primary-color);
}

.relay-type {
  min-width: 80px;
  font-size: 12px;
  color: var(--muted-color);
  text-align: center;
  font-family: var(--font-family);
}

.relay-auth-status {
  min-width: 100px;
  font-size: 11px;
  text-align: center;
  font-family: var(--font-family);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.auth-indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}

.auth-indicator.read-write {
  background-color: #28a745;
  /* Green - fully compatible */
}

.auth-indicator.read-only {
  background-color: #ffc107;
  /* Yellow - read only */
}

.auth-indicator.error {
  background-color: #dc3545;
  /* Red - connection error */
}

.auth-indicator.testing {
  background-color: #6c757d;
  /* Gray - testing in progress */
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%,
  100% {
  opacity: 1;
  }

  50% {
  opacity: 0.5;
  }
}

.auth-status-text {
  font-size: 10px;
  font-weight: bold;
}

.relay-actions {
  display: flex;
  gap: 5px;
}

#main-content .relay-actions button {
  padding: 4px 8px;
  font-size: 12px;
  width: auto;
  height: 32px;
}

.hidden {
  display: none;
}

.status-message {
  padding: 10px;
  margin: 10px 0;
  border-radius: var(--border-radius);
  border: var(--border-width) solid var(--primary-color);
  font-family: var(--font-family);
}

.success {
  background: var(--secondary-color);
  color: var(--primary-color);
  border-color: var(--primary-color);
}

.error {
  background: var(--secondary-color);
  color: var(--accent-color);
  border-color: var(--accent-color);
}

.info {
  background: var(--secondary-color);
  color: var(--primary-color);
  border-color: var(--muted-color);
}

.add-relay-form {
  display: flex;
  gap: 10px;
  align-items: end;
}

.add-relay-form input {
  flex: 1;
}

.add-relay-form select {
  width: 100px;
}

.add-relay-form button {
  width: auto;
  margin: 5px 0;
}

.pubkey-display {
  font-family: var(--font-family);
  font-size: 12px;
  word-break: break-all;
  background: var(--secondary-color);
  color: var(--muted-color);
  padding: 5px;
  border: var(--border-width) solid var(--muted-color);
  border-radius: var(--border-radius);
}

.action-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.daemon-control {
  margin: 15px 0;
}

#main-content #daemon-toggle {
  font-size: 16px;
  padding: 10px 20px;
  margin-bottom: 15px;
  height: 40px;
}

#main-content #daemon-toggle.running {
  background: var(--accent-color);
  color: var(--secondary-color);
  border-color: var(--accent-color);
}

#main-content #daemon-toggle.running:hover {
  border-color: var(--primary-color);
}

#daemon-status {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  background: var(--secondary-color);
  border: var(--border-width) solid var(--primary-color);
  border-radius: var(--border-radius);
  padding: 10px;
  font-size: 14px;
  font-family: var(--font-family);
  color: var(--primary-color);
}

.event-queue-item {
  background: var(--secondary-color);
  border: var(--border-width) solid var(--muted-color);
  border-radius: var(--border-radius);
  padding: 10px;
  margin: 5px 0;
  font-family: var(--font-family);
  font-size: 12px;
  color: var(--primary-color);
}

.event-queue-item.processing {
  border-color: var(--accent-color);
}

.log-entry {
  padding: 8px;
  margin: 2px 0;
  border-left: var(--border-width) solid var(--muted-color);
  background: var(--secondary-color);
  font-family: var(--font-family);
  font-size: 12px;
  color: var(--primary-color);
}

.log-entry.success {
  border-left-color: var(--primary-color);
}

.log-entry.error {
  border-left-color: var(--accent-color);
  color: var(--accent-color);
}

.log-entry.info {
  border-left-color: var(--muted-color);
}

.log-timestamp {
  color: var(--muted-color);
  font-weight: bold;
}

#processing-log {
  max-height: 300px;
  overflow-y: auto;
  border: var(--border-width) solid var(--primary-color);
  border-radius: var(--border-radius);
  background: var(--secondary-color);
}

h1 {
  font-family: var(--font-family);
  color: var(--primary-color);
  text-align: center;
}

p {
  font-family: var(--font-family);
  color: var(--primary-color);
}

strong {
  font-family: var(--font-family);
  color: var(--primary-color);
}

small {
  font-family: var(--font-family);
  color: var(--muted-color);
}

#thrower-banner {
  border: var(--border-width) solid var(--primary-color);
  border-radius: var(--border-radius);
  filter: grayscale(100%);
  transition: filter 0.3s ease;
  object-fit: cover;
  object-position: center;
}

#thrower-banner:hover {
  filter: grayscale(0%) saturate(50%);
}

#thrower-icon {
  width: 50px;
  height: 50px;
  border-radius: var(--border-radius);
  border: var(--border-width) solid var(--primary-color);
  filter: grayscale(100%);
  transition: filter 0.3s ease;
  object-fit: cover;
  object-position: center;
}

#thrower-icon:hover {
  filter: grayscale(0%) saturate(50%);
}

#login-container {
  margin: 20px auto;
  max-width: 500px;
}

#profile-picture {
  width: 50px;
  height: 50px;
  border-radius: var(--border-radius);
  border: var(--border-width) solid var(--primary-color);
  filter: grayscale(100%);
  transition: filter 0.3s ease;
  object-fit: cover;
  object-position: center;
}

#profile-picture:hover {
  filter: grayscale(0%) saturate(50%);
}

#profile-name,
#profile-pubkey {
  font-family: var(--font-family);
  color: var(--primary-color);
}

#profile-pubkey {
  color: var(--muted-color);
  font-size: 12px;
  word-break: break-all;
}

/* Superball Builder Specific Styles */
.json-display {
  background: var(--secondary-color);
  border: var(--border-width) solid var(--muted-color);
  border-radius: var(--border-radius);
  padding: 10px;
  font-family: var(--font-family);
  font-size: 12px;
  white-space: pre-wrap;
  word-wrap: break-word;
  max-height: 400px;
  overflow-y: auto;
  margin: 10px 0;
  color: var(--muted-color);
  display: none;
}

.json-display:not(:empty) {
  display: block;
}

.bounce-section {
  background: var(--secondary-color);
  border: var(--border-width) solid var(--muted-color);
}

.small-input {
  width: 200px;
}

/* Visualization Styles */
.visualization {
  background: var(--secondary-color);
  border: var(--border-width) solid var(--accent-color);
  padding: 15px;
  margin: 15px 0;
  border-radius: var(--border-radius);
}

.timeline {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.timeline-step {
  display: flex;
  align-items: center;
  padding: 10px;
  border: var(--border-width) solid var(--primary-color);
  border-radius: var(--border-radius);
  background: var(--secondary-color);
  transition: all 0.2s ease;
}

.step-time {
  min-width: 80px;
  font-weight: bold;
  color: var(--muted-color);
  font-size: 12px;
  font-family: var(--font-family);
}

.step-actor {
  min-width: 100px;
  font-weight: bold;
  color: var(--primary-color);
  font-family: var(--font-family);
}

.step-action {
  flex: 1;
  margin: 0 10px;
  font-family: var(--font-family);
  color: var(--primary-color);
}

.step-size {
  min-width: 80px;
  text-align: right;
  font-size: 12px;
  color: var(--muted-color);
  font-family: var(--font-family);
}

.step-relays {
  font-size: 11px;
  color: var(--muted-color);
  font-style: italic;
  font-family: var(--font-family);
}

/* Throw button hover effect */
.throw-button:hover {
  border-color: var(--accent-color) !important;
}

#profile-about {
  font-family: var(--font-family);
  color: var(--primary-color);
}

/* Thrower Discovery Styles */
.thrower-item {
  background: var(--secondary-color);
  border: var(--border-width) solid var(--muted-color);
  border-radius: var(--border-radius);
  padding: 8px 15px;
  margin: 5px 0;
  position: relative;
}

.thrower-item.online {
  border-color: #28a745;
}

.thrower-item.offline {
  border-color: #dc3545;
  opacity: 0.7;
}

.thrower-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  margin-bottom: 0;
}

.thrower-header-left {
  display: flex;
  align-items: center;
  flex: 1;
}

.thrower-details-section {
  margin-top: 10px;
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.3s ease;
}

.thrower-details-section.collapsed {
  max-height: 0;
  opacity: 0;
}

.thrower-details-section.expanded {
  max-height: 1000px;
  opacity: 1;
}

.expand-triangle {
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 8px solid var(--muted-color);
  transition: transform 0.3s ease;
  margin-left: 10px;
}

.expand-triangle.expanded {
  transform: rotate(180deg);
}

.thrower-condensed-info {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}

.thrower-status {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-right: 10px;
}

.thrower-status.online {
  background-color: #28a745;
}

.thrower-status.offline {
  background-color: #dc3545;
}

.thrower-name {
  font-weight: bold;
  font-size: 16px;
  flex: 1;
}

.thrower-pubkey {
  font-family: var(--font-family);
  font-size: 10px;
  color: var(--muted-color);
  word-break: break-all;
  margin: 5px 0;
}

.thrower-description {
  color: var(--primary-color);
  margin: 8px 0;
  font-size: 14px;
}

.thrower-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  font-size: 12px;
  color: var(--muted-color);
  margin-top: 10px;
}

.thrower-detail {
  display: flex;
  justify-content: space-between;
}

#discovery-status {
  font-style: italic;
}

.loading {
  animation: pulse 1.5s infinite;
}

/* Additional theme styles from theme.css */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.floating-tab {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 10px 15px;
  border-radius: var(--border-radius);
  border: var(--border-width) solid;
  font-family: var(--font-family);
  font-size: 14px;
  z-index: 1000;
  cursor: pointer;
  transition: all 0.3s ease;
}

.floating-tab.logged-out {
  background: rgba(255, 255, 255, var(--tab-bg-opacity-logged-out));
  color: var(--tab-color-logged-out);
  border-color: rgba(0, 0, 0, var(--tab-border-opacity-logged-out));
}

.floating-tab.logged-in {
  background: rgba(255, 255, 255, var(--tab-bg-opacity-logged-in));
  color: var(--tab-color-logged-in);
  border-color: rgba(255, 0, 0, var(--tab-border-opacity-logged-in));
}

.floating-tab:hover {
  transform: scale(1.05);
}


/* .input-group {
  margin: 20px;
} */

label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
}

textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-sizing: border-box;
}

.tabs {
  display: flex;
  margin: 20px 20px 0;
  border-bottom: 1px solid #ccc;
}

.tab {
  padding: 10px 20px;
  cursor: pointer;
  background-color: #f1f1f1;
  border: 1px solid #ccc;
  border-bottom: none;
  margin-right: 5px;
  border-radius: 4px 4px 0 0;
}

.tab.active {
  background-color: #fff;
  border-bottom: 1px solid #fff;
}

.tab-content {
  display: none;
  padding: 20px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

.tab-content.active {
  display: block;
}