/* Particle Swarm Animation Styles */
#particleSwarmCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    background: #0f0f2d;
    opacity: 0.8;
}

/* Ensure content is above the particle canvas */
.navbar,
.main-content {
    position: relative;
    z-index: 1;
}

/* Make sure navbar is above the particle canvas */
.navbar {
    z-index: 1000;
    position: fixed;

}

/* Dark theme for particles */
[data-theme="dark"] #particleSwarmCanvas {
    background: #0a0a1a;
}


/* Elements Page Specific Styles */

/* Theme Variables */
:root {
    --card-bg: #ffffff;
    --card-border: #e2e8f0;
    --preview-bg: #f8fafc;
}

[data-theme="dark"] {
    --card-bg: #1e293b;
    --card-border: #334155;
    --preview-bg: #0f172a;
}

/* Element Card Styles */
.element-card {
    background-color: var(--card-bg) !important;
    border: 1px solid var(--card-border) !important;
}

.card-preview-container {
    background-color: var(--preview-bg) !important;
}

/* Floating Astronaut */
.floating-astronaut {
    position: fixed;
    top: 10px;
    left: 30px;
    z-index: 1000;
    pointer-events: none;
}

.floating-astronaut .image {
    width: 120px;
    height: 120px;
    display: block;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.3));
    transition: all 0.3s ease;
    transform-origin: center;
}

.floating-astronaut:hover .image {
    transform: scale(1.1);
}

/* Page Header */
.elements-header {
padding: 120px 0 60px;
background: linear-gradient(135deg, var(--background-color) 0%, var(--surface-color) 100%);
text-align: center;
position: relative;
overflow: hidden;
}

.elements-header::before {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: 
radial-gradient(circle at 30% 70%, rgba(99, 102, 241, 0.1) 0%, transparent 50%),
radial-gradient(circle at 70% 30%, rgba(139, 92, 246, 0.1) 0%, transparent 50%);
pointer-events: none;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 30% 70%, rgba(99, 102, 241, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 70% 30%, rgba(139, 92, 246, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

.page-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
    z-index: 1;
}

.page-subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    position: relative;
    z-index: 1;
}

.search-bar {
    position: relative;
    max-width: 500px;
    margin: 0 auto;
    z-index: 1;
}

.search-bar i {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.search-bar input {
    width: 100%;
    padding: 15px 20px 15px 50px;
    border: 2px solid var(--border-color);
    border-radius: 25px;
    background: var(--surface-color);
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.search-bar input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Main Layout */
.elements-main {
    grid-template-columns: 300px 1fr;
    gap: 40px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px;
    background: var(--background-color);
}

/* Sidebar */
.sidebar {
    background: var(--surface-color);
    border-radius: 12px;
    padding: 16px;
    max-width: 220px;
    width: 100%;
    height: fit-content;
    position: sticky;
    top: 120px;
    border: 1px solid var(--border-color);
    box-shadow: 0 6px 18px var(--shadow-light);
    font-size: 0.97rem;
}

.filter-section {
    margin-bottom: 30px;
}

.filter-section:last-child {
    margin-bottom: 0;
}

.filter-section h3 {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: none;
    border: none;
    border-radius: 12px;
    color: var(--text-secondary);
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    width: 100%;
}

.filter-btn:hover {
    background: var(--background-color);
    color: var(--text-primary);
}

.filter-btn.active {
    background: var(--gradient-primary);
    color: white;
}

.filter-btn i {
    font-size: 1rem;
    width: 16px;
}

/* Filter Button Counts */
.filter-btn .count {
    background: var(--primary-color);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: auto;
    min-width: 20px;
    text-align: center;
    transition: all 0.3s ease;
}

.filter-btn:hover .count {
    background: var(--primary-hover);
    transform: scale(1.1);
}

.filter-btn.active .count {
    background: var(--accent-color);
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.3);
}

/* Dark theme adjustments */
[data-theme="dark"] .filter-btn .count {
    background: rgba(99, 102, 241, 0.8);
}

[data-theme="dark"] .filter-btn:hover .count {
    background: rgba(99, 102, 241, 1);
}

[data-theme="dark"] .filter-btn.active .count {
    background: var(--accent-color);
}

/* Elements Grid */
.elements-content {
    min-height: 100vh;
}

.elements-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 48px;
    margin-bottom: 40px;
}


@media (max-width: 700px) {
    .elements-grid {
        grid-template-columns: 1fr;
        gap: 28px;
    }
    
    /* Show desktop filters on tablets */
    .filters-bar {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    .mobile-filters-bar {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
    }
    
    /* Make desktop filters horizontal on tablets */
    .filter-group {
        display: flex;
        flex-direction: row;
        gap: 10px;
        flex-wrap: wrap;
        justify-content: center;
        padding: 16px;
        background: var(--surface-color);
        border-radius: 14px;
        border: 2px solid var(--border-color);
        box-shadow: 0 3px 15px var(--shadow-light);
        margin: 16px 0;
    }
    
    .filter-btn {
        flex-shrink: 0;
        white-space: nowrap;
        min-width: auto;
        padding: 10px 16px;
        font-size: 0.95rem;
        font-weight: 600;
        border-radius: 18px;
        border: 2px solid var(--border-color);
        background: var(--surface-color);
        box-shadow: 0 2px 6px var(--shadow-light);
        transition: all 0.3s ease;
    }
    
    .filter-btn:hover {
        transform: translateY(-1px);
        box-shadow: 0 3px 10px var(--shadow-medium);
    }
    
    .filter-btn.active {
        background: var(--gradient-primary);
        color: white;
        border-color: transparent;
        box-shadow: 0 3px 12px rgba(99, 102, 241, 0.3);
    }
}

/* Category Sidebar Toggle */
.category-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 16px;
    font-size: 0.95rem;
    cursor: pointer;
    margin: 20px 0;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px var(--shadow-light);
}

.category-toggle i {
    font-size: 1.1rem;
    transition: transform 0.2s ease;
}

.category-toggle:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow-medium);
}

