/* ============================================================
   Google Ads Copy Generator — Main Stylesheet
   Google Ads-inspired design: clean white, #1A73E8 blue
   ============================================================ */

:root {
  --g-blue:     #1A73E8;
  --g-blue-h:   #1557B0;
  --g-blue-bg:  #E8F0FE;
  --g-green:    #34A853;
  --g-red:      #EA4335;
  --g-amber:    #F9AB00;
  --bg:         #F8F9FA;
  --surface:    #FFFFFF;
  --border:     #DADCE0;
  --text:       #202124;
  --muted:      #5F6368;
  --hint:       #80868B;
  --nav-h:      56px;
  --sidebar-w:  220px;
  --radius:     8px;
  --radius-sm:  4px;
  color-scheme: light;   /* force light render — prevents browser auto-dark from making CTAs unreadable */
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
}

a { color: var(--g-blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===== NAVIGATION ===== */
.g-nav {
  height: var(--nav-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 100;
}
.g-logo {
  display: flex; align-items: center; gap: 8px;
  font-size: 15px; font-weight: 500; color: var(--text);
  text-decoration: none;
}
.g-logo-icon {
  width: 28px; height: 28px; border-radius: 8px;
  background: var(--g-blue);
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 13px; font-weight: 600;
}
.g-nav-spacer { flex: 1; }
.nav-user-name { font-size: 13px; color: var(--muted); }
.nav-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: #4285F4; color: white;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 500; cursor: pointer;
}
.nav-dropdown { position: relative; }
.nav-dropdown-menu {
  display: none; position: absolute; right: 0; top: 40px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); min-width: 180px;
  box-shadow: 0 2px 8px rgba(0,0,0,.12); z-index: 200;
}
.nav-dropdown.open .nav-dropdown-menu { display: block; }
.nav-dropdown-menu a {
  display: block; padding: 10px 16px; font-size: 13px; color: var(--text);
}
.nav-dropdown-menu a:hover { background: var(--bg); text-decoration: none; }

/* ===== APP LAYOUT ===== */
.app-layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: calc(100vh - var(--nav-h));
}

/* ===== SIDEBAR ===== */
.app-sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 16px 0;
}
.sidebar-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px;
  font-size: 14px; color: var(--muted);
  cursor: pointer; border-left: 3px solid transparent;
  transition: all .15s; text-decoration: none;
}
.sidebar-item:hover { background: #F1F3F4; color: var(--text); text-decoration: none; }
.sidebar-item.active {
  color: var(--g-blue);
  border-left-color: var(--g-blue);
  background: var(--g-blue-bg);
}
.sidebar-icon { width: 20px; height: 20px; flex-shrink: 0; }
.sidebar-divider { border-top: 1px solid var(--border); margin: 8px 0; }

/* ===== MAIN CONTENT ===== */
.app-main { padding: 24px; background: var(--bg); }

/* ===== PAGE HEADER ===== */
.page-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 20px;
}
.page-header h1 { font-size: 20px; font-weight: 400; color: var(--text); }
.page-header p { font-size: 13px; color: var(--muted); margin-top: 2px; }

/* ===== STATS GRID ===== */
.stats-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px;
}
.stat-label { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.stat-value { font-size: 24px; font-weight: 400; color: var(--text); }
.stat-sub { font-size: 12px; margin-top: 4px; }

/* ===== SECTION HEADER ===== */
.section-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 10px;
}
.section-header h2 { font-size: 14px; font-weight: 500; color: var(--text); }
.link-sm { font-size: 13px; color: var(--g-blue); }

/* ===== CLIENT CHIPS ===== */
.client-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.chip {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: 20px;
  border: 1px solid var(--border); background: white;
  font-size: 13px; color: var(--muted); cursor: pointer;
  text-decoration: none; transition: all .15s;
}
.chip:hover { background: var(--bg); text-decoration: none; }
.chip.chip-sm { padding: 3px 10px; font-size: 12px; }
.chip-dashed { border-style: dashed; }
.chip-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

/* ===== TABLE ===== */
.table-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
.data-table { width: 100%; border-collapse: collapse; }
.data-table thead { background: var(--bg); }
.data-table th {
  padding: 10px 16px; text-align: left;
  font-size: 11px; font-weight: 500; color: var(--muted);
  text-transform: uppercase; letter-spacing: .04em;
  border-bottom: 1px solid var(--border);
}
.data-table td { padding: 12px 16px; border-bottom: 1px solid #F1F3F4; vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.td-primary { font-weight: 500; color: var(--text); }
.td-date { font-size: 12px; color: var(--hint); }
.td-actions { display: flex; gap: 6px; }

/* ===== ICON BUTTON ===== */
.icon-btn {
  width: 28px; height: 28px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: white;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--muted); font-size: 14px;
  text-decoration: none; transition: all .15s;
}
.icon-btn:hover { background: var(--bg); color: var(--text); text-decoration: none; }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 16px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500; cursor: pointer;
  border: 1px solid var(--border); background: white; color: var(--g-blue);
  transition: all .15s; text-decoration: none;
}
.btn:hover { background: var(--bg); text-decoration: none; }
.btn-primary { background: var(--g-blue); color: white; border-color: var(--g-blue); }
.btn-primary:hover { background: var(--g-blue-h); color: white; }
.btn-full { width: 100%; justify-content: center; }
.btn-sm { padding: 6px 12px; font-size: 12px; }

/* ===== FORMS ===== */
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block; font-size: 12px; font-weight: 500;
  color: var(--muted); margin-bottom: 6px;
  text-transform: uppercase; letter-spacing: .04em;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%; padding: 9px 12px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 14px; color: var(--text); background: white;
  outline: none; transition: border-color .15s;
  font-family: inherit;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--g-blue);
  box-shadow: 0 0 0 3px rgba(26,115,232,.1);
}
.form-group textarea { resize: vertical; min-height: 80px; }

