* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: #f8f9fc;
  color: #1f2937;
  line-height: 1.6;
}

/* HEADER */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 5vw;
  background: white;
  border-bottom: 1px solid #e5e7eb;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: #4f46e5;
  letter-spacing: -0.5px;
}

.menu {
  display: flex;
  gap: 2.25rem;
}

.menu a {
  text-decoration: none;
  color: #6b7280;
  font-weight: 500;
  transition: color 0.15s ease;
}

.menu a:hover,
.menu a.active {
  color: #4f46e5;
}

/* BUTTONS & LINK BUTTONS */
.btn,
a.btn {
  padding: 0.65rem 1.4rem;
  border-radius: 0.75rem;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  text-decoration: none;
  display: inline-block;
  text-align: center;
}

.btn.primary,
a.btn.primary {
  background: #6366f1;
  color: white;
}

.btn.primary:hover,
a.btn.primary:hover {
  background: #4f46e5;
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.18);
  transform: translateY(-1px);
}

.btn.ghost {
  background: transparent;
  border: 1px solid #d1d5db;
  color: #4b5563;
}

.btn.ghost:hover {
  background: #f3f4f6;
  border-color: #9ca3af;
}

.btn.small,
a.btn.small {
  padding: 0.65rem 1rem;
  font-size: 0.875rem;
  width: 100%;
  margin-top: 1.25rem;
}

/* TOOLBAR - SEARCH & FILTER */
.toolbar {
  max-width: 1400px;
  margin: 2rem auto 1.5rem;
  padding: 0 5vw;
  display: flex;
  gap: 1rem;
}

.search-input,
.category-select {
  padding: 0.8rem 1.1rem;
  border: 1px solid #d1d5db;
  border-radius: 0.75rem;
  font-size: 1rem;
  background: white;
  transition: all 0.2s ease;
}

.search-input {
  flex: 1;
}

.category-select {
  max-width: 260px;
}

.search-input:focus,
.category-select:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

/* APPS GRID & CARDS */
.apps {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 5vw 3rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.75rem;
}

.card {
  background: white;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0,0,0,0.07);
  transition: all 0.28s ease;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0,0,0,0.12);
}

.card-image img {
  width: 100%;
  height: 186px;
  object-fit: cover;
  display: block;
}

.card-content {
  padding: 1.375rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.25rem;
  font-weight: 600;
  color: #111827;
}

.card p {
  font-size: 0.95rem;
  color: #6b7280;
  margin-bottom: 1.25rem;
  flex: 1;
}

/* PAGINATION */
.pagination {
  display: flex;
  justify-content: center;
  gap: 0.8rem;
  margin: 3rem 0 4rem;
}

.page {
  padding: 0.6rem 1.1rem;
  border: 1px solid #d1d5db;
  border-radius: 0.6rem;
  background: white;
  color: #4b5563;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.page:hover {
  background: #f3f4f6;
  border-color: #9ca3af;
}

.page.active {
  background: #6366f1;
  color: white;
  border-color: #6366f1;
}

/* FOOTER */
.footer {
  text-align: center;
  padding: 2.5rem 1rem;
  color: #9ca3af;
  font-size: 0.95rem;
  border-top: 1px solid #e5e7eb;
  background: white;
}

/* APP GRID STYLES */
.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
  padding: 1rem;
}

.app-card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  transition: all 0.3s ease;
  border: 1px solid #e5e7eb;
}

.app-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.app-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.5rem;
  position: relative;
}

.app-icon {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}

.app-info {
  flex: 1;
  min-width: 0;
}

.app-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: #1f2937;
  margin: 0 0 0.5rem 0;
  line-height: 1.4;
}

.app-description {
  font-size: 0.875rem;
  color: #6b7280;
  line-height: 1.5;
  margin: 0;
}

.pinned-indicator {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 1rem;
}

.app-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 1.5rem 1rem;
}

.app-category {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
}

.app-users {
  font-size: 0.875rem;
  color: #6b7280;
  font-weight: 500;
}

.app-actions {
  padding: 0 1.5rem 1.5rem;
}

.no-results {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem;
  color: #6b7280;
  font-size: 1.125rem;
}

/* =============================
   HOME PAGE STYLES
============================= */

/* HERO SECTION */
.hero {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 4rem 5vw;
  text-align: center;
}

.hero-content h1 {
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 1rem;
  line-height: 1.2;
}

.hero-content p {
  font-size: 1.25rem;
  margin-bottom: 2rem;
  opacity: 0.9;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 4rem;
  margin-top: 3rem;
}

.stat {
  text-align: center;
}

