/* Sampoorna — Funder Check + Ask Sampoorna + Compliance Hub Styles */
/* Premium UX, mobile-first, accessible, dark-mode compatible */

/* ===== FUNDER CHECK ===== */
.funder-check-wrapper {
  max-width: 720px;
  margin: 0 auto;
  padding: 48px 24px;
}

.funder-check-header { text-align: center; margin-bottom: 32px; }
.funder-check-title {
  font-size: clamp(28px, 5vw, 42px);
  font-weight: 700;
  color: var(--ink, #191917);
  margin: 0 0 12px;
  letter-spacing: -0.02em;
}
.funder-check-subtitle {
  font-size: clamp(15px, 2.5vw, 18px);
  color: var(--ink-2, #585852);
  line-height: 1.6;
  margin: 0;
  max-width: 540px;
  margin: 0 auto;
}

.funder-check-search { position: relative; margin-bottom: 24px; }
.funder-check-input-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface, #fff);
  border: 2px solid var(--line, #e5e3de);
  border-radius: 16px;
  padding: 8px 8px 8px 20px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.funder-check-input-wrapper:focus-within {
  border-color: #1b5c3a;
  box-shadow: 0 0 0 4px rgba(27, 92, 58, 0.1);
}
.funder-check-icon { color: var(--ink-2, #585852); flex-shrink: 0; }
.funder-check-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 16px;
  font-family: inherit;
  color: var(--ink, #191917);
  background: transparent;
  padding: 12px 0;
}
.funder-check-input::placeholder { color: var(--ink-3, #8a8a84); }
.funder-check-btn {
  background: #1b5c3a;
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 12px 24px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  white-space: nowrap;
}
.funder-check-btn:hover:not(:disabled) { background: #0c3620; }
.funder-check-btn:active:not(:disabled) { transform: scale(0.97); }
.funder-check-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.funder-check-results {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--surface, #fff);
  border: 1px solid var(--line, #e5e3de);
  border-radius: 12px;
  margin-top: 4px;
  max-height: 320px;
  overflow-y: auto;
  z-index: 100;
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}
.funder-check-result-item {
  padding: 12px 20px;
  cursor: pointer;
  border-bottom: 1px solid var(--line, #eceae5);
  transition: background 0.15s;
}
.funder-check-result-item:hover, .funder-check-result-item:focus {
  background: var(--surface-2, #f7f6f3);
  outline: none;
}
.funder-check-result-item:last-child { border-bottom: none; }
.funder-check-result-name { font-weight: 600; color: var(--ink, #191917); font-size: 14px; }
.funder-check-result-meta { font-size: 12px; color: var(--ink-2, #585852); margin-top: 2px; }
.funder-check-no-results { padding: 16px 20px; color: var(--ink-2, #585852); font-size: 14px; }
.funder-check-no-results a { color: #1b5c3a; }

/* Loading state */
.funder-check-loading {
  text-align: center;
  padding: 48px 24px;
}
.funder-check-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--line, #e5e3de);
  border-top-color: #1b5c3a;
  border-radius: 50%;
  margin: 0 auto 16px;
  animation: funder-check-spin 0.8s linear infinite;
}
@keyframes funder-check-spin { to { transform: rotate(360deg); } }
.funder-check-loading-text { font-size: 18px; font-weight: 600; color: var(--ink, #191917); margin-bottom: 8px; }
.funder-check-loading-subtext { font-size: 14px; color: var(--ink-2, #585852); }
.funder-check-dots { display: inline-block; width: 24px; text-align: left; }

/* Report card */
.funder-check-report-card {
  background: var(--surface, #fff);
  border: 1px solid var(--line, #e5e3de);
  border-radius: 20px;
  padding: 32px;
  margin-top: 24px;
  animation: funder-check-fade-in 0.4s ease;
}
@keyframes funder-check-fade-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.funder-check-report-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 24px;
}
.funder-check-report-ngo h3 {
  font-size: 20px;
  font-weight: 700;
  color: var(--ink, #191917);
  margin: 0 0 4px;
}
.funder-check-report-meta { font-size: 13px; color: var(--ink-2, #585852); }

.funder-check-score-circle {
  width: 64px;
  height: 64px;
  border: 3px solid;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.funder-check-score-value { font-size: 22px; font-weight: 700; line-height: 1; }
.funder-check-score-label { font-size: 10px; font-weight: 500; }
.funder-check-score-status { font-size: 12px; font-weight: 600; text-align: center; margin-top: 4px; }

.funder-check-anomaly-notice {
  background: #fff8e1;
  border: 1px solid #ffe082;
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 13px;
  color: #8d6e00;
  margin-bottom: 16px;
}

.funder-check-report-body { margin-bottom: 24px; }
.funder-check-report-ai {
  font-size: 15px;
  line-height: 1.7;
  color: var(--ink, #191917);
}

.funder-check-report-stats {
  display: flex;
  gap: 16px;
  padding: 20px 0;
  border-top: 1px solid var(--line, #eceae5);
  border-bottom: 1px solid var(--line, #eceae5);
  margin-bottom: 24px;
}
.funder-check-stat { flex: 1; text-align: center; }
.funder-check-stat-value { font-size: 18px; font-weight: 700; color: #1b5c3a; line-height: 1.2; }
.funder-check-stat-label { font-size: 12px; color: var(--ink-2, #585852); margin-top: 4px; }

/* Compliance gaps */
.funder-check-gaps {
  margin: 16px 0;
  padding: 16px;
  background: #fff8e1;
  border: 1px solid #ffe082;
  border-radius: 8px;
}
.funder-check-gaps-title { font-size: 13px; font-weight: 600; color: #8a6d00; margin-bottom: 8px; }
.funder-check-gaps-list { margin: 0; padding-left: 20px; }
.funder-check-gaps-list li { font-size: 13px; color: #5d4a00; margin-bottom: 4px; line-height: 1.4; }

/* Unlock banner */
.funder-check-unlock-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
  border: 1px solid #81c784;
  border-radius: 12px;
  margin: 16px 0;
}
.funder-check-unlock-icon { font-size: 28px; flex-shrink: 0; }
.funder-check-unlock-text { flex: 1; }
.funder-check-unlock-title { font-size: 15px; font-weight: 600; color: #1b5c3a; line-height: 1.3; }
.funder-check-unlock-sub { font-size: 13px; color: #2e7d32; margin-top: 4px; }

.funder-check-report-locked {
  background: linear-gradient(135deg, #f7f6f3, #eceae5);
  border: 1px solid var(--line, #e5e3de);
  border-radius: 12px;
  padding: 24px;
  text-align: center;
}
.funder-check-locked-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 16px;
}
.funder-check-locked-icon { font-size: 20px; }
.funder-check-locked-text { font-size: 14px; color: var(--ink-2, #585852); font-weight: 500; }
.funder-check-locked-cta { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.funder-check-cta-btn {
  display: inline-block;
  background: #1b5c3a;
  color: #fff;
  padding: 14px 32px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s, transform 0.1s;
}
.funder-check-cta-btn:hover { background: #0c3620; }
.funder-check-cta-btn:active { transform: scale(0.97); }
.funder-check-cta-note { font-size: 12px; color: var(--ink-3, #8a8a84); }

.funder-check-report-freshness {
  margin-top: 16px;
  padding: 12px 16px;
  background: var(--surface-2, #f7f6f3);
  border-radius: 8px;
  font-size: 12px;
}
.funder-check-freshness-label { font-weight: 600; color: var(--ink-2, #585852); }
.funder-check-freshness-value { color: var(--ink-2, #585852); margin-left: 4px; }

.funder-check-report-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--line, #eceae5);
}
.funder-check-action-btn {
  background: transparent;
  border: 1px solid var(--line, #e5e3de);
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 13px;
  color: var(--ink-2, #585852);
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s;
}
.funder-check-action-btn:hover { background: var(--surface-2, #f7f6f3); }
.funder-check-action-link {
  font-size: 13px;
  color: #1b5c3a;
  text-decoration: none;
  font-weight: 600;
}
.funder-check-action-link:hover { text-decoration: underline; }

.funder-check-disclaimer {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 24px;
  padding: 12px 16px;
  background: var(--surface-2, #f7f6f3);
  border-radius: 8px;
  font-size: 12px;
  color: var(--ink-3, #8a8a84);
  line-height: 1.5;
}
.funder-check-disclaimer-icon { flex-shrink: 0; }

/* ===== ASK SAMPOORNA WIDGET ===== */
.ask-sampoorna-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  background: #1b5c3a;
  color: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(27, 92, 58, 0.3);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, box-shadow 0.2s;
}
.ask-sampoorna-fab:hover { transform: scale(1.05); box-shadow: 0 6px 20px rgba(27, 92, 58, 0.4); }
.ask-sampoorna-fab svg { width: 24px; height: 24px; }

.ask-sampoorna-panel {
  position: fixed;
  bottom: 96px;
  right: 24px;
  width: min(380px, calc(100vw - 48px));
  max-height: 520px;
  background: var(--surface, #fff);
  border: 1px solid var(--line, #e5e3de);
  border-radius: 20px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.12);
  z-index: 9999;
  display: none;
  flex-direction: column;
  overflow: hidden;
}
.ask-sampoorna-panel.open { display: flex; animation: ask-sampoorna-slide-up 0.3s ease; }
@keyframes ask-sampoorna-slide-up {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.ask-sampoorna-header {
  background: linear-gradient(135deg, #0c3620, #1b5c3a);
  color: #fff;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.ask-sampoorna-title { font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.ask-sampoorna-close {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  font-size: 20px;
  padding: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s;
}
.ask-sampoorna-close:hover { background: rgba(255,255,255,0.15); }

.ask-sampoorna-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 200px;
  max-height: 360px;
}
.ask-sampoorna-message { max-width: 85%; padding: 10px 14px; border-radius: 14px; font-size: 14px; line-height: 1.5; }
.ask-sampoorna-message-user { background: #1b5c3a; color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.ask-sampoorna-message-ai { background: var(--surface-2, #f7f6f3); color: var(--ink, #191917); align-self: flex-start; border-bottom-left-radius: 4px; }
.ask-sampoorna-message-typing { display: flex; gap: 4px; padding: 12px 14px; }
.ask-sampoorna-typing-dot { width: 8px; height: 8px; background: var(--ink-3, #8a8a84); border-radius: 50%; animation: ask-sampoorna-bounce 1.4s infinite; }
.ask-sampoorna-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.ask-sampoorna-typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes ask-sampoorna-bounce { 0%, 60%, 100% { transform: translateY(0); } 30% { transform: translateY(-6px); } }

.ask-sampoorna-cta {
  margin-top: 8px;
  padding: 8px 12px;
  background: rgba(27, 92, 58, 0.08);
  border-radius: 8px;
  font-size: 13px;
}
.ask-sampoorna-cta a { color: #1b5c3a; font-weight: 600; }

/* Related links cards */
.ask-sampoorna-related-links {
  margin-top: 8px;
}
.ask-sampoorna-related-header {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--ink-3, #8a8a84);
  margin-bottom: 6px;
  font-weight: 600;
}
.ask-sampoorna-related-card {
  display: block;
  padding: 8px 10px;
  margin-bottom: 6px;
  background: rgba(27, 92, 58, 0.04);
  border: 1px solid rgba(27, 92, 58, 0.12);
  border-radius: 8px;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
}
.ask-sampoorna-related-card:hover {
  background: rgba(27, 92, 58, 0.08);
  border-color: rgba(27, 92, 58, 0.25);
}
.ask-sampoorna-related-title {
  font-size: 13px;
  font-weight: 600;
  color: #1b5c3a;
  margin-bottom: 2px;
}
.ask-sampoorna-related-desc {
  font-size: 11px;
  color: var(--ink-3, #6a6a64);
  line-height: 1.4;
}

/* Resume offer buttons */
.ask-sampoorna-resume-offer {
  padding: 12px 14px !important;
  background: rgba(27, 92, 58, 0.06);
  border-radius: 10px;
}
.ask-sampoorna-resume-btn {
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid rgba(27, 92, 58, 0.3);
  background: transparent;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  color: #1b5c3a;
  transition: background 0.15s;
}
.ask-sampoorna-resume-btn:hover { background: rgba(27, 92, 58, 0.08); }
.ask-sampoorna-resume-yes {
  background: #1b5c3a;
  color: #fff !important;
  border-color: #1b5c3a;
}
.ask-sampoorna-resume-yes:hover { background: #0c3620; }

/* Feedback buttons */
.ask-sampoorna-feedback {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  padding: 4px 0;
}
.ask-sampoorna-feedback-label {
  font-size: 11px;
  color: var(--ink-3, #8a8a84);
}
.ask-sampoorna-feedback-btn {
  background: transparent;
  border: 1px solid var(--line, #e5e3de);
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 14px;
  cursor: pointer;
  line-height: 1;
  transition: background 0.15s, border-color 0.15s;
}
.ask-sampoorna-feedback-btn:hover {
  background: rgba(27, 92, 58, 0.06);
  border-color: rgba(27, 92, 58, 0.3);
}
.ask-sampoorna-feedback-answered .ask-sampoorna-feedback-btn {
  opacity: 0.4;
  pointer-events: none;
}
.ask-sampoorna-feedback-selected {
  background: rgba(27, 92, 58, 0.12) !important;
  border-color: #1b5c3a !important;
  opacity: 1 !important;
}

/* Explore suggestion */
.ask-sampoorna-explore-suggestion {
  font-size: 12px !important;
  font-style: italic;
  color: var(--ink-3, #6a6a64);
  background: rgba(27, 92, 58, 0.03);
  border-radius: 8px;
  padding: 8px 12px !important;
}

.ask-sampoorna-input-wrapper {
  padding: 12px 16px;
  border-top: 1px solid var(--line, #eceae5);
  display: flex;
  gap: 8px;
}
.ask-sampoorna-input {
  flex: 1;
  border: 1px solid var(--line, #e5e3de);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  color: var(--ink, #191917);
  background: var(--surface, #fff);
}
.ask-sampoorna-input:focus { border-color: #1b5c3a; }
.ask-sampoorna-send {
  background: #1b5c3a;
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.ask-sampoorna-send:disabled { opacity: 0.5; cursor: not-allowed; }

.ask-sampoorna-disclaimer {
  padding: 8px 16px 12px;
  font-size: 11px;
  color: var(--ink-3, #8a8a84);
  text-align: center;
}

/* ===== COMPLIANCE HUB ===== */
.compliance-hub { max-width: 760px; margin: 0 auto; padding: 48px 24px; }
.compliance-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; margin-top: 32px; }
.compliance-card {
  background: var(--surface, #fff);
  border: 1px solid var(--line, #e5e3de);
  border-radius: 16px;
  padding: 24px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.1s;
}
.compliance-card:hover { border-color: #1b5c3a; box-shadow: 0 4px 16px rgba(0,0,0,0.06); transform: translateY(-2px); }
.compliance-card-icon { font-size: 28px; margin-bottom: 12px; }
.compliance-card-title { font-size: 17px; font-weight: 700; color: var(--ink, #191917); margin: 0 0 8px; }
.compliance-card-desc { font-size: 14px; color: var(--ink-2, #585852); line-height: 1.5; }
.compliance-card-meta { font-size: 12px; color: var(--ink-3, #8a8a84); margin-top: 12px; }

/* ===== CSR READINESS CHECK ===== */
.readiness-check-wrapper { max-width: 640px; margin: 0 auto; padding: 48px 24px; }
.readiness-check-result {
  background: var(--surface, #fff);
  border: 1px solid var(--line, #e5e3de);
  border-radius: 20px;
  padding: 32px;
  margin-top: 24px;
}
.readiness-score-bar {
  width: 100%;
  height: 12px;
  background: var(--line, #e5e3de);
  border-radius: 6px;
  overflow: hidden;
  margin: 16px 0;
}
.readiness-score-fill { height: 100%; border-radius: 6px; transition: width 0.6s ease; }
.readiness-check-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line, #eceae5);
  font-size: 14px;
}
.readiness-check-item:last-child { border-bottom: none; }
.readiness-check-icon-pass { color: #1b5c3a; font-weight: 700; }
.readiness-check-icon-fail { color: #c44; font-weight: 700; }
.readiness-check-item-label { flex: 1; color: var(--ink, #191917); }
.readiness-check-item-points { font-size: 13px; color: var(--ink-2, #585852); font-weight: 600; }

/* ===== DATA DASHBOARD ===== */
.data-dashboard-wrapper { max-width: 960px; margin: 0 auto; padding: 48px 24px; }
.data-dashboard-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 24px; margin-top: 32px; }
.data-card {
  background: var(--surface, #fff);
  border: 1px solid var(--line, #e5e3de);
  border-radius: 16px;
  padding: 24px;
}
.data-card-title { font-size: 14px; font-weight: 600; color: var(--ink-2, #585852); margin: 0 0 16px; text-transform: uppercase; letter-spacing: 0.05em; }
.data-card-value { font-size: 32px; font-weight: 700; color: #1b5c3a; }
.data-card-sub { font-size: 13px; color: var(--ink-2, #585852); margin-top: 4px; }

/* ===== NGO SCORECARD ===== */
.scorecard-wrapper { max-width: 640px; margin: 0 auto; padding: 48px 24px; }
.scorecard-badge {
  display: inline-block;
  background: linear-gradient(135deg, #0c3620, #1b5c3a);
  color: #fff;
  padding: 8px 20px;
  border-radius: 100px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(27, 92, 58, 0.2);
}
.scorecard-share-btn {
  background: #1b5c3a;
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 12px 24px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  margin: 8px;
}

/* ===== FUNDER PORTAL ===== */
.funder-portal-wrapper { max-width: 800px; margin: 0 auto; padding: 48px 24px; }
.funder-portal-search {
  display: flex;
  gap: 12px;
  margin: 24px 0;
  flex-wrap: wrap;
}
.funder-portal-select {
  border: 1px solid var(--line, #e5e3de);
  border-radius: 12px;
  padding: 10px 16px;
  font-size: 14px;
  font-family: inherit;
  color: var(--ink, #191917);
  background: var(--surface, #fff);
  outline: none;
}
.funder-portal-select:focus { border-color: #1b5c3a; }

/* ===== RESPONSIVE ===== */
@media (max-width: 640px) {
  .funder-check-wrapper, .compliance-hub, .readiness-check-wrapper, .data-dashboard-wrapper, .scorecard-wrapper, .funder-portal-wrapper {
    padding: 32px 16px;
  }
  .funder-check-input-wrapper { flex-direction: column; gap: 8px; padding: 12px; }
  .funder-check-btn { width: 100%; padding: 14px; }
  .funder-check-report-stats { flex-direction: column; gap: 12px; }
  .funder-check-report-header { flex-direction: column; gap: 12px; }
  .funder-check-score-circle { margin: 0 auto; }
  .ask-sampoorna-panel { right: 16px; bottom: 88px; width: calc(100vw - 32px); }
  .ask-sampoorna-fab { bottom: 16px; right: 16px; }
  .compliance-grid { grid-template-columns: 1fr; }
  .data-dashboard-grid { grid-template-columns: 1fr; }
  .funder-portal-search { flex-direction: column; }
}

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .funder-check-spinner { animation: none; border-top-color: var(--line); }
}

/* ===== HIGH CONTRAST ===== */
@media (prefers-contrast: high) {
  .funder-check-input-wrapper, .funder-check-results, .funder-check-report-card, .ask-sampoorna-panel {
    border-width: 2px;
  }
  .funder-check-btn, .funder-check-cta-btn, .ask-sampoorna-send {
    border: 2px solid currentColor;
  }
}
