/* Hydra Registry Island CSS Module */

.wrapper {
  padding: 20px;
  background: #ffffff;
  border: 1px solid #e1e5e9;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease-in-out;
  min-width: 350px;
  max-width: 500px;
}

.wrapper:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border-color: #d1d9e0;
}

.wrapper.hydratedEffect {
  border-color: #6f42c1;
  background: linear-gradient(135deg, #ffffff 0%, #f8f6ff 100%);
}

.registryHeader {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e9ecef;
}

.registryTitle {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: #2c3e50;
}

.registryCount {
  background: #6f42c1;
  color: white;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 600;
}

.searchContainer {
  position: relative;
  margin-bottom: 16px;
}

.searchInput {
  width: 100%;
  padding: 10px 12px 10px 36px;
  border: 1px solid #ced4da;
  border-radius: 6px;
  font-size: 0.9rem;
  background: #ffffff;
  transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.searchInput:focus {
  outline: none;
  border-color: #6f42c1;
  box-shadow: 0 0 0 3px rgba(111, 66, 193, 0.1);
}

.searchIcon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #6c757d;
  font-size: 0.9rem;
}

.modulesList {
  max-height: 300px;
  overflow-y: auto;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  background: #fff;
}

.moduleItem {
  padding: 12px;
  border-bottom: 1px solid #f1f3f4;
  transition: background-color 0.2s ease-in-out;
  cursor: pointer;
}

.moduleItem:last-child {
  border-bottom: none;
}

.moduleItem:hover {
  background: #f8f9fa;
}

.moduleItem.selected {
  background: #e7e3ff;
  border-left: 3px solid #6f42c1;
}

.moduleHeader {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.moduleName {
  font-weight: 600;
  color: #2c3e50;
  font-size: 0.9rem;
}

.moduleVersion {
  font-size: 0.75rem;
  color: #6c757d;
  background: #f8f9fa;
  padding: 2px 6px;
  border-radius: 10px;
}

.moduleDescription {
  font-size: 0.8rem;
  color: #6c757d;
  margin-bottom: 6px;
  line-height: 1.3;
}

.moduleTags {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.moduleTag {
  font-size: 0.7rem;
  background: #e9ecef;
  color: #495057;
  padding: 2px 6px;
  border-radius: 8px;
  font-weight: 500;
}

.moduleTag.loaded {
  background: #d4edda;
  color: #155724;
}

.moduleTag.system {
  background: #fff3cd;
  color: #856404;
}

.moduleTag.user {
  background: #cce7ff;
  color: #004085;
}

.emptyState {
  text-align: center;
  padding: 40px 20px;
  color: #6c757d;
}

.emptyIcon {
  font-size: 2rem;
  margin-bottom: 12px;
  opacity: 0.5;
}

.emptyText {
  font-size: 0.9rem;
  margin-bottom: 8px;
}

.emptySubtext {
  font-size: 0.8rem;
  opacity: 0.7;
}

.actionButtons {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid #e9ecef;
}

.button {
  flex: 1;
  background: #6f42c1;
  color: white;
  border: none;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  font-size: 0.85rem;
  transition: all 0.2s ease-in-out;
}

.button:hover:not(:disabled) {
  background: #5a2d91;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(111, 66, 193, 0.3);
}

.button:disabled {
  background: #6c757d;
  cursor: not-allowed;
  opacity: 0.6;
}

.button.secondary {
  background: #6c757d;
}

.button.secondary:hover:not(:disabled) {
  background: #545b62;
  box-shadow: 0 2px 8px rgba(108, 117, 125, 0.3);
}

/* Loading state styles */
.wrapper.loading {
  opacity: 0.7;
  background: linear-gradient(45deg, #f8f9fa 25%, transparent 25%, transparent 75%, #f8f9fa 75%, #f8f9fa),
              linear-gradient(45deg, #f8f9fa 25%, transparent 25%, transparent 75%, #f8f9fa 75%, #f8f9fa);
  background-size: 20px 20px;
  background-position: 0 0, 10px 10px;
  animation: shimmer 1s linear infinite;
}

.wrapper.loading .button,
.wrapper.loading .searchInput {
  pointer-events: none;
  opacity: 0.5;
}

@keyframes shimmer {
  0% { background-position: 0 0, 10px 10px; }
  100% { background-position: 20px 20px, 30px 30px; }
}

/* Custom scrollbar for modules list */
.modulesList::-webkit-scrollbar {
  width: 6px;
}

.modulesList::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.modulesList::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 3px;
}

.modulesList::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* Dark theme support */
@media (prefers-color-scheme: dark) {
  .wrapper {
    background: #2d3748;
    border-color: #4a5568;
    color: #e2e8f0;
  }

  .registryTitle {
    color: #f7fafc;
  }

  .searchInput {
    background: #1a202c;
    border-color: #4a5568;
    color: #e2e8f0;
  }

  .modulesList {
    background: #1a202c;
    border-color: #4a5568;
  }

  .moduleItem:hover {
    background: #2d3748;
  }

  .moduleName {
    color: #e2e8f0;
  }

  .moduleVersion {
    background: #4a5568;
    color: #a0aec0;
  }

  .moduleTag {
    background: #4a5568;
    color: #a0aec0;
  }
}

/* Responsive design */
@media (max-width: 480px) {
  .wrapper {
    padding: 15px;
    min-width: 280px;
  }

  .actionButtons {
    flex-direction: column;
  }

  .modulesList {
    max-height: 250px;
  }
}
