/**
 * this:matters Font Analyzer - Frontend/Shortcode Styles
 * Design: Modern, kräftige Farben
 */

#tm-font-analyzer-app.tm-shortcode {
  --tm-bg-page: #f8fafc;
  --tm-bg-card: #ffffff;
  --tm-bg-input: #f1f5f9;
  
  --tm-text-dark: #0f172a;
  --tm-text-body: #475569;
  --tm-text-muted: #94a3b8;
  
  --tm-primary: #6366f1;
  --tm-primary-dark: #4f46e5;
  --tm-primary-light: #e0e7ff;
  
  --tm-success: #059669;
  --tm-success-light: #d1fae5;
  --tm-warning: #d97706;
  --tm-warning-light: #fef3c7;
  --tm-error: #dc2626;
  --tm-error-light: #fee2e2;
  
  --tm-border: #e2e8f0;
  
  --tm-radius-lg: 16px;
  --tm-radius-xl: 24px;
  --tm-radius-2xl: 32px;
  
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--tm-bg-card);
  border-radius: var(--tm-radius-2xl);
  overflow: hidden;
  position: relative;
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
}

#tm-font-analyzer-app.tm-shortcode *,
#tm-font-analyzer-app.tm-shortcode *::before,
#tm-font-analyzer-app.tm-shortcode *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Gradient Blob */
#tm-font-analyzer-app.tm-shortcode .tm-gradient-blob {
  position: absolute;
  top: -60px;
  right: -60px;
  width: 280px;
  height: 280px;
  background: 
    radial-gradient(ellipse at 30% 30%, rgba(99, 102, 241, 0.25) 0%, transparent 50%),
    radial-gradient(ellipse at 70% 40%, rgba(236, 72, 153, 0.2) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 70%, rgba(59, 130, 246, 0.2) 0%, transparent 50%);
  filter: blur(40px);
  pointer-events: none;
  z-index: 0;
}

#tm-font-analyzer-app.tm-shortcode .tm-card-content {
  position: relative;
  z-index: 1;
  padding: 2rem;
}

#tm-font-analyzer-app.tm-shortcode .tm-card-header {
  margin-bottom: 1.5rem;
}

#tm-font-analyzer-app.tm-shortcode .tm-header-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: linear-gradient(135deg, var(--tm-success), #047857);
  color: white;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: 100px;
  margin-bottom: 0.75rem;
}

#tm-font-analyzer-app.tm-shortcode .tm-card-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--tm-text-dark);
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

#tm-font-analyzer-app.tm-shortcode .tm-card-title-accent {
  background: linear-gradient(135deg, var(--tm-primary), #a855f7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

#tm-font-analyzer-app.tm-shortcode .tm-card-subtitle {
  font-size: 0.9375rem;
  color: var(--tm-text-body);
}

#tm-font-analyzer-app.tm-shortcode .tm-input-section {
  margin-bottom: 1.25rem;
}

#tm-font-analyzer-app.tm-shortcode .tm-input-wrapper {
  position: relative;
  margin-bottom: 0.875rem;
}

#tm-font-analyzer-app.tm-shortcode .tm-input-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--tm-text-muted);
  pointer-events: none;
}

#tm-font-analyzer-app.tm-shortcode .tm-input {
  width: 100%;
  padding: 0.9375rem 1rem 0.9375rem 2.75rem;
  font-size: 1rem;
  font-family: inherit;
  background: var(--tm-bg-input);
  border: 2px solid transparent;
  border-radius: var(--tm-radius-lg);
  color: var(--tm-text-dark);
  transition: all 0.2s;
  outline: none;
}

#tm-font-analyzer-app.tm-shortcode .tm-input::placeholder {
  color: var(--tm-text-muted);
}

#tm-font-analyzer-app.tm-shortcode .tm-input:focus {
  background: white;
  border-color: var(--tm-primary);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
}

/* Analysis Mode Selector */
#tm-font-analyzer-app.tm-shortcode .tm-mode-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

#tm-font-analyzer-app.tm-shortcode .tm-mode-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background-color: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

#tm-font-analyzer-app.tm-shortcode .tm-mode-option:hover {
  background-color: #f1f5f9;
  border-color: #cbd5e1;
}

#tm-font-analyzer-app.tm-shortcode .tm-mode-option.active {
  background-color: #eef2ff;
  border-color: #6366f1;
}

#tm-font-analyzer-app.tm-shortcode .tm-mode-check {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background-color: #e2e8f0;
  border-radius: 50%;
  color: transparent;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

#tm-font-analyzer-app.tm-shortcode .tm-mode-option.active .tm-mode-check {
  background-color: #6366f1;
  color: white;
}

