/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary-color: #3b82f6;
  --primary-dark: #2563eb;
  --secondary-color: #64748b;
  --success-color: #10b981;
  --danger-color: #ef4444;
  --warning-color: #f59e0b;
  --bg-color: #0f172a;
  --card-bg: #1e293b;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --border-color: #334155;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.5);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-primary);
  line-height: 1.6;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Navigation */
.navbar {
  background: var(--card-bg);
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary-color);
}

.logo img {
  height: 40px;
  width: auto;
}

.logo-text {
  font-size: 1.5rem;
  font-weight: 700;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-secondary);
  font-weight: 500;
  transition: color 0.2s;
}

.nav-links a:hover {
  color: var(--primary-color);
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 1rem;
}

#user-email {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Buttons */
.btn {
  padding: 0.625rem 1.25rem;
  border: none;
  border-radius: 6px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  display: inline-block;
  font-size: 0.9rem;
}

.btn-primary {
  background: var(--primary-color);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.btn-secondary {
  background: var(--secondary-color);
  color: white;
}

.btn-secondary:hover {
  background: #475569;
}

.btn-large {
  padding: 0.875rem 2rem;
  font-size: 1rem;
}

.btn-success {
  background: var(--success-color);
  color: white;
}

.btn-danger {
  background: var(--danger-color);
  color: white;
}

/* Hero Section */
.hero {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  border-bottom: 1px solid var(--border-color);
  color: white;
  padding: 4rem 0;
  text-align: center;
}

.hero h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
  font-weight: 800;
}

.hero-subtitle {
  font-size: 1.25rem;
  margin-bottom: 2rem;
  opacity: 0.9;
}

.hero-search {
  max-width: 600px;
  margin: 0 auto 3rem;
  display: flex;
  gap: 0.5rem;
}

.hero-search input {
  flex: 1;
  padding: 0.875rem 1.25rem;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  max-width: 800px;
  margin: 0 auto;
}

.stat {
  display: flex;
  flex-direction: column;
}

.stat-number {
  font-size: 2.5rem;
  font-weight: 700;
}

.stat-label {
  opacity: 0.9;
  font-size: 0.9rem;
}

/* Sections */
section {
  padding: 4rem 0;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.section-header h2 {
  font-size: 2rem;
  font-weight: 700;
}

.filters {
  display: flex;
  gap: 1rem;
}

.filters select,
.filters input {
  padding: 0.625rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 0.9rem;
}

/* Plugin Grid */
.plugin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.plugin-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
  transition: all 0.3s;
  cursor: pointer;
}

.plugin-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.plugin-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 3rem;
}

.plugin-content {
  padding: 1.25rem;
}

.plugin-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  margin-bottom: 0.75rem;
}

.plugin-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.plugin-price {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary-color);
  white-space: nowrap;
}