.category-toggle:active {
    transform: translateY(0);
}

/* Sidebar Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    backdrop-filter: blur(3px);
}

[data-theme="dark"] .sidebar-overlay {
    background: rgba(0, 0, 0, 0.7);
}

/* Category Sidebar */
.mrcoding-category-sidebar {
    position: fixed;
    top: 0;
    left: -100%; 
    width: 300px;
    height: 100vh;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-right: 1px solid rgba(255, 255, 255, 0.3); 
    z-index: 1000;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1); 
    overflow-y: auto;
    box-shadow: 8px 0 32px var(--shadow-medium); 
}

[data-theme="dark"] .mrcoding-category-sidebar {
    background: rgba(30, 41, 59, 0.95);
    border-right: 1px solid rgba(255, 255, 255, 0.1); /* Changed from border-left */
    box-shadow: 8px 0 32px var(--shadow-heavy); /* Changed shadow direction */
}

.mrcoding-category-sidebar.active {
    left: 0; /* Changed from right */
}

.mrcoding-sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    position: sticky;
    top: 0;
    z-index: 2;
}

.mrcoding-sidebar-header h3 {
    color: var(--text-primary);
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

[data-theme="dark"] .mrcoding-sidebar-header h3 {
    color: var(--text-primary);
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.mrcoding-close-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 18px;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

[data-theme="dark"] .mrcoding-close-btn {
    color: var(--text-primary);
}

.mrcoding-close-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transition: all 0.3s ease;
    transform: translate(-50%, -50%);
}

.mrcoding-close-btn:hover::before {
    width: 32px;
    height: 32px;
}

.mrcoding-close-btn:hover {
    transform: rotate(90deg);
}

.mrcoding-category-list {
    padding: 16px 0;
}

.mrcoding-category-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 16px 20px;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    border-radius: 0;
    position: relative;
    overflow: hidden;
}

[data-theme="dark"] .mrcoding-category-item {
    color: var(--text-primary);
}

.mrcoding-category-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.2), transparent);
    transition: width 0.3s ease;
}

.mrcoding-category-item:hover::before {
    width: 100%;
}

.mrcoding-category-item:hover {
    background: rgba(59, 130, 246, 0.05);
    transform: translateX(4px);
}

[data-theme="dark"] .mrcoding-category-item:hover {
    background: rgba(59, 130, 246, 0.1);
}

.mrcoding-category-item.active {
    background: rgba(59, 130, 246, 0.1);
    border-left: 3px solid var(--primary-color);
    box-shadow: inset 0 0 20px rgba(59, 130, 246, 0.1);
}

[data-theme="dark"] .mrcoding-category-item.active {
    background: rgba(59, 130, 246, 0.2);
    border-left: 3px solid var(--primary-color);
    box-shadow: inset 0 0 20px rgba(59, 130, 246, 0.2);
}

.mrcoding-category-item.active::before {
    width: 100%;
}

.mrcoding-category-item i {
    width: 20px;
    text-align: center;
    font-size: 16px;
    opacity: 0.8;
    transition: all 0.3s ease;
}

.mrcoding-category-item:hover i {
    opacity: 1;
    transform: scale(1.1);
}

.mrcoding-category-item span {
    flex: 1;
    position: relative;
    z-index: 1;
}

.mrcoding-count {
    background: var(--gradient-primary);
    color: #ffffff;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    min-width: 24px;
    text-align: center;
    position: relative;
    z-index: 1;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px var(--shadow-medium);
}

