/* ==========================================================================
   Rosetta Skills Documentation - FastAPI-inspired Styles
   ========================================================================== */

/* Reset & Base */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  padding: 0;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  color: #212529;
  background-color: #F8F9FA;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Container */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Header */
.header {
  padding: 2rem 0 1.5rem;
  border-bottom: 1px solid #DEE2E6;
  margin-bottom: 2rem;
}

.header h1 {
  margin: 0 0 0.5rem;
  font-size: 2rem;
  font-weight: 700;
  color: #212529;
  letter-spacing: -0.025em;
}

.subtitle {
  margin: 0;
  color: #6C757D;
  font-size: 1.125rem;
}

/* Layout */
.layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 2rem;
  align-items: start;
}

/* Sidebar */
.sidebar {
  position: sticky;
  top: 2rem;
  background: #FFFFFF;
  border: 1px solid #DEE2E6;
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.sidebar h3 {
  margin: 0 0 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #495057;
}

.stats-section {
  margin-bottom: 2rem;
}

.stat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid #F1F3F5;
}

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

.stat-label {
  color: #868E96;
  font-size: 0.875rem;
}

.stat-value {
  font-weight: 600;
  color: #212529;
  font-variant-numeric: tabular-nums;
}

/* IDE Filters */
.ide-filters {
  margin-bottom: 2rem;
}

.ide-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.ide-tab {
  flex: 1 0 auto;
  min-width: 80px;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #495057;
  background: #F8F9FA;
  border: 1px solid #DEE2E6;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.ide-tab:hover {
  background: #E9ECEF;
  border-color: #CED4DA;
}

.ide-tab.active {
  background: #339AF0;
  color: #FFFFFF;
  border-color: #339AF0;
}

.tab-hint {
  margin: 0;
  font-size: 0.875rem;
  color: #6C757D;
}

.tab-hint strong {
  color: #212529;
  font-weight: 600;
}

/* Domain Stats */
.domain-stats {
  margin-bottom: 1rem;
}

#domain-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.domain-tag {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: #495057;
  background: #E9ECEF;
  border-radius: 999px;
}

/* Main Content */
.content {
  min-width: 0; /* Prevent grid blowout */
}

/* Search Bar */
.search-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: #FFFFFF;
  border: 1px solid #DEE2E6;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.search-bar input[type="text"] {
  flex: 1;
  border: none;
  outline: none;
  font-size: 1rem;
  font-family: inherit;
  color: #212529;
  background: transparent;
  min-width: 0;
}

.search-bar input[type="text"]::placeholder {
  color: #ADB5BD;
}

.search-count {
  font-size: 0.875rem;
  color: #6C757D;
  white-space: nowrap;
}

/* Skill Grid */
.skill-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

/* Skill Card */
.skill-card {
  background: #FFFFFF;
  border: 1px solid #DEE2E6;
  border-radius: 8px;
  padding: 1.25rem;
  transition: all 0.2s ease;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  display: flex;
  flex-direction: column;
}

.skill-card:hover {
  border-color: #339AF0;
  box-shadow: 0 4px 12px rgba(51, 154, 240, 0.1);
  transform: translateY(-2px);
}

.skill-card.expanded {
  grid-column: 1 / -1;
  cursor: default;
}

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

.card-header h3 {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: #212529;
  line-height: 1.3;
}

.skill-card.expanded .card-header h3 {
  font-size: 1.375rem;
}

.description {
  margin: 0 0 1rem;
  color: #495057;
  font-size: 0.9375rem;
  line-height: 1.6;
  flex: 1;
}

.skill-card.expanded .description {
  margin-bottom: 1.5rem;
}

.metadata {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* Badges */
.badge {
  display: inline-block;
  padding: 0.25rem 0.625rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.025em;
  border-radius: 4px;
  white-space: nowrap;
}

.badge-installed {
  background: #D3F9D8;
  color: #2B8A3E;
}

.badge-user-created {
  background: #D0EBFF;
  color: #1971C2;
}

.badge-catalog {
  background: #F1F3F5;
  color: #495057;
}

.ide-badge {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: #495057;
  background: #E9ECEF;
  border: 1px solid #DEE2E6;
  border-radius: 4px;
}

/* Card Body (Expanded) */
.card-body {
  border-top: 1px solid #F1F3F5;
  padding-top: 1.25rem;
  margin-top: 0.5rem;
}

.card-body section {
  margin-bottom: 1.25rem;
}

.card-body h4 {
  margin: 0 0 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #495057;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.card-body ul {
  margin: 0;
  padding-left: 1.25rem;
  color: #495057;
}

.card-body li {
  margin-bottom: 0.25rem;
  font-size: 0.9375rem;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.tag {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #495057;
  background: #F1F3F5;
  border-radius: 4px;
}

.repo-link {
  display: inline-flex;
  align-items: center;
  margin-bottom: 1rem;
  color: #339AF0;
  font-weight: 500;
  text-decoration: none;
  font-size: 0.9375rem;
}

.repo-link:hover {
  text-decoration: underline;
}

.collapse-btn {
  align-self: flex-start;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #495057;
  background: #F8F9FA;
  border: 1px solid #DEE2E6;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.collapse-btn:hover {
  background: #E9ECEF;
  border-color: #CED4DA;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: #6C757D;
  background: #FFFFFF;
  border: 1px dashed #DEE2E6;
  border-radius: 8px;
}

.empty-state p {
  margin: 0;
  font-size: 1.125rem;
}

/* Responsive */
@media (max-width: 768px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    margin-bottom: 1.5rem;
  }

  .skill-grid {
    grid-template-columns: 1fr;
  }

  .header h1 {
    font-size: 1.5rem;
  }

  .subtitle {
    font-size: 1rem;
  }
}

/* Focus States for Accessibility */
button:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 2px solid #339AF0;
  outline-offset: 2px;
}

/* Print Styles */
@media print {
  .sidebar {
    display: none;
  }

  .layout {
    grid-template-columns: 1fr;
  }

  .skill-card {
    break-inside: avoid;
    page-break-inside: avoid;
  }
}
/* Raw YAML Section */
.raw-yaml {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px dashed #DEE2E6;
}

.raw-yaml h4 {
  margin-bottom: 0.75rem;
  color: #495057;
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.raw-yaml pre {
  margin: 0;
  padding: 1rem;
  background: #F8F9FA;
  border: 1px solid #DEE2E6;
  border-radius: 6px;
  overflow-x: auto;
}

.raw-yaml code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
  font-size: 0.875rem;
  color: #343A40;
  line-height: 1.45;
}
