/**
 * Share Analyzer Tool - Specific Styles
 * Extends the main output.css with tool-specific components
 */

/* ===============================
   Results Container Layout
   =============================== */
.results-container {
  max-width: 1300px;
  margin: 0 auto;
  padding: 0;
}

/* ===============================
   Textarea Input
   =============================== */
.share-textarea {
  width: 100%;
  min-height: 120px;
  padding: 1rem;
  border: 1px solid var(--border-subtle);
  border-radius: 0.75rem;
  background: var(--card-bg-secondary);
  color: var(--app-text-primary);
  font-family: inherit;
  font-size: 0.95rem;
  line-height: 1.6;
  resize: vertical;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.share-textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(37, 111, 195, 0.1);
}

.share-textarea::placeholder {
  color: var(--app-text-secondary);
  opacity: 0.7;
}

.textarea-row {
  width: 100%;
}

.input-actions {
  display: flex;
  justify-content: center;
}

.input-error {
  color: #dc2626;
  font-size: 0.85rem;
}

.input-success {
  color: #16a34a;
  font-size: 0.85rem;
}

[data-theme="dark"] .input-error {
  color: #fca5a5;
}

[data-theme="dark"] .input-success {
  color: #86efac;
}

/* ===============================
   Score Card
   =============================== */
.score-card {
  padding: 2rem;
  max-width: 100%;
}

.score-card-cta {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
}

.score-card-cta p {
  color: var(--app-text-secondary);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.score-card-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.score-summary {
  font-weight: 500;
}

/* ===============================
   Report Grid - Responsive
   =============================== */
.report-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  width: 100%;
}

/* On desktop, 2 cards per row looks good */
@media (min-width: 768px) {
  .report-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
  }
}

/* On mobile, single column at 90% width */
@media (max-width: 767px) {
  .report-grid {
    grid-template-columns: 1fr;
    width: 100%;
    margin: 0 auto;
    padding: 0;
  }
}

.report-card {
  padding: 1.25rem;
  width: 100%;
}

/* ===============================
   Full-Width Sections
   (Single cards that should span full width)
   =============================== */
.extracted-preview,
.utm-section,
.suggestions-section,
.ai-suggestions-section,
.upsell-section {
  width: 100%;
  max-width: 100%;
}

@media (max-width: 767px) {
  .extracted-preview,
  .utm-section,
  .suggestions-section,
  .ai-suggestions-section,
  .upsell-section {
    width: 100%;
    padding: 0;
    margin-left: auto;
    margin-right: auto;
  }
}

/* ===============================
   Extracted Content Preview
   =============================== */
.extracted-preview {
  padding: 1.5rem;
}

.extracted-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.extracted-item {
  display: flex;
  gap: 0.5rem;
}

.extracted-label {
  font-weight: 600;
  color: var(--app-text-primary);
}

.extracted-value {
  color: var(--app-text-secondary);
  word-break: break-word;
}

/* ===============================
   UTM Parameters Section
   =============================== */
.utm-section {
  padding: 1.5rem;
}

.utm-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

@media (max-width: 640px) {
  .utm-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

.utm-column h4 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--app-text-primary);
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