#tm-font-analyzer-app.tm-shortcode .tm-mode-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

#tm-font-analyzer-app.tm-shortcode .tm-mode-title {
  font-size: 15px;
  font-weight: 700;
  color: #1e293b;
  line-height: 1.3;
}

#tm-font-analyzer-app.tm-shortcode .tm-mode-option.active .tm-mode-title {
  color: #4f46e5;
}

#tm-font-analyzer-app.tm-shortcode .tm-mode-desc {
  font-size: 13px;
  font-weight: 500;
  color: #64748b;
  line-height: 1.3;
}

#tm-font-analyzer-app.tm-shortcode button.tm-btn-primary,
#tm-font-analyzer-app.tm-shortcode .tm-btn-primary {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.5rem !important;
  width: 100% !important;
  padding: 1rem 1.5rem !important;
  font-size: 1rem !important;
  font-weight: 600 !important;
  font-family: inherit !important;
  background: linear-gradient(135deg, #6366f1, #4f46e5) !important;
  border: none !important;
  border-radius: 16px !important;
  color: white !important;
  cursor: pointer !important;
  transition: all 0.2s !important;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4) !important;
  text-decoration: none !important;
  outline: none !important;
}

#tm-font-analyzer-app.tm-shortcode button.tm-btn-primary:hover:not(:disabled),
#tm-font-analyzer-app.tm-shortcode .tm-btn-primary:hover:not(:disabled) {
  transform: translateY(-2px) !important;
  box-shadow: 0 8px 25px rgba(99, 102, 241, 0.5) !important;
  background: linear-gradient(135deg, #4f46e5, #4338ca) !important;
}

#tm-font-analyzer-app.tm-shortcode button.tm-btn-primary:disabled,
#tm-font-analyzer-app.tm-shortcode .tm-btn-primary:disabled {
  opacity: 0.6 !important;
  cursor: not-allowed !important;
  transform: none !important;
}

#tm-font-analyzer-app.tm-shortcode .tm-btn-icon {
  display: flex !important;
  color: white !important;
}

#tm-font-analyzer-app.tm-shortcode .tm-loading {
  display: none;
  flex-direction: column;
  align-items: stretch;
  padding: 2rem;
  gap: 1.5rem;
}

#tm-font-analyzer-app.tm-shortcode .tm-loading.active {
  display: flex;
}

/* Progress Bar */
#tm-font-analyzer-app.tm-shortcode .tm-progressbar-container {
  width: 100%;
}

#tm-font-analyzer-app.tm-shortcode .tm-progressbar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

#tm-font-analyzer-app.tm-shortcode .tm-progressbar-label {
  font-size: 0.9375rem;
  font-weight: 600;
  color: #0f172a;
}

#tm-font-analyzer-app.tm-shortcode .tm-progressbar-percent {
  font-size: 1.25rem;
  font-weight: 700;
  color: #6366f1;
  font-variant-numeric: tabular-nums;
}

#tm-font-analyzer-app.tm-shortcode .tm-progressbar-track {
  width: 100%;
  height: 12px;
  background: #e2e8f0;
  border-radius: 6px;
  overflow: hidden;
}

#tm-font-analyzer-app.tm-shortcode .tm-progressbar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #6366f1, #8b5cf6, #a855f7);
  border-radius: 6px;
  transition: width 0.3s ease;
  position: relative;
}

#tm-font-analyzer-app.tm-shortcode .tm-progressbar-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  animation: tm-shimmer 1.5s infinite;
}

@keyframes tm-shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

#tm-font-analyzer-app.tm-shortcode .tm-progressbar-pages {
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: #64748b;
  text-align: center;
}

#tm-font-analyzer-app.tm-shortcode .tm-progressbar-pages strong {
  color: #6366f1;
  font-weight: 700;
}

/* Steps */
#tm-font-analyzer-app.tm-shortcode .tm-steps-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

#tm-font-analyzer-app.tm-shortcode .tm-step {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.875rem;
  background: #f1f5f9;
  border-radius: 100px;
  opacity: 0.5;
  transition: all 0.3s ease;
}

#tm-font-analyzer-app.tm-shortcode .tm-step.active {
  opacity: 1;
  background: #e0e7ff;
}

#tm-font-analyzer-app.tm-shortcode .tm-step.completed {
  opacity: 1;
  background: #d1fae5;
}

#tm-font-analyzer-app.tm-shortcode .tm-step-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  color: #94a3b8;
}

#tm-font-analyzer-app.tm-shortcode .tm-step.active .tm-step-icon {
  color: #6366f1;
}

#tm-font-analyzer-app.tm-shortcode .tm-step.completed .tm-step-icon {
  color: #059669;
}

