/* XAPYX Color Scheme */
:root {
  --primary: var(--primary-color);
  --primary-dark: #d98a20;
  --primary-light: #f8d8a0;
  --background: #fff9f0;
  --white: #ffffff;
  --text-dark: #222222;
  --text-light: #555555;
  --border: #e0e0e0;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  --shadow-hover: 0 4px 12px rgba(243, 167, 44, 0.15);
  --border-radius: 8px;
  --transition: all 0.3s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: var(--background);
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  color: var(--text-dark);
  line-height: 1.5;
  font-size: 14px;
}

/* Header - Fixed for Mobile */
.main-header {
  background: var(--white);
  border-bottom: 2px solid var(--primary);
  box-shadow: var(--shadow);
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1000;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  max-width: 1200px;
  margin: 0 auto;
}

.logo-text {
  font-size: 1.4rem;
  font-weight: bold;
  color: var(--primary);
  letter-spacing: 1px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  color: var(--text-dark);
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 6px;
  transition: var(--transition);
  font-size: 14px;
}

.nav-link:hover {
  background: var(--primary-light);
  color: var(--primary-dark);
}

/* Main Container */
.main-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 80px 20px 30px;
}

/* Main Sections */
.main-section {
  background: var(--white);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  margin-bottom: 24px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.section-header {
  background: var(--primary);
  color: var(--white);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--primary-dark);
}

.section-header h2 {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 0;
}

.section-header i {
  font-size: 1rem;
}

.live-dot {
  width: 6px;
  height: 6px;
  background: #48bb78;
  border-radius: 50%;
  animation: pulse 2s infinite;
  margin-left: auto;
}

@keyframes pulse {
  0% { opacity: 1; }
  50% { opacity: 0.5; }
  100% { opacity: 1; }
}

.section-content {
  padding: 20px;
}

.section-action {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* Shouts Section */
.shouts-container {
  max-height: 300px;
  overflow-y: auto;
  padding-right: 12px;
}

.shouts-container::-webkit-scrollbar {
  width: 4px;
}

.shouts-container::-webkit-scrollbar-track {
  background: var(--background);
  border-radius: 2px;
}

.shouts-container::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 2px;
}

.shout-item {
  display: flex;
  gap: 12px;
  padding: 12px;
  background: var(--background);
  border-radius: 6px;
  margin-bottom: 12px;
  transition: var(--transition);
  border: 1px solid var(--border);
}

.shout-item:hover {
  border-color: var(--primary);
  transform: translateX(3px);
}

.shout-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  border: 2px solid var(--primary);
}

.shout-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.shout-content {
  flex: 1;
}

.shout-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.shout-user {
  font-weight: 600;
  color: var(--text-dark);
  font-size: 13px;
}

.shout-time {
  font-size: 11px;
  color: var(--text-light);
}

.shout-message {
  color: var(--text-dark);
  margin: 0;
  line-height: 1.4;
  font-size: 13px;
}

/* Products Grid */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.product-card {
  text-decoration: none;
  color: inherit;
  display: block;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  transition: var(--transition);
  box-shadow: var(--shadow);
}

.product-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
  border-color: var(--primary);
  text-decoration: none;
  color: inherit;
}

.product-image {
  position: relative;
  height: 140px;
  overflow: hidden;
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition);
}

.product-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(243, 167, 44, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: var(--transition);
}

.product-card:hover .product-overlay {
  opacity: 1;
}

.product-card:hover .product-image img {
  transform: scale(1.05);
}

.view-text {
  color: var(--white);
  font-weight: 600;
  font-size: 12px;
}

.product-info {
  padding: 12px;
}

.product-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.2rem;
}

.product-details {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.product-price {
  color: var(--primary);
  font-weight: 700;
  font-size: 13px;
}

.product-location {
  color: var(--text-light);
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 2px;
}

.product-category {
  background: var(--primary-light);
  color: var(--primary-dark);
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  display: inline-block;
}

/* Join Section - Compact Mobile Design */
.join-content {
  padding: 16px;
  text-align: left;
}

.join-icon {
  width: 50px;
  height: 50px;
  background: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 0 16px 0;
  font-size: 1.2rem;
  color: var(--white);
}

.join-content h3 {
  font-size: 1.3rem;
  color: var(--text-dark);
  margin-bottom: 12px;
  font-weight: 600;
  text-align: left;
}

.join-text {
  color: var(--text-light);
  font-size: 13px;
  margin-bottom: 20px;
  max-width: 100%;
  text-align: left;
  margin-left: 0;
  margin-right: 0;
}

.join-features {
  display: ruby-text;
  justify-content: flex-start;
  gap: 20px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.feature {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-dark);
  font-weight: 500;
  font-size: 13px;
}

.feature i {
  color: var(--primary);
  font-size: 14px;
}

.join-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-start;
  flex-wrap: wrap;
}

.user-welcome {
  text-align: left;
}