.stat-number {
  display: block;
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.stat-label {
  font-size: 0.875rem;
  opacity: 0.8;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* SECTION HEADERS */
.section-header {
  text-align: center;
  margin-bottom: 3rem;
}

.section-header h2 {
  font-size: 2.5rem;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 1rem;
}

.section-header p {
  font-size: 1.125rem;
  color: #6b7280;
  max-width: 600px;
  margin: 0 auto;
}

/* CATEGORIES SECTION */
.categories-section {
  max-width: 1400px;
  margin: 4rem auto;
  padding: 0 5vw;
}

.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
}

.category-card {
  background: white;
  border-radius: 16px;
  padding: 2rem;
  text-align: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  border: 1px solid #e5e7eb;
  cursor: pointer;
  transition: all 0.3s ease;
}

.category-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.category-icon {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  font-size: 2rem;
}

.category-card h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 0.5rem;
}

.category-card p {
  color: #6b7280;
  font-size: 0.875rem;
}

/* FEATURES SECTION */
.features {
  background: #f9fafb;
  padding: 4rem 5vw;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.feature-card {
  background: white;
  border-radius: 16px;
  padding: 2rem;
  text-align: center;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  border: 1px solid #e5e7eb;
  transition: all 0.3s ease;
}

.feature-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.feature-icon {
  font-size: 3rem;
  margin-bottom: 1.5rem;
}

.feature-card h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 1rem;
}

.feature-card p {
  color: #6b7280;
  line-height: 1.6;
}

/* PRICING SECTION */
.pricing {
  padding: 4rem 5vw;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  max-width: 1000px;
  margin: 0 auto;
}

.pricing-card {
  background: white;
  border-radius: 16px;
  padding: 2.5rem;
  text-align: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  border: 1px solid #e5e7eb;
  position: relative;
  transition: all 0.3s ease;
}

.pricing-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.pricing-card.featured {
  border-color: #6366f1;
  box-shadow: 0 8px 30px rgba(99, 102, 241, 0.2);
}

.badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: #6366f1;
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.pricing-card h3 {
  font-size: 1.5rem;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 1rem;
}

.price {
  font-size: 3rem;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 2rem;
}

.price span {
  font-size: 1rem;
  font-weight: 400;
  color: #6b7280;
}

.pricing-card ul {
  list-style: none;
  padding: 0;
  margin-bottom: 2rem;
}

.pricing-card li {
  padding: 0.75rem 0;
  color: #4b5563;
  position: relative;
}

.pricing-card li:before {
  content: "✓";
  color: #10b981;
  font-weight: 700;
  margin-right: 0.75rem;
}

.btn.secondary {
  background: transparent;
  border: 2px solid #e5e7eb;
  color: #4b5563;
}

.btn.secondary:hover {
  background: #f3f4f6;
  border-color: #d1d5db;
  color: #1f2937;
}

/* FOOTER EXTENDED */
.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-section h4 {
  font-size: 1rem;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 1rem;
}

.footer-section p {
  color: #6b7280;
  line-height: 1.6;
}

.footer-section ul {
  list-style: none;
  padding: 0;
}

.footer-section li {
  margin-bottom: 0.5rem;
}

.footer-section a {
  color: #6b7280;
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-section a:hover {
  color: #6366f1;
}

.footer-bottom {
  border-top: 1px solid #e5e7eb;
  padding-top: 2rem;
  text-align: center;
  color: #9ca3af;
}

/* Category badge colors */
.app-category.ai-tools {
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
}

.app-category.productivity {
  background: linear-gradient(135deg, #10b981, #059669);
}

.app-category.forms {
  background: linear-gradient(135deg, #f59e0b, #d97706);
}

.app-category.analytics {
  background: linear-gradient(135deg, #ef4444, #dc2626);
}

.app-category.communication {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
}

/* RESPONSIVE DESIGN */
@media (max-width: 1023px) {
  .hero-content h1 {
    font-size: 2.5rem;
  }
  
  .hero-stats {
    gap: 2rem;
  }
  
  .stat-number {
    font-size: 2rem;
  }
  
  .categories-grid,
  .features-grid,
  .pricing-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  }
  
  .grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .toolbar {
    flex-direction: column;
  }

  .search-input,
  .category-select {
    width: 100%;
  }
}

@media (max-width: 639px) {
  .hero {
    padding: 3rem 5vw;
  }
  
  .hero-content h1 {
    font-size: 2rem;
  }
  
  .hero-stats {
    flex-direction: column;
    gap: 1.5rem;
  }
  
  .section-header h2 {
    font-size: 2rem;
  }
  
  .categories-grid,
  .features-grid,
  .pricing-grid {
    grid-template-columns: 1fr;
  }
  
  .pricing-card {
    padding: 2rem;
  }
  
  .price {
    font-size: 2.5rem;
  }
  
  .grid {
    grid-template-columns: 1fr;
  }

  .header {
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1.25rem 5vw;
  }

  .menu {
    flex: 1;
    justify-content: center;
    gap: 1.5rem;
  }
}

/* Optional: Hiệu ứng focus cho accessibility */
a:focus,
button:focus,
input:focus,
select:focus {
  outline: 2px solid #6366f1;
  outline-offset: 2px;
}