/* ============================================
   Blob Lab Seller Map — Styles
   Modern, minimal design studio aesthetic
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Anton&display=swap');

:root {
  --bg: #ffffff;
  --bg-elevated: #f5f5f5;
  --bg-hover: #eeeeee;
  --text: #1a1a1a;
  --text-secondary: #666666;
  --text-muted: #999999;
  --accent: #1a1a1a;
  --accent-hover: #333333;
  --accent-dim: rgba(0, 0, 0, 0.06);
  --border: #e0e0e0;
  --success: #00b894;
  --warning: #f39c12;
  --error: #e17055;
  --radius: 8px;
  --radius-sm: 4px;
  --shadow: 0 4px 24px rgba(0,0,0,0.08);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --transition: 0.2s ease;
}

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

html, body {
  height: 100%;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Hide header when embedded in iframe */
body.embedded .header {
  display: none;
}

a {
  color: #444;
  text-decoration: none;
}

a:hover {
  color: #000;
  text-decoration: underline;
}

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

.page {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  position: relative;
}

.logo {
  font-family: 'Anton', sans-serif;
  font-size: 22px;
  font-weight: 400;
  color: var(--text);
  letter-spacing: 1px;
  text-decoration: none;
}

.logo:hover {
  text-decoration: none;
  opacity: 0.8;
}

.header-center {
  font-family: var(--font);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.nav-links {
  display: flex;
  gap: 24px;
}

.btn-seller-login {
  display: inline-flex;
  align-items: center;
  padding: 8px 18px;
  border: 2px solid var(--text);
  border-radius: var(--radius);
  background: transparent;
  color: var(--text) !important;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none !important;
  transition: all var(--transition);
}

.btn-seller-login:hover {
  background: var(--text);
  color: #ffffff !important;
  text-decoration: none !important;
}

.main {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* ============================================
   Toolbar
   ============================================ */

.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  flex-wrap: wrap;
  position: relative;
  z-index: 10000;
}

.view-toggle {
  display: flex;
  background: var(--bg-elevated);
  border-radius: var(--radius);
  padding: 4px;
}

.view-toggle button {
  padding: 8px 16px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
}

.view-toggle button.active {
  background: var(--accent);
  color: #ffffff;
}

.view-toggle button:hover:not(.active) {
  color: var(--text);
}

.search-box {
  flex: 1;
  min-width: 200px;
  max-width: 400px;
  position: relative;
  z-index: 10000;
}

.search-box input {
  width: 100%;
  padding: 10px 16px 10px 40px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  transition: border-color var(--transition);
}

.search-box input::placeholder {
  color: var(--text-muted);
}

.search-box input:focus {
  outline: none;
  border-color: var(--accent);
}

.search-box::before {
  content: '🔍';
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  opacity: 0.5;
  z-index: 1;
}

.search-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  max-height: 300px;
  overflow-y: auto;
  z-index: 10000;
  box-shadow: var(--shadow);
}

.search-dropdown-item {
  padding: 10px 16px;
  cursor: pointer;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-dropdown-item:last-child {
  border-bottom: none;
}

.search-dropdown-item:hover {
  background: var(--bg-elevated);
}

.search-dropdown-item .search-type {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

.search-dropdown-item .search-label {
  color: var(--text);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--bg-hover);
  border-color: var(--text-muted);
}

.btn-danger {
  background: var(--error);
  color: #ffffff;
}

.btn-danger:hover {
  opacity: 0.9;
}

.btn-success {
  background: var(--success);
  color: #ffffff;
}

.btn-success:hover {
  opacity: 0.9;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-icon {
  padding: 8px;
  border-radius: var(--radius-sm);
}

/* ============================================
   Map View
   ============================================ */

.map-container {
  flex: 1;
  position: relative;
}

#map {
  width: 100%;
  height: 100%;
}

.leaflet-popup-content-wrapper {
  background: #ffffff;
  color: var(--text);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.leaflet-popup-content {
  margin: 16px;
  font-family: var(--font);
}

.leaflet-popup-tip {
  background: #ffffff;
}

.popup-name {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 8px;
}

.popup-location {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.popup-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: var(--accent);
}

/* ============================================
   List View
   ============================================ */

.list-container {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

.list-group {
  margin-bottom: 32px;
}

.list-group-header {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.list-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all var(--transition);
}

.list-item:hover {
  border-color: var(--text-muted);
  background: var(--bg-hover);
}

.list-item-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.list-item-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.list-item-location {
  font-size: 12px;
  color: var(--text-secondary);
}

.list-item-link {
  font-size: 12px;
  color: var(--accent);
}

/* ============================================
   Expandable Details
   ============================================ */

.seller-details {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.seller-details-toggle {
  background: none;
  border: none;
  padding: 0;
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  font-family: var(--font);
}

.seller-details-toggle:hover {
  color: var(--text);
}

.seller-tenure {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
  font-style: italic;
}

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

.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 200px;
  color: var(--text-muted);
  font-size: 14px;
}

.loading::before {
  content: '';
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-right: 12px;
}

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

.error-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--error);
}

.error-state p {
  margin-bottom: 16px;
}

.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}