#tm-font-analyzer-app.tm-shortcode .tm-step-icon-done {
  display: none;
}

#tm-font-analyzer-app.tm-shortcode .tm-step.completed .tm-step-icon-default {
  display: none;
}

#tm-font-analyzer-app.tm-shortcode .tm-step.completed .tm-step-icon-done {
  display: block;
}

#tm-font-analyzer-app.tm-shortcode .tm-step.active .tm-step-icon {
  animation: tm-pulse 1.5s ease-in-out infinite;
}

@keyframes tm-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

#tm-font-analyzer-app.tm-shortcode .tm-step-text {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #64748b;
}

#tm-font-analyzer-app.tm-shortcode .tm-step.active .tm-step-text {
  color: #4f46e5;
}

#tm-font-analyzer-app.tm-shortcode .tm-step.completed .tm-step-text {
  color: #047857;
}

#tm-font-analyzer-app.tm-shortcode .tm-results {
  display: none;
  margin-top: 1.5rem;
}

#tm-font-analyzer-app.tm-shortcode .tm-results.active {
  display: block;
}

#tm-font-analyzer-app.tm-shortcode .tm-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

#tm-font-analyzer-app.tm-shortcode .tm-stat {
  background: linear-gradient(135deg, var(--tm-primary-light), #f5f3ff);
  border-radius: 14px;
  padding: 1rem 0.75rem;
  text-align: center;
  border: 1px solid rgba(99, 102, 241, 0.1);
}

#tm-font-analyzer-app.tm-shortcode .tm-stat-value {
  font-size: 1.625rem;
  font-weight: 700;
  color: var(--tm-primary-dark);
  letter-spacing: -0.02em;
}

#tm-font-analyzer-app.tm-shortcode .tm-stat-label {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--tm-primary);
  margin-top: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

#tm-font-analyzer-app.tm-shortcode .tm-result-section {
  background: var(--tm-bg-input);
  border-radius: var(--tm-radius-xl);
  padding: 1.25rem;
  margin-bottom: 1rem;
  border: 1px solid var(--tm-border);
}

#tm-font-analyzer-app.tm-shortcode .tm-section-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

#tm-font-analyzer-app.tm-shortcode .tm-section-icon {
  color: var(--tm-primary);
}

#tm-font-analyzer-app.tm-shortcode .tm-section-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--tm-text-dark);
}

#tm-font-analyzer-app.tm-shortcode .tm-font-item {
  background: var(--tm-bg-card);
  border-radius: 14px;
  padding: 1.25rem;
  margin-bottom: 0.625rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  border: 1px solid var(--tm-border);
}

#tm-font-analyzer-app.tm-shortcode .tm-font-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

#tm-font-analyzer-app.tm-shortcode .tm-font-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--tm-text-dark);
}

#tm-font-analyzer-app.tm-shortcode .tm-font-badge {
  padding: 0.25rem 0.75rem;
  border-radius: 100px;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

#tm-font-analyzer-app.tm-shortcode .tm-font-badge.optimal {
  background: var(--tm-success-light);
  color: var(--tm-success);
}

#tm-font-analyzer-app.tm-shortcode .tm-font-badge.savings {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  color: #b45309;
  border: 1px solid #fbbf24;
}

#tm-font-analyzer-app.tm-shortcode .tm-weight-row {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  margin-bottom: 0.5rem;
}

#tm-font-analyzer-app.tm-shortcode .tm-weight-label {
  width: 80px;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--tm-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

#tm-font-analyzer-app.tm-shortcode .tm-weight-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}

#tm-font-analyzer-app.tm-shortcode .tm-weight-pill {
  padding: 0.25rem 0.625rem;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  font-family: ui-monospace, 'SF Mono', monospace;
}

#tm-font-analyzer-app.tm-shortcode .tm-weight-pill.used {
  background: var(--tm-success-light);
  color: var(--tm-success);
  border: 1px solid rgba(5, 150, 105, 0.2);
}

#tm-font-analyzer-app.tm-shortcode .tm-weight-pill.unused {
  background: var(--tm-error-light);
  color: var(--tm-error);
  text-decoration: line-through;
  border: 1px solid rgba(220, 38, 38, 0.2);
}

/* Icon Fonts Section */
#tm-font-analyzer-app.tm-shortcode .tm-icon-fonts-section {
  background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
  border: 1px dashed var(--tm-border);
}

#tm-font-analyzer-app.tm-shortcode .tm-icon-fonts-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--tm-text-muted);
  margin-bottom: 0.75rem;
}

