/* Komodo Platform Faucet - Dark Theme */

:root {
  /* Komodo Colors */
  --bg-primary: #0A1018;
  --bg-secondary: #0F1922;
  --bg-card: #0F1922;
  --bg-hover: #1A2532;
  
  --text-primary: #FFFFFF;
  --text-secondary: #8B9CAD;
  --text-muted: #5A6B7D;
  
  --accent-cyan: #00D9FF;
  --accent-blue: #5865F2;
  --success: #27AE60;
  --error: #E74C3C;
  --warning: #F39C12;
  
  --border-color: rgba(255, 255, 255, 0.1);
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.6);
  
  --radius-card: 26px;
  --radius-button: 12px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', 'Roboto', 'Oxygen',
    'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
  background: linear-gradient(135deg, var(--bg-primary) 0%, #0F1520 50%, var(--bg-secondary) 100%);
  background-attachment: fixed;
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 20px;
}

/* Header */
.header {
  text-align: center;
  margin-bottom: 48px;
  padding: 32px 0;
}

.logo {
  width: 180px;
  height: auto;
  margin-bottom: 16px;
  fill: var(--text-primary);
}

.header h1 {
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 12px;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-cyan) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.subtitle {
  font-size: 1.125rem;
  color: var(--text-secondary);
  font-weight: 400;
}

/* Main Content */
.main-content {
  /* No background needed, cards have their own */
}

/* Stats Section */
.stats-section {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius-card);
  padding: 24px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-color);
  transition: all 0.3s ease;
  text-align: center;
}

/* Animated border effect for Faucet Balance */
.stat-card.animated-border {
  position: relative;
  overflow: hidden;
  border: none;
  background: transparent;
}

.stat-card.animated-border::before {
  content: "";
  position: absolute;
  width: 200%;
  height: 200%;
  background: linear-gradient(90deg, var(--bg-primary) 20%, var(--accent-cyan) 45%, var(--bg-primary) 70%);
  top: -50%;
  left: -50%;
  animation: rotate-border 3s linear infinite;
}

.stat-card.animated-border::after {
  content: "";
  position: absolute;
  inset: 2px;
  background: var(--bg-card);
  border-radius: calc(var(--radius-card) - 2px);
  z-index: 1;
}

.stat-card.animated-border .stat-label,
.stat-card.animated-border .stat-value {
  position: relative;
  z-index: 2;
}

@keyframes rotate-border {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.stat-card:hover:not(.animated-border) {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(0, 217, 255, 0.3);
}

.stat-card.animated-border:hover {
  box-shadow: var(--shadow-lg);
}

.stat-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  font-weight: 600;
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.stat-value.loading {
  color: var(--text-muted);
  font-size: 1.25rem;
}

/* Request Section */
.request-section {
  margin-bottom: 32px;
}

/* Form Container */
.form-container {
  background: var(--bg-card);
  border-radius: var(--radius-card);
  padding: 32px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-color);
}

.form-container h2 {
  font-size: 1.75rem;
  margin-bottom: 8px;
  color: var(--text-primary);
  font-weight: 700;
}

.form-description {
  color: var(--text-secondary);
  margin-bottom: 28px;
  font-size: 0.9375rem;
}

.form-group {
  margin-bottom: 24px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.9375rem;
}

.form-group input {
  width: 100%;
  padding: 14px 18px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-button);
  color: var(--text-primary);
  font-size: 1rem;
  transition: all 0.3s ease;
  font-family: 'Monaco', 'Courier New', monospace;
}

.form-group input:focus {
  outline: none;
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px rgba(0, 217, 255, 0.1);
}

.form-group input::placeholder {
  color: var(--text-muted);
}

