/**
 * Browse Page Styles
 */

/* Override workspace layout for browse page */
html, body {
  width: 100%;
  height: auto;
  overflow: visible;
}

body.ready {
  opacity: 1;
}

main {
  margin-top: 0;
}

.browse-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 40px 20px;
  padding-top: calc(40px + var(--topbar-height, 60px));
}

.section-header {
  margin-bottom: 40px;
  text-align: center;
  cursor: default;
}

.section-header h1,
.section-header h2 {
  font-size: 2.5rem;
  color: var(--text);
  margin: 0 0 10px;
  font-weight: 600;
}

.section-header p {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin: 0;
}

/* THEMES GRID */
.themes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
  margin-bottom: 80px;
}

/* THEME CARD */
.theme-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.theme-card:hover {
  background: var(--surface-hover);
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 120, 212, 0.15);
}

.theme-card-image {
  width: 100%;
  height: 200px;
  overflow: hidden;
  background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.theme-card:hover .theme-card-image img {
  transform: scale(1.05);
}

.theme-card-content {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.theme-card-name {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.theme-card-creator {
  font-size: 0.9rem;
  color: var(--accent);
  margin: 0 0 10px;
  font-weight: 500;
}

.theme-card-description {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin: 0 0 15px;
  flex-grow: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.theme-card-dates {
  display: flex;
  gap: 20px;
  margin-bottom: 15px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--border);
}

.date-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.date-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.date-value {
  font-size: 0.9rem;
  color: var(--text);
}

.theme-download-btn {
  width: 100%;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.theme-download-btn svg {
  width: 18px;
  height: 18px;
}

.no-themes,
.error-message {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
  font-size: 1.1rem;
}

.error-message {
  color: #ff6b6b;
}

/* SUBMISSION SECTION */
.submission-section, .section-header {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 50px;
  margin-bottom: 40px;
}

.submission-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
}

.submission-steps {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.step {
  display: flex;
  gap: 20px;
}

.step-number {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: var(--bg);
  border-radius: 50%;
  font-weight: 700;
  font-size: 1.2rem;
}

.step-content h3 {
  margin: 0 0 10px;
  color: var(--text);
  font-size: 1.1rem;
}

.step-content p {
  margin: 0 0 10px;
  color: var(--text-secondary);
}

.step-content ul,
.step-content ol {
  margin: 10px 0 0;
  padding-left: 20px;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.step-content li {
  margin-bottom: 8px;
  line-height: 1.5;
}

.step-content strong {
  color: var(--text);
}

.submission-button {
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-large {
  padding: 16px 32px;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 12px;
  width: fit-content;
  text-decoration: none;
}

.btn-large svg {
  width: 24px;
  height: 24px;
}

/* SEARCH BAR */
.search-container {
  position: relative;
  margin-bottom: 30px;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
}

.search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-secondary);
  pointer-events: none;
  flex-shrink: 0;
}

.search-input {
  width: 100%;
  padding: 12px 16px 12px 44px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-secondary);
  color: var(--text);
  font-size: 14px;
  font-family: var(--font-body);
  transition: all 0.2s ease;
}

.search-input::placeholder {
  color: var(--text-tertiary);
}

.search-input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--bg);
  box-shadow: 0 0 0 3px rgba(0, 120, 212, 0.1);
}

.theme-card.hidden {
  display: none;
}

/* RESPONSIVE DESIGN */
@media (max-width: 1024px) {
  .submission-content {
    grid-template-columns: 1fr;
  }

  .section-header h1,
  .section-header h2 {
    font-size: 2rem;
  }
}

@media (max-width: 768px) {
  .browse-container {
    padding: 20px 16px;
  }

  .themes-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
  }

  .section-header h1,
  .section-header h2 {
    font-size: 1.8rem;
  }

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

  .submission-section {
    padding: 30px 20px;
  }

  .submission-steps {
    gap: 20px;
  }

  .step {
    gap: 16px;
  }

  .step-number {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }

  .submission-button {
    margin-top: 20px;
  }
}

@media (max-width: 480px) {
  .browse-container {
    padding: 16px 12px;
  }

  .themes-grid {
    grid-template-columns: 1fr;
  }

  .theme-card-image {
    height: 160px;
  }

  .section-header h1,
  .section-header h2 {
    font-size: 1.5rem;
  }

  .submission-section {
    padding: 20px 16px;
  }

  .step-content h3 {
    font-size: 1rem;
  }

  .step-content ul,
  .step-content ol {
    font-size: 0.9rem;
  }

  .btn-large {
    padding: 12px 24px;
    font-size: 0.95rem;
  }
}
