* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Vazirmatn', 'Inter', system-ui, sans-serif;
  background: linear-gradient(135deg, #0f172a 0%, #1a1a2e 50%, #16213e 100%);
  color: #e2e8f0;
  min-height: 100vh;
}

@import url('https://cdn.jsdelivr.net/gh/rastikerdar/vazirmatn@v33.003/Vazirmatn-font-face.css');

/* ========== ناوبری شیشه‌ای ========== */
.glass-nav {
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-container {
  max-width: 1300px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.3rem;
  font-weight: 700;
  background: linear-gradient(135deg, #c4b5fd, #a855f7);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.logo-icon {
  font-size: 1.5rem;
}

.nav-links {
  display: flex;
  gap: 1.5rem;
}

.nav-links a {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  transition: all 0.3s;
  padding: 0.3rem 0;
}

.nav-links a:hover, .nav-links a.active {
  color: white;
  border-bottom: 2px solid #a855f7;
}

.search-box {
  display: flex;
  gap: 0.5rem;
}

.search-input {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 40px;
  padding: 0.5rem 1rem;
  color: white;
  font-family: inherit;
  width: 250px;
}

.search-input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.search-input:focus {
  outline: none;
  border-color: #a855f7;
}

.search-btn {
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  border: none;
  border-radius: 40px;
  padding: 0.5rem 1rem;
  color: white;
  cursor: pointer;
}

/* ========== Hero Section ========== */
.hero-section {
  text-align: center;
  padding: 3rem 1.5rem;
  background: rgba(15, 23, 42, 0.3);
  backdrop-filter: blur(8px);
  margin-bottom: 2rem;
}

.hero-section h1 {
  font-size: 2.5rem;
  background: linear-gradient(135deg, #c4b5fd, #a855f7);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 1rem;
}

.hero-section p {
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 1.5rem;
}

.upload-btn {
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 40px;
  text-decoration: none;
  display: inline-block;
  transition: transform 0.2s;
}

.upload-btn:hover {
  transform: translateY(-2px);
}

/* ========== فیلترها ========== */
.filters {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.filter-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 40px;
  padding: 0.5rem 1.2rem;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  transition: all 0.3s;
}

.filter-btn:hover, .filter-btn.active {
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  color: white;
  border-color: transparent;
}

/* ========== گرید پست‌ها ========== */
.container {
  max-width: 1300px;
  margin: 0 auto;
  padding: 1rem 1.5rem 3rem;
}

.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 1.5rem;
}

.post-card {
  background: rgba(30, 41, 59, 0.5);
  backdrop-filter: blur(12px);
  border-radius: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
  transition: all 0.3s;
  cursor: pointer;
}

.post-card:hover {
  transform: translateY(-5px);
  border-color: rgba(124, 58, 237, 0.5);
  box-shadow: 0 20px 35px -12px rgba(0, 0, 0, 0.3);
}

.post-header {
  padding: 1rem 1.2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.post-author {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.author-avatar {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
}

.author-name {
  font-weight: 600;
  color: #c4b5fd;
}

.post-date {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.4);
}

.post-title {
  padding: 1rem 1.2rem 0.5rem;
  font-size: 1.2rem;
  font-weight: 600;
}

.post-description {
  padding: 0 1.2rem 1rem;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.85rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-tags {
  padding: 0 1.2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag {
  background: rgba(124, 58, 237, 0.2);
  border-radius: 20px;
  padding: 0.2rem 0.6rem;
  font-size: 0.7rem;
  color: #a78bfa;
}

.post-footer {
  padding: 1rem 1.2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.stats {
  display: flex;
  gap: 1rem;
}

.stat {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.5);
}

.like-btn {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s;
}

.like-btn.liked {
  color: #f43f5e;
}

.download-btn {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 30px;
  padding: 0.3rem 0.8rem;
  color: white;
  cursor: pointer;
  font-size: 0.75rem;
  transition: all 0.2s;
}

.download-btn:hover {
  background: #7c3aed;
}

/* ========== کارت آپلود ========== */
.upload-card {
  max-width: 600px;
  margin: 0 auto;
  padding: 2rem;
  background: rgba(30, 41, 59, 0.5);
  backdrop-filter: blur(12px);
  border-radius: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.upload-card h2 {
  margin-bottom: 0.5rem;
  color: #c4b5fd;
}

.form-group {
  margin-bottom: 1.2rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.7);
}

.form-group input, .form-group textarea {
  width: 100%;
  padding: 0.8rem;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.8rem;
  color: white;
  font-family: inherit;
}

.form-group input:focus, .form-group textarea:focus {
  outline: none;
  border-color: #a855f7;
}

.file-drop-area {
  border: 2px dashed rgba(255, 255, 255, 0.2);
  border-radius: 1rem;
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
}

.file-drop-area:hover {
  border-color: #a855f7;
  background: rgba(124, 58, 237, 0.1);
}

.file-info {
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: #a78bfa;
}

.submit-btn {
  width: 100%;
  padding: 0.8rem;
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  border: none;
  border-radius: 40px;
  color: white;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(124, 58, 237, 0.4);
}

.upload-status {
  margin-top: 1rem;
  text-align: center;
  padding: 0.5rem;
  border-radius: 0.5rem;
}

/* ========== صفحه نمایش کد ========== */
.post-view {
  background: rgba(30, 41, 59, 0.5);
  backdrop-filter: blur(12px);
  border-radius: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 2rem;
}

.post-view-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 1rem;
  margin-bottom: 1.5rem;
}

.post-view-title {
  font-size: 1.8rem;
  margin-bottom: 0.5rem;
}

.post-view-author {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.post-view-github a {
  color: #a78bfa;
  text-decoration: none;
}

.post-view-description {
  background: rgba(15, 23, 42, 0.5);
  padding: 1rem;
  border-radius: 0.8rem;
  margin: 1rem 0;
  border-right: 3px solid #a855f7;
}

.code-container {
  background: #0f172a;
  border-radius: 1rem;
  overflow: hidden;
  margin: 1.5rem 0;
}

.code-container pre {
  margin: 0;
  padding: 1.5rem;
  overflow-x: auto;
  font-size: 0.8rem;
}

/* ========== فوتر ========== */
.glass-footer {
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(12px);
  text-align: center;
  padding: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.5);
}

.loading {
  text-align: center;
  padding: 3rem;
  color: rgba(255, 255, 255, 0.5);
}

/* ========== ریسپانسیو ========== */
@media (max-width: 768px) {
  .nav-container {
    flex-direction: column;
    text-align: center;
  }
  .posts-grid {
    grid-template-columns: 1fr;
  }
  .hero-section h1 {
    font-size: 1.8rem;
  }
  .search-input {
    width: 180px;
  }
}
.code-dropdown {
  margin: 1rem 0;
  width: 100%;
  direction: ltr;
}

.code-dropdown-btn {
  width: 100%;
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  border: none;
  border-radius: 12px;
  padding: 0.8rem 1.5rem;
  color: white;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.3s ease;
  font-family: inherit;
}

.code-dropdown-btn:hover {
  background: linear-gradient(135deg, #6d28d9, #9333ea);
  transform: translateY(-1px);
}

.dropdown-icon {
  transition: transform 0.3s ease;
  font-size: 1.2rem;
}

.code-dropdown-btn.active .dropdown-icon {
  transform: rotate(180deg);
}

.code-content-wrapper {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  background: #0f172a;
  border-radius: 0 0 12px 12px;
  margin-top: 0;
}

.code-content-wrapper.show {
  max-height: 500px;
  overflow-y: auto;
  margin-top: 0.5rem;
}

.code-content-wrapper pre {
  margin: 0;
  padding: 1.5rem;
  overflow-x: auto;
  font-size: 0.8rem;
  line-height: 1.5;
  background: #0f172a;
  border-radius: 12px;
  direction: ltr;
  text-align: left;
}

.code-content-wrapper code {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  white-space: pre-wrap;
  word-break: break-word;
}

.code-content-wrapper::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.code-content-wrapper::-webkit-scrollbar-track {
  background: #1e293b;
  border-radius: 10px;
}

.code-content-wrapper::-webkit-scrollbar-thumb {
  background: #7c3aed;
  border-radius: 10px;
}

.code-status {
  font-size: 0.8rem;
  color: #94a3b8;
  margin-top: 0.5rem;
  text-align: center;
}

body.dark-mode .code-content-wrapper {
  background: #0f172a;
}

body.dark-mode .code-content-wrapper pre {
  background: #0f172a;
}