/* ===== ALERTS ===== */
.alert {
  padding: 10px 14px; border-radius: var(--radius-sm);
  font-size: 13px; margin-bottom: 16px;
}
.alert-error  { background: #FDECEA; color: #C5221F; border: 1px solid #F5C6C4; }
.alert-success { background: #E6F4EA; color: #137333; border: 1px solid #CEEAD6; }
.alert-info   { background: var(--g-blue-bg); color: #174EA6; border: 1px solid #A8C7FA; }
.alert-warning { background: #FEF7E0; color: #B06000; border: 1px solid #FDD663; }

/* ===== UPGRADE BANNER ===== */
.upgrade-banner {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--g-blue-bg); border: 1px solid #A8C7FA;
  border-radius: var(--radius); padding: 14px 16px;
  margin-top: 24px; gap: 16px;
}
.upgrade-banner div { font-size: 13px; color: #174EA6; }

/* ===== EMPTY STATE ===== */
.empty-state {
  padding: 24px; text-align: center;
  background: var(--surface); border: 1px dashed var(--border);
  border-radius: var(--radius); color: var(--muted); font-size: 13px;
}

/* ===== AUTH PAGES ===== */
.auth-page { background: var(--bg); min-height: 100vh; }
.auth-wrap {
  display: flex; align-items: flex-start; justify-content: center;
  padding: 48px 24px;
}
.auth-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 40px; width: 100%; max-width: 420px;
}
.auth-logo {
  display: flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 500; color: var(--text);
  margin-bottom: 24px;
}
.logo-icon {
  width: 28px; height: 28px; border-radius: 8px;
  background: var(--g-blue);
}
.auth-card h2 { font-size: 20px; font-weight: 400; margin-bottom: 4px; }
.auth-card p  { font-size: 14px; color: var(--muted); margin-bottom: 24px; }
.auth-footer  { text-align: center; font-size: 13px; color: var(--muted); margin-top: 20px; }

/* ===== UTILITY ===== */
.text-muted    { color: var(--muted); }
.text-hint     { color: var(--hint); }
.text-success  { color: var(--g-green); }
.text-danger   { color: var(--g-red); }
.char-ok       { color: var(--g-green); }
.char-warn     { color: var(--g-amber); }
.char-danger   { color: var(--g-red); }

/* ===== GENERATOR PAGE ===== */
.gen-layout {
  display: grid; grid-template-columns: 300px 1fr;
  min-height: calc(100vh - var(--nav-h));
}
.gen-sidebar {
  background: var(--surface); border-right: 1px solid var(--border);
  padding: 20px; overflow-y: auto;
}
.gen-results { background: var(--bg); padding: 20px; overflow-y: auto; }
.lang-toggle { display: flex; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.lang-opt {
  flex: 1; padding: 7px; text-align: center;
  font-size: 12px; font-weight: 500; cursor: pointer;
  color: var(--muted); background: white; border: none;
  transition: all .15s;
}
.lang-opt.active { background: var(--g-blue); color: white; }

.result-tabs { display: flex; gap: 4px; margin-bottom: 16px; flex-wrap: wrap; }
.rtab {
  padding: 7px 14px; border-radius: 20px; font-size: 13px;
  cursor: pointer; background: white; border: 1px solid var(--border); color: var(--muted);
  transition: all .15s;
}
.rtab.active { background: var(--g-blue-bg); border-color: #A8C7FA; color: var(--g-blue); font-weight: 500; }

.result-set {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); margin-bottom: 12px; overflow: hidden; display: none;
}
.result-set.active { display: block; }
.rs-head {
  padding: 10px 14px; background: var(--bg); border-bottom: 1px solid var(--border);
  font-size: 12px; font-weight: 500; color: var(--muted);
  text-transform: uppercase; letter-spacing: .04em;
  display: flex; justify-content: space-between; align-items: center;
}
.rs-copy-all { font-size: 12px; color: var(--g-blue); cursor: pointer; font-weight: 400; text-transform: none; letter-spacing: 0; }
.headline-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 14px; border-bottom: 1px solid #F1F3F4; gap: 12px;
}
.headline-row:last-child { border-bottom: none; }
.hl-text { font-size: 13px; color: var(--text); flex: 1; }
.hl-meta { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.char-badge {
  font-size: 11px; padding: 2px 7px; border-radius: 10px; font-weight: 500;
}
.copy-hl-btn {
  padding: 4px 10px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: 12px; color: var(--muted);
  background: white; cursor: pointer; transition: all .15s;
}
.copy-hl-btn:hover { background: var(--g-blue-bg); border-color: #A8C7FA; color: var(--g-blue); }
.copy-hl-btn.copied { background: #E6F4EA; border-color: #CEEAD6; color: var(--g-green); }

.placeholder-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 300px; color: var(--hint); text-align: center;
}
.ph-icon {
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--g-blue-bg); display: flex; align-items: center;
  justify-content: center; margin: 0 auto 12px; font-size: 20px;
}
.policy-warning {
  background: #FEF7E0; border: 1px solid #FDD663;
  border-radius: var(--radius); padding: 12px 14px;
  margin-bottom: 12px; font-size: 13px; color: #B06000;
  display: flex; gap: 10px;
}
.usage-progress {
  margin-top: 16px; padding: 12px; background: var(--bg);
  border-radius: var(--radius-sm); border: 1px solid var(--border);
}
.usage-progress-labels {
  display: flex; justify-content: space-between;
  font-size: 12px; color: var(--muted); margin-bottom: 6px;
}
.usage-track { height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.usage-fill { height: 100%; background: var(--g-blue); border-radius: 3px; transition: width .3s; }
