/* Base & Reset */
:root {
  --primary-color: #FF5700;
  --secondary-color: #0079D3;
  --dark-bg: #1A1A1B;
  --light-bg: #272729;
  --lighter-bg: #343536;
  --card-bg: #1A1A1B;
  --text-color: #D7DADC;
  --text-muted: #818384;
  --upvote: #FF8b60;
  --downvote: #9494FF;
  --border-radius: 4px;
  --transition: all 0.2s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--dark-bg);
  color: var(--text-color);
  line-height: 1.5;
  overflow-x: hidden;
}

.container {
  width: 92%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 500;
  margin-bottom: 1rem;
}

h1 {
  font-size: 2.5rem;
  line-height: 1.2;
  margin-bottom: 1.5rem;
  font-weight: 600;
}

h2 {
  font-size: 1.8rem;
  margin-bottom: 1.5rem;
  font-weight: 600;
}

h3 {
  font-size: 1.3rem;
  font-weight: 500;
}

p {
  margin-bottom: 1rem;
}

.highlight {
  color: var(--primary-color);
}

/* Header & Navigation */
header {
  position: sticky;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  background-color: var(--light-bg);
  padding: 0.8rem 0;
  box-shadow: 0 1px 5px rgba(0,0,0,0.3);
}

.logo-svg {
  height: 36px;
  width: auto;
}

header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

nav ul {
  display: flex;
  gap: 1.5rem;
  list-style: none;
}

nav ul li a {
  color: var(--text-color);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition);
  font-size: 0.95rem;
  padding: 0.5rem 0;
  position: relative;
}

nav ul li a:hover {
  color: var(--primary-color);
}

nav ul li a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--primary-color);
  transition: var(--transition);
}

nav ul li a:hover::after {
  width: 100%;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-color);
  font-size: 1.5rem;
  cursor: pointer;
  z-index: 101;
  width: 30px;
  height: 24px;
  position: relative;
}

.menu-toggle span {
  display: block;
  position: absolute;
  height: 2px;
  width: 100%;
  background: var(--text-color);
  border-radius: 2px;
  opacity: 1;
  left: 0;
  transform: rotate(0deg);
  transition: var(--transition);
}

.menu-toggle span:nth-child(1) {
  top: 0px;
}

.menu-toggle span:nth-child(2) {
  top: 10px;
}

.menu-toggle span:nth-child(3) {
  top: 20px;
}

.menu-toggle.active span:nth-child(1) {
  top: 10px;
  transform: rotate(135deg);
}

.menu-toggle.active span:nth-child(2) {
  opacity: 0;
  left: -60px;
}

.menu-toggle.active span:nth-child(3) {
  top: 10px;
  transform: rotate(-135deg);
}

/* Hero Section */
.hero {
  padding: 80px 0 60px;
  background-color: var(--light-bg);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    radial-gradient(circle at 20% 30%, rgba(255, 87, 0, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(0, 121, 211, 0.15) 0%, transparent 50%);
  opacity: 0.8;
  z-index: 0;
}

.hero .container {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  gap: 2rem;
}

.vote-arrows {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 1rem;
}

.upvote, .downvote {
  width: 30px;
  height: 30px;
  cursor: pointer;
  transition: var(--transition);
}

.upvote {
  color: var(--text-muted);
}

.upvote:hover {
  color: var(--upvote);
}

.downvote {
  color: var(--text-muted);
  transform: rotate(180deg);
}

.downvote:hover {
  color: var(--downvote);
}

.vote-count {
  margin: 0.5rem 0;
  font-weight: 600;
  font-size: 1.1rem;
}

.hero-content {
  flex: 1;
}

.cta-wrapper {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
}

.cta-button {
  display: inline-block;
  padding: 10px 20px;
  border-radius: var(--border-radius);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  transition: var(--transition);
  text-align: center;
}

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

.cta-button.primary:hover {
  background-color: #E74E1A;
  transform: translateY(-2px);
}

.cta-button.secondary {
  background-color: var(--light-bg);
  color: var(--text-color);
  border: 1px solid var(--lighter-bg);
}

.cta-button.secondary:hover {
  background-color: var(--lighter-bg);
  transform: translateY(-2px);
}

.cta-button.full {
  display: block;
  width: 100%;
  padding: 12px;
  margin-top: 1rem;
}

/* Trending Section */
.trending-section {
  padding: 60px 0;
  background-color: var(--dark-bg);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.sort-options {
  display: flex;
  gap: 1rem;
}

.sort-options span {
  font-size: 0.9rem;
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  cursor: pointer;
  transition: var(--transition);
}

.sort-options .sort-active {
  background-color: var(--lighter-bg);
  font-weight: 600;
}

.sort-options span:hover:not(.sort-active) {
  background-color: var(--light-bg);
}

.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.post-card {
  background-color: var(--light-bg);
  border-radius: var(--border-radius);
  overflow: hidden;
  transition: var(--transition);
  display: flex;
  border: 1px solid var(--lighter-bg);
}

.post-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.post-votes {
  padding: 0.8rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  background-color: rgba(0,0,0,0.03);
}

.vote-icon {
  width: 20px;
  height: 20px;
  color: var(--upvote);
}

.post-votes span {
  margin-top: 0.3rem;
  font-weight: 600;
  font-size: 0.85rem;
}

.post-content {
  padding: 1rem;
  flex: 1;
}

.post-content h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.post-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.community {
  color: var(--secondary-color);
  font-weight: 500;
}

.preview-svg {
  width: 100%;
  height: auto;
  border-radius: var(--border-radius);
}

/* Communities Section */
.communities-section {
  padding: 60px 0;
  background-color: var(--light-bg);
}

.communities-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin: 3rem 0;
}

.community-card {
  display: flex;
  align-items: center;
  background-color: var(--dark-bg);
  padding: 1.5rem;
  border-radius: var(--border-radius);
  transition: var(--transition);
}

.community-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.community-icon {
  width: 50px;
  height: 50px;
  margin-right: 1rem;
  flex-shrink: 0;
}

.community-info {
  flex: 1;
}

.community-info h3 {
  margin-bottom: 0.3rem;
  font-size: 1.1rem;
}

.community-info p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.8rem;
}