.input-hint {
  display: block;
  margin-top: 6px;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

/* Turnstile Widget */
.turnstile-container {
  display: flex;
  justify-content: center;
  margin: 24px 0;
}

/* Button */
.submit-btn {
  width: 100%;
  padding: 16px 32px;
  background: var(--text-primary);
  color: var(--bg-primary);
  border: none;
  border-radius: var(--radius-button);
  font-size: 1.0625rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.submit-btn:hover:not(:disabled) {
  background: var(--accent-cyan);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 217, 255, 0.3);
}

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

.submit-btn:disabled {
  background: var(--bg-hover);
  color: var(--text-muted);
  cursor: not-allowed;
  opacity: 0.6;
}

/* Spinner */
.spinner {
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.hidden {
  display: none !important;
}

/* Messages */
.message-container {
  padding: 16px 20px;
  border-radius: var(--radius-button);
  margin-top: 20px;
  font-weight: 500;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.message {
  font-size: 1rem;
  line-height: 1.5;
}

.message-container.success {
  background: rgba(39, 174, 96, 0.15);
  color: var(--success);
  border: 1px solid rgba(39, 174, 96, 0.3);
}

.message-container.error {
  background: rgba(231, 76, 60, 0.15);
  color: var(--error);
  border: 1px solid rgba(231, 76, 60, 0.3);
}

.message-container.warning {
  background: rgba(243, 156, 18, 0.15);
  color: var(--warning);
  border: 1px solid rgba(243, 156, 18, 0.3);
}

/* Info Section - What Else Can I Do */
.info-section {
  background: var(--bg-card);
  border-radius: var(--radius-card);
  padding: 32px;
  margin-bottom: 32px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-color);
}

.info-section h2 {
  font-size: 1.75rem;
  margin-bottom: 24px;
  color: var(--text-primary);
  font-weight: 700;
  text-align: center;
}

.info-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.info-card {
  background: var(--bg-primary);
  border-radius: var(--radius-button);
  padding: 24px;
  border: 1px solid var(--border-color);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
}

.info-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(0, 217, 255, 0.3);
}

.info-icon {
  font-size: 2.5rem;
  margin-bottom: 16px;
  line-height: 1;
}

.info-card h3 {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.info-card p {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 16px;
  flex-grow: 1;
}

.info-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent-cyan);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9375rem;
  transition: all 0.2s ease;
}

.info-link:hover {
  color: var(--text-primary);
  gap: 10px;
}

/* History Section */
.history-section {
  background: var(--bg-card);
  border-radius: var(--radius-card);
  padding: 32px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-color);
}

.history-section h3 {
  font-size: 1.5rem;
  margin-bottom: 20px;
  color: var(--text-primary);
  font-weight: 700;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.history-item {
  padding: 16px;
  background: var(--bg-primary);
  border-radius: var(--radius-button);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--accent-cyan);
  transition: all 0.2s ease;
}

.history-item:hover {
  background: var(--bg-hover);
  border-color: rgba(0, 217, 255, 0.2);
}

.history-item.success {
  border-left-color: var(--success);
}

.history-item.failed {
  border-left-color: var(--error);
}

.history-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.history-item-address {
  font-family: 'Monaco', 'Courier New', monospace;
  font-size: 0.9rem;
  color: var(--text-primary);
  word-break: break-all;
}

.history-item-time {
  font-size: 0.8125rem;
  color: var(--text-muted);
  white-space: nowrap;
  margin-left: 12px;
}

.history-item-details {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.history-item-txid {
  font-size: 0.8125rem;
  color: var(--text-muted);
  font-family: 'Monaco', 'Courier New', monospace;
  word-break: break-all;
}

.history-item-txid a {
  color: var(--accent-cyan);
  text-decoration: none;
  transition: color 0.2s ease;
}

.history-item-txid a:hover {
  color: var(--text-primary);
  text-decoration: underline;
}

.no-history {
  text-align: center;
  padding: 32px;
  color: var(--text-muted);
  font-style: italic;
}

/* Footer */
.footer {
  text-align: center;
  margin-top: 48px;
  padding: 24px 0;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.footer a {
  color: var(--accent-cyan);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer a:hover {
  color: var(--text-primary);
}

/* Responsive Design */
@media (max-width: 768px) {
  .header h1 {
    font-size: 2.25rem;
  }
  
  .subtitle {
    font-size: 1rem;
  }
  
  .stats-section {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .form-container,
  .history-section {
    padding: 24px;
  }
  
  .container {
    padding: 24px 16px;
  }
  
  .history-item-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .history-item-time {
    margin-left: 0;
    margin-top: 4px;
  }
  
  .info-cards {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .header h1 {
    font-size: 1.875rem;
  }
  
  .stat-value {
    font-size: 1.5rem;
  }
  
  .form-container,
  .history-section {
    padding: 20px;
  }
}
