/* Antonio's SEO Tools - Component Library */
/* Reusable UI components following seoworkflows.com aesthetic */

/* ============================================
   BUTTONS
   ============================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  padding: var(--space-2) var(--space-4);
  font-family: var(--font-primary);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  line-height: 1;
  text-decoration: none;
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition-all-base);
  white-space: nowrap;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* Primary Button */
.btn-primary {
  background: var(--primary-action);
  color: white;
  box-shadow: 0 3px 6px rgba(36, 153, 239, 0.3);
}

.btn-primary:hover:not(:disabled) {
  background: #1a7fc4;
  transform: translateY(-2px);
  box-shadow: 0 5px 12px rgba(36, 153, 239, 0.4);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(36, 153, 239, 0.3);
}

/* Secondary Button */
.btn-secondary {
  background: var(--primary-dark);
  color: white;
  box-shadow: 0 3px 6px rgba(0, 6, 57, 0.3);
}

.btn-secondary:hover:not(:disabled) {
  background: #000428;
  transform: translateY(-2px);
  box-shadow: 0 5px 12px rgba(0, 6, 57, 0.4);
}

/* Outline Button */
.btn-outline {
  background: transparent;
  color: var(--primary-action);
  border: 2px solid var(--primary-action);
  padding: calc(var(--space-2) - 2px) calc(var(--space-4) - 2px);
}

.btn-outline:hover:not(:disabled) {
  background: var(--primary-action);
  color: white;
}

/* Ghost Button */
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: none;
}

.btn-ghost:hover:not(:disabled) {
  background: rgba(158, 158, 158, 0.08);
  color: var(--text-primary);
}

/* Success Button */
.btn-success {
  background: var(--success);
  color: white;
  box-shadow: 0 3px 6px rgba(16, 185, 129, 0.3);
}

.btn-success:hover:not(:disabled) {
  background: #059669;
  transform: translateY(-2px);
}

/* Warning Button */
.btn-warning {
  background: var(--warning);
  color: white;
  box-shadow: 0 3px 6px rgba(245, 158, 11, 0.3);
}

.btn-warning:hover:not(:disabled) {
  background: #d97706;
  transform: translateY(-2px);
}

/* Error/Danger Button */
.btn-danger {
  background: var(--error);
  color: white;
  box-shadow: 0 3px 6px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover:not(:disabled) {
  background: #dc2626;
  transform: translateY(-2px);
}

/* Button Sizes */
.btn-sm {
  padding: var(--space-1) var(--space-2);
  font-size: var(--font-size-xs);
}

.btn-lg {
  padding: var(--space-3) var(--space-5);
  font-size: var(--font-size-base);
}

.btn-block {
  width: 100%;
  justify-content: center;
}

/* ============================================
   CARDS
   ============================================ */

.card {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: var(--transition-all-base);
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.card-header {
  padding: var(--space-3) var(--space-4);
  border-bottom: var(--border-thin) solid var(--glass-border);
  background: var(--bg-secondary);
}

.card-body {
  padding: var(--space-4);
}

.card-footer {
  padding: var(--space-3) var(--space-4);
  border-top: var(--border-thin) solid var(--glass-border);
  background: var(--bg-secondary);
}

.card-title {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  margin: 0;
  color: var(--text-primary);
}

.card-subtitle {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  margin: var(--space-1) 0 0 0;
}

/* ============================================
   BADGES & PILLS
   ============================================ */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

/* ============================================
   SUPPORTER HARD CAP POPUP
   ============================================ */

.supporter-hard-cap-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  z-index: var(--z-modal);
}

.supporter-hard-cap-card {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  box-shadow: var(--shadow-xl);
  width: min(520px, 100%);
  border: var(--border-thin) solid rgba(36, 153, 239, 0.28);
  position: relative;
  text-align: left;
}

.supporter-hard-cap-close {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(15, 23, 42, 0.08);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition-all-base);
}

.supporter-hard-cap-close:hover {
  background: rgba(15, 23, 42, 0.15);
  color: var(--text-primary);
}

.supporter-hard-cap-header {
  margin-bottom: var(--space-3);
}

.supporter-hard-cap-header h2 {
  margin: var(--space-1) 0 0;
  font-size: var(--font-size-xl);
  color: var(--text-primary);
}