[data-theme="dark"] .mrcoding-count {
    background: var(--gradient-primary);
    box-shadow: 0 2px 8px var(--shadow-heavy);
}

/* Restore original card and preview styles */
.element-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    min-width: 0;
    max-width: 100%;
    min-height: 720px;
    padding: 0;
    margin: 0;
    font-size: 1rem;
    display: flex;
    flex-direction: column;
}
.element-card:hover {
    transform: translateY(-5px) scale(1.01) !important;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04) !important;
    border-color: rgba(99, 102, 241, 0.3) !important;
}

.element-preview {
  min-height: 700px;
  height: 700px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent !important;
  border-radius: 0;
  box-shadow: none;
  border: none;
  padding: 0;
  flex: 1;
}
.preview-content {
  width: 100%;
  min-height: 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  background: none;
  border: none;
  box-shadow: none;
}


.element-preview {
    height: 180px;
    background: var(--background-color);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: visible;
    border-radius: 8px;
}

.element-preview::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 49%, var(--border-color) 49%, var(--border-color) 51%, transparent 51%);
    background-size: 20px 20px;
    opacity: 0.1;
}

/* Card Overlay and View Details Button */
.card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: all 0.3s ease;
    border-radius: 0 0 20px 20px;
}

.element-card:hover .card-overlay {
    opacity: 1;
}

.view-details-btn {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.7rem;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.view-details-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.6);
}

.view-details-btn i {
    font-size: 0.6rem;
}



/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    backdrop-filter: blur(5px);
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--surface-color);
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    width: 90%;
    max-width: 1000px;
    max-height: 90vh;
    overflow: hidden;
    border: 1px solid var(--border-color);
    box-shadow: 0 20px 60px var(--shadow-heavy);
    margin: auto;
    position: relative;

}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: var(--background-color);
    color: var(--text-primary);
}



.preview-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    background: var(--background-color);
}

.tab-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 15px 20px;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
}

.tab-btn:hover {
    color: var(--text-primary);
    background: var(--surface-color);
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    background: var(--surface-color);
}

.tab-content {
    height: calc(70vh - 60px);
    overflow: auto;
}

.tab-pane {
    display: none;
    height: 100%;
}

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

.preview-container {
    padding: 20px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--background-color);
    border-radius: 8px;
    overflow: hidden;
}

.preview-container iframe {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 8px;
    background: transparent;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.code-editor {
    height: 100%;
    min-height: 300px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.modal-footer {
    display: flex;
    justify-content: center;
    gap: 15px;
    padding: 20px 30px;
    border-top: 1px solid var(--border-color);
    background: var(--background-color);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .elements-main {
        grid-template-columns: 250px 1fr;
        gap: 30px;
    }
    
    .sidebar {
        padding: 20px;
    }
    
    .elements-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 20px;
    }
    
    /* Show desktop filters on tablets */
    .filters-bar {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    .mobile-filters-bar {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
    }
    
    /* Make desktop filters horizontal on tablets */
    .filter-group {
        display: flex;
        flex-direction: row;
        gap: 12px;
        flex-wrap: wrap;
        justify-content: center;
        padding: 20px;
        background: var(--surface-color);
        border-radius: 16px;
        border: 2px solid var(--border-color);
        box-shadow: 0 4px 20px var(--shadow-light);
        margin: 20px 0;
    }
    
    .filter-btn {
        flex-shrink: 0;
        white-space: nowrap;
        min-width: auto;
        padding: 12px 20px;
        font-size: 1rem;
        font-weight: 600;
        border-radius: 20px;
        border: 2px solid var(--border-color);
        background: var(--surface-color);
        box-shadow: 0 2px 8px var(--shadow-light);
        transition: all 0.3s ease;
    }
    
    .filter-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px var(--shadow-medium);
    }
    
    .filter-btn.active {
        background: var(--gradient-primary);
        color: white;
        border-color: transparent;
        box-shadow: 0 4px 16px rgba(99, 102, 241, 0.3);
    }
}

@media (max-width: 768px) {
    .floating-astronaut {
        display: none;
    }
    
    .elements-main {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 0 16px;
        display: flex;
        flex-direction: column;
    }
    
    .sidebar {
        position: static;
        order: 3;
    }
    
    .elements-content {
        order: 2;
    }
    
    .elements-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    /* Hide desktop filters and show mobile filters */
    .filters-bar {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        order: 4;
    }
    
    .mobile-filters-bar {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        margin: 16px 0;
        padding: 16px 12px;
        background: var(--surface-color);
        border: 2px solid var(--border-color);
        border-radius: 14px;
        box-shadow: 0 3px 12px var(--shadow-light);
        min-height: 50px;
        position: relative;
        z-index: 100;
    }
    
    .hero-modern-hero {
        order: 0;
    }
}
    
    /* Enhanced mobile card styles */
    .element-card {
        min-height: 570px;
        border-radius: 16px;
        box-shadow: 0 4px 16px var(--shadow-light);
        transition: all 0.3s ease;
        overflow: visible;
    }
    
    .element-card:hover {
        transform: translateY(-4px);
        box-shadow: 0 8px 24px var(--shadow-medium);
    }
    
    .element-preview {
        height: 550px;
        border-radius: 12px;
        margin: 12px;
        overflow: visible;
    }
    
    .preview-content {
        height: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
     }
    
    .card-overlay {
        opacity: 0;
        transition: all 0.3s ease;
    }
    
    .element-card:hover .card-overlay {
        opacity: 1;
    }
    
    .view-details-btn {
        background: white;
        color: var(--primary-color);
        padding: 10px 20px;
        border-radius: 25px;
        font-weight: 600;
        font-size: 0.9rem;
        border: none;
        cursor: pointer;
        transition: all 0.3s ease;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }
    
    .view-details-btn:hover {
        transform: scale(1.05);
        box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
    }
    
    .page-title {
        font-size: 2.5rem;
    }
    
    .modal-content {
        width: 95%;
        max-height: 95vh;

    }
    
    .modal-header,
    .modal-footer {
        padding: 15px 20px;
    }
    
    .preview-tabs {
        overflow-x: auto;
    }
    
    .tab-btn {
        white-space: nowrap;
        padding: 12px 16px;
    }

/* Loading Animation */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
    color: var(--text-secondary);
}

