/* ==================== Variables ==================== */
:root {
  --primary: #14b8a6;
  --primary-light: #5eead4;
  --primary-dark: #0d9488;
  --accent: #8b5cf6;
  --bg-dark: #1e293b;
  --bg-gradient-1: #1e3a5f;
  --bg-gradient-2: #312e81;
  --glass: rgba(255, 255, 255, 0.06);
  --glass-border: rgba(255, 255, 255, 0.1);
  --warning: #f59e0b;
  --success: #22c55e;
  --error: #ef4444;
}

/* ==================== Reset ==================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: linear-gradient(135deg, var(--bg-dark) 0%, var(--bg-gradient-1) 50%, var(--bg-gradient-2) 100%);
  min-height: 100vh;
  color: #fff;
  overflow-x: hidden;
}

/* ==================== Animated Background ==================== */
.bg-animation {
  position: fixed;
  inset: 0;
  overflow: hidden;
  z-index: 0;
  pointer-events: none;
}

.gradient-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.5;
  animation: float 20s ease-in-out infinite;
}

.orb-1 {
  width: 300px;
  height: 300px;
  background: linear-gradient(135deg, var(--primary) 0%, transparent 70%);
  top: -100px;
  right: -50px;
  animation-delay: 0s;
}

.orb-2 {
  width: 250px;
  height: 250px;
  background: linear-gradient(135deg, var(--accent) 0%, transparent 70%);
  bottom: -80px;
  left: -50px;
  animation-delay: -7s;
}

.orb-3 {
  width: 200px;
  height: 200px;
  background: linear-gradient(135deg, #3b82f6 0%, transparent 70%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation-delay: -14s;
  opacity: 0.3;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(30px, -30px) scale(1.1); }
  50% { transform: translate(-20px, 20px) scale(0.9); }
  75% { transform: translate(20px, 30px) scale(1.05); }
}

.grid-overlay {
  position: absolute;
  inset: 0;
  background-image: 
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 50px 50px;
  mask-image: radial-gradient(ellipse at center, black 0%, transparent 70%);
}

/* ==================== Container ==================== */
.container {
  position: relative;
  z-index: 10;
  max-width: 500px;
  margin: 0 auto;
  padding: 30px 20px;
}

/* ==================== Header ==================== */
.header {
  text-align: center;
  margin-bottom: 30px;
}

.logo-container {
  position: relative;
  width: 80px;
  height: 80px;
  margin: 0 auto 16px;
}

.logo-glow {
  position: absolute;
  inset: -15px;
  background: radial-gradient(circle, var(--primary) 0%, transparent 70%);
  opacity: 0.4;
  filter: blur(20px);
  animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.4; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.1); }
}

.logo-main {
  position: absolute;
  inset: 10px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 
    0 15px 30px rgba(20, 184, 166, 0.3),
    inset 0 1px 0 rgba(255,255,255,0.2);
}

.logo-main span {
  color: white;
  font-size: 32px;
  font-weight: 900;
  font-style: italic;
}

.header h1 {
  font-size: 24px;
  font-weight: 800;
  background: linear-gradient(135deg, #fff 0%, var(--primary-light) 50%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 6px;
}

.header p {
  color: rgba(255,255,255,0.5);
  font-size: 13px;
}

/* ==================== Glass Card ==================== */
.glass-card {
  background: var(--glass);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 20px;
  margin-bottom: 16px;
}

.card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.card-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 18px;
}