.community-tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.community-tags span {
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  background-color: var(--lighter-bg);
  border-radius: 999px;
  color: var(--text-muted);
}

.community-join {
  text-align: center;
  margin-top: 3rem;
}

.community-join p {
  margin-bottom: 1.5rem;
  font-size: 1.1rem;
}

/* Generate Section */
.generate-section {
  padding: 80px 0;
  background-color: var(--dark-bg);
  position: relative;
  overflow: hidden;
}

.generate-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    linear-gradient(135deg, rgba(255, 87, 0, 0.05) 0%, rgba(0, 0, 0, 0) 50%),
    linear-gradient(45deg, rgba(0, 121, 211, 0.05) 0%, rgba(0, 0, 0, 0) 50%);
  z-index: 0;
}

.generate-form {
  max-width: 700px;
  margin: 3rem auto 0;
  background-color: var(--light-bg);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  position: relative;
  z-index: 2;
  border: 1px solid var(--lighter-bg);
}

.form-header {
  display: flex;
  align-items: center;
  margin-bottom: 1.5rem;
}

.form-icon {
  width: 24px;
  height: 24px;
  margin-right: 0.8rem;
  color: var(--primary-color);
}

.form-header h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 0;
}

.prompt-area {
  margin-bottom: 1.5rem;
}

.prompt-field {
  display: flex;
  align-items: center;
  background-color: var(--dark-bg);
  padding: 1rem;
  border-radius: var(--border-radius);
  cursor: text;
}

.field-icon {
  width: 20px;
  height: 20px;
  margin-right: 0.8rem;
  color: var(--text-muted);
}

.prompt-field span {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.generate-options {
  display: flex;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.option {
  display: flex;
  align-items: center;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: var(--border-radius);
  transition: var(--transition);
}

.option:hover {
  background-color: var(--lighter-bg);
}

.option-icon {
  width: 18px;
  height: 18px;
  margin-right: 0.5rem;
  color: var(--text-muted);
}

.option span {
  font-size: 0.85rem;
}

/* Footer */
footer {
  background-color: var(--light-bg);
  padding: 60px 0 30px;
  border-top: 1px solid var(--lighter-bg);
}

.footer-top {
  display: flex;
  justify-content: space-between;
  margin-bottom: 3rem;
  flex-wrap: wrap;
  gap: 2rem;
}

.footer-logo {
  flex: 1;
  min-width: 250px;
}

.footer-logo-svg {
  height: 36px;
  margin-bottom: 1rem;
}

.footer-logo p {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  gap: 4rem;
  flex-wrap: wrap;
}

.footer-column h4 {
  margin-bottom: 1.2rem;
  font-size: 1rem;
}

.footer-column ul {
  list-style: none;
}

.footer-column ul li {
  margin-bottom: 0.8rem;
}

.footer-column ul li a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  transition: var(--transition);
}

.footer-column ul li a:hover {
  color: var(--primary-color);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1.5rem;
  border-top: 1px solid var(--lighter-bg);
  color: var(--text-muted);
  font-size: 0.85rem;
}

.favicon-svg {
  width: 24px;
  height: 24px;
}

/* Responsive */
@media (max-width: 992px) {
  h1 {
    font-size: 2.2rem;
  }
  
  h2 {
    font-size: 1.6rem;
  }
  
  .communities-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  }
}

@media (max-width: 768px) {
  h1 {
    font-size: 1.8rem;
  }
  
  .menu-toggle {
    display: block;
  }
  
  nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 70%;
    max-width: 300px;
    height: 100vh;
    background-color: var(--dark-bg);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    box-shadow: 0 0 20px rgba(0,0,0,0.3);
  }
  
  nav.active {
    right: 0;
  }
  
  nav ul {
    flex-direction: column;
    align-items: center;
  }
  
  .hero .container {
    flex-direction: column;
    align-items: center;
  }
  
  .vote-arrows {
    flex-direction: row;
    gap: 1rem;
    padding-top: 0;
  }
  
  .section-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .post-grid {
    grid-template-columns: 1fr;
  }
  
  .communities-grid {
    grid-template-columns: 1fr;
  }
  
  .generate-options {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  
  .option {
    flex: 1;
    min-width: 45%;
  }
  
  .footer-top {
    flex-direction: column;
  }
  
  .footer-links {
    width: 100%;
    gap: 2rem;
  }
  
  .footer-bottom {
    flex-direction: column;
    gap: 1rem;
  }
}
