/* General styles */
.snippets-page {
    font-family: 'Inter', sans-serif;
    background: #111;
    color: #fff;
}

/* Language Cards */
.language-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 4rem;
}

.language-card {
    background-color: #1a1a1a;
    border-radius: 14px;
    padding: 2rem;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-decoration: none;
    color: var(--text);
    position: relative;
    overflow: hidden;
}

.language-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.language-card i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--accent);
}

.language-card h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.language-card p {
    color: var(--muted);
}

.view-snippets-btn {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--accent);
    color: white;
    padding: 1rem;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.language-card:hover .view-snippets-btn {
    transform: translateY(0);
}


/* Hero Section */
.hero-section {
    padding: 4rem 2rem;
    text-align: center;
}

.hero-content {
    max-width: 1200px;
    margin: 0 auto;
}

.hero-text h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 2rem;
    color: #f0f6fc;
}

.search-container {
    position: relative;
    max-width: 580px;
    margin: 0 auto;
}

#search-input {
    width: 100%;
    padding: 1rem 1.5rem;
    border-radius: 6px;
    border: 1px solid #30363d;
    background: #0d1117;
    color: #c9d1d9;
    font-size: 1rem;
    transition: all 0.2s ease-in-out;
}
#search-input:focus {
    outline: none;
    border-color: #58a6ff;
    box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.3);
}

/* Snippet Grid */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
    padding: 2rem 0;
}

/* Snippet Card */
.snippet-card {
 feat/snippet-page-redesign
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 6px;
 feat/playground-sharing
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
}

.snippet-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.card-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text);
}

.card-category {
  background: var(--accent);
  color: white;
  padding: 0.2rem 0.5rem;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: uppercase;
}

.card-description {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
}

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

.tag {
  background: rgba(255, 255, 255, 0.1);
  color: var(--muted);
  padding: 0.2rem 0.5rem;
  border-radius: 8px;
  font-size: 0.8rem;
}

.copy-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1.2rem;
  cursor: pointer;
  transition: color 0.2s ease;
}

.copy-btn:hover {
  color: var(--accent);
}

.code-preview {
  display: none;
  margin-top: 1rem;
  background: #0B0F17;
  border-radius: 10px;
  padding: 1rem;
  overflow-x: auto;
  position: relative;
}

/* Filter and Sort Controls */
.filter-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 0;
  flex-wrap: wrap;
  gap: 1rem;
}

.filter-pills {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.filter-btn {
  background: var(--glass);
  color: var(--muted);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  text-decoration: none;
}

.filter-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.filter-btn.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

#sort-select {
  background: var(--glass);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  font-family: 'Inter', sans-serif;
}

.snippet-count {
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 500;
}

.filter-pills {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.filter-btn {
  background: var(--glass);
  color: var(--muted);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  text-decoration: none;
}

.filter-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.filter-btn.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

#sort-select {
  background: var(--glass);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  font-family: 'Inter', sans-serif;
}

/* Expanded Snippet View */
.snippet-card.expanded .code-preview {
  display: block;
}

.preview-actions {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.preview-copy-btn, .try-it-btn {
  background: var(--accent);
  color: white;
  border: none;
  padding: 0.4rem 0.8rem;
  cursor: pointer;
  border-radius: 8px;
  font-size: 0.9rem;
  font-family: 'Inter', sans-serif;
  transition: background 0.2s;
}

.preview-copy-btn:hover, .try-it-btn:hover {
  background: #5a8de0;
}

/* Site Footer */
.site-footer {
    padding: 2rem 0;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    margin-top: 2rem;
}

.site-footer .btn {
    margin-bottom: 1rem;
}

.footer-links a {
    color: var(--muted);
    text-decoration: none;
    margin: 0 0.5rem;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--accent);
}


/* Custom Toastify Styles */
.devsnips-toast {
  border-radius: 10px !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
  font-family: 'Inter', sans-serif !important;
  font-weight: 500 !important;
  background: linear-gradient(to right, #F57C00, #0D47A1) !important;
  padding: 12px 20px !important;
}
/* Nanobar styles */
.nanobar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  z-index: 9999;
  transition: opacity 0.5s;
}

.nanobar-bar {
  width: 0;
  height: 100%;
  background: linear-gradient(to right, #0D47A1, #F57C00);
  transition: width 0.3s ease-out;
}
    background: #1a1a1a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    transition: all 0.2s ease-in-out;
    cursor: pointer;
}

.snippet-card:hover {
    border-color: #58a6ff;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid #30363d;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 500;
    color: #f0f6fc;
}

.card-actions {
    display: flex;
    gap: 0.5rem;
}

.card-action-btn {
    background: transparent;
    border: none;
    color: #8b949e;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.card-action-btn:hover {
    background-color: rgba(177, 186, 196, 0.12);
    color: #f0f6fc;
}

.code-preview {
    position: relative;
    padding: 1rem;
    background-color: #161b22;
    border-bottom: 1px solid #30363d;
}

.code-preview pre {
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.5;
    white-space: pre-wrap;
    overflow-x: auto;
    max-height: 250px;
}

.copy-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: #21262d;
    color: #f0f6fc;
    border: 1px solid #30363d;
    padding: 0.4rem 0.7rem;
    border-radius: 6px;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
}

.snippet-card:hover .copy-btn {
    opacity: 1;
    visibility: visible;
}

.card-footer {
    padding: 0.75rem 1rem;
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.tag {
    background: #30363d;
    color: #8b949e;
    padding: 0.25rem 0.6rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}
    background: rgba(255, 255, 255, 0.1);
    color: var(--muted);
    padding: 0.2rem 0.5rem;
    border-radius: 8px;
    font-size: 0.8rem;
}

.error-message {
    color: #ff8b8b;
    background-color: rgba(255, 0, 0, 0.1);
    border: 1px solid #ff8b8b;
    padding: 1rem;
    border-radius: 6px;
    text-align: center;
}
