/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #1a1a1a;
    background: #f5f5f5;
}

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

/* Typography */
h1, h2, h3, h4 {
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

a {
    color: #0066cc;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Header */
.site-header {
    background: white;
    padding: 1rem 0;
    border-bottom: 2px solid #eaeaea;
    margin-bottom: 2rem;
}

.logo h1 {
    margin: 0;
    font-size: 2rem;
}

.logo h1 a {
    color: #1a1a1a;
    text-decoration: none;
}

.logo span {
    color: #0066cc;
    font-weight: 300;
}

.tagline {
    color: #666;
    font-size: 0.9rem;
}

.main-nav {
    margin-top: 1rem;
}

.main-nav a {
    margin-right: 1.5rem;
    color: #444;
    font-weight: 500;
}

.main-nav a:hover,
.main-nav a.active {
    color: #0066cc;
    text-decoration: none;
}

/* Hero Section */
.hero {
    background: white;
    padding: 3rem;
    border-radius: 8px;
    margin-bottom: 3rem;
    border: 1px solid #eaeaea;
}

.hero h2 {
    text-align: center;
    margin-bottom: 2rem;
}

.search-form {
    display: flex;
    max-width: 600px;
    margin: 0 auto;
}

.search-form input {
    flex: 1;
    padding: 1rem;
    font-size: 1.1rem;
    border: 2px solid #eaeaea;
    border-right: none;
    border-radius: 4px 0 0 4px;
}

.search-form button {
    padding: 1rem 2rem;
    background: #0066cc;
    color: white;
    border: none;
    border-radius: 0 4px 4px 0;
    font-size: 1.1rem;
    cursor: pointer;
    font-weight: 600;
}

.search-form button:hover {
    background: #0052a3;
}

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

.category-card {
    background: white;
    padding: 1.5rem;
    border: 1px solid #eaeaea;
    border-radius: 4px;
    color: #1a1a1a;
    transition: all 0.2s;
}

.category-card:hover {
    border-color: #0066cc;
    box-shadow: 0 2px 8px rgba(0,102,204,0.1);
    text-decoration: none;
}

.category-card h4 {
    margin-bottom: 0.5rem;
    color: #0066cc;
}

.category-card p {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.count {
    font-size: 0.85rem;
    color: #888;
}

/* Snippet List */
.snippet-list {
    background: white;
    border: 1px solid #eaeaea;
    border-radius: 4px;
}

.snippet-item {
    display: flex;
    padding: 1.5rem;
    border-bottom: 1px solid #eaeaea;
}

.snippet-item:last-child {
    border-bottom: none;
}

.vote-box {
    width: 50px;
    text-align: center;
    margin-right: 1.5rem;
}

.votes {
    font-size: 1.5rem;
    font-weight: 600;
    color: #0066cc;
}

.snippet-content {
    flex: 1;
}

.snippet-content h4 {
    margin-bottom: 0.5rem;
}

.snippet-content h4 a {
    color: #1a1a1a;
}

.snippet-content h4 a:hover {
    color: #0066cc;
}

.snippet-content p {
    color: #666;
    margin-bottom: 1rem;
}

.meta {
    display: flex;
    gap: 1rem;
    font-size: 0.9rem;
    color: #888;
    align-items: center;
    flex-wrap: wrap;
}

.language {
    background: #f0f0f0;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    color: #444;
}

.difficulty {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-weight: 500;
}

.difficulty.beginner { background: #e6f3e6; color: #2e7d32; }
.difficulty.intermediate { background: #fff3e0; color: #f57c00; }
.difficulty.advanced { background: #ffebee; color: #c62828; }

/* Footer */
.site-footer {
    margin-top: 4rem;
    background: white;
    border-top: 2px solid #eaeaea;
    padding: 3rem 0 1rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    margin-bottom: 1rem;
}

.footer-section a {
    display: block;
    margin-bottom: 0.5rem;
    color: #666;
}

.footer-section a:hover {
    color: #0066cc;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid #eaeaea;
    color: #888;
}

/* Single Snippet Page */
.snippet-header {
    background: white;
    padding: 2rem;
    border: 1px solid #eaeaea;
    border-radius: 4px;
    margin-bottom: 2rem;
}

.code-block {
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 1.5rem;
    border-radius: 4px;
    overflow-x: auto;
    font-family: 'Courier New', monospace;
    line-height: 1.4;
    margin: 1.5rem 0;
}

.explanation {
    background: white;
    padding: 2rem;
    border: 1px solid #eaeaea;
    border-radius: 4px;
    margin: 1.5rem 0;
}

/* Responsive */
@media (max-width: 768px) {
    h1 { font-size: 2rem; }
    h2 { font-size: 1.5rem; }
    
    .hero {
        padding: 2rem;
    }
    
    .search-form {
        flex-direction: column;
    }
    
    .search-form input {
        border-right: 2px solid #eaeaea;
        border-radius: 4px;
        margin-bottom: 1rem;
    }
    
    .search-form button {
        border-radius: 4px;
    }
    
    .snippet-item {
        flex-direction: column;
    }
    
    .vote-box {
        width: auto;
        margin-right: 0;
        margin-bottom: 1rem;
    }
    
    .meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

/* Utilities */
.text-center { text-align: center; }
.mt-4 { margin-top: 2rem; }
.mb-4 { margin-bottom: 2rem; }

/* Add to style.css */

/* Categories Page */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.category-full-card {
    background: white;
    padding: 2rem;
    border: 1px solid #eaeaea;
    border-radius: 4px;
    transition: transform 0.2s;
}

.category-full-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.category-full-card h2 {
    margin-top: 0;
    border-bottom: 2px solid #0066cc;
    padding-bottom: 0.5rem;
    display: inline-block;
}

.cat-desc {
    color: #666;
    margin: 1rem 0;
}

.cat-stats {
    display: flex;
    gap: 1rem;
    margin: 1rem 0;
    font-size: 0.9rem;
    color: #888;
}

.stat {
    background: #f5f5f5;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
}

.top-snippets {
    margin: 1rem 0;
    padding: 1rem;
    background: #f9f9f9;
    border-radius: 4px;
}

.top-snippets h4 {
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    color: #444;
}

.top-snippets ul {
    list-style: none;
    padding: 0;
}

.top-snippets li {
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
}

.top-snippets li a {
    color: #0066cc;
}

.browse-link {
    display: inline-block;
    margin-top: 1rem;
    font-weight: 600;
    color: #0066cc;
}

/* Search Results */
.search-filters {
    background: white;
    padding: 1.5rem;
    border: 1px solid #eaeaea;
    border-radius: 4px;
    margin: 2rem 0;
}

.filter-group {
    margin: 1rem 0;
}

.filter-group h4 {
    margin-bottom: 0.5rem;
}

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

.filter-options label {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    cursor: pointer;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin: 2rem 0;
}

.pagination a, .pagination span {
    padding: 0.5rem 1rem;
    border: 1px solid #eaeaea;
    background: white;
    color: #333;
}

.pagination a:hover {
    background: #f5f5f5;
    text-decoration: none;
}

.pagination .current {
    background: #0066cc;
    color: white;
    border-color: #0066cc;
}

/* Profile Page */
.profile-header {
    background: white;
    padding: 2rem;
    border: 1px solid #eaeaea;
    border-radius: 4px;
    margin-bottom: 2rem;
}

.profile-stats {
    display: flex;
    gap: 2rem;
    margin-top: 1rem;
}

.profile-stat {
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 2rem;
    font-weight: 600;
    color: #0066cc;
}

.stat-label {
    font-size: 0.9rem;
    color: #666;
}

.user-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: #f0f0f0;
    border-radius: 20px;
    font-size: 0.85rem;
    margin-right: 0.5rem;
}

.badge-gold {
    background: #f7e05e;
    color: #333;
}

.badge-silver {
    background: #e0e0e0;
    color: #333;
}

/* Submit Form */
.submit-form {
    background: white;
    padding: 2rem;
    border: 1px solid #eaeaea;
    border-radius: 4px;
    max-width: 800px;
    margin: 2rem auto;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.form-group input[type="text"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: inherit;
}

.form-group textarea {
    min-height: 200px;
    font-family: 'Courier New', monospace;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.help-text {
    font-size: 0.85rem;
    color: #666;
    margin-top: 0.25rem;
}

.submit-btn {
    background: #0066cc;
    color: white;
    padding: 1rem 2rem;
    border: none;
    border-radius: 4px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
}

.submit-btn:hover {
    background: #0052a3;
}

/* Error Pages */
.error-page {
    text-align: center;
    padding: 4rem 2rem;
    background: white;
    border: 1px solid #eaeaea;
    border-radius: 4px;
    margin: 2rem 0;
}

.error-page h2 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.error-page .button {
    display: inline-block;
    padding: 1rem 2rem;
    background: #0066cc;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    margin-top: 2rem;
}

/* Responsive additions */
@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .profile-stats {
        flex-direction: column;
        gap: 1rem;
    }
    
    .categories-grid {
        grid-template-columns: 1fr;
    }
}

/* Popular Page Styles */
.time-tabs {
    display: flex;
    gap: 1rem;
    margin: 2rem 0;
    border-bottom: 2px solid #eaeaea;
    padding-bottom: 1rem;
}

.time-tabs a {
    padding: 0.5rem 1.5rem;
    background: white;
    border: 1px solid #eaeaea;
    border-radius: 4px;
    color: #333;
    text-decoration: none;
    font-weight: 500;
}

.time-tabs a.active {
    background: #0066cc;
    color: white;
    border-color: #0066cc;
}

.popular-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.popular-section {
    background: white;
    border: 1px solid #eaeaea;
    border-radius: 8px;
    padding: 1.5rem;
}

.popular-section h2 {
    font-size: 1.25rem;
    margin-top: 0;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #f0f0f0;
}

.popular-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.popular-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background: #f9f9f9;
    border-radius: 4px;
    transition: transform 0.2s;
}

.popular-item:hover {
    transform: translateX(4px);
    background: #f0f0f0;
}

.rank-number {
    font-size: 1.5rem;
    font-weight: 600;
    color: #0066cc;
    min-width: 40px;
    text-align: center;
}

.views-count {
    font-size: 1.25rem;
    font-weight: 600;
    color: #28a745;
    min-width: 60px;
    text-align: center;
}

.trending-badge {
    background: #ff6b6b;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    min-width: 70px;
    text-align: center;
}

.item-content {
    flex: 1;
}

.item-content h3 {
    font-size: 1rem;
    margin: 0 0 0.5rem 0;
}

.item-content h3 a {
    color: #333;
    text-decoration: none;
}

.item-content h3 a:hover {
    color: #0066cc;
}

/* Language Stats */
.language-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.lang-stat-card {
    background: white;
    padding: 1.5rem;
    border: 1px solid #eaeaea;
    border-radius: 8px;
    text-align: center;
    transition: transform 0.2s;
}

.lang-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.lang-stat-card h3 {
    margin: 0 0 1rem 0;
    color: #0066cc;
}

.lang-numbers {
    display: flex;
    justify-content: space-around;
    margin: 1rem 0;
    font-size: 0.9rem;
}

.lang-count {
    color: #28a745;
    font-weight: 600;
}

.lang-views {
    color: #666;
}

.lang-link {
    display: inline-block;
    margin-top: 1rem;
    padding: 0.5rem 1rem;
    background: #f0f0f0;
    border-radius: 4px;
    color: #333;
    text-decoration: none;
    font-size: 0.9rem;
}

.lang-link:hover {
    background: #0066cc;
    color: white;
}

/* Category Page Enhancements */
.category-header {
    background: white;
    padding: 2rem;
    border: 1px solid #eaeaea;
    border-radius: 8px;
    margin: 2rem 0;
}

.category-stats {
    display: flex;
    gap: 2rem;
    justify-content: center;
    margin: 1.5rem 0 0;
}

.category-description {
    font-size: 1.1rem;
    color: #666;
    max-width: 600px;
    margin: 1rem auto;
    text-align: center;
}

.related-categories {
    margin: 3rem 0;
    text-align: center;
}

.category-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    margin: 1.5rem 0;
}

.category-link {
    padding: 0.5rem 1.5rem;
    background: #f0f0f0;
    border-radius: 25px;
    color: #333;
    text-decoration: none;
    transition: all 0.2s;
}

.category-link:hover {
    background: #0066cc;
    color: white;
    transform: scale(1.05);
}

/* Filters */
.filters {
    margin: 2rem 0;
}

.filter-form {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
}

.filter-form select {
    padding: 0.75rem 2rem 0.75rem 1rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    font-size: 1rem;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    background-size: 1.2rem;
}

.filter-form select:hover {
    border-color: #0066cc;
}

/* No Results */
.no-results {
    text-align: center;
    padding: 3rem;
    background: white;
    border: 1px solid #eaeaea;
    border-radius: 8px;
    margin: 2rem 0;
}

.no-results .button {
    display: inline-block;
    margin-top: 1rem;
    padding: 0.75rem 2rem;
    background: #0066cc;
    color: white;
    text-decoration: none;
    border-radius: 4px;
}

/* Mini Tags */
.mini-tags {
    margin-top: 0.5rem;
}

.mini-tag {
    display: inline-block;
    margin-right: 0.5rem;
    font-size: 0.75rem;
    color: #888;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .filter-form {
        flex-direction: column;
    }
    
    .filter-form select {
        width: 100%;
    }
    
    .time-tabs {
        flex-wrap: wrap;
    }
    
    .popular-grid {
        grid-template-columns: 1fr;
    }
    
    .language-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .category-stats {
        flex-direction: column;
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .language-stats {
        grid-template-columns: 1fr;
    }
}

/* Add to your existing style.css */

/* Auth Pages */
.auth-container {
    max-width: 400px;
    margin: 2rem auto;
}

.auth-card {
    background: white;
    padding: 2rem;
    border: 1px solid #eaeaea;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.auth-card h1 {
    margin-top: 0;
    text-align: center;
}

.auth-subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 2rem;
}

.auth-form .form-group {
    margin-bottom: 1.5rem;
}

.auth-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.auth-form input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.auth-form small {
    display: block;
    margin-top: 0.25rem;
    color: #666;
    font-size: 0.85rem;
}

.auth-btn {
    width: 100%;
    padding: 1rem;
    background: #0066cc;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
}

.auth-btn:hover {
    background: #0052a3;
}

.auth-links {
    display: flex;
    justify-content: space-between;
    margin-top: 1.5rem;
    font-size: 0.9rem;
}

.alert {
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1.5rem;
}

.alert.error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.alert.success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

/* Profile Page */
.profile-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 3rem 2rem;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.profile-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid #eaeaea;
    padding-bottom: 1rem;
}

.tab-btn {
    padding: 0.75rem 1.5rem;
    background: none;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    color: #666;
    transition: all 0.2s;
}

.tab-btn:hover {
    background: #f0f0f0;
    color: #333;
}

.tab-btn.active {
    background: #0066cc;
    color: white;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.vote-indicator {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    font-weight: 600;
}

.vote-indicator.upvote {
    background: #e6f3e6;
    color: #2e7d32;
}

.vote-indicator.downvote {
    background: #ffebee;
    color: #c62828;
}

/* Submit Page */
.submit-header {
    text-align: center;
    margin-bottom: 2rem;
}

.submit-form {
    max-width: 800px;
    margin: 0 auto 3rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.submit-guidelines {
    background: #f9f9f9;
    padding: 2rem;
    border-radius: 8px;
    margin-top: 2rem;
}

.submit-guidelines ul {
    margin: 1rem 0 0 1.5rem;
    color: #666;
}

.submit-guidelines li {
    margin-bottom: 0.5rem;
}

/* Search Page */
.search-form-large {
    margin: 2rem 0;
}

.search-input-group {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.search-input-group input {
    flex: 1;
    padding: 1rem;
    font-size: 1.1rem;
    border: 2px solid #eaeaea;
    border-radius: 4px;
}

.search-input-group button {
    padding: 0 2rem;
    background: #0066cc;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1.1rem;
    cursor: pointer;
}

.search-filters {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-group select {
    padding: 0.5rem 2rem 0.5rem 1rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
}

.search-results-header {
    margin: 2rem 0;
}

mark {
    background: #ffeb3b;
    padding: 0.2rem 0;
    border-radius: 2px;
}

.search-tips {
    margin: 3rem 0;
}

.tips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.tip {
    text-align: center;
    padding: 2rem;
    background: white;
    border: 1px solid #eaeaea;
    border-radius: 8px;
}

.tip-icon {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 1rem;
}

.tip h4 {
    margin: 0 0 0.5rem 0;
}

.tip p {
    color: #666;
    margin: 0;
}

/* Edit link */
.edit-link {
    color: #666;
    font-size: 0.85rem;
    margin-left: auto;
}

.edit-link:hover {
    color: #0066cc;
}