.loading i {
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Show Details button styles */
.show-details-btn {
  position: absolute;
  left: 23%;
  bottom: 15px;
  transform: translateX(-50%);
  z-index: 2;
  background: var(--gradient-primary);
  color: #fff;
  font-size: 0.8rem;
  padding: 6px 12px;
  border-radius: 15px;
  border: none;
  opacity: 0;
  pointer-events: none;
  box-shadow: 0 4px 15px var(--shadow-medium);
  transition: all 0.3s ease;
  cursor: pointer;
  font-weight: 500;
  backdrop-filter: blur(10px);
}
.element-card:hover .show-details-btn {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(-5px);
}
.preview-content {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
}

.card-preview-container {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px;
  border-radius: 8px;
  overflow: auto;
  position: relative;
  background: transparent;
}

.card-preview-container * {
  max-width: 100%;
  max-height: 100%;
}

.show-details-btn::after {
  content: '\2192';
  font-size: 1.1em;
  margin-left: 6px;
  display: inline-block;
  transition: transform 0.3s ease, color 0.2s;
}
.show-details-btn:hover::after {
  transform: translateX(5px);
  color: #38bdf8;
}
.show-details-btn:hover {
    background: var(--gradient-primary);
    transform: translateX(-50%) translateY(-5px) scale(1.05);
    box-shadow: 0 8px 24px var(--shadow-heavy), 0 0 0 2px var(--primary-color);
}

.element-card {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06) !important;
    backdrop-filter: blur(10px);
}

.element-card .preview-content {
    color: var(--text-primary) !important;
}

.show-details-btn {
    background: var(--gradient-primary) !important;
    color: #fff !important;
    border: none !important;
    box-shadow: 0 2px 8px var(--shadow-light) !important;
}

/* Professional Tooltips */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip::before,
.tooltip::after {
    position: absolute;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    pointer-events: none;
    z-index: 1000;
}

.tooltip::before {
    content: attr(data-tooltip);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transform: translateY(10px) scale(0.8);
    transform-origin: center bottom;
}

.tooltip::after {
    content: '';
    width: 0;
    height: 0;
    border: 6px solid transparent;
    border-top-color: #667eea;
    transform: translateY(10px) scale(0.8);
    transform-origin: center bottom;
}

/* Tooltip positions */
.tooltip[data-position="top"]::before {
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(10px) scale(0.8);
}

.tooltip[data-position="top"]::after {
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(10px) scale(0.8);
    border-top-color: transparent;
    border-bottom-color: #667eea;
}

.tooltip[data-position="bottom"]::before {
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-10px) scale(0.8);
}

.tooltip[data-position="bottom"]::after {
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-10px) scale(0.8);
}

.tooltip[data-position="left"]::before {
    right: 100%;
    top: 50%;
    transform: translateY(-50%) translateX(10px) scale(0.8);
}

.tooltip[data-position="left"]::after {
    right: 100%;
    top: 50%;
    transform: translateY(-50%) translateX(10px) scale(0.8);
    border-left-color: #667eea;
    border-top-color: transparent;
}

.tooltip[data-position="right"]::before {
    left: 100%;
    top: 50%;
    transform: translateY(-50%) translateX(-10px) scale(0.8);
}

