/* SupaWP Wegot Trades - Custom Styles */

/* Global Trades Theme Colors */
:root {
  --trades-primary: #ff9800;
  --trades-primary-dark: #f57c00;
  --trades-primary-light: #ffb74d;
  --trades-secondary: #2196f3;
  --trades-success: #4caf50;
  --trades-error: #f44336;
  --trades-warning: #ff9800;
  --trades-gray-light: #f8f9fa;
  --trades-gray: #6c757d;
  --trades-gray-dark: #495057;
}

/* Trade Dashboard Global Styles */
.supawp-trades-dashboard {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial,
    sans-serif;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* Dashboard Header */
.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 40px;
  gap: 20px;
}

.header-content {
  flex: 1;
}

.dashboard-header h1 {
  font-size: 28px;
  font-weight: 600;
  color: #333;
  margin-bottom: 10px;
}

.dashboard-header p {
  color: #666;
  font-size: 16px;
  line-height: 1.5;
}

.header-actions {
  flex-shrink: 0;
}

.btn-add-business {
  background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.btn-add-business:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
  background: linear-gradient(135deg, #45a049 0%, #388e3c 100%);
}

/* Stats Cards Section */
.stats-section {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.stat-card {
  background: white;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  gap: 16px;
  border: 1px solid #e5e7eb;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.stat-icon {
  font-size: 32px;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8fafc;
  border-radius: 50%;
}

.stat-icon img {
  width: 32px;
}

.stat-content h3 {
  font-size: 14px;
  color: #6b7280;
  margin: 0 0 8px 0;
  font-weight: 500;
}

.stat-value {
  font-size: 24px;
  font-weight: 700;
  color: #1f2937;
  margin: 0;
}

/* Trade Details Section */
.trade-details-section {
  background: #f9fafb;
  border-radius: 12px;
  padding: 32px;
  border: 1px solid #e5e7eb;
}

.trade-details-section h2 {
  font-size: 20px;
  font-weight: 600;
  color: #1f2937;
  margin: 0 0 8px 0;
}

.section-subtitle {
  color: #6b7280;
  font-size: 14px;
  margin: 0 0 32px 0;
}

.trade-details-grid {
  display: grid;
  gap: 16px;
}

.detail-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid #e5e7eb;
}

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

.detail-label {
  font-weight: 500;
  color: #1f2937;
  flex: 1;
}

.detail-value {
  flex: 1;
  text-align: right;
  color: #6b7280;
}

.no-trade-message {
  text-align: center;
  padding: 40px;
  color: #6b7280;
  font-style: italic;
}

/* Edit Business Section */
.edit-business-section {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 2px solid #e5e7eb;
  text-align: center;
}

.btn-edit-business {
  background: linear-gradient(
    135deg,
    var(--trades-primary) 0%,
    var(--trades-primary-dark) 100%
  );
  color: white;
  border: none;
  padding: 14px 32px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(255, 152, 0, 0.3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.btn-edit-business:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 152, 0, 0.4);
  background: linear-gradient(
    135deg,
    var(--trades-primary-dark) 0%,
    #ef6c00 100%
  );
}

.btn-edit-business:active {
  transform: translateY(0);
}

/* Trade Form Styles */
.new-trade-form {
  max-width: 700px;
  margin: 0 auto;
}

.new-trade-form .form-group {
  margin-bottom: 24px;
}

.new-trade-form label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--trades-gray-dark);
  font-size: 14px;
}

.new-trade-form input[type='text'],
.new-trade-form input[type='email'],
.new-trade-form textarea,
.new-trade-form select {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #e1e5e9;
  border-radius: 8px;
  font-size: 14px;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  box-sizing: border-box;
  background-color: #fff;
}

.new-trade-form input:focus,
.new-trade-form textarea:focus,
.new-trade-form select:focus {
  outline: none;
  border-color: var(--trades-primary);
  box-shadow: 0 0 0 3px rgba(255, 152, 0, 0.1);
}

.new-trade-form textarea {
  resize: vertical;
  min-height: 100px;
  font-family: inherit;
}

/* Trade Form Submit Button */
.new-trade-form .submit-btn {
  background: linear-gradient(
    135deg,
    var(--trades-primary) 0%,
    var(--trades-primary-dark) 100%
  );
  color: white;
  padding: 14px 32px;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(255, 152, 0, 0.3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.new-trade-form .submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 152, 0, 0.4);
  background: linear-gradient(
    135deg,
    var(--trades-primary-dark) 0%,
    #ef6c00 100%
  );
}

.new-trade-form .submit-btn:active {
  transform: translateY(0);
}

/* Image Upload Styles */
.image-upload-container {
  border: 2px dashed #e1e5e9;
  border-radius: 8px;
  padding: 32px;
  text-align: center;
  background-color: #fafbfc;
  transition: all 0.3s ease;
  position: relative;
}

.image-upload-container:hover {
  border-color: var(--trades-primary);
  background-color: rgba(255, 152, 0, 0.05);
}