.supporter-hard-cap-tier {
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
  margin: var(--space-1) 0 0;
}

.supporter-hard-cap-usage {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.supporter-hard-cap-usage .label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-tertiary);
}

.supporter-hard-cap-usage strong {
  display: block;
  font-size: 1.875rem;
  color: var(--primary-action);
}

.supporter-hard-cap-message {
  margin-bottom: var(--space-3);
  color: var(--text-secondary);
  line-height: var(--line-height-relaxed);
}

.supporter-hard-cap-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.supporter-hard-cap-actions .btn {
  flex: 1;
  justify-content: center;
  min-width: 180px;
}

.supporter-hard-cap-contact {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.supporter-hard-cap-contact a {
  color: var(--primary-action);
  text-decoration: underline;
}

@media (max-width: 600px) {
  .supporter-hard-cap-card {
    padding: var(--space-4);
  }

  .supporter-hard-cap-usage strong {
    font-size: 1.5rem;
  }

  .supporter-hard-cap-actions .btn {
    min-width: 100%;
  }
}

.badge-primary {
  background: rgba(36, 153, 239, 0.1);
  color: var(--primary-action);
}

.badge-success {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success);
}

.badge-warning {
  background: rgba(245, 158, 11, 0.1);
  color: var(--warning);
}

.badge-error {
  background: rgba(239, 68, 68, 0.1);
  color: var(--error);
}

.badge-info {
  background: rgba(59, 130, 246, 0.1);
  color: var(--info);
}

/* ============================================
   SNACKBAR NOTIFICATIONS
   ============================================ */

.snackbar {
  position: fixed;
  bottom: var(--space-4);
  right: var(--space-4);
  background: white;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 300px;
  max-width: 400px;
  border-left: var(--border-thick) solid currentColor;
  animation: slideInRight 0.3s ease-out;
  z-index: var(--z-tooltip);
}

.snackbar-success {
  color: var(--success);
}

.snackbar-error {
  color: var(--error);
}

.snackbar-warning {
  color: var(--warning);
}

.snackbar-info {
  color: var(--primary-action);
}

.snackbar-close {
  margin-left: auto;
  background: none;
  border: none;
  font-size: 1.25rem;
  color: var(--text-tertiary);
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: var(--transition-all-fast);
}

.snackbar-close:hover {
  background: rgba(158, 158, 158, 0.1);
  color: var(--text-primary);
}

@keyframes slideInRight {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOutRight {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(400px);
    opacity: 0;
  }
}

/* ============================================
   USAGE WARNING BANNER
   ============================================ */

.usage-warning-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  background: rgba(245, 158, 11, 0.12);
  border: var(--border-thin) solid rgba(245, 158, 11, 0.35);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-lg);
  margin: var(--space-4) var(--space-4) var(--space-3);
}

