/* Base Styles */
:root {
  --primary: #6c5ce7;
  --primary-dark: #5649c0;
  --secondary: #00cec9;
  --accent: #fd79a8;
  --dark: #2d3436;
  --light: #f5f6fa;
  --success: #00b894;
  --warning: #fdcb6e;
  --danger: #d63031;
  --radius: 12px;
  --shadow: 0 8px 24px rgba(0,0,0,0.1);
  --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  margin: 0;
  padding: 0;
  background-color: var(--light);
  color: var(--dark);
  line-height: 1.6;
}

.marketplace-container {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  overflow-x: hidden;
}

/* Header Styles */
.marketplace-header {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  padding: 2rem 1rem;
  text-align: center;
  margin-bottom: 2rem;
  position: relative;
  overflow: hidden;
}

.marketplace-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiPjxkZWZzPjxwYXR0ZXJuIGlkPSJwYXR0ZXJuIiB3aWR0aD0iNDAiIGhlaWdodD0iNDAiIHBhdHRlcm5Vbml0cz0idXNlclNwYWNlT25Vc2UiIHBhdHRlcm5UcmFuc2Zvcm09InJvdGF0ZSg0NSkiPjxyZWN0IHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0icmdiYSgyNTUsMjU1LDI1NSwwLjA1KSIvPjwvcGF0dGVybj48L2RlZnM+PHJlY3Qgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgZmlsbD0idXJsKCNwYXR0ZXJuKSIvPjwvc3ZnPg==');
}

.header-content {
  position: relative;
  z-index: 1;
  max-width: 800px;
  margin: 0 auto;
}

.welcome-message {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.welcome-subtext {
  font-size: 1.2rem;
  opacity: 0.9;
  margin-bottom: 1rem;
}

/* Alert Messages */
.alert-message {
  background: var(--success);
  color: white;
  padding: 1rem;
  margin: 0 1rem 1rem;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  animation: slideIn 0.3s ease-out;
  box-shadow: var(--shadow);
}

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

/* Section Styles */
.section-header {
  text-align: center;
  margin-bottom: 2rem;
  padding: 0 1rem;
}

.section-header h2 {
  font-size: 1.8rem;
  margin-bottom: 0.5rem;
  color: var(--dark);
  position: relative;
  display: inline-block;
}

.section-header h2::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 50px;
  height: 3px;
  background: var(--primary);
  border-radius: 3px;
}

.section-header p {
  color: #666;
  font-size: 1rem;
}

/* Categories Scroll */
.stories-container {
  padding: 0 0 2rem;
  margin-bottom: 2rem;
}

.stories-scroll {
  display: flex;
  gap: 1rem;
  padding: 0 1rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding: 0 1rem;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.stories-scroll::-webkit-scrollbar {
  display: none;
}

.story-item {
  scroll-snap-align: start;
  flex: 0 0 80px;
  text-align: center;
  text-decoration: none;
  color: var(--dark);
  transition: var(--transition);
}

.story-item:hover {
  transform: translateY(-5px);
}

.story-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(45deg, var(--primary), var(--secondary));
  padding: 3px;
  margin: 0 auto 0.5rem;
}

.story-avatar-inner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
}

.story-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.story-name {
  font-size: 0.8rem;
  font-weight: 500;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Search Section */
.search-section {
  background: white;
  padding: 2rem 1rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow);
}

.search-form {
  max-width: 600px;
  margin: 0 auto;
}

.search-wrapper {
  position: relative;
  display: flex;
  border-radius: 50px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.search-icon {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  color: #999;
}

.search-input {
  flex: 1;
  padding: 1rem 1rem 1rem 3rem;
  border: none;
  font-size: 1rem;
  outline: none;
}

.search-button {
  background: var(--primary);
  color: white;
  border: none;
  padding: 0 1.5rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

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

.search-tips {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: #666;
  text-align: center;
}

.search-tips em {
  font-style: normal;
  color: var(--primary);
  font-weight: 500;
}

/* Items Grid */
.items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1rem;
  padding: 0 1rem;
  margin-bottom: 2rem;
}

.item-card {
  background: white;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
  text-decoration: none;
  color: inherit;
  position: relative;
  display: flex;
  flex-direction: column;
}

.item-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 24px rgba(0,0,0,0.15);
}

.item-media-container {
  position: relative;
  padding-top: 100%;
  background: #f8f9fa;
}

.item-media {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.item-image, .item-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.item-video {
  background: black;
}

.media-indicator {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0,0,0,0.5);
  color: white;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
}

.unsupported-media {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8f9fa;
  color: #999;
  font-size: 2rem;
}

.item-info {
  padding: 1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.item-title {
  font-size: 1rem;
  margin: 0 0 0.5rem;
  font-weight: 600;
}

.price-badge {
  background: var(--primary);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 50px;
  font-weight: 700;
  font-size: 0.9rem;
  display: inline-block;
  margin-bottom: 0.5rem;
  align-self: flex-start;
}

.item-description {
  font-size: 0.85rem;
  color: #666;
  margin: 0 0 0.5rem;
  flex: 1;
}

.shop-info {
  display: flex;
  align-items: center;
  font-size: 0.8rem;
  color: #666;
  margin-top: auto;
}

.shop-info i {
  margin-right: 0.25rem;
  color: var(--primary);
}

.item-actions {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  opacity: 0;
  transition: var(--transition);
}

.item-card:hover .item-actions {
  opacity: 1;
}

.action-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: white;
  border: none;
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transition: var(--transition);
}