.tooltip[data-position="right"]::after {
    left: 100%;
    top: 50%;
    transform: translateY(-50%) translateX(-10px) scale(0.8);
    border-right-color: #667eea;
    border-top-color: transparent;
}

/* Hover effects */
.tooltip:hover::before,
.tooltip:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.tooltip[data-position="top"]:hover::before {
    transform: translateX(-50%) translateY(-5px) scale(1);
}

.tooltip[data-position="top"]:hover::after {
    transform: translateX(-50%) translateY(-5px) scale(1);
}

.tooltip[data-position="bottom"]:hover::before {
    transform: translateX(-50%) translateY(5px) scale(1);
}

.tooltip[data-position="bottom"]:hover::after {
    transform: translateX(-50%) translateY(5px) scale(1);
}

.tooltip[data-position="left"]:hover::before {
    transform: translateY(-50%) translateX(-5px) scale(1);
}

.tooltip[data-position="left"]:hover::after {
    transform: translateY(-50%) translateX(-5px) scale(1);
}

.tooltip[data-position="right"]:hover::before {
    transform: translateY(-50%) translateX(5px) scale(1);
}

.tooltip[data-position="right"]:hover::after {
    transform: translateY(-50%) translateX(5px) scale(1);
}

/* Dark theme tooltips */
[data-theme="dark"] .tooltip::before {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .tooltip::after {
    border-top-color: #2c3e50;
}

[data-theme="dark"] .tooltip[data-position="top"]::after {
    border-bottom-color: #2c3e50;
}

[data-theme="dark"] .tooltip[data-position="left"]::after {
    border-left-color: #2c3e50;
}

[data-theme="dark"] .tooltip[data-position="right"]::after {
    border-right-color: #2c3e50;
}

/* Enhanced filter button tooltips */
.filter-btn.tooltip::before {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    font-size: 11px;
    padding: 6px 10px;
    border-radius: 6px;
}

/* Enhanced element card tooltips */
.element-card.tooltip::before {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    font-size: 11px;
    padding: 8px 12px;
    border-radius: 8px;
    max-width: 200px;
    white-space: normal;
    text-align: center;
}

/* Animation delay for smooth appearance */
.tooltip::before,
.tooltip::after {
    transition-delay: 0.1s;
}

/* Responsive tooltips */
@media (max-width: 768px) {
    .tooltip::before {
        font-size: 10px;
        padding: 6px 8px;
    }
    
    .tooltip[data-position="top"]::before,
    .tooltip[data-position="bottom"]::before {
        left: 50%;
        transform: translateX(-50%);
    }
}

[data-theme="dark"] .element-card {
  background: var(--surface-color) !important;
  color: var(--text-primary) !important;
  border: 1px solid var(--border-color) !important;
  box-shadow: 0 2px 8px var(--shadow-medium) !important;
}

[data-theme="dark"] .element-card {
    background: rgba(30, 41, 59, 0.3) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
  color: var(--text-primary) !important;
  border: 1px solid var(--border-color) !important;
  box-shadow: 0 2px 8px var(--shadow-medium) !important;
}

[data-theme="dark"] .element-card .card-preview-container {
  background: var(--background-color) !important;
}

/* Modern Hero Section */
.hero-modern-hero {
    grid-column: 1 / span 2;
    width: 100%;
    margin-bottom: 36px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, var(--background-color) 60%, var(--primary-color) 100%);
    border-radius: 24px;
    box-shadow: 0 8px 32px var(--shadow-light);
    padding: 48px 32px 40px 32px;
    position: relative;
    overflow: hidden;
    min-height: auto;
    gap: 32px;
}
.hero-modern-content {
    text-align: center;
    max-width: 700px;
    margin: 0 auto;
    z-index: 2;
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.hero-modern-title {
    font-size: 2.6rem;
    font-weight: 800;
    margin-bottom: 18px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 0.5px;
}
.hero-modern-desc {
    font-size: 1.18rem;
    color: var(--text-secondary);
    margin-bottom: 28px;
    font-weight: 400;
}
.hero-modern-cta {
    font-size: 1.1rem;
    padding: 14px 36px;
    border-radius: 25px;
    font-weight: 700;
    box-shadow: 0 4px 18px var(--shadow-light);
    transition: background 0.3s, box-shadow 0.3s, transform 0.2s;
}
.hero-modern-cta:hover {
    transform: translateY(-3px) scale(1.04);
    box-shadow: 0 8px 32px var(--shadow-medium);
}
.hero-modern-illustration {
    flex: 0 0 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 120px;
    max-width: 220px;
    z-index: 1;
}
.hero-modern-illustration svg {
    width: 100%;
    height: auto;
    max-width: 180px;
    max-height: 140px;
    display: block;
}
@media (max-width: 900px) {
    .hero-modern-hero {
        flex-direction: column-reverse;
        align-items: center;
        padding: 32px 10px 28px 10px;
        min-height: 120px;
        gap: 18px;
    }
    .hero-modern-content {
        text-align: center;
        max-width: 100%;
    }
    .hero-modern-illustration {
        max-width: 140px;
    }
    .hero-modern-title {
        font-size: 2rem;
    }
}
@media (max-width: 600px) {
    .hero-modern-hero {
        padding: 18px 2vw 16px 2vw;
        min-height: 80px;
        margin-bottom: 18px;
    }
    .hero-modern-title {
        font-size: 1.3rem;
    }
    .hero-modern-desc {
        font-size: 0.98rem;
    }
    .hero-modern-cta {
        font-size: 0.95rem;
        padding: 10px 18px;
    }
    .hero-modern-illustration {
        max-width: 90px;
    }
    
    /* Extra small screen enhancements */
    .elements-main {
        padding: 0 12px;
    }
    
    .mobile-filters-bar {
        padding: 12px 8px;
        margin-bottom: 16px;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        background: var(--surface-color);
        border: 2px solid var(--border-color);
        border-radius: 14px;
        box-shadow: 0 3px 12px var(--shadow-light);
        min-height: 50px;
        position: relative;
        z-index: 100;
    }
    
    .filters-bar {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
    }
    
    .mobile-filters-bar .filter-group {
        gap: 4px;
        padding: 0 1px;
    }
    
    .mobile-filters-bar .filter-btn {
        padding: 6px 12px;
        font-size: 0.8rem;
        gap: 4px;
        min-height: 32px;
        font-weight: 600;
        border-radius: 16px;
        border: 1.5px solid var(--border-color);
    }
    
    .mobile-filters-bar .filter-btn i {
        font-size: 0.75rem;
        width: 10px;
    }
    
    .mobile-filters-bar .filter-btn .count {
        padding: 1px 3px;
        font-size: 0.6rem;
        min-width: 12px;
    }
    
    .element-card {
        min-height: 500px;
        border-radius: 12px;
    }
    
    .element-preview {
        height: 480px;
        margin: 8px;
        border-radius: 8px;
    }
    
    .preview-content {
        padding: 12px;
    }
    
    .view-details-btn {
        padding: 8px 16px;
        font-size: 0.85rem;
    }
}
/* Hero Modern Section */
.hero-modern-hero {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    border-radius: 16px;
    margin: 20px 0 40px 0;
    padding: 60px 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

[data-theme="dark"] .hero-modern-hero {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.5) 0%, rgba(15, 23, 42, 0.4) 100%) !important;
    border-color: rgba(255, 255, 255, 0.05);
}

