/* Component Library Styles */

/* Search Section */
.search-section {
    padding: 40px 0;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(139, 92, 246, 0.1));
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.search-section h2 {
    font-size: 2rem;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.search-section p {
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 30px;
    font-size: 1.1rem;
}

.search-filters {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
    align-items: center;
}

.search-input, .search-select {
    padding: 12px 16px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 14px;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.search-input:focus, .search-select:focus {
    outline: none;
    border-color: #3b82f6;
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
}

.btn-search {
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    border: none;
    padding: 12px 24px;
    border-radius: 10px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.btn-search:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(59, 130, 246, 0.4);
}

.search-results {
    min-height: 200px;
}

.search-stats {
    margin-bottom: 20px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.search-stats h3 {
    color: #3b82f6;
    margin-bottom: 10px;
}

.filter-tag {
    display: inline-block;
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-right: 10px;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.component-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.component-card {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    padding: 20px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.component-card:hover {
    transform: translateY(-5px);
    border-color: rgba(59, 130, 246, 0.5);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
}

.component-card h4 {
    color: #f0f3fa;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.component-category {
    color: #8b5cf6;
    font-size: 0.9rem;
    margin-bottom: 5px;
    font-weight: 500;
}

.component-size {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
    margin-bottom: 15px;
}

.btn-view {
    background: linear-gradient(135deg, #10b981, #059669);
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    color: white;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
}

.btn-view:hover {
    background: linear-gradient(135deg, #059669, #047857);
    transform: translateY(-2px);
}

.loading, .no-results, .error {
    text-align: center;
    padding: 40px;
    color: rgba(255, 255, 255, 0.8);
}

.loading {
    color: #3b82f6;
}

.error {
    color: #ef4444;
}

/* Responsive Design */
@media (max-width: 768px) {
    .search-filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-input, .search-select, .btn-search {
        width: 100%;
    }
    
    .component-grid {
        grid-template-columns: 1fr;
    }
    
    .search-section h2 {
        font-size: 1.5rem;
    }
}

/* Components Section */
.components-section {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.components-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.components-header h4 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.components-count {
  font-size: 0.875rem;
  color: var(--text-secondary);
  background: rgba(59, 130, 246, 0.1);
  color: var(--accent-primary);
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-weight: 500;
}

.components-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.75rem;
}

.component-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
  width: 100%;
}

.component-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--accent-primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.component-icon {
  font-size: 1.5rem;
  line-height: 1;
  flex-shrink: 0;
}

.component-name {
  flex: 1;
  font-weight: 500;
  color: var(--text-primary);
  font-size: 0.875rem;
}

.component-size {
  font-size: 0.75rem;
  color: var(--text-secondary);
  background: rgba(0, 0, 0, 0.3);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-weight: 500;
}

/* Modal Styles */
.orynx-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.orynx-modal.active {
  display: flex;
  animation: modalFadeIn 0.3s ease-out;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  background: linear-gradient(145deg, var(--bg-card), var(--bg-secondary));
  border: 1px solid var(--border-color);
  border-radius: 16px;
  width: 100%;
  max-width: 800px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 50px var(--shadow);
  animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-50px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.modal-close {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.5rem;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.2s ease;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.2);
  color: var(--text-primary);
}

.modal-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
}

.code-block {
  margin: 0;
  background: #0d1117;
  border: none;
  border-radius: 0;
  overflow: auto;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  flex: 1;
  max-height: 400px;
}

.code-block code {
  display: block;
  padding: 1.5rem;
  color: #e6edf3;
  font-size: 0.875rem;
  line-height: 1.6;
  white-space: pre-wrap;
}

.modal-footer {
  display: flex;
  gap: 0.75rem;
  padding: 1.5rem;
  border-top: 1px solid var(--border-color);
  justify-content: flex-end;
}

.modal-footer .btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.modal-footer .btn-primary {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: white;
}

.modal-footer .btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.modal-footer .btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.modal-footer .btn-secondary:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Responsive Design */
@media (max-width: 768px) {
  .components-grid {
    grid-template-columns: 1fr;
  }
  
  .component-btn {
    padding: 0.625rem;
  }
  
  .component-icon {
    font-size: 1.25rem;
  }
  
  .component-name {
    font-size: 0.8rem;
  }
  
  .modal-content {
    margin: 0.5rem;
    max-height: 95vh;
  }
  
  .modal-header,
  .modal-footer {
    padding: 1rem;
  }
  
  .modal-footer {
    flex-direction: column;
  }
  
  .modal-footer .btn {
    justify-content: center;
  }
  
  .code-block code {
    padding: 1rem;
    font-size: 0.8rem;
  }
}

/* Animation for components loading */
.components-section {
  animation: fadeInUp 0.5s ease-out;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Loading state for components */
.components-section.loading {
  opacity: 0.5;
  pointer-events: none;
}

.components-section.loading::after {
  content: 'Loading components...';
  display: block;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-top: 1rem;
}

/* Enhanced card hover with components */
.card:hover .components-section {
  opacity: 1;
}

.card .components-section {
  transition: opacity 0.3s ease;
}

/* Component button focus state */
.component-btn:focus {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

/* Copy success animation */
@keyframes copySuccess {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

.modal-footer .btn-primary.copied {
  animation: copySuccess 0.3s ease;
}

