:root {
    --bg-primary: #1e1e1e;
    --bg-secondary: #2d2d2d;
    --bg-snippet: #252525;
    --text-primary: #e0e0e0;
    --text-secondary: #b0b0b0;
    --accent: #61afef;
    --accent-hover: #528bcc;
    --border: #404040;
    --success: #98c379;
}

[data-theme="light"] {
    --bg-primary: #ffffff;
    --bg-secondary: #f5f5f5;
    --bg-snippet: #fafafa;
    --text-primary: #2c3e50;
    --text-secondary: #7f8c8d;
    --accent: #3498db;
    --accent-hover: #2980b9;
    --border: #e0e0e0;
    --success: #27ae60;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    padding: 2rem;
}

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

header {
    text-align: left;
    margin-bottom: 2rem;
    position: relative;
}

h1 {
    font-size: 2.5rem;
    color: var(--accent);
}

.subtitle {
    color: var(--text-secondary);
}

.theme-toggle {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.2s;
    margin-top: 1rem;
}

.theme-toggle:hover {
    background: var(--accent);
    transform: scale(1.1);
}

.theme-icon {
    transition: transform 0.3s;
}

.theme-toggle:hover .theme-icon {
    transform: rotate(20deg);
}


footer {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
    text-align: right;
    color: var(--text-secondary);
}

footer a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.2s;
}

footer a:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

.search-box {
    margin-bottom: 2rem;
}

#search-input {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 2px solid var(--border);
    border-radius: 6px;
    background: var(--bg-secondary);
    color: var(--text-primary);
}

#search-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(97, 175, 239, 0.1);
}

.filters {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    border: 1px solid var(--border);
}

.filters-row {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    align-items: flex-start;
}

.filter-group {
    flex: 1;
    min-width: 250px;
}

.filter-group label {
    display: block;
    font-weight: bold;
    margin-bottom: 0.5rem;
    color: var(--accent);
}

select {
    width: 100%;
    padding: 0.5rem;
    border-radius: 4px;
    border: 1px solid var(--border);
    background: var(--bg-snippet);
    color: var(--text-primary);
    font-size: 0.95rem;
}

select:focus {
    outline: none;
    border-color: var(--accent);
}

.filter-actions {
    flex: 0;
    min-width: auto;
}

.filter-actions label {
    opacity: 0;
    pointer-events: none;
}

button {
    padding: 0.5rem 0.5rem;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    font-size: 0.95rem;
    transition: all 0.2s;
}

button:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
}

.stats {
    background: var(--bg-snippet);
    padding: 0.75rem 1rem;
    border-radius: 4px;
    margin-bottom: 1.5rem;
    font-weight: bold;
    border-left: 3px solid var(--accent);
}

.snippet {
    background: var(--bg-snippet);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    transition: all 0.3s;
}

.snippet:hover {
    border-color: var(--accent);
    box-shadow: 0 4px 12px rgba(97, 175, 239, 0.2);
    transform: translateY(-2px);
}

.snippet-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}

.snippet-header h2 {
    flex: 1;
    margin: 0;
    font-size: 1.5rem;
}

.snippet-header h3 {
    flex: 1;
    margin: 0;
}

.permalink {
    color: var(--text-secondary);
    text-decoration: none;
    margin-right: 0.5rem;
    opacity: 0.5;
    transition: opacity 0.2s;
}

.permalink:hover {
    opacity: 1;
    color: var(--accent);
}

.copy-btn, .link-copy-btn {
    padding: 0.5rem 1.5rem;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    font-size: 0.95rem;
    transition: all 0.2s;
    white-space: nowrap;
}

.copy-btn:hover, .link-copy-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
}

.copy-btn.copied, .link-copy-btn.copied {
    background: var(--success);
}

.snippet-code {
    background: var(--bg-primary);
    padding: 1rem;
    border-radius: 6px;
    overflow-x: auto;
    margin-bottom: 1rem;
    border: 1px solid var(--border);
}

.snippet-code code {
    font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.snippet-description {
    padding-bottom: 2rem;
}

.snippet-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

#about-container p {
    padding-bottom: 1rem;;
}

#about-container ul {
    padding-bottom: 1rem;
    padding-left: 2rem;
}

.blog-link {
    padding-bottom: 0.5rem;
    text-align: right;
}

.blog-link a {
    color:#2980b9;
    text-decoration: none;
}

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

.tag-badge {
    padding: 0.25rem 0.75rem;
    background: var(--accent);
    color: white;
    border-radius: 4px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}

.tag-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(97, 175, 239, 0.4);
}

.metadata {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.metadata span {
    padding: 0.25rem 0.5rem;
    background: var(--bg-secondary);
    border-radius: 4px;
}

.share-section {
    margin-top: 2rem;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--border);
}

.share-section h3 {
    margin-bottom: 1rem;
    color: var(--accent);
}


#error {
    text-align: center;
    padding: 3rem;
    background: var(--bg-secondary);
    border-radius: 8px;
    border: 2px dashed var(--border);
}

#error p {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: #e06c75;
}

.share-url {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.share-url input {
    flex: 1;
    padding: 0.5rem;
    background: var(--bg-snippet);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-primary);
    font-family: monospace;
}

.share-url input:focus {
    outline: none;
    border-color: var(--accent);
}

.search-highlight {
    background: #f0ad4e;
    color: #000;
    padding: 0 0.2rem;
    border-radius: 2px;
}

#no-results {
    text-align: center;
    padding: 3rem;
    background: var(--bg-secondary);
    border-radius: 8px;
    border: 2px dashed var(--border);
}

#no-results p {
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

#reset-btn {
    padding: 0.5rem 1.5rem;
}

.hidden {
    display: none;
}

.back-link {
    display: inline-block;
    margin-bottom: 2rem;
    padding: 0.5rem 1rem;
    background: var(--bg-secondary);
    color: var(--accent);
    text-decoration: none;
    border-radius: 4px;
    border: 1px solid var(--border);
    transition: all 0.2s;
}

.back-link:hover {
    background: var(--accent);
    color: white;
    transform: translateY(-2px);
}

@media (max-width: 768px) {
    body {
        padding: 1rem;
    }

    h1 {
        font-size: 1.75rem;
    }

    .snippet-header {
        flex-direction: column;
    }

    .copy-btn {
        width: 100%;
    }
}