.utm-params {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.utm-param {
  font-size: 0.85rem;
  color: var(--app-text-secondary);
}

.utm-param code {
  background: var(--card-bg-secondary);
  padding: 0.15rem 0.4rem;
  border-radius: 0.25rem;
  font-size: 0.8rem;
  color: var(--primary-color);
}

.utm-none {
  color: var(--app-text-secondary);
  opacity: 0.6;
  font-style: italic;
}

/* ===============================
   AI Suggestions Section
   =============================== */
.ai-suggestions-section {
  padding: 1.5rem;
}

.ai-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.premium-badge {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: white;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.ai-gate {
  text-align: center;
  padding: 1.5rem;
  background: var(--card-bg-secondary);
  border-radius: 0.75rem;
}

.ai-gate p {
  color: var(--app-text-secondary);
  margin-bottom: 1rem;
}

.email-input-row {
  display: flex;
  gap: 0.75rem;
  max-width: 500px;
  margin: 0 auto;
}

@media (max-width: 640px) {
  .email-input-row {
    flex-direction: column;
  }
}

.email-input {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-subtle);
  border-radius: 0.5rem;
  background: var(--card-bg-primary);
  color: var(--app-text-primary);
  font-size: 0.9rem;
}

.email-input:focus {
  outline: none;
  border-color: var(--primary-color);
}

.ai-content {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.ai-suggestion-card {
  background: var(--card-bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 0.75rem;
  padding: 1rem;
}

.ai-platform {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary-color);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.5rem;
}

.ai-message {
  font-size: 0.9rem;
  color: var(--app-text-primary);
  line-height: 1.6;
  white-space: pre-wrap;
  margin-bottom: 0.75rem;
}

.btn-copy {
  font-size: 0.8rem;
  padding: 0.4rem 0.8rem;
  background: var(--card-bg-primary);
  border: 1px solid var(--border-subtle);
  border-radius: 0.375rem;
  color: var(--app-text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-copy:hover {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

.ai-coming-soon {
  text-align: center;
  padding: 2rem;
  background: var(--card-bg-secondary);
  border-radius: 0.75rem;
}

.coming-soon-icon {
  font-size: 2rem;
  display: block;
  margin-bottom: 0.75rem;
}

.ai-coming-soon p {
  color: var(--app-text-secondary);
  margin: 0.5rem 0;
}

/* ===============================
   Critical Alert (Firebase)
   =============================== */
.critical-alert-container {
  margin-bottom: 1.5rem;
}

.firebase-shutdown-alert {
  display: flex;
  gap: 1.5rem;
  padding: 1.5rem;
  background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
  border: 2px solid #ef4444;
  border-radius: 0.75rem;
}

[data-theme="dark"] .firebase-shutdown-alert {
  background: linear-gradient(135deg, #450a0a 0%, #7f1d1d 100%);
}

.firebase-shutdown-alert .alert-icon {
  font-size: 2.5rem;
  flex-shrink: 0;
}

.firebase-shutdown-alert .alert-content {
  flex: 1;
}

.firebase-shutdown-alert strong {
  display: block;
  font-size: 1.1rem;
  color: #dc2626;
  margin-bottom: 0.5rem;
}

[data-theme="dark"] .firebase-shutdown-alert strong {
  color: #fca5a5;
}

.firebase-shutdown-alert p {
  color: #991b1b;
  margin: 0.5rem 0;
  font-size: 0.9rem;
}

[data-theme="dark"] .firebase-shutdown-alert p {
  color: #fecaca;
}

.firebase-shutdown-alert .alert-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

@media (max-width: 640px) {
  .firebase-shutdown-alert {
    flex-direction: column;
    text-align: center;
  }

  .firebase-shutdown-alert .alert-actions {
    justify-content: center;
  }

  .firebase-shutdown-alert .btn-gradient,
  .firebase-shutdown-alert .btn-nav.btn-signup {
    width: 100% !important;
    max-width: 100%;
  }
}

/* ===============================
   Suggestions
   =============================== */
.suggestions-section {
  padding: 1.5rem;
}

.suggestions-content {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.suggestion-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.9rem;
}

.suggestion-icon {
  flex-shrink: 0;
  width: 1.5rem;
  text-align: center;
}

.suggestion-critical {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

[data-theme="dark"] .suggestion-critical {
  background: #450a0a;
  border-color: #7f1d1d;
  color: #fecaca;
}

.suggestion-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

[data-theme="dark"] .suggestion-error {
  background: #450a0a;
  border-color: #7f1d1d;
  color: #fecaca;
}

.suggestion-warning {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
}

[data-theme="dark"] .suggestion-warning {
  background: #451a03;
  border-color: #78350f;
  color: #fde68a;
}

.suggestion-info {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
}

[data-theme="dark"] .suggestion-info {
  background: #1e3a5f;
  border-color: #1e40af;
  color: #bfdbfe;
}

.suggestion-success {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
}

[data-theme="dark"] .suggestion-success {
  background: #052e16;
  border-color: #166534;
  color: #bbf7d0;
}

/* ===============================
   Section Title
   =============================== */
.section-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--app-text-primary);
}

/* ===============================
   Upsell Section
   =============================== */
.upsell-section {
  padding: 2rem;
  background: linear-gradient(
    135deg,
    var(--card-bg-primary) 0%,
    var(--card-bg-secondary) 100%
  );
  border: 1px solid var(--border-subtle);
}

.upsell-header h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--app-text-primary);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.upsell-benefits {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.upsell-benefits .benefit-item {
  font-size: 0.9rem;
  color: var(--app-text-secondary);
}

.upsell-cta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ===============================
   Button Secondary
   =============================== */
.btn-secondary {
  padding: 0.75rem 1.5rem;
  border: 1px solid var(--border-subtle);
  border-radius: 0.5rem;
  /* background: var(--card-bg-primary); */
  color: var(--app-text-primary);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  /* background: var(--card-bg-secondary); */
  /* border-color: var(--primary-color); */
}

/* Email Gate Modal */
.email-gate-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.5);
  z-index: 140;
  padding: 1.5rem;
}

.email-gate-panel {
  position: relative;
  width: min(420px, 100%);
  background: var(--card-bg-primary);
  border: 1px solid var(--border-subtle);
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: var(--shadow-lg);
}

[data-theme="dark"] .email-gate-panel {
  border-color: rgba(148, 163, 184, 0.25);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
}

.email-gate-panel h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.email-gate-panel p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.email-gate-close {
  position: absolute;
  right: 1rem;
  top: 1rem;
  border: none;
  background: transparent;
  font-size: 1.25rem;
  cursor: pointer;
  color: var(--text-secondary);
}

.email-gate-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.email-gate-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.email-gate-input {
  padding: 0.75rem 0.9rem;
  border-radius: 0.625rem;
  border: 1px solid var(--border-medium);
  background: var(--input-bg, var(--card-bg-primary));
  color: var(--text-primary);
}

.email-gate-input:focus {
  outline: none;
  border-color: var(--app-primary, #256fc3);
  box-shadow: 0 0 0 3px rgba(37, 111, 195, 0.15);
}

.email-gate-error {
  color: #dc2626;
  font-size: 0.85rem;
}

[data-theme="dark"] .email-gate-error {
  color: #fca5a5;
}

.email-gate-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
}

.email-gate-panel .btn-gradient:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-pdf:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-cancel {
  padding: 0.6rem 1.2rem;
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: 0.5rem;
  color: var(--app-text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-cancel:hover {
  border-color: var(--app-text-secondary);
}

@media (max-width: 640px) {
  .pdf-download-section {
    flex-direction: column;
    text-align: center;
  }

  .upsell-cta {
    flex-direction: column;
  }

  .upsell-cta .btn-gradient,
  .upsell-cta .btn-nav.btn-signup {
    width: 100% !important;
  }

  .upsell-benefits {
    display: grid;
    grid-template-columns:  1fr;
    grid-template-rows: repeat(1, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.5rem;
  }

  .upsell-header h3 {
    align-items: flex-start;
    text-align: start;
    justify-content: center;
  }

  .upsell-header h3 img {
    margin-top: 0.2rem;
  }
}
.tool-controls button:disabled,
#analyze-btn:disabled {
  pointer-events: none;
}

#analyze-btn .btn-spinner {
  width: 1rem;
  height: 1rem;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.dark-theme .benefit-card,
.dark-theme .cta-card,
.dark-theme .faq-card,
.dark-theme .input-card {
  border-color: #333;
}