.card-icon.api { background: linear-gradient(135deg, #3b82f6, #1d4ed8); }
.card-icon.email { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); }
.card-icon.code { background: linear-gradient(135deg, var(--warning), #d97706); }
.card-icon.info { background: linear-gradient(135deg, var(--accent), #7c3aed); }

.card-title {
  display: flex;
  flex-direction: column;
}

.card-title .step {
  color: rgba(255,255,255,0.5);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.card-title .label {
  color: white;
  font-size: 15px;
  font-weight: 700;
}

/* ==================== API Selector ==================== */
.api-selector {
  display: flex;
  gap: 10px;
}

.api-option {
  flex: 1;
  padding: 14px;
  border: 2px solid var(--glass-border);
  border-radius: 14px;
  background: rgba(0,0,0,0.2);
  cursor: pointer;
  transition: all 0.3s;
  text-align: center;
}

.api-option:hover {
  border-color: rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.05);
}

.api-option.active {
  border-color: var(--primary);
  background: rgba(20, 184, 166, 0.15);
}

.api-option .name {
  color: rgba(255,255,255,0.8);
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
}

.api-option.active .name {
  color: var(--primary-light);
}

.api-option .domain {
  color: rgba(255,255,255,0.4);
  font-size: 11px;
  font-family: monospace;
}

.api-option.active .domain {
  color: var(--primary);
}

/* ==================== Input Row ==================== */
.input-row {
  display: flex;
  gap: 10px;
}

.input-box {
  flex: 1;
  height: 48px;
  background: rgba(0,0,0,0.25);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  display: flex;
  align-items: center;
  padding: 0 14px;
  color: var(--primary-light);
  font-size: 14px;
  font-family: monospace;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.input-box.empty {
  color: rgba(255,255,255,0.4);
  font-family: inherit;
}

.text-input {
  flex: 1;
  height: 48px;
  background: rgba(0,0,0,0.25);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 0 14px;
  color: rgba(255,255,255,0.9);
  font-size: 14px;
  outline: none;
  transition: border-color 0.3s;
}

.text-input:focus {
  border-color: var(--primary);
}

.text-input::placeholder {
  color: rgba(255,255,255,0.4);
}

/* ==================== Code Box ==================== */
.code-box {
  flex: 1;
  height: 56px;
  background: rgba(0,0,0,0.25);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.4);
  font-size: 28px;
  font-weight: 700;
  font-family: monospace;
  letter-spacing: 6px;
}

.code-box.polling {
  animation: pulse-border 1s ease-in-out infinite;
  color: var(--warning);
}

.code-box.has-code {
  color: var(--success);
  border-color: rgba(34, 197, 94, 0.4);
  background: rgba(34, 197, 94, 0.1);
}

@keyframes pulse-border {
  0%, 100% { border-color: rgba(245, 158, 11, 0.2); }
  50% { border-color: rgba(245, 158, 11, 0.5); }
}

/* ==================== Buttons ==================== */
.btn {
  height: 48px;
  padding: 0 20px;
  border: none;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  box-shadow: 0 8px 20px rgba(20, 184, 166, 0.3);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(20, 184, 166, 0.4);
}

.btn-secondary {
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.7);
  border: 1px solid var(--glass-border);
}

.btn-secondary:hover:not(:disabled) {
  background: rgba(255,255,255,0.15);
  color: white;
}

.btn-warning {
  background: linear-gradient(135deg, var(--warning), #d97706);
  color: white;
  box-shadow: 0 8px 20px rgba(245, 158, 11, 0.3);
}

.btn-warning:hover:not(:disabled) {
  transform: translateY(-2px);
}

.copy-btn {
  width: 48px;
  height: 48px;
  padding: 0;
  min-width: 48px;
}

.copy-btn.copied {
  background: var(--success) !important;
  color: white !important;
  box-shadow: none;
}

/* ==================== Poll Options ==================== */
.poll-options {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--glass-border);
}

.poll-options input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--primary);
}

.poll-options label {
  color: rgba(255,255,255,0.5);
  font-size: 12px;
  cursor: pointer;
}

/* ==================== Status ==================== */
.status {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.status.loading {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.2);
  color: var(--warning);
}

.status.success {
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.2);
  color: var(--success);
}

.status.error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: var(--error);
}

.status:empty {
  display: none;
}

/* ==================== Spinner ==================== */
.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.2);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ==================== Info Card ==================== */
.info-list {
  color: rgba(255,255,255,0.6);
  font-size: 13px;
  line-height: 2;
}

.info-list li {
  margin-left: 16px;
}

.domain-info {
  margin-top: 14px;
  padding: 10px 14px;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: 10px;
  color: var(--warning);
  font-size: 12px;
  text-align: center;
}

/* ==================== Footer ==================== */
.footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 14px 20px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  margin-top: 10px;
}

.footer-item {
  display: flex;
  align-items: center;
  gap: 6px;
  color: rgba(255,255,255,0.4);
  font-size: 11px;
}

.footer-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 10px var(--success);
}

.footer-divider {
  width: 1px;
  height: 12px;
  background: rgba(255,255,255,0.1);
}

/* ==================== Utility ==================== */
.hidden {
  display: none !important;
}

/* ==================== Scrollbar ==================== */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}
