/* =====================================================
   BoutiqueSEO Pro - Styles
   Matches boutiqueseo.ai design system
   ===================================================== */

:root {
  --cream: #FDF8F3;
  --warm-white: #FFFCF9;
  --charcoal: #2D2A26;
  --soft-black: #1A1816;
  --terracotta: #C4704B;
  --terracotta-light: #E8956E;
  --terracotta-dark: #A85D3B;
  --sage: #7D8B6F;
  --sage-light: #9BA88D;
  --blush: #E8D5CC;
  --border: #E5DDD4;
  --red-alert: #C45B4B;
  --yellow-warn: #C9A227;
  --green-good: #6B8E5E;
  --shadow: 0 4px 24px rgba(30, 26, 25, 0.08);
  --shadow-lg: 0 8px 32px rgba(30, 26, 25, 0.12);
  --radius: 12px;
  --radius-lg: 16px;
}

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

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--cream);
  color: var(--charcoal);
  line-height: 1.6;
  min-height: 100vh;
}

/* =====================================================
   Typography
   ===================================================== */

h1, h2, h3 {
  font-family: 'Instrument Serif', serif;
  font-weight: 400;
  color: var(--soft-black);
}

h1 { font-size: 2.5rem; line-height: 1.2; }
h2 { font-size: 1.75rem; line-height: 1.3; }
h3 { font-size: 1.25rem; line-height: 1.4; }

/* =====================================================
   Navigation / Header
   ===================================================== */

.app-header {
  background: var(--warm-white);
  border-bottom: 1px solid var(--border);
  padding: 1rem 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: baseline;
  gap: 0.1rem;
  text-decoration: none;
  font-family: 'Instrument Serif', serif;
  font-size: 1.5rem;
}

.logo-boutique { color: var(--soft-black); }
.logo-seo { color: var(--terracotta); }
.logo-ai { color: var(--sage); font-style: italic; font-size: 1.1rem; }

.nav-tabs {
  display: flex;
  gap: 0.5rem;
}

.nav-tab {
  padding: 0.5rem 1rem;
  border-radius: 100px;
  text-decoration: none;
  color: var(--charcoal);
  font-weight: 500;
  font-size: 0.95rem;
  transition: all 0.2s;
}

.nav-tab:hover {
  background: var(--blush);
}

.nav-tab.active {
  background: var(--soft-black);
  color: white;
}

.user-menu {
  position: relative;
}

.user-button {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  border-radius: 100px;
  background: var(--warm-white);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--charcoal);
  transition: all 0.2s;
}

.user-button:hover {
  border-color: var(--terracotta);
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--terracotta);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.8rem;
}

/* =====================================================
   Main Layout
   ===================================================== */

.app-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

/* =====================================================
   Auth Pages (Login/Signup)
   ===================================================== */