.hero-modern-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 900px;
    margin: 0 auto;
}

.hero-modern-title {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

.hero-modern-desc {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

.hero-search-bar {
    position: relative;
    display: flex;
    align-items: center;
    max-width: 600px;
    margin: 20px auto 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    overflow: hidden;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.hero-search-bar i {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 1.1rem;
    z-index: 2;
}

.hero-search-bar input {
    width: 100%;
    padding: 16px 20px 16px 50px;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s ease;
    height: 100%;
    backdrop-filter: blur(10px);
}

.hero-search-bar input:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.3);
}

@media (max-width: 600px) {
    .hero-search-bar {
        max-width: 98vw;
    }
    .hero-search-bar input {
        font-size: 0.98rem;
        padding: 10px 10px 10px 38px;
    }
    .hero-search-bar i {
        left: 15px;
    }
}

[data-theme="dark"] .hero-search-bar {
    background: rgba(30, 41, 59, 0.5);
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .hero-search-bar input {
    color: #e2e8f0;
}

.pagination-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 40px;
    padding: 20px 0;
}

.pagination-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    border-radius: 12px;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pagination-btn:hover:not(:disabled) {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow-light);
}

.pagination-btn.active {
    background: var(--gradient-primary);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.pagination-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: var(--background-color);
}

.pagination-btn i {
    font-size: 0.9em;
}

.prev-btn i {
    margin-right: 6px;
}

.next-btn i {
    margin-left: 6px;
}

.pagination-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    color: var(--text-secondary);
}

@media (max-width: 600px) {
    .pagination-bar {
        gap: 4px;
        margin: 18px 0 0 0;
    }
    .pagination-bar button {
        font-size: 0.98rem;
        padding: 6px 8px;
        min-width: 28px;
    }
}
[data-theme="dark"] .pagination-bar button {
    background: #181c2400;
    color: #bfc7d5;
    border-color: #23272f;
}
[data-theme="dark"] .pagination-bar .pagination-num.active {
    background: linear-gradient(90deg, #6366f1 0%, #764ba2 100%);
    color: #fff;
    border-color: #6366f1;
}

/* Professional Mobile Filters */
.mrcoding-mobile-filters {
    display: none;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    margin: 20px;
    padding: 16px;
    box-shadow: 0 8px 32px var(--shadow-light);
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

[data-theme="dark"] .mrcoding-mobile-filters {
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px var(--shadow-medium);
}

.mrcoding-mobile-filters::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
}

.mrcoding-filter-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    position: relative;
    z-index: 1;
}

