/*
Theme Name: Mass Marketing Lists
Theme URI: https://massmarketinglists.com
Author: Mass Marketing Lists
Description: Membership theme for MassMarketingLists.com - browse, filter, and build custom contact list downloads by state and contact count.
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: mass-marketing-lists
*/

:root {
  --mml-primary: #1a365d;
  --mml-primary-light: #2c5282;
  --mml-accent: #ed8936;
  --mml-success: #38a169;
  --mml-bg: #f7fafc;
  --mml-card-bg: #ffffff;
  --mml-border: #e2e8f0;
  --mml-text: #2d3748;
  --mml-text-muted: #718096;
}

* {
  box-sizing: border-box;
}

body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--mml-text);
  background: var(--mml-bg);
  line-height: 1.6;
  margin: 0;
}

/* Header */
.site-header {
  background: var(--mml-primary);
  color: white;
  padding: 1rem 2rem;
  box-shadow: 0 2px 10px rgba(0,0,0,0.15);
}

.site-header .header-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.site-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
}

.site-title a {
  color: white;
  text-decoration: none;
}

/* Main content */
.site-main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 2rem;
}

/* List Grid */
.lists-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.list-card {
  background: var(--mml-card-bg);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  border: 1px solid var(--mml-border);
  transition: transform 0.2s, box-shadow 0.2s;
}

.list-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.list-card .state-badge {
  display: inline-block;
  background: var(--mml-primary);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.875rem;
  margin-bottom: 0.75rem;
}

.list-card .contact-count {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--mml-primary);
  margin: 0.5rem 0;
}

.list-card .add-to-builder {
  margin-top: 1rem;
  padding: 0.5rem 1rem;
  background: var(--mml-accent);
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.2s;
}

.list-card .add-to-builder:hover {
  background: #dd6b20;
}

.list-card .add-to-builder.added {
  background: var(--mml-success);
}

/* Filters */
.lists-filters {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  align-items: center;
}

.lists-filters select {
  padding: 0.5rem 1rem;
  border: 1px solid var(--mml-border);
  border-radius: 6px;
  font-size: 1rem;
  min-width: 180px;
}

.lists-filters label {
  font-weight: 500;
  color: var(--mml-text-muted);
}

/* List Builder */
.list-builder-panel {
  position: fixed;
  right: 0;
  top: 0;
  width: 360px;
  max-width: 100%;
  height: 100vh;
  background: var(--mml-card-bg);
  box-shadow: -4px 0 20px rgba(0,0,0,0.15);
  padding: 1.5rem;
  overflow-y: auto;
  z-index: 1000;
  transform: translateX(100%);
  transition: transform 0.3s ease;
}

.list-builder-panel.open {
  transform: translateX(0);
}

.list-builder-toggle {
  position: fixed;
  right: 2rem;
  bottom: 2rem;
  background: var(--mml-accent);
  color: white;
  border: none;
  padding: 1rem 1.5rem;
  border-radius: 50px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(237, 137, 54, 0.5);
  z-index: 999;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.list-builder-toggle .count {
  background: white;
  color: var(--mml-accent);
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
}

.builder-selected-lists {
  list-style: none;
  padding: 0;
  margin: 0;
}

.builder-selected-lists li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--mml-border);
}

.builder-selected-lists .remove-list {
  color: #e53e3e;
  cursor: pointer;
  font-size: 0.875rem;
}

.builder-download-btn {
  width: 100%;
  padding: 1rem;
  background: var(--mml-success);
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  margin-top: 1rem;
}

.builder-download-btn:hover {
  background: #2f855a;
}

.builder-download-btn:disabled {
  background: var(--mml-text-muted);
  cursor: not-allowed;
}

.apply-filters-btn {
  padding: 0.5rem 1.25rem;
  background: var(--mml-primary);
  color: white;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
}

.apply-filters-btn:hover {
  background: var(--mml-primary-light);
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.close-builder-btn {
  margin-top: 1rem;
  width: 100%;
  padding: 0.5rem;
  background: transparent;
  border: 1px solid var(--mml-border);
  border-radius: 6px;
  cursor: pointer;
  color: var(--mml-text-muted);
}

.builder-options {
  margin: 1rem 0;
}

.builder-options label {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.875rem;
}

.builder-options select {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid var(--mml-border);
  border-radius: 6px;
}

.builder-total-contacts {
  font-weight: 600;
  color: var(--mml-primary);
}

.site-footer {
  text-align: center;
  padding: 2rem;
  color: var(--mml-text-muted);
  border-top: 1px solid var(--mml-border);
}

.no-lists {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem;
  color: var(--mml-text-muted);
}

/* Paywall */
.mml-paywall {
  max-width: 480px;
  margin: 3rem auto;
}

.paywall-card {
  background: var(--mml-card-bg);
  border-radius: 16px;
  padding: 2.5rem;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  border: 1px solid var(--mml-border);
}

.paywall-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--mml-primary);
  margin: 0 0 1rem 0;
}

.paywall-description {
  color: var(--mml-text-muted);
  margin: 0 0 1.5rem 0;
  line-height: 1.6;
}

.paywall-price {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--mml-primary);
  margin: 0 0 0.25rem 0;
}

.paywall-price span {
  font-size: 1rem;
  font-weight: 500;
  color: var(--mml-text-muted);
}

.paywall-login-prompt {
  margin: 1.5rem 0 1rem 0;
  color: var(--mml-text);
}

.paywall-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.paywall-form {
  margin-top: 1.5rem;
}

.paywall-btn {
  display: inline-block;
  padding: 0.875rem 1.75rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 8px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: opacity 0.2s;
}

.paywall-btn:hover {
  opacity: 0.9;
}