.plugin-description {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.plugin-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.plugin-rating {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.plugin-downloads {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.plugin-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.tag {
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.3);
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  font-size: 0.75rem;
  color: #60a5fa;
}

/* Creators Section */
.creators-section {
  background: #1a2332;
}

.creators-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
}

.creator-feature {
  text-align: center;
}

.feature-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.creator-feature h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.creator-feature p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.cta-box {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  color: white;
  padding: 3rem;
  border-radius: 12px;
  text-align: center;
  box-shadow: var(--shadow-lg);
}

.cta-box h3 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.cta-box p {
  font-size: 1.125rem;
  margin-bottom: 2rem;
  opacity: 0.9;
}

/* Footer */
.footer {
  background: #0a0f1a;
  border-top: 1px solid var(--border-color);
  color: white;
  padding: 3rem 0 1rem;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-section h4 {
  margin-bottom: 1rem;
}

.footer-section a {
  display: block;
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  margin-bottom: 0.5rem;
  transition: color 0.2s;
}

.footer-section a:hover {
  color: white;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 1rem;
  text-align: center;
  color: rgba(255, 255, 255, 0.7);
}

/* Modals */
.modal {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  animation: fadeIn 0.2s;
  overflow-y: auto;
  padding: 2rem 0;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content {
  background-color: var(--card-bg);
  margin: 0 auto;
  padding: 2rem;
  border-radius: 12px;
  max-width: 500px;
  position: relative;
  animation: slideIn 0.3s;
  max-height: none;
}

@keyframes slideIn {
  from {
    transform: translateY(-50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-large {
  max-width: 900px;
}

.close {
  position: absolute;
  right: 1.5rem;
  top: 1.5rem;
  font-size: 2rem;
  font-weight: 300;
  color: var(--text-secondary);
  cursor: pointer;
  transition: color 0.2s;
}

.close:hover {
  color: var(--text-primary);
}

.modal h2 {
  margin-bottom: 1.5rem;
}

.modal form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.modal input,
.modal textarea,
.modal select {
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 1rem;
  font-family: inherit;
}

.modal textarea {
  min-height: 100px;
  resize: vertical;
}

.modal-note {
  margin-top: 1rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-align: center;
}

.benefits-list {
  margin: 1.5rem 0;
  list-style: none;
}

.benefits-list li {
  padding: 0.5rem 0;
  font-size: 1rem;
}

/* Plugin Detail */
.plugin-detail-header {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 2rem;
  margin-bottom: 2rem;
}

.plugin-detail-images {
  display: grid;
  gap: 1rem;
}

.plugin-detail-main-image {
  width: 100%;
  height: 400px;
  object-fit: cover;
  border-radius: 8px;
  background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 4rem;
}

.plugin-detail-thumbnails {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 0.5rem;
  margin-top: 1rem;
}

.plugin-thumbnail {
  width: 100%;
  height: 80px;
  object-fit: cover;
  border-radius: 4px;
  cursor: pointer;
  border: 2px solid var(--border-color);
  transition: all 0.2s;
  opacity: 0.7;
}

.plugin-thumbnail:hover {
  opacity: 1;
  border-color: var(--primary-color);
}

.plugin-thumbnail.active {
  border-color: var(--primary-color);
  opacity: 1;
  box-shadow: 0 0 0 1px var(--primary-color);
}

.plugin-detail-sidebar {
  background: #0f172a;
  border: 1px solid var(--border-color);
  padding: 1.5rem;
  border-radius: 8px;
  height: fit-content;
  position: sticky;
  top: 100px;
}

.plugin-detail-price {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 1rem;
}

.plugin-detail-info {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}

.plugin-detail-info-item {
  display: flex;
  justify-content: space-between;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.plugin-detail-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.plugin-detail-content h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.plugin-detail-content p {
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 1.5rem;
}

.reviews-section {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
}

.review-form {
  background: #0f172a;
  border: 1px solid var(--border-color);
  padding: 1.5rem;
  border-radius: 8px;
  margin-bottom: 2rem;
}

.review-card {
  background: #0f172a;
  border: 1px solid var(--border-color);
  padding: 1.5rem;
  border-radius: 8px;
  margin-bottom: 1rem;
}

.review-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.review-author {
  font-weight: 600;
}

.review-date {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.review-text {
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Loading & Empty States */
.loading {
  text-align: center;
  padding: 3rem;
  color: var(--text-secondary);
}

#no-results {
  text-align: center;
  padding: 3rem;
  color: var(--text-secondary);
}

/* Responsive */
@media (max-width: 768px) {
  .hero h1 {
    font-size: 2rem;
  }

  .hero-subtitle {
    font-size: 1rem;
  }

  .hero-search {
    flex-direction: column;
  }

  .section-header {
    flex-direction: column;
    align-items: start;
    gap: 1rem;
  }

  .filters {
    width: 100%;
    flex-direction: column;
  }

  .filters select,
  .filters input {
    width: 100%;
  }

  .plugin-detail-header {
    grid-template-columns: 1fr;
  }

  .plugin-detail-sidebar {
    position: static;
  }

  .nav-links {
    display: none;
  }
}

/* Gallery Modal */
.gallery-modal {
  background-color: rgba(0, 0, 0, 0.95);
}

.gallery-content {
  position: relative;
  width: 90%;
  max-width: 1200px;
  height: 90vh;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 2rem;
}

.gallery-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 3rem;
  color: #fff;
  cursor: pointer;
  z-index: 10;
  background: rgba(0, 0, 0, 0.5);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.gallery-close:hover {
  background: rgba(0, 0, 0, 0.8);
}

#gallery-image {
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  border: none;
  font-size: 3rem;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.gallery-nav:hover {
  background: rgba(0, 0, 0, 0.8);
  transform: translateY(-50%) scale(1.1);
}

.gallery-prev {
  left: 1rem;
}

.gallery-next {
  right: 1rem;
}

.gallery-counter {
  color: #fff;
  font-size: 1.2rem;
  margin-top: 1rem;
  background: rgba(0, 0, 0, 0.5);
  padding: 0.5rem 1rem;
  border-radius: 20px;
}

.gallery-thumbnails {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
  max-width: 100%;
  overflow-x: auto;
  padding: 0.5rem;
}

.gallery-thumbnails img {
  width: 80px;
  height: 60px;
  object-fit: cover;
  border-radius: 4px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s;
  opacity: 0.6;
}

.gallery-thumbnails img:hover {
  opacity: 1;
  border-color: var(--primary-color);
}

.gallery-thumbnails img.active {
  opacity: 1;
  border-color: var(--primary-color);
  box-shadow: 0 0 10px var(--primary-color);
}