.image-upload-container.dragover {
  border-color: var(--trades-primary-dark);
  background-color: rgba(255, 152, 0, 0.1);
  transform: scale(1.02);
}

.image-upload-container input[type='file'] {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;
  cursor: pointer;
}

/* Image Preview Styles */
.image-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
  justify-content: center;
}

.image-preview-item {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
}

.image-preview-item:hover {
  transform: scale(1.05);
}

.image-preview img {
  width: 100px;
  height: 100px;
  object-fit: cover;
  display: block;
  border-radius: 8px;
}

.image-preview-remove {
  position: absolute;
  top: -8px;
  right: -8px;
  background: var(--trades-error);
  color: white;
  border: none;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  cursor: pointer;
  font-size: 14px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
}

.image-preview-remove:hover {
  background: #d32f2f;
  transform: scale(1.1);
}

.image-upload-note {
  font-size: 12px;
  color: var(--trades-gray);
  margin-top: 12px;
  font-style: italic;
}

/* Dropdown Styles */
.dropdown-item {
  position: relative;
}

.dropdown-trigger {
  color: var(--trades-secondary);
  cursor: pointer;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
}

.dropdown-trigger:hover {
  color: #1976d2;
  text-decoration: underline;
}

.dropdown-content {
  position: absolute;
  top: 100%;
  right: 0;
  background: white;
  border: 1px solid #e1e5e9;
  border-radius: 8px;
  padding: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  z-index: 1000;
  min-width: 250px;
  max-width: 350px;
  display: none;
}

.dropdown-content div {
  padding: 8px 12px;
  border-bottom: 1px solid #f1f3f4;
  color: var(--trades-gray-dark);
  font-size: 14px;
}

.dropdown-content div:last-child {
  border-bottom: none;
}

.dropdown-content div:hover {
  background-color: var(--trades-gray-light);
}

/* Navigation Styles */
.mepr-nav-item.trades-nav a,
.mepr-nav-item.add-trade-nav a,
.mepr-nav-item.view-likes-nav a,
.mepr-nav-item.view-reviews-nav a {
  transition: all 0.3s ease;
  position: relative;
}

.mepr-nav-item.trades-nav a:before,
.mepr-nav-item.add-trade-nav a:before,
.mepr-nav-item.view-likes-nav a:before,
.mepr-nav-item.view-reviews-nav a:before {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  width: 0;
  height: 2px;
  background-color: var(--trades-primary);
  transition: all 0.3s ease;
  transform: translateX(-50%);
}

.mepr-nav-item.trades-nav a:hover:before,
.mepr-nav-item.add-trade-nav a:hover:before,
.mepr-nav-item.view-likes-nav a:hover:before,
.mepr-nav-item.view-reviews-nav a:hover:before {
  width: 100%;
}

/* Stats Cards Enhancement */
.stat-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* Message Styles */
.supawp-trades-message {
  padding: 16px 20px;
  margin: 16px 0;
  border-radius: 8px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 12px;
}

.supawp-trades-message.success {
  background-color: #e8f5e8;
  color: #2e7d32;
  border-left: 4px solid var(--trades-success);
}

.supawp-trades-message.error {
  background-color: #ffebee;
  color: #c62828;
  border-left: 4px solid var(--trades-error);
}

.supawp-trades-message.warning {
  background-color: #fff3e0;
  color: #ef6c00;
  border-left: 4px solid var(--trades-warning);
}

/* Loading States */
.loading {
  opacity: 0.6;
  pointer-events: none;
  position: relative;
}

.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid var(--trades-primary);
  border-top: 2px solid transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .dashboard-header {
    flex-direction: column;
    align-items: stretch;
  }

  .header-actions {
    margin-top: 16px;
  }

  .btn-add-business {
    width: 100%;
    justify-content: center;
  }

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

  .detail-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .detail-value {
    text-align: left;
  }

  .btn-edit-business {
    width: 100%;
    max-width: 300px;
  }

  .new-trade-form {
    padding: 16px;
  }

  .image-preview {
    justify-content: flex-start;
  }

  .image-preview img {
    width: 80px;
    height: 80px;
  }

  .dropdown-content {
    position: fixed;
    top: auto;
    right: 16px;
    left: 16px;
    max-width: none;
  }
}

/* Accessibility Improvements */
.new-trade-form input:focus,
.new-trade-form textarea:focus,
.new-trade-form select:focus {
  outline: 2px solid var(--trades-primary);
  outline-offset: 2px;
}

.submit-btn:focus {
  outline: 2px solid var(--trades-primary-dark);
  outline-offset: 2px;
}

/* Print Styles */
@media print {
  .supawp-trades-dashboard {
    color: black !important;
  }

  .stat-card {
    box-shadow: none !important;
    border: 1px solid #ccc;
  }

  .dropdown-content {
    display: block !important;
    position: static !important;
    box-shadow: none !important;
    border: 1px solid #ccc;
    margin-top: 8px;
  }
}
