/* Ad Marketplace Styles */

.ad-marketplace-container,
.creator-monetization-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

/* Header */
.marketplace-header,
.monetization-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 1.5rem;
}

.marketplace-header h1,
.monetization-header h1 {
  font-size: 2rem;
  margin: 0;
}

/* Wallet Section */
.wallet-section {
  display: grid;
  grid-template-columns: 1fr 3fr;
  gap: 2rem;
  margin-bottom: 3rem;
}

.wallet-card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.wallet-card h3 {
  margin: 0 0 1rem 0;
  font-size: 0.9rem;
  opacity: 0.9;
}

.wallet-amount {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
}

.wallet-card .btn-secondary {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.wallet-card .btn-secondary:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.stat-card {
  background: var(--bg-secondary);
  padding: 1.5rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.stat-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.stat-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary-color);
}

/* Campaigns Grid */
.campaigns-section h2,
.earnings-section h2,
.payout-section h2 {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
}

.campaigns-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
}

.campaign-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}

.campaign-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.campaign-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: start;
}

.campaign-header h3 {
  margin: 0;
  flex: 1;
}

.status-badge {
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  white-space: nowrap;
  margin-left: 1rem;
}

.status-badge.status-pending {
  background: #fef08a;
  color: #854d0e;
}

.status-badge.status-approved {
  background: #86efac;
  color: #166534;
}

.status-badge.status-rejected {
  background: #fca5a5;
  color: #7f1d1d;
}

.status-badge.status-active {
  background: #93c5fd;
  color: #1e40af;
}

.campaign-image {
  width: 100%;
  height: 200px;
  background: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.campaign-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.no-image {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.campaign-stats {
  padding: 1.5rem;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.stat {
  display: flex;
  flex-direction: column;
}

.stat .label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  margin-bottom: 0.25rem;
}

.stat .value {
  font-size: 1.2rem;
  font-weight: 700;
}

.campaign-budget {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.budget-bar {
  width: 100%;
  height: 8px;
  background: var(--bg-primary);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.budget-progress {
  height: 100%;
  background: linear-gradient(90deg, #667eea, #764ba2);
  transition: width 0.3s ease;
}

.budget-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.campaign-actions {
  padding: 1rem;
  display: flex;
  gap: 0.5rem;
}

.btn-small {
  flex: 1;
  padding: 6px 16px;
  font-size: 0.8125rem;
  border-radius: 50px;
}

/* Empty State */
.empty-state,
.empty {
  padding: 3rem;
  text-align: center;
  color: var(--text-secondary);
}

/* Forms */
.form-section {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

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

.form-group label {
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.form-group input,
.form-group textarea,
.form-group select {
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.form-actions {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

.file-upload {
  border: 2px dashed var(--border-color);
  border-radius: 8px;
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s;
}

.file-upload:hover {
  border-color: var(--primary-color);
}

.file-upload input {
  display: none;
}

.upload-hint {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 0.5rem;
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background: var(--bg-secondary);
  border-radius: 12px;
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp 0.3s ease;
}

.modal-content.modal-small {
  max-width: 400px;
}

@keyframes slideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2rem;
  border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-secondary);
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  color: var(--text-primary);
}

.modal-content .form-section {
  padding: 2rem;
}

.modal-content h3 {
  margin-top: 0;
  margin-bottom: 1rem;
}

/* Info Box */
.info-box {
  background: var(--bg-primary);
  border-left: 4px solid var(--primary-color);
  padding: 1rem;
  border-radius: 6px;
  font-size: 0.9rem;
}

/* Checkboxes */
.preference-item,
.checkbox {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.checkbox input {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--primary-color);
}

.checkbox span {
  cursor: pointer;
}

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

/* Earnings Section */
.earnings-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.earning-card {
  background: var(--bg-secondary);
  padding: 1.5rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  text-align: center;
}

.earning-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.earning-amount {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary-color);
}

.earning-date {
  font-size: 1.1rem;
  color: var(--text-primary);
}

/* Table */
.earnings-table {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
}

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

.earnings-table th {
  background: var(--bg-primary);
  padding: 1rem;
  text-align: left;
  font-weight: 600;
  border-bottom: 2px solid var(--border-color);
}

.earnings-table td {
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
}

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

.earnings-table .loading,
.earnings-table .empty {
  text-align: center;
  padding: 2rem;
}

/* Payout */
.payout-section {
  margin-top: 3rem;
}

.payout-history {
  margin-top: 1.5rem;
}

.payout-history h3 {
  margin-top: 0;
}

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

.payout-item {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.payout-info {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.payout-amount {
  font-size: 1.5rem;
  font-weight: 700;
}

.payout-details {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.payout-date {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.payout-status {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
}

.payout-status.status-pending {
  background: #fef08a;
  color: #854d0e;
}

.payout-status.status-processing {
  background: #93c5fd;
  color: #1e40af;
}

.payout-status.status-completed {
  background: #86efac;
  color: #166534;
}

/* Notifications */
.notification {
  position: fixed;
  bottom: 20px;
  right: 20px;
  padding: 1rem 1.5rem;
  border-radius: 8px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s ease;
  z-index: 2000;
}

.notification.show {
  opacity: 1;
  transform: translateY(0);
}

.notification-success {
  border-color: #86efac;
  color: #166534;
  background: #f0fdf4;
}

.notification-error {
  border-color: #fca5a5;
  color: #7f1d1d;
  background: #fef2f2;
}

.notification-info {
  border-color: #93c5fd;
  color: #1e40af;
  background: #eff6ff;
}

/* Loading State */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.loading::before {
  content: '';
  width: 16px;
  height: 16px;
  border: 2px solid var(--border-color);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin-right: 0.75rem;
}

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

/* Responsive */
@media (max-width: 768px) {
  .ad-marketplace-container,
  .creator-monetization-container {
    padding: 1rem;
  }

  .marketplace-header,
  .monetization-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .wallet-section {
    grid-template-columns: 1fr;
  }

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

  .earning-card {
    padding: 1rem;
  }

  .modal-content {
    width: 95%;
    max-height: 95vh;
  }

  .form-actions {
    flex-direction: column;
  }

  .form-actions button {
    width: 100%;
  }

  .earnings-summary {
    grid-template-columns: 1fr;
  }

  .payout-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .payout-info {
    width: 100%;
    flex-direction: column;
    gap: 1rem;
  }
}
