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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  padding: 20px;
}

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

.header {
  text-align: center;
  color: white;
  margin-bottom: 40px;
}

.header h1 {
  font-size: 3em;
  margin-bottom: 10px;
}

.header p {
  font-size: 1.2em;
  opacity: 0.9;
}

.card {
  background: white;
  border-radius: 12px;
  padding: 30px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
  margin-bottom: 20px;
}

.input-group {
  margin-bottom: 20px;
}

.input-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  color: #333;
}

.input-group input {
  width: 100%;
  padding: 15px;
  font-size: 16px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  transition: border-color 0.3s;
}

.input-group input:focus {
  outline: none;
  border-color: #667eea;
}

button {
  width: 100%;
  padding: 15px;
  font-size: 18px;
  font-weight: 600;
  color: white;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

button:active {
  transform: translateY(0);
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.results {
  margin-top: 30px;
  display: none;
}

.results.show {
  display: block;
}

.hidden {
  display: none;
}

.result-section {
  margin-bottom: 25px;
  padding-bottom: 25px;
  border-bottom: 1px solid #e0e0e0;
}

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

.result-section h3 {
  color: #667eea;
  margin-bottom: 10px;
  font-size: 1.2em;
}

.url-display {
  background: #f5f5f5;
  padding: 15px;
  border-radius: 8px;
  word-break: break-all;
  font-family: 'Courier New', monospace;
  font-size: 14px;
  margin-bottom: 10px;
}

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  margin-right: 8px;
  margin-bottom: 5px;
}

.badge-shortened {
  background: #ffe5e5;
  color: #c41e3a;
}

.badge-clean {
  background: #e5ffe5;
  color: #2d5016;
}

.badge-tracking {
  background: #fff3cd;
  color: #856404;
}

.chain {
  margin-top: 10px;
}

.chain-item {
  padding: 10px;
  background: #f9f9f9;
  border-left: 3px solid #667eea;
  margin-bottom: 8px;
  font-family: 'Courier New', monospace;
  font-size: 13px;
}

.removed-params-header {
  margin-bottom: 15px;
  font-weight: 600;
}

.rules-applied {
  margin-top: 10px;
}

.rule-item {
  padding: 8px 12px;
  background: #f0f0f0;
  border-radius: 6px;
  margin-bottom: 6px;
  font-size: 13px;
}

.rule-id {
  font-weight: 600;
  color: #667eea;
}

.button-group {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.action-btn {
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  color: white;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-width: 0;
  transition: transform 0.2s, box-shadow 0.2s;
}

.action-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.action-btn:active {
  transform: translateY(0);
}

.loading {
  text-align: center;
  color: #667eea;
  font-size: 18px;
  margin: 20px 0;
  display: none;
}

.loading.show {
  display: block;
}

.error-message {
  background: #fee;
  border: 2px solid #c33;
  border-radius: 8px;
  padding: 15px;
  margin: 20px 0;
  color: #c33;
  font-size: 16px;
  display: none;
}

.error-message.show {
  display: block;
}

.footer {
  text-align: center;
  color: white;
  margin-top: 40px;
  opacity: 0.8;
}

.footer a {
  color: white;
  text-decoration: underline;
}

.privacy-link {
  background: none;
  border: none;
  color: white;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
  font-size: inherit;
  font-family: inherit;
  opacity: 0.8;
}

.privacy-link:hover {
  opacity: 1;
}

/* Popover styling */
#privacy-policy {
  max-width: 600px;
  max-height: 80vh;
  padding: 0;
  border: none;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.3);
  background: white;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  overflow: hidden;
}

#privacy-policy::backdrop {
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 30px;
  border-bottom: 1px solid #e0e0e0;
  position: sticky;
  top: 0;
  background: white;
  z-index: 1;
}

.modal-header h2 {
  color: #667eea;
  margin: 0;
  font-size: 24px;
}

.modal-close {
  background: none;
  border: none;
  font-size: 32px;
  color: #999;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background 0.2s, color 0.2s;
  line-height: 1;
}

.modal-close:hover {
  background: #f0f0f0;
  color: #333;
  transform: none;
  box-shadow: none;
}

.modal-content {
  padding: 20px 30px 30px;
  overflow-y: auto;
  max-height: calc(80vh - 80px);
}

.modal-content h3 {
  color: #333;
  margin-top: 20px;
  margin-bottom: 10px;
  font-size: 18px;
}

.modal-content p {
  color: #555;
  line-height: 1.6;
  margin-bottom: 10px;
}

.modal-content ul {
  margin: 10px 0;
  padding-left: 20px;
}

.modal-content li {
  color: #555;
  line-height: 1.8;
  margin-bottom: 5px;
}

.modal-content .privacy-updated {
  margin-top: 20px;
  font-size: 12px;
  color: #999;
  text-align: center;
}
