/* Google Ads Audit Agent — Modern Design */
/* PhotoPixc Studio */

:root {
  --brand: #176b53;
  --brand-dark: #0f4b3a;
  --brand-light: #e7efe5;
  --pri: #1a56db;
  --pri-dark: #1543a8;
  --ok: #0e9f6e;
  --warn: #c27803;
  --bad: #e02424;
  --bg: #f8fafc;
  --card: #ffffff;
  --line: #e2e8f0;
  --text: #0f172a;
  --mut: #64748b;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Hind Siliguri', 'Noto Sans Bengali', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 20px 100px;
}

/* Header */
header.top {
  background: linear-gradient(135deg, var(--brand) 0%, #1e3a8a 100%);
  color: #fff;
  padding: 30px;
  border-radius: 16px;
  margin-bottom: 24px;
  box-shadow: 0 10px 25px -5px rgba(23, 107, 83, 0.25);
}

.top-brand {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

header.top h1 {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

header.top p {
  opacity: 0.9;
  font-size: 14px;
  margin-top: 4px;
}

.top-tag {
  background: rgba(255, 255, 255, 0.2);
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  backdrop-filter: blur(4px);
}

/* Cards */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
}

.card h2 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 16px;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Inputs */
.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.grid3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
}

@media (max-width: 768px) {
  .grid2, .grid3 { grid-template-columns: 1fr; }
}

label {
  font-size: 13px;
  font-weight: 700;
  color: #334155;
  display: block;
  margin-bottom: 5px;
}

input[type=text], input[type=date] {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 14px;
  font-family: inherit;
  transition: all 0.2s;
  background: #fff;
}

input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(23, 107, 83, 0.15);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: none;
  cursor: pointer;
  border-radius: 10px;
  padding: 11px 22px;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  transition: all 0.2s;
}

.btn-pri {
  background: var(--brand);
  color: #fff;
}
.btn-pri:hover {
  background: var(--brand-dark);
  transform: translateY(-1px);
}
.btn-pri:disabled {
  background: #94a3b8;
  cursor: not-allowed;
  transform: none;
}

.btn-sec {
  background: var(--brand-light);
  color: var(--brand-dark);
  border: 1px solid #c5dcd0;
}
.btn-sec:hover {
  background: #d8e8d5;
}

.btn-ghost {
  background: #fff;
  color: #475569;
  border: 1px solid var(--line);
}
.btn-ghost:hover {
  background: #f1f5f9;
}

.btn-wa {
  background: #25d366;
  color: #fff;
}
.btn-wa:hover {
  background: #20ba59;
}

/* Detected Tags Badge Card */
.tag-summary-card {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 20px;
}

.tag-summary-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
}