.mrcoding-filter-left {
    flex: 1;
}

.mrcoding-sort-group {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

[data-theme="dark"] .mrcoding-sort-group {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.mrcoding-sort-group:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.mrcoding-sort-group i {
    font-size: 12px;
    opacity: 0.8;
    transition: transform 0.3s ease;
}

.mrcoding-sort-group:hover i:last-child {
    transform: rotate(180deg);
}

.mrcoding-filter-right {
    display: flex;
    align-items: center;
}

.mrcoding-category-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--gradient-primary);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    padding: 10px 16px;
    color: #ffffff;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 12px var(--shadow-medium);
}

[data-theme="dark"] .mrcoding-category-btn {
    background: var(--gradient-primary);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 12px var(--shadow-heavy);
}

.mrcoding-category-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s ease;
}

.mrcoding-category-btn:hover::before {
    left: 100%;
}

.mrcoding-category-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.mrcoding-category-btn i {
    font-size: 12px;
    transition: transform 0.3s ease;
}

.mrcoding-category-btn:hover i {
    transform: translateX(2px);
}

/* Category Sidebar */
.mrcoding-category-sidebar {
    position: fixed;
    top: 0;
    left: -100%; 
    width: 300px;
    height: 100vh;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-right: 1px solid rgba(255, 255, 255, 0.3); 
    z-index: 1000;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1); 
    overflow-y: auto;
    box-shadow: 8px 0 32px var(--shadow-medium); 
}

[data-theme="dark"] .mrcoding-category-sidebar {
    background: rgba(30, 41, 59, 0.95);
    border-right: 1px solid rgba(255, 255, 255, 0.1); /* Changed from border-left */
    box-shadow: 8px 0 32px var(--shadow-heavy); /* Changed shadow direction */
}

.mrcoding-category-sidebar.active {
    left: 0; /* Changed from right */
}

.mrcoding-sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    position: sticky;
    top: 0;
    z-index: 2;
}

.mrcoding-sidebar-header h3 {
    color: var(--text-primary);
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

[data-theme="dark"] .mrcoding-sidebar-header h3 {
    color: var(--text-primary);
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.mrcoding-close-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 18px;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

[data-theme="dark"] .mrcoding-close-btn {
    color: var(--text-primary);
}

.mrcoding-close-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transition: all 0.3s ease;
    transform: translate(-50%, -50%);
}

.mrcoding-close-btn:hover::before {
    width: 32px;
    height: 32px;
}

.mrcoding-close-btn:hover {
    transform: rotate(90deg);
}

.mrcoding-category-list {
    padding: 16px 0;
}

.mrcoding-category-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 16px 20px;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    border-radius: 0;
    position: relative;
    overflow: hidden;
}

[data-theme="dark"] .mrcoding-category-item {
    color: var(--text-primary);
}

.mrcoding-category-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.2), transparent);
    transition: width 0.3s ease;
}

.mrcoding-category-item:hover::before {
    width: 100%;
}

.mrcoding-category-item:hover {
    background: rgba(59, 130, 246, 0.05);
    transform: translateX(4px);
}

[data-theme="dark"] .mrcoding-category-item:hover {
    background: rgba(59, 130, 246, 0.1);
}

.mrcoding-category-item.active {
    background: rgba(59, 130, 246, 0.1);
    border-left: 3px solid var(--primary-color);
    box-shadow: inset 0 0 20px rgba(59, 130, 246, 0.1);
}

[data-theme="dark"] .mrcoding-category-item.active {
    background: rgba(59, 130, 246, 0.2);
    border-left: 3px solid var(--primary-color);
    box-shadow: inset 0 0 20px rgba(59, 130, 246, 0.2);
}

.mrcoding-category-item.active::before {
    width: 100%;
}

.mrcoding-category-item i {
    width: 20px;
    text-align: center;
    font-size: 16px;
    opacity: 0.8;
    transition: all 0.3s ease;
}

.mrcoding-category-item:hover i {
    opacity: 1;
    transform: scale(1.1);
}

.mrcoding-category-item span {
    flex: 1;
    position: relative;
    z-index: 1;
}

.mrcoding-count {
    background: var(--gradient-primary);
    color: #ffffff;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    min-width: 24px;
    text-align: center;
    position: relative;
    z-index: 1;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px var(--shadow-medium);
}

[data-theme="dark"] .mrcoding-count {
    background: var(--gradient-primary);
    box-shadow: 0 2px 8px var(--shadow-heavy);
}

