:root {
  --primary-color: #6366f1;
  --primary-hover: #5856f1;
  --secondary-color: #8b5cf6;
  --background: #fafafa;
  --card-background: #ffffff;
  --text-primary: #1f2937;
  --text-secondary: #6b7280;
  --border-color: #e5e7eb;
  --border-focus: #6366f1;
  --success-color: #10b981;
  --error-color: #ef4444;
  --warning-color: #f59e0b;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

* {
  box-sizing: border-box;
}

/* Home Logo Styles */
.home-logo {
  position: fixed;
  top: 1rem;
  left: 1rem;
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.2rem;
  text-decoration: none;
  box-shadow: var(--shadow-md);
  transition: all 0.3s ease;
  z-index: 100;
  cursor: pointer;
}

.home-logo:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  background: linear-gradient(135deg, var(--primary-hover) 0%, #7c3aed 100%);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  margin: 0;
  padding: 0;
  background: var(--background);
  color: var(--text-primary);
  line-height: 1.6;
}

.main-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.header-section {
  text-align: center;
  margin-bottom: 1.5rem;
}

h1 {
  font-size: 2.2rem;
  font-weight: 800;
  margin: 0 0 0.5rem 0;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

h1 + p {
  font-size: 1rem;
  color: var(--text-secondary);
  margin: 0 0 1rem 0;
}

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

.form-content {
  background: var(--card-background);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 1.5rem;
  border: 1px solid var(--border-color);
}

.form-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

h2 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.url-input-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.url-input-group {
  display: flex;
  flex-direction: column;
}

label {
  margin-bottom: 0.5rem;
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--text-primary);
}

textarea {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
  background: var(--card-background);
  color: var(--text-primary);
  transition: all 0.2s ease;
  resize: none;
  height: 120px;
}

textarea:hover {
  border-color: var(--primary-color);
}

textarea:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.helper-notes {
  margin-top: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.helper-note {
  font-size: 0.8rem;
  color: #6b7280;
  font-style: italic;
}

.analyze-options {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem;
  background: #f8fafc;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.analyze-options label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  cursor: pointer;
  font-size: 0.9rem;
}

.analyze-options input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary-color);
}

.analyze-button {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  color: white;
  border: none;
  padding: 1rem 2rem;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  align-self: flex-start;
  min-width: 180px;
}

.analyze-button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}

.analyze-button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top: 2px solid white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

.results-section {
  flex: 1;
}

.results-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.url-result {
  background: var(--card-background);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-color);
  overflow: hidden;
}

.section-result {
  background: var(--card-background);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-color);
  overflow: hidden;
  margin-bottom: 1rem;
}

.section-header {
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 1rem;
  border-bottom: 1px solid var(--border-color);
  background: #f8fafc;
}

.section-count {
  padding: 0.375rem 1rem;
  border-radius: 9999px;
  font-size: 0.85rem;
  font-weight: 600;
  background: var(--primary-color);
  color: white;
  flex-shrink: 0;
  border: 2px solid var(--primary-color);
}

.button-site {
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-style: italic;
}

.url-header {
  padding: 1.5rem;
  display: flex;
  justify-content: between;
  align-items: center;
  gap: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.url-header h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  flex: 1;
  word-break: break-all;
}

.status {
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 500;
  flex-shrink: 0;
}

.status.success {
  background: #dcfce7;
  color: #166534;
}

.status.error {
  background: #fee2e2;
  color: #991b1b;
}

.buttons-list {
  padding: 1.5rem;
}

.button-item {
  padding: 1rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  background: #fafafa;
}

.button-item:last-child {
  margin-bottom: 0;
}

.button-info {
  margin-bottom: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.button-info strong {
  color: var(--text-primary);
  font-size: 0.95rem;
}

.button-info code {
  font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
  background: #f1f5f9;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  align-self: flex-start;
}

.events-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.5rem;
}

.event-section {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.event-section-title {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid var(--border-color);
}

.event-section .event-item {
  margin-left: 0.5rem;
}

.event-item {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  background: white;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
}

.event-type {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--primary-color);
  letter-spacing: 0.025em;
}

.event-value {
  font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
  font-size: 0.8rem;
  color: var(--text-primary);
  background: #f8fafc;
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
}

.no-events, .no-buttons, .no-results {
  color: var(--text-secondary);
  font-style: italic;
  text-align: center;
  padding: 1rem;
}

.footer {
  text-align: center;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
  color: var(--text-secondary);
}

.footer a {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 500;
}

.footer a:hover {
  text-decoration: underline;
}

@media (max-width: 768px) {
  .main-content {
    padding: 1rem;
  }

  h1 {
    font-size: 2rem;
  }

  .form-content {
    padding: 1.5rem;
  }

  .analyze-options {
    gap: 0.5rem;
  }

  .url-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .events-list {
    flex-direction: column;
  }
}

/* New styles for dataLayer event display */
.click-count {
  padding: 0.375rem 1rem;
  border-radius: 9999px;
  font-size: 0.85rem;
  font-weight: 600;
  background: #6b7280;
  color: white;
  flex-shrink: 0;
  border: 2px solid #6b7280;
}

.event-details {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  width: 100%;
}

.button-text-value {
  font-weight: 700 !important;
  color: var(--text-primary) !important;
}

.event-property {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.25rem 0;
}

.error-message {
  padding: 1rem;
  background: #fee2e2;
  color: #991b1b;
  border-radius: var(--radius-sm);
  margin: 1rem;
  border: 1px solid #fecaca;
}

/* Event Checkbox Styles for Footer */
.event-checkbox {
  margin-right: 0.75rem;
  flex-shrink: 0;
}

.event-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.event-checkbox label {
  display: none;
}

/* Section Push Button Styles */
.section-push-container {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: center;
}

.section-push-btn {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2);
}

.section-push-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(59, 130, 246, 0.3);
}

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

.section-push-btn.pushed {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  cursor: not-allowed;
  opacity: 0.7;
}

.section-push-btn.pushed:hover {
  transform: none;
  box-shadow: 0 2px 4px rgba(16, 185, 129, 0.2);
}

/* Update event-item layout for checkboxes */
.event-item {
  align-items: flex-start;
} 