#tm-font-analyzer-app.tm-shortcode .tm-icon-font-pill {
  display: inline-block;
  padding: 0.375rem 0.75rem;
  background: white;
  border-radius: 8px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--tm-text-body);
  margin: 0.25rem;
  border: 1px solid var(--tm-border);
}

#tm-font-analyzer-app.tm-shortcode .tm-chars-box {
  background: var(--tm-bg-card);
  border-radius: 14px;
  padding: 1rem 1.25rem;
  font-family: ui-monospace, 'SF Mono', monospace;
  font-size: 0.875rem;
  line-height: 1.9;
  color: var(--tm-text-dark);
  word-break: break-all;
  max-height: 120px;
  overflow-y: auto;
  border: 1px solid var(--tm-border);
}

#tm-font-analyzer-app.tm-shortcode .tm-code-block {
  background: var(--tm-bg-card);
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--tm-border);
}

#tm-font-analyzer-app.tm-shortcode .tm-code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.625rem 1rem;
  background: var(--tm-bg-input);
  border-bottom: 1px solid var(--tm-border);
}

#tm-font-analyzer-app.tm-shortcode .tm-code-lang {
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--tm-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

#tm-font-analyzer-app.tm-shortcode .tm-copy-btn {
  padding: 0.375rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--tm-primary);
  border: none;
  border-radius: 6px;
  color: white;
  cursor: pointer;
  transition: all 0.2s;
}

#tm-font-analyzer-app.tm-shortcode .tm-copy-btn:hover {
  background: var(--tm-primary-dark);
}

#tm-font-analyzer-app.tm-shortcode .tm-code-content {
  padding: 1rem 1.25rem;
  font-family: ui-monospace, 'SF Mono', monospace;
  font-size: 0.8125rem;
  line-height: 1.6;
  color: var(--tm-text-body);
  overflow-x: auto;
  white-space: pre;
}

/* Message Styles */
#tm-font-analyzer-app.tm-shortcode .tm-message {
  padding: 1rem 1.25rem;
  border-radius: 12px;
  font-size: 0.9375rem;
  font-weight: 500;
  margin-bottom: 1rem;
}

#tm-font-analyzer-app.tm-shortcode .tm-message.success {
  background: var(--tm-success-light);
  color: var(--tm-success);
  border: 1px solid rgba(5, 150, 105, 0.2);
}

#tm-font-analyzer-app.tm-shortcode .tm-message.warning {
  background: var(--tm-warning-light);
  color: var(--tm-warning);
  border: 1px solid rgba(217, 119, 6, 0.2);
}

#tm-font-analyzer-app.tm-shortcode .tm-message.error {
  background: var(--tm-error-light);
  color: var(--tm-error);
  border: 1px solid rgba(220, 38, 38, 0.2);
}

/* Full Analysis CTA */
#tm-font-analyzer-app.tm-shortcode .tm-full-analysis-cta {
  background: linear-gradient(135deg, #fef3c7, #fef9c3);
  border: 2px solid #fbbf24;
  border-radius: var(--tm-radius-lg);
  padding: 1.25rem;
  margin-top: 1.5rem;
  text-align: center;
}

#tm-font-analyzer-app.tm-shortcode .tm-full-analysis-title {
  font-size: 1rem;
  font-weight: 700;
  color: #92400e;
  margin-bottom: 0.5rem;
}

#tm-font-analyzer-app.tm-shortcode .tm-full-analysis-text {
  font-size: 0.875rem;
  color: #a16207;
  margin-bottom: 1rem;
}

#tm-font-analyzer-app.tm-shortcode .tm-email-input {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 0.9375rem;
  border: 2px solid #fbbf24;
  border-radius: 10px;
  margin-bottom: 0.75rem;
  outline: none;
}

#tm-font-analyzer-app.tm-shortcode .tm-email-input:focus {
  border-color: #f59e0b;
  box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.3);
}

#tm-font-analyzer-app.tm-shortcode .tm-btn-full-analysis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-size: 0.9375rem;
  font-weight: 600;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  border: none;
  border-radius: 10px;
  color: white;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}

#tm-font-analyzer-app.tm-shortcode .tm-btn-full-analysis:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(245, 158, 11, 0.5);
}

/* Responsive */
@media (max-width: 540px) {
  #tm-font-analyzer-app.tm-shortcode .tm-card-content {
    padding: 1.5rem 1.25rem;
  }
  
  #tm-font-analyzer-app.tm-shortcode .tm-stats {
    grid-template-columns: repeat(2, 1fr);
  }
  
  #tm-font-analyzer-app.tm-shortcode .tm-weight-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.375rem;
  }
  
  #tm-font-analyzer-app.tm-shortcode .tm-weight-label {
    width: auto;
  }
}
