/* Components Page Styles */
body {
    background: #fafafa;
    color: #1f2937;
}

/* Back Button */
.back-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #666;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s ease;
}

.back-btn:hover {
    color: #6c63ff;
}

/* Components Header */
.components-header {
    background: white;
    color: #1f2937;
    padding: 120px 0 40px;
    text-align: center;
    position: relative;
    border-bottom: 1px solid #e5e7eb;
    margin-top: 40px;
}

.components-header::before {
    display: none;
}

.header-content {
    position: relative;
    z-index: 1;
}

.header-content h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 12px;
    color: #111827;
    letter-spacing: -1px;
}

.header-content p {
    font-size: 1.05rem;
    color: #6b7280;
    max-width: 600px;
    margin: 0 auto;
    font-weight: 400;
}

/* Filters Section */
.filters-section {
    background: white;
    padding: 32px 0;
    border-bottom: 1px solid #e5e7eb;
}

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

.filter-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    flex-wrap: wrap;
    justify-content: center;
}

.filter-tab {
    padding: 8px 20px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 24px;
    color: #6b7280;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-tab:hover {
    background: #f9fafb;
    color: #111827;
    border-color: #d1d5db;
}

.filter-tab.active {
    background: #111827;
    color: #ffffff;
    border-color: #111827;
}

.filter-options {
    display: flex;
    gap: 16px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.filter-select {
    padding: 10px 16px;
    background: #ffffff;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    color: #333;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-select:focus {
    outline: none;
    border-color: #6c63ff;
    box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.1);
}

.filter-select option {
    background: #ffffff;
    color: #333;
}

/* Search Input */
.search-input-container {
    position: relative;
    display: flex;
    align-items: center;
    flex: 1;
    max-width: 400px;
}

.search-input-container i {
    position: absolute;
    left: 16px;
    color: #666;
    z-index: 1;
    font-size: 0.9rem;
}

.search-input-container input {
    width: 100%;
    padding: 10px 16px 10px 40px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    background: #ffffff;
    color: #333;
}

.search-input-container input:focus {
    outline: none;
    border-color: #6c63ff;
    box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.1);
}

.search-input-container input::placeholder {
    color: #9ca3af;
}

/* Components Section */
.components-section {
    padding: 48px 0 80px;
    background: #fafafa;
}

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

.components-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

/* Component Card */
.component-card {
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.component-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
    border-color: #d1d5db;
}

.component-preview {
    position: relative;
    height: 200px;
    background: #fafafa;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
    overflow: hidden;
    border-bottom: 1px solid #f3f4f6;
}

.component-preview.dark-bg {
    background: linear-gradient(135deg, #374151 0%, #1f2937 100%);
}

.component-preview.light-bg {
    background: linear-gradient(135deg, #ffffff 0%, #f9fafb 100%);
}

.component-info {
    padding: 20px;
}

.component-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.component-info h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 4px;
    letter-spacing: -0.2px;
}

.component-author {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #6b7280;
    font-size: 0.85rem;
}

.author-avatar {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6c63ff 0%, #5a52d9 100%);
}

.component-stats {
    display: flex;
    gap: 16px;
    color: #9ca3af;
    font-size: 0.85rem;
}

.stat {
    display: flex;
    align-items: center;
    gap: 4px;
}

.stat i {
    font-size: 0.8rem;
}

/* Code Modal */
.code-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    background: #ffffff;
    border-radius: 20px;
    border: 2px solid #e5e7eb;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.code-modal.active {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.code-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    border-bottom: 2px solid #e5e7eb;
    background: linear-gradient(135deg, #6c63ff 0%, #5a52d9 100%);
    border-radius: 20px 20px 0 0;
}

.code-modal-header h2 {
    font-size: 1.3rem;
    font-weight: 700;
    color: #ffffff;
}

.close-modal {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #ffffff;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.close-modal:hover {
    background: rgba(255, 255, 255, 0.3);
}

.code-tabs {
    display: flex;
    gap: 8px;
    padding: 16px 24px 0;
    border-bottom: 2px solid #e5e7eb;
    background: #f9fafb;
}

.code-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: #6b7280;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.code-tab:hover {
    color: #6c63ff;
}

.code-tab.active {
    color: #6c63ff;
    border-bottom-color: #6c63ff;
}

.code-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.code-tab-content {
    display: none;
}

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

.code-tab-content pre {
    background: #1f2937;
    border: 2px solid #374151;
    border-radius: 12px;
    padding: 24px;
    overflow-x: auto;
    margin: 0;
}

.code-tab-content code {
    color: #e5e7eb;
    font-family: 'Courier New', 'Monaco', monospace;
    font-size: 0.9rem;
    line-height: 1.8;
    white-space: pre;
}

.code-modal-footer {
    padding: 20px 24px;
    border-top: 2px solid #e5e7eb;
    display: flex;
    justify-content: flex-end;
    background: #f9fafb;
}

.copy-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    background: #6c63ff;
    color: #ffffff;
    border: none;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(108, 99, 255, 0.3);
}

.copy-btn:hover {
    background: #5a52d9;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(108, 99, 255, 0.4);
}

.copy-btn.copied {
    background: #10b981;
    color: #fff;
}

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

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

/* No Results */
.no-results {
    text-align: center;
    padding: 80px 20px;
}

.no-results-content i {
    font-size: 3rem;
    color: #d1d5db;
    margin-bottom: 16px;
}

.no-results-content h3 {
    color: #4b5563;
    margin-bottom: 8px;
    font-weight: 600;
}

.no-results-content p {
    color: #6b7280;
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .components-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .components-header {
        padding: 100px 0 32px;
    }
    
    .header-content h1 {
        font-size: 2.2rem;
    }
    
    .header-content p {
        font-size: 1rem;
        padding: 0 20px;
    }
    
    .filters-container {
        flex-direction: column;
        gap: 16px;
    }
    
    .filter-tabs {
        flex-wrap: wrap;
        gap: 8px;
        justify-content: center;
    }
    
    .filter-tab {
        padding: 8px 16px;
        font-size: 0.85rem;
        flex: 0 0 auto;
    }
    
    .filter-options {
        width: 100%;
        justify-content: center;
    }
    
    .search-input-container {
        width: 100%;
        max-width: 100%;
    }
    
    .components-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .component-preview {
        height: 200px;
        padding: 30px;
    }
    
    .code-modal {
        width: 95%;
        max-height: 85vh;
    }
    
    .code-modal-header {
        padding: 20px;
    }
    
    .code-modal-header h2 {
        font-size: 1.1rem;
    }
    
    .code-content {
        padding: 16px;
    }
}

@media (max-width: 480px) {
    .components-header {
        padding: 80px 0 24px;
    }
    
    .header-content h1 {
        font-size: 1.8rem;
    }
    
    .filter-tabs {
        gap: 6px;
        padding: 0 10px;
    }
    
    .filter-tab {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
    
    .filter-options {
        flex-direction: column;
        width: 100%;
        padding: 0 10px;
    }
    
    .search-input-container {
        max-width: 100%;
    }
    
    .component-preview {
        height: 180px;
        padding: 20px;
    }
    
    .component-info {
        padding: 16px;
    }
    
    .code-tab-content pre {
        padding: 16px;
    }
    
    .code-tab-content code {
        font-size: 0.8rem;
    }
}