/* Form Styles */
.ad-form-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
}

.form-header {
  margin-bottom: 30px;
}

.form-header h1 {
  font-size: 28px;
  margin-bottom: 8px;
}

.form-subtitle {
  color: #6b7280;
  font-size: 16px;
}

.ad-form {
  background: white;
  border-radius: 12px;
  padding: 30px;
  border: 1px solid var(--border-color);
}

.form-section {
  margin-bottom: 32px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border-color);
}

.form-section:last-of-type {
  border-bottom: none;
}

.form-section h2 {
  font-size: 20px;
  margin-bottom: 20px;
  color: var(--text-color);
}

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

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-color);
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 15px;
  transition: border-color 0.2s;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-textarea {
  resize: vertical;
  font-family: inherit;
}

.form-hint {
  display: block;
  font-size: 13px;
  color: #6b7280;
  margin-top: 4px;
}

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

.radio-group {
  display: flex;
  gap: 20px;
  align-items: center;
}

.radio-group input[type="radio"] {
  margin-right: 6px;
}

.radio-group label {
  margin-bottom: 0;
  font-weight: normal;
  cursor: pointer;
}

.error-messages {
  background: #fee2e2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 24px;
}

.error-messages h3 {
  color: var(--danger-color);
  font-size: 16px;
  margin-bottom: 8px;
}

.error-messages ul {
  list-style: none;
  padding: 0;
}

.error-messages li {
  color: #991b1b;
  font-size: 14px;
  margin-bottom: 4px;
}

/* Image Upload */
.image-upload {
  border: 2px dashed var(--border-color);
  border-radius: 12px;
  padding: 24px;
  text-align: center;
  transition: border-color 0.2s;
}

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

.file-input {
  display: none;
}

.upload-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: var(--primary-color);
  color: white;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  transition: background 0.2s;
}

.upload-button:hover {
  background: var(--primary-hover);
}

.upload-icon {
  width: 20px;
  height: 20px;
}

.image-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.image-preview-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.preview-thumbnail {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.remove-image {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 28px;
  height: 28px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.remove-image:hover {
  background: var(--danger-color);
}

.form-actions {
  display: flex;
  gap: 12px;
  padding-top: 24px;
  border-top: 1px solid var(--border-color);
}

.btn-link {
  background: none;
  color: #6b7280;
  text-decoration: none;
  padding: 8px 16px;
}

.btn-link:hover {
  color: var(--text-color);
  text-decoration: underline;
}

/* Dashboard Styles */
.dashboard-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
}

.dashboard-header h1 {
  font-size: 28px;
}

.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 24px;
  text-align: center;
}

.stat-value {
  font-size: 36px;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 8px;
}

.stat-label {
  font-size: 14px;
  color: #6b7280;
  text-transform: uppercase;
  font-weight: 600;
}

.dashboard-filters {
  margin-bottom: 24px;
}

.filter-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 2px solid var(--border-color);
  overflow-x: auto;
}

.tab-link {
  padding: 12px 20px;
  color: #6b7280;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s;
  white-space: nowrap;
}

.tab-link:hover {
  color: var(--text-color);
}

.tab-link.active {
  color: var(--primary-color);
  border-bottom-color: var(--primary-color);
  font-weight: 600;
}

.dashboard-ads-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 30px;
}

.dashboard-ad-card {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 20px;
  display: grid;
  grid-template-columns: 120px 1fr auto;
  gap: 20px;
  align-items: center;
  transition: box-shadow 0.2s;
}

.dashboard-ad-card:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.ad-image-thumb {
  width: 120px;
  height: 120px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-light);
}

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

.thumb-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9ca3af;
  font-size: 12px;
}

.ad-info {
  flex: 1;
}

.ad-title-row {
  display: flex;
  justify-content: space-between;
  align-items: start;
  margin-bottom: 8px;
}

.ad-title {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
}

.ad-title a {
  color: var(--text-color);
  text-decoration: none;
}

.ad-title a:hover {
  color: var(--primary-color);
}

.ad-status-badges {
  display: flex;
  gap: 6px;
}

.status-badge {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.status-draft {
  background: #e5e7eb;
  color: #4b5563;
}

.status-active {
  background: #d1fae5;
  color: #065f46;
}

.status-sold {
  background: #dbeafe;
  color: #1e40af;
}

.status-expired {
  background: #fee2e2;
  color: #991b1b;
}

.status-featured {
  background: var(--primary-color);
  color: white;
}

.ad-meta-row {
  display: flex;
  gap: 16px;
  margin-bottom: 8px;
  font-size: 14px;
  color: #6b7280;
}

.ad-price {
  font-weight: 600;
  color: var(--primary-color);
}

.ad-stats-row {
  display: flex;
  gap: 16px;
  font-size: 13px;
  color: #6b7280;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.ad-actions {
  position: relative;
}

.action-menu-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 6px;
  transition: background 0.2s;
}

.action-menu-btn:hover {
  background: var(--bg-light);
}

.text-danger {
  color: var(--danger-color) !important;
}

.empty-icon {
  width: 80px;
  height: 80px;
  color: #d1d5db;
  margin-bottom: 16px;
}

/* Responsive */
@media (max-width: 768px) {
  .form-row {
    grid-template-columns: 1fr;
  }

  .dashboard-header {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }

  .dashboard-ad-card {
    grid-template-columns: 80px 1fr;
    gap: 12px;
  }

  .ad-image-thumb {
    width: 80px;
    height: 80px;
  }

  .ad-actions {
    grid-column: 1 / -1;
    text-align: right;
  }

  .ad-meta-row {
    flex-direction: column;
    gap: 4px;
  }

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