.auth-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.auth-card {
  background: var(--warm-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 3rem;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
}

.auth-logo {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-logo .logo {
  justify-content: center;
  font-size: 1.75rem;
}

.auth-title {
  text-align: center;
  margin-bottom: 0.5rem;
}

.auth-subtitle {
  text-align: center;
  color: var(--charcoal);
  opacity: 0.7;
  margin-bottom: 2rem;
  font-size: 0.95rem;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group label {
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--soft-black);
}

.form-group input {
  padding: 0.875rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 1rem;
  background: var(--cream);
  transition: all 0.2s;
}

.form-group input:focus {
  outline: none;
  border-color: var(--terracotta);
  background: var(--warm-white);
}

.form-group input::placeholder {
  color: var(--charcoal);
  opacity: 0.4;
}

.btn {
  padding: 0.875rem 1.5rem;
  border-radius: 100px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-primary {
  background: var(--terracotta);
  color: white;
}

.btn-primary:hover {
  background: var(--terracotta-dark);
  transform: translateY(-1px);
}

.btn-primary:disabled {
  background: var(--blush);
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background: var(--soft-black);
  color: white;
}

.btn-secondary:hover {
  background: var(--charcoal);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--charcoal);
}

.btn-outline:hover {
  border-color: var(--terracotta);
  color: var(--terracotta);
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 0.5rem 0;
  color: var(--charcoal);
  opacity: 0.5;
  font-size: 0.85rem;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.auth-footer {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.9rem;
  color: var(--charcoal);
}

.auth-footer a {
  color: var(--terracotta);
  text-decoration: none;
  font-weight: 500;
}

.auth-footer a:hover {
  text-decoration: underline;
}

.auth-error {
  background: #FEF2F2;
  border: 1px solid var(--red-alert);
  color: var(--red-alert);
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
  display: none;
}

.auth-error.show {
  display: block;
}

/* =====================================================
   Dashboard - Score Card
   ===================================================== */

.score-card {
  background: var(--warm-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow);
  margin-bottom: 2rem;
}

.score-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 2rem;
}

.score-main {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.score-circle {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
}

.score-circle::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 8px solid var(--border);
}

.score-circle.good::before { border-color: var(--green-good); }
.score-circle.fair::before { border-color: var(--yellow-warn); }
.score-circle.at-risk::before { border-color: var(--red-alert); }

.score-number {
  font-family: 'Instrument Serif', serif;
  font-size: 3rem;
  line-height: 1;
  color: var(--soft-black);
}

.score-max {
  font-size: 1rem;
  color: var(--charcoal);
  opacity: 0.5;
}

.score-meta h2 {
  margin-bottom: 0.25rem;
}

.score-change {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
}

.score-change.up {
  color: var(--green-good);
  background: rgba(107, 142, 94, 0.1);
}

.score-change.down {
  color: var(--red-alert);
  background: rgba(196, 91, 75, 0.1);
}

.score-change.same {
  color: var(--charcoal);
  opacity: 0.6;
}

.score-percentile {
  color: var(--charcoal);
  opacity: 0.7;
  font-size: 0.9rem;
  margin-top: 0.5rem;
}

.next-scan {
  text-align: right;
  font-size: 0.9rem;
  color: var(--charcoal);
  opacity: 0.7;
}

.next-scan strong {
  display: block;
  color: var(--soft-black);
  opacity: 1;
}

/* =====================================================
   Score Breakdown
   ===================================================== */

.score-breakdown {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.breakdown-item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.breakdown-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
}

.breakdown-label span:first-child {
  color: var(--charcoal);
}

.breakdown-label span:last-child {
  font-weight: 600;
  color: var(--soft-black);
}

.breakdown-bar {
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.breakdown-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s ease;
}

.breakdown-fill.good { background: var(--green-good); }
.breakdown-fill.fair { background: var(--yellow-warn); }
.breakdown-fill.poor { background: var(--red-alert); }

/* =====================================================
   Wins & Needs Attention
   ===================================================== */

.insights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.insight-card {
  background: var(--warm-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.insight-card h3 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

.insight-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.insight-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.95rem;
  line-height: 1.4;
}

.insight-icon {
  flex-shrink: 0;
  width: 20px;
  text-align: center;
}

/* =====================================================
   Action Items
   ===================================================== */

.action-items {
  background: var(--warm-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  margin-bottom: 2rem;
}

.action-items h3 {
  margin-bottom: 1rem;
}

.action-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.action-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem;
  background: var(--cream);
  border-radius: var(--radius);
  border: 1px solid transparent;
  transition: all 0.2s;
}

.action-item:hover {
  border-color: var(--terracotta);
}

.action-checkbox {
  width: 24px;
  height: 24px;
  border: 2px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s;
}

.action-checkbox:hover {
  border-color: var(--terracotta);
}

.action-checkbox.checked {
  background: var(--green-good);
  border-color: var(--green-good);
  color: white;
}

.action-content {
  flex: 1;
}

.action-title {
  font-weight: 600;
  color: var(--soft-black);
  margin-bottom: 0.25rem;
}

.action-description {
  font-size: 0.9rem;
  color: var(--charcoal);
  opacity: 0.8;
}

.action-meta {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.action-tag {
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-weight: 500;
}

.action-tag.impact-high { background: rgba(107, 142, 94, 0.15); color: var(--green-good); }
.action-tag.impact-medium { background: rgba(201, 162, 39, 0.15); color: var(--yellow-warn); }
.action-tag.effort-easy { background: rgba(125, 139, 111, 0.15); color: var(--sage); }
.action-tag.effort-medium { background: rgba(232, 213, 204, 0.5); color: var(--charcoal); }

/* =====================================================
   Trend Chart
   ===================================================== */

.trend-card {
  background: var(--warm-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.trend-card h3 {
  margin-bottom: 1rem;
}

.trend-chart {
  height: 200px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}

.trend-bar {
  flex: 1;
  background: var(--terracotta);
  border-radius: 4px 4px 0 0;
  min-height: 20px;
  position: relative;
  transition: height 0.3s ease;
}

.trend-bar:hover {
  background: var(--terracotta-dark);
}

.trend-labels {
  display: flex;
  justify-content: space-between;
  padding-top: 0.5rem;
  font-size: 0.75rem;
  color: var(--charcoal);
  opacity: 0.6;
}

/* =====================================================
   Reports Page
   ===================================================== */

.reports-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.report-card {
  background: var(--warm-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: all 0.2s;
}

.report-card:hover {
  border-color: var(--terracotta);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.report-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.report-date {
  font-weight: 600;
  color: var(--soft-black);
}

.report-score {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.report-score-number {
  font-family: 'Instrument Serif', serif;
  font-size: 1.5rem;
  color: var(--soft-black);
}

.report-summary {
  font-size: 0.95rem;
  color: var(--charcoal);
  line-height: 1.5;
}

/* =====================================================
   Settings Page
   ===================================================== */

.settings-section {
  background: var(--warm-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
}

.settings-section h3 {
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.settings-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}

.settings-row:last-child {
  border-bottom: none;
}

.settings-label {
  font-weight: 500;
  color: var(--soft-black);
}

.settings-value {
  color: var(--charcoal);
  font-size: 0.95rem;
}

.gsc-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.status-dot.connected { background: var(--green-good); }
.status-dot.disconnected { background: var(--red-alert); }

/* =====================================================
   Empty States
   ===================================================== */

.empty-state {
  text-align: center;
  padding: 4rem 2rem;
}

.empty-state-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
}

.empty-state h2 {
  margin-bottom: 0.5rem;
}

.empty-state p {
  color: var(--charcoal);
  opacity: 0.7;
  margin-bottom: 1.5rem;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

/* =====================================================
   Loading States
   ===================================================== */

.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4rem;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--terracotta);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* =====================================================
   Responsive
   ===================================================== */

@media (max-width: 768px) {
  .app-header {
    padding: 1rem;
  }

  .header-inner {
    flex-wrap: wrap;
    gap: 1rem;
  }

  .nav-tabs {
    order: 3;
    width: 100%;
    justify-content: center;
  }

  .app-main {
    padding: 1rem;
  }

  .score-header {
    flex-direction: column;
    gap: 1.5rem;
  }

  .next-scan {
    text-align: left;
  }

  .score-breakdown {
    grid-template-columns: 1fr;
  }

  .insights-grid {
    grid-template-columns: 1fr;
  }

  .auth-card {
    padding: 2rem 1.5rem;
  }
}