.usage-warning-content {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.usage-warning-text {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.usage-warning-title {
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
}

.usage-warning-meta {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
}

@media (max-width: 768px) {
  .usage-warning-banner {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ============================================
   FORM INPUTS
   ============================================ */

.form-group {
  margin-bottom: var(--space-3);
}

.form-label {
  display: block;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
  margin-bottom: var(--space-1);
}

.form-label-required::after {
  content: '*';
  color: var(--error);
  margin-left: 0.25rem;
}

.form-control {
  width: 100%;
  padding: var(--space-2);
  border: var(--border-thin) solid var(--glass-border);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-sm);
  font-family: var(--font-primary);
  color: var(--text-primary);
  background: white;
  transition: var(--transition-all-base);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-action);
  box-shadow: 0 0 0 3px rgba(36, 153, 239, 0.1);
}

.form-control::placeholder {
  color: var(--text-tertiary);
}

.form-control:disabled {
  background: var(--bg-secondary);
  color: var(--text-tertiary);
  cursor: not-allowed;
}

.form-help {
  font-size: var(--font-size-xs);
  color: var(--text-tertiary);
  margin-top: var(--space-1);
}

.form-error {
  font-size: var(--font-size-xs);
  color: var(--error);
  margin-top: var(--space-1);
}

/* Checkbox & Radio */
.form-check {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}

.form-check-input {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.form-check-label {
  font-size: var(--font-size-sm);
  color: var(--text-primary);
  cursor: pointer;
}

/* ============================================
   UPLOAD ZONE
   ============================================ */

.upload-zone {
  border: 2px dashed var(--glass-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  text-align: center;
  background: var(--bg-tertiary);
  transition: var(--transition-all-base);
  cursor: pointer;
}

.upload-zone:hover {
  border-color: var(--primary-action);
  background: rgba(36, 153, 239, 0.03);
}

.upload-zone.dragover {
  border-color: var(--primary-action);
  background: rgba(36, 153, 239, 0.08);
  border-style: solid;
}

.upload-icon {
  font-size: 3rem;
  margin-bottom: var(--space-2);
  color: var(--text-tertiary);
}

.upload-text {
  font-size: var(--font-size-base);
  color: var(--text-secondary);
  margin-bottom: var(--space-1);
  font-weight: var(--font-weight-medium);
}

.upload-hint {
  font-size: var(--font-size-sm);
  color: var(--text-tertiary);
}

/* ============================================
   TOOLTIPS
   ============================================ */

.tooltip {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.tooltip-trigger {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--text-tertiary);
  color: white;
  font-size: 0.625rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: help;
  font-weight: var(--font-weight-bold);
}

.tooltip-content {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary-dark);
  color: white;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  font-size: var(--font-size-xs);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-base);
  margin-bottom: var(--space-1);
  box-shadow: var(--shadow-lg);
  z-index: var(--z-tooltip);
}

.tooltip:hover .tooltip-content {
  opacity: 1;
}

.tooltip-content::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 4px solid transparent;
  border-top-color: var(--primary-dark);
}

/* ============================================
   EMPTY STATES
   ============================================ */

.empty-state {
  text-align: center;
  padding: var(--space-8) var(--space-4);
}

.empty-state-icon {
  font-size: 4rem;
  color: var(--text-tertiary);
  margin-bottom: var(--space-3);
}

.empty-state-title {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

.empty-state-text {
  font-size: var(--font-size-base);
  color: var(--text-secondary);
  max-width: 400px;
  margin: 0 auto var(--space-4);
  line-height: var(--line-height-relaxed);
}

/* ============================================
   STAT PILLS
   ============================================ */

.stat-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-2) var(--space-3);
  background: white;
  border: var(--border-thin) solid var(--glass-border);
  border-radius: var(--radius-full);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  box-shadow: var(--shadow-sm);
}

.stat-icon {
  font-size: 1.125rem;
}

/* ============================================
   LOADING SPINNER
   ============================================ */

.spinner {
  border: 3px solid var(--bg-secondary);
  border-top-color: var(--primary-action);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 0.8s linear infinite;
}

.spinner-sm {
  width: 20px;
  height: 20px;
  border-width: 2px;
}

.spinner-lg {
  width: 60px;
  height: 60px;
  border-width: 4px;
}

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

/* ============================================
   PROGRESS BAR
   ============================================ */

.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--bg-secondary);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-action), var(--accent-purple));
  border-radius: var(--radius-full);
  transition: width var(--transition-slow);
}

/* ============================================
   DIVIDER
   ============================================ */

.divider {
  border: 0;
  border-top: var(--border-thin) solid var(--glass-border);
  margin: var(--space-4) 0;
}

/* ============================================
   TABLES
   ============================================ */

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--font-size-sm);
}

.table thead {
  background: var(--bg-secondary);
  border-bottom: 2px solid var(--border-color);
}

.table th {
  padding: var(--space-3);
  text-align: left;
  font-weight: var(--font-weight-semibold);
  color: var(--text-secondary);
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.table td {
  padding: var(--space-3);
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
}

.table tbody tr:hover {
  background: var(--bg-secondary);
}

.table tbody tr:last-child td {
  border-bottom: none;
}

/* Responsive Tables */
@media (max-width: 768px) {
  .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .table {
    min-width: 600px;
  }
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */

@media (max-width: 768px) {
  .btn {
    padding: var(--space-2) var(--space-3);
    font-size: var(--font-size-xs);
  }

  .btn-lg {
    padding: var(--space-2) var(--space-4);
    font-size: var(--font-size-sm);
  }

  .snackbar {
    left: var(--space-2);
    right: var(--space-2);
    bottom: var(--space-2);
    min-width: auto;
  }
}
