/* Shared styles for all tool pages - extracted to reduce page weight */

.tool-wrapper {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1.5rem 2rem;
  position: relative;
  z-index: 2;
}

.tool-hero-minimal {
  text-align: center;
  padding: 0.5rem 0 0.75rem;
  border-bottom: 1px solid rgba(16, 185, 129, 0.2);
  margin-bottom: 1rem;
}

.tool-hero-minimal h1 {
  font-size: 1.6rem;
  font-weight: 800;
  background: linear-gradient(135deg, #10b981, #34d399, #6ee7b7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0 0 0.25rem;
  line-height: 1.1;
  text-shadow: 0 0 30px rgba(16, 185, 129, 0.3);
}

.tool-hero-minimal p {
  color: #94a3b8;
  font-size: 0.9rem;
  margin: 0;
  font-weight: 400;
}

.tool-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

@media (max-width: 968px) {
  .tool-grid {
    grid-template-columns: 1fr;
  }
}

/*
  Tool pages reuse the class name `.tool-card`, but the global site stylesheet
  also defines `.tool-card` for the homepage grid (fixed height, flex layout).
  Scope tool-page card styling to `.tool-wrapper` to avoid collisions.
*/
 .tool-wrapper .tool-card {
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: 12px;
  padding: 1.25rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  height: auto;
  min-height: 0;
  display: block;
  text-align: left;
}

/*
  Global stylesheet defines `.tool-card p` for the homepage grid using flex.
  Tool pages need normal paragraph flow (and `<br>` line breaks).
*/
.tool-wrapper .tool-card p {
  display: block;
  flex: initial;
  align-items: initial;
  text-align: left;
}

.tool-wrapper .tool-card:hover {
  transform: none !important;
  border-color: rgba(16, 185, 129, 0.4);
}

.card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.card-header-icon {
  font-size: 1.5rem;
}

.card-header h2 {
  font-size: 1.1rem;
  font-weight: 700;
  color: #10b981;
  margin: 0;
}

.tool-input-group {
  margin-bottom: 1rem;
}

.tool-input-group label {
  display: block;
  color: #cbd5e1;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.tool-input-wrapper {
  position: relative;
  display: flex;
  gap: 0.5rem;
}

.tool-input {
  flex: 1;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  color: #e2e8f0;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.tool-input:focus {
  outline: none;
  border-color: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.tool-input::placeholder {
  color: #64748b;
}

.tool-btn {
  background: linear-gradient(135deg, #10b981, #059669);
  border: none;
  border-radius: 8px;
  padding: 0.75rem 1.5rem;
  color: white;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.tool-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #059669, #047857);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.tool-btn:active:not(:disabled) {
  transform: translateY(0);
}

.tool-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.tool-btn-secondary {
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.tool-btn-secondary:hover:not(:disabled) {
  background: rgba(51, 65, 85, 0.9);
  border-color: #10b981;
}

.results-container {
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: 12px;
  padding: 1.5rem;
  margin-top: 1rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.results-container.hidden {
  display: none;
}

.loading-state {
  text-align: center;
  padding: 2rem;
}

.spinner {
  border: 3px solid rgba(16, 185, 129, 0.1);
  border-top-color: #10b981;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 0 auto 1rem;
}

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

.loading-state p {
  color: #94a3b8;
  font-size: 0.95rem;
}

.error-state {
  text-align: center;
  padding: 2rem;
  color: #ef4444;
}

.error-state svg {
  width: 48px;
  height: 48px;
  margin-bottom: 1rem;
  color: #ef4444;
}

.success-state {
  color: #10b981;
}

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

.result-section:last-child {
  margin-bottom: 0;
}

.result-section h3 {
  color: #10b981;
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.result-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(16, 185, 129, 0.1);
}

.result-item:last-child {
  border-bottom: none;
}

.result-label {
  color: #94a3b8;
  font-size: 0.9rem;
  font-weight: 500;
  flex-shrink: 0;
  margin-right: 1rem;
}

.result-value {
  color: #e2e8f0;
  font-size: 0.9rem;
  text-align: right;
  word-break: break-word;
  font-family: 'Courier New', monospace;
}

.result-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.result-badge.warning {
  background: rgba(251, 191, 36, 0.2);
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.3);
}

.result-badge.error {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.3);
}

.copy-btn {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 6px;
  padding: 0.4rem 0.75rem;
  color: #10b981;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-left: 0.5rem;
}

.copy-btn:hover {
  background: rgba(16, 185, 129, 0.2);
  border-color: #10b981;
}

.info-text {
  color: #94a3b8;
  font-size: 0.85rem;
  margin-top: 0.5rem;
  font-style: italic;
}

@media (max-width: 768px) {
  .tool-wrapper {
    padding: 0 1rem 2rem;
  }

  .tool-hero-minimal h1 {
    font-size: 1.4rem;
  }

  .tool-input-wrapper {
    flex-direction: column;
  }

  .tool-btn {
    width: 100%;
  }

  .result-item {
    flex-direction: column;
    gap: 0.25rem;
  }

  .result-label {
    margin-right: 0;
  }

  .result-value {
    text-align: left;
  }
}