.user-welcome p {
  color: var(--text-light);
  margin-bottom: 12px;
  font-size: 13px;
}

/* Buttons */
.btn {
  border-radius: 6px;
  padding: 8px 16px;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
  border: 2px solid transparent;
  text-align: center;
  justify-content: center;
  font-size: 13px;
}

.btn-primary {
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary);
}

.btn-primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-hover);
  color: var(--white);
}

.btn-outline-primary {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}

.btn-outline-primary:hover {
  background: var(--primary);
  color: var(--white);
  transform: translateY(-1px);
  box-shadow: var(--shadow-hover);
}

.w-100 {
  width: 100% !important;
}

/* Empty States */
.empty-state {
  text-align: left;
  padding: 30px 20px;
  color: var(--text-light);
}

.empty-state i {
  font-size: 2rem;
  margin-bottom: 12px;
  color: var(--border);
}

.empty-state p {
  margin-bottom: 16px;
  font-size: 13px;
}

/* Footer */
.main-footer {
  background: var(--white);
  border-top: 1px solid var(--border);
  padding: 20px 0;
  text-align: center;
  color: var(--text-light);
  margin-top: 24px;
  font-size: 13px;
}

/* Responsive Design - COMPACT MOBILE JOIN SECTION */
@media (max-width: 768px) {
  .main-container {
    padding: 70px 15px 20px;
  }
  
  .section-header {
    padding: 10px 16px;
    flex-direction: row;
    text-align: left;
    gap: 8px;
  }
  
  .section-content {
    padding: 16px;
  }
  
  .products-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  /* Compact Join Section for Mobile */
  .join-section .section-content {
    padding: 12px 16px; /* Reduced padding */
  }
  
  .join-icon {
    width: 40px; /* Smaller icon */
    height: 40px;
    font-size: 1rem;
    margin-bottom: 12px;
  }
  
  .join-content h3 {
    font-size: 1.1rem; /* Smaller heading */
    margin-bottom: 8px;
  }
  
  .join-text {
    font-size: 12px; /* Smaller text */
    margin-bottom: 16px;
    line-height: 1.4;
  }
  
  .join-features {
    gap: 12px;
    margin-bottom: 16px;
    justify-content: flex-start;
  }
  
  .feature {
    font-size: 12px; /* Smaller feature text */
  }
  
  .feature i {
    font-size: 12px;
  }
  
  .join-actions {
    gap: 8px;
    flex-direction: column;
    align-items: flex-start;
  }
  
  .btn {
    width: 100%;
    max-width: 200px;
    padding: 6px 12px; /* Smaller buttons */
    font-size: 12px;
  }
  
  .user-welcome p {
    font-size: 12px;
    margin-bottom: 8px;
  }
  
  .shout-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }
  
  /* Fix header layout on mobile */
  .header-content {
    flex-direction: row;
    padding: 10px 15px;
    text-align: left;
  }
  
  .logo-text {
    font-size: 1.3rem;
  }
  
  .nav-link {
    font-size: 13px;
    padding: 5px 10px;
  }
}

@media (max-width: 480px) {
  /* Keep header horizontal on very small screens */
  .header-content {
    flex-direction: row;
    gap: 0;
    text-align: left;
  }
  
  .section-header {
    flex-direction: row;
    gap: 6px;
    text-align: left;
  }
  
  .live-dot {
    margin-left: auto;
  }
  
  /* Ultra-compact join section for very small screens */
  .join-section .section-content {
    padding: 10px 12px; /* Even more compact */
  }
  
  .join-icon {
    width: 35px;
    height: 35px;
    font-size: 0.9rem;
    margin-bottom: 8px;
  }
  
  .join-content h3 {
    font-size: 1.5rem;
    margin-bottom: 6px;
  }
  
  .join-text {
    font-size: 14px;
    margin-bottom: 12px;
  }
  
  .join-features {
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
    margin-bottom: 12px;
  }
  
  .feature {
    font-size: 11px;
  }
  
  .join-actions {
    gap: 6px;
  }
  
  .btn {
    padding: 5px 10px;
    font-size: 11px;
  }
  
  /* Ensure proper spacing on very small screens */
  .main-container {
    padding: 60px 10px 15px;
  }
  
  .section-content {
    padding: 12px;
  }
  
  .product-image {
    height: 120px;
  }
}

/* Extra small devices (phones under 360px) */
@media (max-width: 360px) {
  .join-section .section-content {
    padding: 8px 10px; /* Minimal padding */
  }
  
  .join-icon {
    width: 30px;
    height: 30px;
    font-size: 0.8rem;
    margin-bottom: 6px;
  }
  
  .join-content h3 {
    font-size: 0.9rem;
  }
  
  .join-text {
    font-size: 14px;
    margin-bottom: 10px;
  }
  
  .join-features {
    margin-bottom: 10px;
  }
  
  .feature {
    font-size: 10px;
  }
}