.btn-tag-assistant {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #1e293b;
  color: #fff;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}
.btn-tag-assistant:hover {
  background: #0f172a;
}

.tag-badge-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.t-badge {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  background: #fff;
  border: 1px solid #cbd5e1;
}

.t-badge.gtm { background: #eff6ff; border-color: #93c5fd; color: #1d4ed8; }
.t-badge.ga4 { background: #fefce8; border-color: #fde047; color: #a16207; }
.t-badge.gads { background: #fdf2f8; border-color: #f9a8d4; color: #be185d; }
.t-badge.pixel { background: #eef2ff; border-color: #a5b4fc; color: #4338ca; }
.t-badge.dl { background: #ecfdf5; border-color: #6ee7b7; color: #047857; }
.t-badge.none { background: #fee2e2; border-color: #fca5a5; color: #b91c1c; }

/* Filter Tabs */
.tabs-wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
}

.tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tab-btn {
  border: 1px solid var(--line);
  background: #fff;
  padding: 8px 18px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  color: #475569;
  transition: all 0.2s;
}

.tab-btn.active {
  background: #0f172a;
  color: #fff;
  border-color: #0f172a;
}

.search-box input {
  max-width: 250px;
  padding: 7px 12px;
  font-size: 13px;
}

/* Individual Check Card */
.check {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px 20px;
  margin-bottom: 14px;
  transition: all 0.2s;
}

.check.auto-done {
  border-left: 5px solid var(--brand);
}

.chead {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.num {
  background: #f1f5f9;
  color: #334155;
  font-weight: 800;
  border-radius: 8px;
  min-width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}

.ttl {
  flex: 1;
}

.ttl div {
  font-weight: 700;
  font-size: 15px;
  color: #0f172a;
}

.en-sub {
  color: #64748b;
  font-size: 12px;
  display: block;
  margin-top: 2px;
}

.tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 10px 0 0 46px;
}

.tag {
  font-size: 11px;
  padding: 2px 9px;
  border-radius: 999px;
  font-weight: 700;
}
.tag.High { background: #fee2e2; color: #b91c1c; }
.tag.Medium { background: #fef3c7; color: #b45309; }
.tag.Low { background: #e0e7ff; color: #3730a3; }
.tag.sec { background: #f1f5f9; color: #475569; }
.tag.auto { background: #dbeafe; color: #1d4ed8; }

.statusrow {
  display: flex;
  gap: 8px;
  margin: 12px 0 0 46px;
  flex-wrap: wrap;
}

.st {
  border: 1px solid var(--line);
  background: #fff;
  padding: 7px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  transition: all 0.15s;
}

.st.on-pass { background: var(--ok); color: #fff; border-color: var(--ok); }
.st.on-partial { background: var(--warn); color: #fff; border-color: var(--warn); }
.st.on-fail { background: var(--bad); color: #fff; border-color: var(--bad); }
.st.on-na { background: #64748b; color: #fff; border-color: #64748b; }

.evidence {
  margin: 10px 0 0 46px;
  font-size: 13px;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  padding: 9px 12px;
  color: #1e293b;
}

.fields {
  margin: 12px 0 0 46px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.fields input {
  font-size: 12px;
  padding: 7px 10px;
}

@media (max-width: 640px) {
  .tags, .statusrow, .evidence, .fields { margin-left: 0; }
  .fields { grid-template-columns: 1fr; }
}

/* Sticky Bottom Summary Bar */
#sumbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #0f172a;
  color: #fff;
  padding: 12px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.25);
  z-index: 100;
}

.sum-stats {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.sum-score {
  font-size: 24px;
  font-weight: 900;
  color: #4ade80;
}

.sum-grade {
  background: rgba(255, 255, 255, 0.15);
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
}

.sum-meta {
  font-size: 13px;
  opacity: 0.85;
}

.sum-bar-container {
  width: 140px;
  height: 8px;
  background: #334155;
  border-radius: 999px;
  overflow: hidden;
}

#progressBar {
  height: 100%;
  width: 0%;
  background: #4ade80;
  transition: width 0.3s;
}

.sum-actions {
  display: flex;
  gap: 10px;
}

/* History Drawer */
.hist-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: 13px;
}

.hist-badge {
  background: var(--brand-light);
  color: var(--brand-dark);
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 12px;
}

/* Executive Report View (Print Optimized) */
#reportView {
  display: none;
}

.report-wrapper {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 40px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

.rep-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid #0f172a;
  padding-bottom: 24px;
  margin-bottom: 24px;
}

.rep-brand h1 {
  font-size: 28px;
  font-weight: 900;
  color: var(--brand);
}

.rep-brand p {
  color: #64748b;
  font-size: 14px;
}

.rep-badge-grade {
  width: 90px;
  height: 90px;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 900;
  background: #0f172a;
}

.rep-badge-grade.Aplus, .rep-badge-grade.A { background: #0e9f6e; }
.rep-badge-grade.B { background: #2563eb; }
.rep-badge-grade.C { background: #d97706; }
.rep-badge-grade.D { background: #dc2626; }

.grade-letter { font-size: 34px; line-height: 1; }
.grade-score { font-size: 11px; opacity: 0.9; margin-top: 4px; }

.rep-meta-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  background: #f8fafc;
  padding: 16px 20px;
  border-radius: 10px;
  margin-bottom: 28px;
  font-size: 13px;
}

@media (max-width: 768px) {
  .rep-meta-grid { grid-template-columns: 1fr 1fr; }
}

.rep-card {
  margin-bottom: 30px;
}

.rep-card h3 {
  font-size: 18px;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.rep-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

@media (max-width: 640px) {
  .rep-metrics { grid-template-columns: 1fr 1fr; }
}

.metric-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  padding: 16px;
  border-radius: 12px;
  text-align: center;
}

.metric-box .num {
  font-size: 26px;
  font-weight: 900;
  color: #0f172a;
  margin: 0 auto 6px;
  background: transparent;
}

.metric-box.bad .num { color: #dc2626; }
.metric-box .lbl { font-size: 12px; color: #64748b; font-weight: 600; }

.rep-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-top: 10px;
}

.rep-table th, .rep-table td {
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  text-align: left;
}

.rep-table th {
  background: #f1f5f9;
  font-weight: 800;
  color: #1e293b;
}

.p-badge {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 800;
}
.p-badge.High { background: #fee2e2; color: #991b1b; }
.p-badge.Medium { background: #fef3c7; color: #92400e; }
.p-badge.Low { background: #e0e7ff; color: #3730a3; }

.status-badge {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 800;
}
.status-badge.fail { background: #dc2626; color: #fff; }
.status-badge.partial { background: #d97706; color: #fff; }
.status-badge.pass { background: #0e9f6e; color: #fff; }

.rec-cell {
  color: #15803d;
  font-weight: 600;
}

.sec-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 640px) {
  .sec-grid { grid-template-columns: 1fr; }
}

.sec-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #f8fafc;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
}

.sec-ttl { flex: 1; font-weight: 600; }
.sec-bar-bg { width: 90px; height: 6px; background: #e2e8f0; border-radius: 999px; overflow: hidden; }
.sec-bar-fill { height: 100%; background: var(--brand); }
.sec-pct { font-weight: 800; width: 40px; text-align: right; }

.rep-actions {
  display: flex;
  gap: 12px;
  margin-top: 30px;
}

/* Presets & Modal Styles */
.preset-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0 10px 0;
  flex-wrap: wrap;
  padding: 10px 14px;
  background: #f1f5f9;
  border-radius: 10px;
}
.preset-label {
  font-size: 13px;
  font-weight: 700;
  color: #334155;
}
.preset-btn {
  background: #fff;
  border: 1px solid #cbd5e1;
  color: #475569;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.preset-btn:hover {
  background: #e2e8f0;
}
.preset-btn.active {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(3px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
}
.modal-card {
  background: #fff;
  border-radius: 12px;
  max-width: 650px;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
  padding: 24px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.25);
}

/* Wasted Spend Box & Roadmap */
.wasted-spend-card {
  background: #fff5f5;
  border: 2px solid #fed7d7;
  border-radius: 10px;
  padding: 16px 20px;
  margin: 20px 0;
  display: flex;
  align-items: center;
  gap: 18px;
}
.wasted-spend-icon {
  font-size: 36px;
}
.wasted-spend-text h4 {
  margin: 0 0 4px 0;
  color: #9b2c2c;
  font-size: 17px;
}
.wasted-spend-text p {
  margin: 0;
  color: #742a2a;
  font-size: 13px;
  line-height: 1.5;
}

.roadmap-card {
  margin-top: 24px;
}
.roadmap-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 14px;
}
@media (max-width: 640px) {
  .roadmap-steps { grid-template-columns: 1fr; }
}
.roadmap-step {
  background: #f8fafc;
  border-top: 3px solid var(--brand);
  border-radius: 8px;
  padding: 14px;
}
.roadmap-step h5 {
  margin: 0 0 6px 0;
  color: var(--brand);
  font-size: 14px;
}
.roadmap-step p {
  margin: 0;
  font-size: 12px;
  color: #475569;
  line-height: 1.5;
}

/* Print Overrides */
@media print {
  body { background: #fff; color: #000; }
  .wrap { max-width: 100%; padding: 0; }
  .noprint, #editorView, #sumbar { display: none !important; }
  #reportView { display: block !important; }
  .report-wrapper { border: none; box-shadow: none; padding: 0; }
  .rep-header { border-bottom: 2px solid #000; }
  a { text-decoration: none; color: inherit; }
}
