/* Tapify Pro NFC Stylesheet */
.tapify-nfc {
  --tn-primary: #0062ff;
  --tn-primary-hover: #0052cc;
  --tn-bg: #0f172a;
  --tn-surface: #1e293b;
  --tn-surface-border: #334155;
  --tn-text: #ffffff;
  --tn-muted: #94a3b8;
  --tn-accent: #38bdf8;
  --tn-success: #22c55e;
  
  width: 100%;
  max-width: 620px;
  margin: 10px auto;
  min-height: auto !important;
  background: var(--tn-bg);
  border-radius: 16px;
  box-shadow: 0 15px 35px rgba(0,0,0,0.3);
  border: 1px solid var(--tn-surface-border);
  overflow: hidden;
  color: var(--tn-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  box-sizing: border-box;
}

.tapify-nfc * {
  box-sizing: border-box;
}

.tapify-nfc input,
.tapify-nfc textarea,
.tn-field input,
.tn-field textarea,
.tn-inline-form input {
  color: #ffffff !important;
  background-color: #090d16 !important;
  border: 1px solid var(--tn-surface-border);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  width: 100%;
  outline: none;
}

.tapify-nfc input::placeholder,
.tapify-nfc textarea::placeholder,
.tn-field input::placeholder,
.tn-field textarea::placeholder {
  color: #64748b !important;
}

.tapify-nfc input:focus,
.tapify-nfc textarea:focus {
  border-color: var(--tn-primary);
  box-shadow: 0 0 0 2px rgba(0, 98, 255, 0.25);
}

.tn-tabs {
  display: flex;
  background: #0062ff;
  padding: 6px;
  gap: 6px;
}

.tn-tabs button {
  flex: 1;
  padding: 10px 8px;
  border: none;
  background: transparent;
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tn-tabs button.active {
  background: var(--tn-surface);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.tn-main {
  padding: 30px;
}

.tn-panel {
  display: none;
}

.tn-panel.active {
  display: block;
}

.tn-hero-card {
  text-align: center;
  padding: 24px 16px;
  background: var(--tn-surface);
  border-radius: 14px;
  border: 1px solid var(--tn-surface-border);
}

.tn-hero-logo {
  width: 60px;
  height: 60px;
  margin-bottom: 12px;
}

.tn-hero-card h2 {
  font-size: 18px;
  margin: 0 0 4px;
  color: #ffffff;
}

.tn-hero-card p {
  font-size: 12px;
  color: var(--tn-muted);
  margin: 0 0 16px;
}

/* Vertical Record List for Write Tab */
.tn-section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--tn-muted);
  margin: 0 0 10px 4px;
}

.tn-record-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 420px;
  overflow-y: auto;
  padding-right: 4px;
}

.tn-record-list::-webkit-scrollbar {
  width: 4px;
}
.tn-record-list::-webkit-scrollbar-thumb {
  background: var(--tn-surface-border);
  border-radius: 4px;
}

.tn-list-item {
  width: 100%;
  background: var(--tn-surface);
  border: 1px solid var(--tn-surface-border);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s;
}

.tn-list-item:hover {
  border-color: var(--tn-primary);
  background: #253046;
}

.tn-list-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tn-list-left .tn-icon {
  font-size: 18px;
  width: 24px;
  text-align: center;
}

.tn-list-left b {
  display: block;
  font-size: 13px;
  color: #ffffff;
}

.tn-list-left small {
  font-size: 11px;
  color: var(--tn-muted);
}

.tn-chevron {
  color: #64748b;
  font-size: 12px;
  font-weight: bold;
}

.tn-btn-primary {
  width: 100%;
  padding: 12px 16px;
  background: var(--tn-primary);
  color: #ffffff;
  border: none;
  border-radius: 10px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
}

.tn-btn-primary:hover {
  background: var(--tn-primary-hover);
}

.tn-btn-secondary {
  width: 100%;
  padding: 12px 16px;
  background: var(--tn-surface-border);
  color: #ffffff;
  border: none;
  border-radius: 10px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
  transition: all 0.2s;
}

.tn-btn-secondary:hover {
  background: #475569;
}

.tn-card-mini {
  margin-top: 14px;
  background: var(--tn-surface);
  border: 1px solid var(--tn-surface-border);
  border-radius: 10px;
  padding: 12px;
}

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

.tn-badge-active {
  font-size: 10px;
  background: rgba(34, 197, 94, 0.15);
  color: var(--tn-success);
  padding: 3px 8px;
  border-radius: 6px;
  font-weight: 600;
}

.tn-btn-text {
  background: none;
  border: none;
  color: var(--tn-muted);
  font-size: 11px;
  cursor: pointer;
}

.tn-preview-code {
  font-family: monospace;
  font-size: 11px;
  background: #090d16;
  color: var(--tn-accent);
  padding: 8px;
  border-radius: 6px;
  margin-bottom: 10px;
  word-break: break-all;
  max-height: 80px;
  overflow-y: auto;
}

.tn-card-compact {
  background: var(--tn-surface);
  border: 1px solid var(--tn-surface-border);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 10px;
}

.tn-card-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--tn-muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tn-inline-form {
  display: flex;
  gap: 8px;
}

.tn-tool-row {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #090d16;
  border: 1px solid var(--tn-surface-border);
  padding: 10px;
  border-radius: 8px;
  color: #ffffff;
  font-size: 12px;
  cursor: pointer;
  margin-bottom: 6px;
}

.tn-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.tn-modal[hidden] {
  display: none !important;
}

.tn-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(4px);
}

.tn-modal-card {
  position: relative;
  background: var(--tn-surface);
  border: 1px solid var(--tn-surface-border);
  border-radius: 16px;
  width: 100%;
  max-width: 400px;
  padding: 20px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  z-index: 2;
  animation: tn-pop 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes tn-pop {
  0% { transform: scale(0.9); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.tn-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: none;
  color: var(--tn-muted);
  font-size: 16px;
  cursor: pointer;
}

.tn-anim-box {
  text-align: center;
  padding: 12px 0;
}

.tn-pulse-ring {
  width: 64px;
  height: 64px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: rgba(0, 98, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: tn-pulse 1.6s infinite ease-out;
}

.tn-pulse-ring svg {
  width: 32px;
  height: 32px;
}

@keyframes tn-pulse {
  0% { box-shadow: 0 0 0 0 rgba(0, 98, 255, 0.6); }
  70% { box-shadow: 0 0 0 18px rgba(0, 98, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 98, 255, 0); }
}

.tn-field {
  margin-bottom: 12px;
  text-align: left;
}

.tn-field label {
  display: block;
  font-size: 11px;
  color: var(--tn-muted);
  margin-bottom: 4px;
  font-weight: 600;
}

.tn-data-output {
  text-align: left;
  background: #090d16;
  border: 1px solid var(--tn-surface-border);
  padding: 12px;
  border-radius: 8px;
  font-family: monospace;
  font-size: 11px;
  color: var(--tn-accent);
  max-height: 160px;
  overflow-y: auto;
  white-space: pre-wrap;
  margin-bottom: 12px;
}

.tn-modal-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tn-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #ffffff;
  color: #0f172a;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 10px 25px rgba(0,0,0,0.3);
  display: none;
  z-index: 100000;
}

@media (max-width: 640px) {
  .tapify-nfc {
    max-width: 100% !important;
    margin: 0 !important;
    border-radius: 12px !important;
    min-height: auto !important;
    border: none;
  }
  
  .tn-main {
    padding: 12px;
  }
}