.paywall-btn-primary {
  background: var(--mml-accent);
  color: white;
}

.paywall-btn-secondary {
  background: var(--mml-border);
  color: var(--mml-text);
}

/* Paywall + Auth Panel layout */
.mml-paywall-wrap {
  display: flex;
  min-height: 60vh;
}

.mml-paywall {
  flex: 1;
  max-width: 100%;
}

/* Auth overlay */
.mml-auth-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}

.mml-auth-overlay.open {
  opacity: 1;
  visibility: visible;
}

/* Auth Panel (right side) */
.mml-auth-panel {
  position: fixed;
  right: 0;
  top: 0;
  width: 400px;
  max-width: 100%;
  height: 100vh;
  background: var(--mml-card-bg);
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
  padding: 2rem;
  overflow-y: auto;
  z-index: 1000;
  transform: translateX(100%);
  transition: transform 0.3s ease;
}

.mml-auth-panel.open {
  transform: translateX(0);
}

.mml-auth-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 36px;
  height: 36px;
  padding: 0;
  font-size: 1.5rem;
  line-height: 1;
  background: none;
  border: none;
  color: var(--mml-text-muted);
  cursor: pointer;
  border-radius: 4px;
  transition: color 0.2s, background 0.2s;
}

.mml-auth-close:hover {
  color: var(--mml-text);
  background: var(--mml-border);
}

.mml-auth-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--mml-primary);
  margin: 0 0 1.5rem 0;
}

.mml-auth-form .mml-form-row {
  margin: 0 0 1rem 0;
}

.mml-auth-form label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.35rem;
  color: var(--mml-text);
}

.mml-auth-form input {
  width: 100%;
  padding: 0.6rem 0.75rem;
  font-size: 1rem;
  border: 1px solid var(--mml-border);
  border-radius: 8px;
}

.mml-auth-form input:focus {
  outline: none;
  border-color: var(--mml-primary);
  box-shadow: 0 0 0 2px rgba(26, 54, 93, 0.2);
}

.mml-auth-form .paywall-btn {
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.75rem;
}

.mml-form-error {
  color: #e53e3e;
  font-size: 0.875rem;
  margin: 0 0 0.5rem 0;
}

.mml-auth-footer {
  margin: 1rem 0 0 0;
  font-size: 0.9rem;
  color: var(--mml-text-muted);
}

.mml-auth-footer a {
  color: var(--mml-primary);
  font-weight: 500;
}

body.mml-auth-panel-open {
  overflow: hidden;
}

@media (max-width: 768px) {
  .mml-auth-panel {
    width: 100%;
  }
}

/* Tabs */
.mml-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid var(--mml-border);
}

.mml-tab {
  padding: 0.75rem 1.25rem;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--mml-text-muted);
  cursor: pointer;
  transition: color 0.2s;
}

.mml-tab:hover {
  color: var(--mml-text);
}

.mml-tab.active {
  color: var(--mml-primary);
  border-bottom-color: var(--mml-primary);
}

.mml-tab-content {
  display: none;
}

.mml-tab-content.active {
  display: block;
}

/* Data Explorer */
.mml-explorer-controls {
  display: flex;
  gap: 1rem;
  align-items: flex-end;
  margin-bottom: 1.5rem;
}

.mml-explorer-preview {
  background: var(--mml-card-bg);
  border: 1px solid var(--mml-border);
  border-radius: 8px;
  padding: 1rem;
  min-height: 200px;
}

.mml-explorer-placeholder,
.mml-explorer-loading,
.mml-explorer-error {
  color: var(--mml-text-muted);
  margin: 2rem 0;
}

.mml-explorer-meta {
  margin: 0 0 1rem 0;
  font-size: 0.9rem;
  color: var(--mml-text-muted);
}

.mml-explorer-table-wrap {
  overflow-x: auto;
  max-height: 500px;
  overflow-y: auto;
}

.mml-explorer-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.mml-explorer-table th,
.mml-explorer-table td {
  padding: 0.5rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--mml-border);
  white-space: nowrap;
}

.mml-explorer-table th {
  background: var(--mml-primary);
  color: white;
  font-weight: 600;
  position: sticky;
  top: 0;
}

.mml-explorer-table tbody tr:hover {
  background: rgba(0, 0, 0, 0.03);
}

/* US Map */
.mml-us-map-wrap {
  margin-bottom: 2rem;
  position: relative;
  background: var(--mml-card-bg);
  border-radius: 12px;
  padding: 1rem;
  border: 1px solid var(--mml-border);
}

.mml-us-map {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
}

.mml-us-map svg {
  width: 100%;
  height: auto;
  display: block;
}

.mml-us-map path {
  fill: rgb(230, 230, 230);
  stroke: #fff;
  stroke-width: 0.5px;
  cursor: pointer;
}

.mml-us-map path:hover {
  filter: brightness(1.1);
}

.mml-us-map path.mml-state-added {
  fill: #38a169 !important;
  filter: none;
}

.mml-map-tooltip {
  position: fixed;
  padding: 0.5rem 0.75rem;
  background: var(--mml-primary);
  color: white;
  border-radius: 6px;
  font-size: 0.875rem;
  pointer-events: none;
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s, visibility 0.15s;
  max-width: 200px;
}

.mml-map-tooltip.visible {
  opacity: 1;
  visibility: visible;
}

.mml-map-tooltip strong {
  display: block;
  margin-bottom: 0.25rem;
}

.mml-map-tooltip em {
  font-size: 0.75rem;
  opacity: 0.9;
}

/* Page titles */
.page-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--mml-primary);
  margin: 0 0 0.5rem 0;
}

.page-subtitle {
  color: var(--mml-text-muted);
  margin: 0 0 2rem 0;
}
