/* ==============================================================================
   3. UI Components & Widgets - Learn Coding
   ============================================================================== */

/* Smart Search Bar Component */
.search-container {
  position: relative;
  margin-top: 0.85rem;
  width: 100%;
}

.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  background-color: #1e293b;
  border: 1px solid #334155;
  border-radius: 0.5rem;
  padding: 0.45rem 0.65rem;
  transition: all 0.2s ease;
}

.search-input-wrapper:focus-within {
  border-color: #38bdf8;
  background-color: #0f172a;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.25);
}

.search-icon {
  font-size: 0.85rem;
  margin-right: 0.45rem;
  opacity: 0.7;
}

.search-input {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: #f8fafc;
  font-size: 0.825rem;
  font-weight: 500;
}

.search-input::placeholder {
  color: #64748b;
}

.search-shortcut {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.65rem;
  font-weight: 600;
  background-color: #334155;
  color: #94a3b8;
  padding: 0.15rem 0.35rem;
  border-radius: 0.25rem;
  border: 1px solid #475569;
  line-height: 1;
  pointer-events: none;
  margin-left: 0.35rem;
  white-space: nowrap;
}

/* Search Results Dropdown */
.search-results {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  right: 0;
  background-color: #0f172a;
  border: 1px solid #334155;
  border-radius: 0.625rem;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.6), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
  max-height: 400px;
  overflow-y: auto;
  z-index: 1000;
  display: none;
}

.search-results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  background-color: #020617;
  border-bottom: 1px solid #1e293b;
  font-size: 0.725rem;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.search-nav-hint {
  font-size: 0.65rem;
  font-weight: 500;
  color: #64748b;
  text-transform: none;
}

.search-results-list {
  list-style: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

.search-result-item {
  border-bottom: 1px solid #1e293b;
  transition: background-color 0.15s ease;
  cursor: pointer;
}

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

.search-result-item:hover,
.search-result-item.selected {
  background-color: #1e293b !important;
}

.search-result-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.75rem;
  text-decoration: none !important;
  color: #cbd5e1 !important;
  gap: 0.5rem;
}