.action-btn:hover {
  background: var(--primary);
  color: white;
  transform: scale(1.1);
}

/* Empty State */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem 1rem;
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.empty-icon {
  font-size: 3rem;
  color: var(--primary);
  margin-bottom: 1rem;
}

.empty-title {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.empty-message {
  color: #666;
  margin-bottom: 2rem;
}

/* Request CTA */
.request-cta {
  background: linear-gradient(135deg, #f5f7fa 0%, #e4e8eb 100%);
  padding: 2rem;
  border-radius: var(--radius);
  margin-top: 2rem;
  text-align: center;
}

.request-cta h4 {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}

.request-cta p {
  color: #666;
  margin-bottom: 1.5rem;
}

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

.benefit {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.benefit i {
  font-size: 1.5rem;
  color: var(--primary);
  background: white;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.cta-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--primary);
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 600;
  transition: var(--transition);
  border: none;
  cursor: pointer;
}

.cta-button:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(108, 92, 231, 0.3);
}

.request-button {
  font-size: 1rem;
  padding: 1rem 2rem;
}

.cta-button.outline {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}

.cta-button.outline:hover {
  background: var(--primary);
  color: white;
}

.auth-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 1rem;
}

/* CTA Section */
.cta-section {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  padding: 0 1rem;
  margin-bottom: 2rem;
}

.cta-card {
  background: white;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: var(--transition);
}

.cta-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 24px rgba(0,0,0,0.15);
}

.request-feature {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
}

.request-feature .cta-content {
  max-width: 600px;
}

.cta-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  color: white;
}

.request-feature .cta-icon {
  background: rgba(255,255,255,0.2);
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cta-title {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.cta-message {
  margin-bottom: 1.5rem;
}

.request-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
  width: 100%;
}

.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.step-number {
  background: white;
  color: var(--primary);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.request-feature .step p {
  margin: 0;
  font-size: 0.9rem;
  opacity: 0.9;
}

.cta-card.secondary {
  background: white;
  color: var(--dark);
  flex-direction: row;
  text-align: left;
  align-items: center;
  gap: 1.5rem;
}

.cta-card.secondary .cta-icon {
  color: var(--primary);
  font-size: 2rem;
  margin-bottom: 0;
  flex: 0 0 60px;
  height: 60px;
  background: rgba(108, 92, 231, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Footer */
.marketplace-footer {
  background: var(--dark);
  color: white;
  padding: 3rem 1rem 1rem;
  margin-top: 3rem;
}

.footer-content {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.footer-brand h3 {
  font-size: 1.8rem;
  margin-bottom: 0.5rem;
}

.footer-brand p {
  opacity: 0.7;
}

.footer-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 2rem;
}

.link-group h4 {
  font-size: 1.1rem;
  margin-bottom: 1rem;
  position: relative;
}

.link-group h4::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 30px;
  height: 2px;
  background: var(--primary);
}

.footer-link {
  display: block;
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  margin-bottom: 0.5rem;
  transition: var(--transition);
}

.footer-link:hover {
  color: white;
  transform: translateX(5px);
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 1.5rem;
  margin-top: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  text-align: center;
}

.social-links {
  display: flex;
  gap: 1rem;
}

.social-link {
  color: white;
  font-size: 1.2rem;
  opacity: 0.7;
  transition: var(--transition);
}

.social-link:hover {
  opacity: 1;
  transform: translateY(-2px);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .welcome-message {
      font-size: 2rem;
  }
  
  .welcome-subtext {
      font-size: 1rem;
  }
  
  .items-grid {
      grid-template-columns: repeat(2, 1fr);
      gap: 0.5rem;
      padding: 0;
  }
  
  .item-card {
      border-radius: 0;
      box-shadow: none;
      border-bottom: 1px solid #eee;
  }
  
  .item-media-container {
      padding-top: 100%;
  }
  
  .item-info {
      padding: 0.75rem;
  }
  
  .price-badge {
      font-size: 0.8rem;
      padding: 0.2rem 0.6rem;
  }
  
  .cta-section {
      padding: 0;
  }
  
  .cta-card {
      border-radius: 0;
  }
  
  .cta-card.secondary {
      flex-direction: column;
      text-align: center;
  }
  
  .auth-buttons {
      flex-direction: column;
      gap: 0.5rem;
  }
}

@media (min-width: 992px) {
  .cta-section {
      grid-template-columns: 2fr 1fr;
  }
  
  .footer-content {
      grid-template-columns: 1fr 2fr;
  }
  
  .footer-bottom {
      flex-direction: row;
      justify-content: space-between;
  }
}

/* Animation Classes */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.floating {
  animation: float 3s ease-in-out infinite;
}

/* Tooltip Styles */
.tooltip {
  position: absolute;
  background: var(--dark);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  font-size: 0.8rem;
  z-index: 100;
  pointer-events: none;
  white-space: nowrap;
}

.tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 5px;
  border-style: solid;
  border-color: var(--dark) transparent transparent transparent;
}