/* ============================================
   Portal Page
   ============================================ */

.portal-container {
  max-width: 600px;
  margin: 0 auto;
  padding: 48px 24px;
  width: 100%;
}

.portal-title {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}

.portal-subtitle {
  color: var(--text-secondary);
  font-size: 15px;
  margin-bottom: 32px;
}

.wallet-connect-box {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 48px;
  text-align: center;
  margin-bottom: 24px;
}

.wallet-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.wallet-connect-box h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
}

.wallet-connect-box p {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 24px;
}

.wallet-address {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  font-family: monospace;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 24px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wallet-address span {
  color: var(--accent);
}

.profile-form {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  transition: border-color var(--transition);
}

.form-group textarea {
  resize: vertical;
  min-height: 100px;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--accent);
}

.form-group input:disabled,
.form-group textarea:disabled,
.form-group select:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.status-badge.active {
  background: rgba(0, 184, 148, 0.15);
  color: var(--success);
}

.status-badge.pending {
  background: rgba(253, 203, 110, 0.15);
  color: var(--warning);
}

.status-badge.suspended {
  background: rgba(225, 112, 85, 0.15);
  color: var(--error);
}

.status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 24px;
}

.section-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text);
}

/* ============================================
   Admin Page
   ============================================ */

.admin-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 24px;
  width: 100%;
}

.admin-title {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}

.admin-subtitle {
  color: var(--text-secondary);
  font-size: 15px;
  margin-bottom: 32px;
}

.login-form {
  max-width: 400px;
  margin: 0 auto;
}

.login-form .form-group {
  margin-bottom: 16px;
}

.login-form .btn {
  width: 100%;
  justify-content: center;
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
}

.stat-number {
  font-size: 32px;
  font-weight: 700;
  color: var(--accent);
}

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 4px;
}

.admin-table-wrapper {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table th,
.admin-table td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.admin-table th {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  background: var(--bg-elevated);
}

.admin-table tr:last-child td {
  border-bottom: none;
}

.admin-table tr:hover td {
  background: var(--bg-hover);
}

.admin-table .seller-name {
  font-weight: 600;
  font-size: 14px;
}

.admin-table .seller-address {
  font-size: 12px;
  color: var(--text-muted);
  font-family: monospace;
  margin-top: 2px;
}

.admin-table .seller-location {
  font-size: 13px;
  color: var(--text-secondary);
}

.admin-table .actions {
  display: flex;
  gap: 8px;
}

.admin-table .actions button {
  padding: 6px 10px;
  font-size: 11px;
}

.verification-log {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

.admin-table td:nth-child(4) {
  max-width: 200px;
}

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

@media (max-width: 768px) {
  .header {
    padding: 12px 16px;
  }

  .nav-links {
    gap: 16px;
  }

  .toolbar {
    padding: 12px 16px;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .admin-table {
    font-size: 12px;
  }

  .admin-table th,
  .admin-table td {
    padding: 10px 8px;
  }
}

/* ============================================
   Utilities
   ============================================ */

.hidden {
  display: none !important;
}

.text-center {
  text-align: center;
}

.mt-16 {
  margin-top: 16px;
}

.mb-16 {
  margin-bottom: 16px;
}