.search-result-title-group {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.search-result-title {
  font-size: 0.825rem;
  font-weight: 600;
  color: #f8fafc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-result-snippet {
  font-size: 0.725rem;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 210px;
  line-height: 1.35;
}

.search-result-file {
  font-size: 0.7rem;
  color: #64748b;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}

.search-highlight {
  background-color: rgba(56, 189, 248, 0.25);
  color: #38bdf8;
  padding: 0 0.2rem;
  border-radius: 0.2rem;
  font-weight: 700;
}

.search-result-badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 9999px;
  white-space: nowrap;
  border: 1px solid transparent;
}

.badge-c { background-color: #0284c7; color: #e0f2fe; }
.badge-cpp { background-color: #2563eb; color: #dbeafe; }
.badge-html { background-color: #ea580c; color: #ffedd5; }
.badge-css { background-color: #0284c7; color: #e0f2fe; }
.badge-js { background-color: #ca8a04; color: #fef9c3; }
.badge-python { background-color: #16a34a; color: #dcfce7; }
.badge-java { background-color: #d97706; color: #fef3c7; }
.badge-sql { background-color: #7c3aed; color: #ede9fe; }
.badge-git-and-github { background-color: #475569; color: #f1f5f9; }

.search-no-results {
  padding: 1.25rem 0.85rem;
  text-align: center;
  color: #94a3b8;
}

.no-results-icon {
  font-size: 1.35rem;
  display: block;
  margin-bottom: 0.35rem;
}

.search-no-results p {
  font-size: 0.825rem;
  margin-bottom: 0.25rem;
  color: #cbd5e1 !important;
}

.search-tip {
  font-size: 0.7rem;
  color: #64748b;
  display: block;
}

/* Code Formatting & Syntax Highlighting Overrides */
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.875em;
  background-color: #1e293b !important;
  color: #38bdf8 !important;
  padding: 0.2em 0.45em;
  border-radius: 0.35rem;
  border: 1px solid #334155;
}

.highlighter-rouge, .highlight, div.highlighter-rouge, div.highlight {
  margin: 1.5rem 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  background-color: transparent !important;
}

pre, pre.highlight, div.highlighter-rouge pre, div.highlight pre {
  background-color: #020617 !important;
  color: #f1f5f9 !important;
  padding: 1.25rem 1.5rem !important;
  border-radius: 0.75rem !important;
  overflow-x: auto !important;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace !important;
  font-size: 0.9rem !important;
  line-height: 1.65 !important;
  margin-bottom: 1.5rem !important;
  border: 1px solid #1e293b !important;
  white-space: pre !important;
  word-spacing: normal !important;
  word-break: normal !important;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4) !important;
}

pre code, pre.highlight code, div.highlighter-rouge code, div.highlight code {
  background-color: transparent !important;
  color: #f1f5f9 !important;
  padding: 0 !important;
  border-radius: 0 !important;
  border: none !important;
  font-size: inherit !important;
  display: block !important;
  white-space: pre !important;
}

/* Dark Theme Table Styling */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.95rem;
  background-color: #0f172a;
  border-radius: 0.5rem;
  overflow: hidden;
  border: 1px solid #1e293b;
}

th, td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid #1e293b;
  color: #cbd5e1;
}

th {
  background-color: #1e293b;
  font-weight: 700;
  color: #f8fafc !important;
  border-bottom: 2px solid #334155;
}

tr:hover td {
  background-color: #1e293b;
}

/* Dark Theme Language Cards Grid */
.language-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 1.25rem;
  margin: 2rem 0;
}

.language-card {
  display: flex;
  flex-direction: column;
  padding: 1.25rem;
  background-color: #0f172a !important;
  border: 1px solid #1e293b !important;
  border-radius: 0.75rem;
  text-decoration: none !important;
  color: inherit !important;
  transition: all 0.2s ease-in-out;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
}

.language-card:hover {
  transform: translateY(-3px);
  background-color: #1e293b !important;
  border-color: #2563eb !important;
  box-shadow: 0 10px 20px -3px rgba(37, 99, 235, 0.25);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.card-title-group {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.card-icon {
  font-size: 1.5rem;
}

.card-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #f8fafc !important;
  margin: 0 !important;
  border: none !important;
  padding: 0 !important;
}

.card-badge {
  font-size: 0.75rem;
  font-weight: 600;
  background-color: #1e3a8a;
  color: #93c5fd;
  padding: 0.2rem 0.55rem;
  border-radius: 9999px;
  border: 1px solid #1d4ed8;
}

.card-desc {
  font-size: 0.875rem;
  color: #94a3b8 !important;
  margin: 0 0 1rem 0 !important;
  line-height: 1.5;
  flex: 1;
}

.card-link-text {
  font-size: 0.85rem;
  font-weight: 600;
  color: #38bdf8 !important;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.language-card:hover .card-link-text {
  color: #60a5fa !important;
}

/* Dark Theme Roadmap Flow Component */
.roadmap-flow {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 2rem 0;
}

.roadmap-card {
  background-color: #0f172a;
  border: 1px solid #1e293b;
  border-left: 4px solid #2563eb;
  border-radius: 0.5rem;
  padding: 1.25rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
}

.roadmap-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.step-num {
  font-size: 0.75rem;
  font-weight: 700;
  background-color: #2563eb;
  color: #ffffff;
  padding: 0.2rem 0.6rem;
  border-radius: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.step-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #f8fafc !important;
  margin: 0 !important;
  border: none !important;
  padding: 0 !important;
}

.step-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
}

.tech-tag {
  font-size: 0.875rem;
  font-weight: 600;
  background-color: #1e293b;
  color: #f1f5f9;
  padding: 0.35rem 0.75rem;
  border-radius: 0.375rem;
  border: 1px solid #334155;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.roadmap-arrow {
  color: #38bdf8;
  font-size: 1.1rem;
  font-weight: bold;
}

.roadmap-connector {
  text-align: center;
  font-size: 1.25rem;
  color: #38bdf8;
  font-weight: bold;
  margin: -0.25rem 0;
}

/* Dynamic Contributor Cards Grid */
.contributor-cards-wrapper {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.contributor-card {
  background-color: #0f172a;
  border: 1px solid #1e293b;
  border-radius: 0.625rem;
  padding: 0.85rem;
  transition: all 0.2s ease-in-out;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
}

.contributor-card:hover {
  transform: translateY(-2px);
  background-color: #1e293b;
  border-color: #38bdf8;
  box-shadow: 0 8px 16px -2px rgba(56, 189, 248, 0.2);
}

.contributor-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none !important;
  color: inherit !important;
}

.contributor-avatar {
  width: 42px;
  height: 42px;
  border-radius: 9999px;
  border: 2px solid #3b82f6;
  flex-shrink: 0;
}

.contributor-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.contributor-name {
  font-size: 0.875rem;
  font-weight: 700;
  color: #f8fafc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.contributor-commits {
  font-size: 0.725rem;
  color: #38bdf8;
  font-weight: 600;
}