.mrcoding-category-item:hover .mrcoding-count {
    background: var(--gradient-accent);
    transform: scale(1.1);
    box-shadow: 0 4px 12px var(--shadow-medium);
}

[data-theme="dark"] .mrcoding-category-item:hover .mrcoding-count {
    background: var(--gradient-accent);
    box-shadow: 0 4px 12px var(--shadow-heavy);
}

/* Overlay for sidebar */
.mrcoding-sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
}

.mrcoding-sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Responsive Design */
@media (max-width: 768px) {
    .mrcoding-mobile-filters {
        display: block;
        margin: 16px;
        padding: 12px;
    }
    
    .mrcoding-category-sidebar {
        width: 280px;
    }
    
    .mrcoding-filter-container {
        gap: 12px;
    }
    
    .mrcoding-sort-group {
        font-size: 13px;
        padding: 6px 10px;
    }
    
    .mrcoding-category-btn {
        padding: 8px 12px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .mrcoding-mobile-filters {
        margin: 12px;
        padding: 10px;
    }
    
    .mrcoding-category-sidebar {
        width: 100%;
        left: -100%; /* Changed from right */
    }
    
    .mrcoding-filter-container {
        flex-direction: column;
        gap: 12px;
    }
    
    .mrcoding-filter-left,
    .mrcoding-filter-right {
        width: 100%;
    }
    
    .mrcoding-sort-group {
        justify-content: center;
    }
    
    .mrcoding-category-btn {
        justify-content: center;
        width: 100%;
    }
}

/* Hide on desktop */
@media (min-width: 769px) {
    .mrcoding-mobile-filters {
        display: none;
    }
}

@media (max-width: 768px) {
  .mrcoding-filter-left {
    display: none !important;
  }
}

/* Desktop Filters Bar */
.filters-bar {
    display: none; /* Hidden by default */
    margin-bottom: 30px;
    justify-content: center;
    text-align: center;
}

.filters-bar.active {
    display: flex;
}

.filter-toggle-container {
    display: none; /* Hidden by default, shown on desktop/tablet */
    margin-bottom: 20px;
    text-align: center;
}

.filter-toggle-btn {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 25px;
    padding: 12px 25px;
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px var(--shadow-light);
}

.filter-toggle-btn:hover {
    background: var(--background-color);
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--shadow-medium);
}

.filter-toggle-btn.active .toggle-icon {
    transform: rotate(180deg);
}

/* Original Desktop Filters Bar */
/* Re-apply desktop filter bar styles for when it's active */
@media (min-width: 769px) {
    .filter-toggle-container {
        display: block;
    }

    .filters-bar {
        display: flex;
        flex-direction: row;
        gap: 10px;
        flex-wrap: wrap;
        justify-content: center;
        padding: 16px;
        background: var(--surface-color);
        border-radius: 14px;
        border: 2px solid var(--border-color);
        box-shadow: 0 3px 15px var(--shadow-light);
        margin: 16px 0;
        display: none; /* Hide by default on desktop */
    }

    .filters-bar.active {
        display: flex; /* Show when active */
    }
}

@media (max-width: 768px) {
    .filter-toggle-container {
        display: block; /* Show on tablets */
    }

    .filters-bar {
        display: none !important; /* Always hide desktop filter bar on mobile */
    }
}

/* Responsive tweaks for elements-main layout to accommodate the new button */
@media (max-width: 1024px) {
    .elements-main {
        padding-top: 20px; /* Adjust padding for new button */
    }
}

@media (max-width: 768px) {
    .elements-main {
        padding-top: 10px; /* Further adjust for mobile */
    }
}

/* Footer */
.footer {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    padding: 60px 0 30px;
    position: relative;
    z-index: 1;
    border-radius: 16px 16px 0 0;
    margin-top: 40px;
}

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

.footer-section h4 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.footer-logo i {
    font-size: 1.8rem;
}

.footer-section p {
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.6;
}

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

.footer-section ul li {
    margin-bottom: 10px;
}

.footer-section ul li a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s ease;
}

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

.social-links {
    display: flex;
    gap: 15px;
}

.social-links a {
    width: 40px;
    height: 40px;
    background: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.3s ease;
}

.social-links a:hover {
    background: var(--gradient-primary);
    color: white;
    border-color: transparent;
    transform: translateY(-3px);
}

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
}
/* Specific icon colors on hover */
.social-icon[aria-label="YouTube"]:hover {
    background: #ff0000;
    color: white;
}

.social-icon[aria-label="Facebook"]:hover {
    background: #1877f2;
    color: white;
}

.social-icon[aria-label="Instagram"]:hover {
    background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
    color: white;
}

.social-icon[aria-label="TikTok"]:hover {
    background: #000000;
    color: #69c9d0;
}