/**
 * Styling for the GitHub Copilot Feature Matrix website.
 */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial,
    sans-serif;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  min-height: 100vh;
  color: #333;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Header */
header {
  background: white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  padding: 2rem 0;
  margin-bottom: 2rem;
}

header h1 {
  font-size: 2.5rem;
  color: #0366d6;
  margin-bottom: 0.5rem;
}

.subtitle {
  font-size: 1.1rem;
  color: #666;
  line-height: 1.6;
}

/* Main content */
main {
  margin-bottom: 2rem;
}

.search-section {
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  padding: 2rem;
}

/* Search input */
.search-container {
  margin-bottom: 1.5rem;
}

.search-input-wrapper {
  position: relative;
}

.search-icon {
  position: absolute;
  top: 50%;
  left: 1rem;
  transform: translateY(-50%);
  color: #999;
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.75rem;
  font-size: 1rem;
  border: 2px solid #e0e0e0;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.search-input:focus {
  outline: none;
  border-color: #0366d6;
  box-shadow: 0 0 0 3px rgba(3, 102, 214, 0.1);
}

.search-input:focus ~ .search-icon {
  color: #0366d6;
}

.search-input::placeholder {
  color: #999;
}

/* Launch-announcements filter */
.filter-container {
  margin: -0.75rem 0 1.5rem;
}

.filter-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.95rem;
  color: #555;
  cursor: pointer;
}

.filter-note {
  color: #666;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

/* Hint */
.hint {
  background: #f0f4f8;
  border-left: 4px solid #0366d6;
  padding: 1rem;
  border-radius: 4px;
  margin-bottom: 1.5rem;
}

.hint p {
  margin-bottom: 0.5rem;
  color: #555;
  font-size: 0.95rem;
}

.hint ul {
  margin-left: 1.5rem;
  color: #555;
  font-size: 0.95rem;
}

.hint li {
  margin-bottom: 0.25rem;
}

/* Error message */
.error-message {
  background: #f8d7da;
  border: 1px solid #f5c6cb;
  color: #721c24;
  padding: 1rem;
  border-radius: 4px;
  margin-bottom: 1.5rem;
}

.error-message strong {
  font-weight: 600;
}

/* Results */
.results {
  margin-top: 1.5rem;
}

.summary-section {
  background: #f0f7ff;
  border-left: 4px solid #0366d6;
  padding: 1rem;
  border-radius: 4px;
  margin-bottom: 1.5rem;
}

.summary-section h2 {
  font-size: 1rem;
  color: #0366d6;
  margin-bottom: 0.5rem;
}

.summary-section p {
  font-size: 0.95rem;
  color: #555;
}

/* Permanent disclaimer shown below the search results area, regardless of
   search state (initial hint, no matches, or a populated results table). */
.disclaimer {
  margin-top: 1rem;
  font-size: 0.82rem;
  color: #666;
}

/* Rows table */
.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.rows-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  margin-top: 1rem;
}

.rows-table thead {
  background: #f0f0f0;
  position: sticky;
  top: 0;
  z-index: 10;
}

.rows-table th,
.rows-table td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid #e0e0e0;
  vertical-align: top;
}

.rows-table th {
  font-weight: 600;
  color: #333;
  background: #f9f9f9;
}

.rows-table tbody tr:hover {
  background: #f9f9f9;
}

.ide-cell {
  font-weight: 600;
  color: #333;
  white-space: nowrap;
  text-align: left;
}

/* Inner wrapper handles the logo + name layout. Flex must live here rather
   than on the <td> itself: browsers center a flex table-cell's content
   instead of respecting text-align/justify-content, which breaks
   left-alignment. */
.ide-name {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.ide-logo {
  width: 24px;
  height: 24px;
  object-fit: contain;
  flex-shrink: 0;
}

.snippet-match {
  background: #fff3bf;
  color: inherit;
  border-radius: 2px;
  padding: 0 0.1em;
}

.version-link {
  text-decoration: none;
}

.version-link:hover .version-badge {
  filter: brightness(1.1);
}

.version-badge {
  display: inline-block;
  background: #0366d6;
  color: white;
  padding: 0.2rem 0.55rem;
  border-radius: 3px;
  font-weight: 600;
  font-size: 0.85rem;
  white-space: nowrap;
}

.version-badge.later {
  background: #5f6f82;
}

.date-cell {
  color: #555;
  white-space: nowrap;
}

.desc-cell {
  color: #333;
  max-width: 480px;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}

.desc-cell a {
  color: inherit;
  text-decoration: none;
}

.desc-cell a:hover {
  text-decoration: underline;
}

.section-divider td {
  border-bottom: none;
  padding: 0.6rem 0.75rem 0.3rem;
  background: transparent;
  color: #666;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
}

.na-row {
  background: #fafafa;
  color: #666;
}

.na-row:hover {
  background: #f3f3f3;
}

.na-row .ide-cell {
  color: #666;
  font-weight: 500;
}

.na-cell {
  text-align: center;
  color: #666;
  font-style: italic;
}

.na-badge {
  font-size: 1.1rem;
  margin-right: 0.35rem;
}

.mobile-results {
  display: none;
  margin-top: 1rem;
}

.mobile-ide-group {
  margin-bottom: 1rem;
}

.mobile-ide-group-na {
  margin-bottom: 0.75rem;
}

.mobile-ide-heading,
.mobile-section-title {
  font-size: 0.95rem;
  color: #333;
  margin-bottom: 0.5rem;
}

.mobile-section-title {
  margin-top: 1.25rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #666;
}

.mobile-release-card {
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: 0.75rem;
  margin-bottom: 0.75rem;
  background: white;
}

.mobile-release-card-na {
  background: #fafafa;
}

.mobile-field + .mobile-field {
  margin-top: 0.6rem;
}

.mobile-field-label {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #666;
  margin-bottom: 0.2rem;
}

.mobile-field-value {
  color: #333;
}

.mobile-field-value a {
  color: inherit;
  text-decoration: none;
}

.mobile-field-value a:hover {
  text-decoration: underline;
}

/* Footer */
footer {
  background: white;
  border-top: 1px solid #e0e0e0;
  padding: 1.5rem 0;
  text-align: center;
  font-size: 0.9rem;
  color: #666;
}

footer p {
  margin-bottom: 0.5rem;
}

footer a {
  color: #0366d6;
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

/* Responsive design */
@media (max-width: 768px) {
  .container {
    padding: 0 0.85rem;
  }

  header {
    padding: 1.25rem 0;
    margin-bottom: 1.25rem;
  }

  header h1 {
    font-size: 1.6rem;
  }

  .subtitle {
    font-size: 0.95rem;
  }

  .search-section {
    padding: 1.1rem;
  }

  .search-input {
    font-size: 16px; /* Prevents zoom on iOS */
    padding: 0.7rem 0.75rem 0.7rem 2.6rem;
  }

  .filter-label {
    padding: 0.35rem 0; /* Larger touch target */
  }

  .filter-label input {
    width: 1.1rem;
    height: 1.1rem;
  }

  .rows-table {
    font-size: 0.9rem;
  }

  .rows-table th,
  .rows-table td {
    padding: 0.5rem;
  }

  .desc-cell {
    max-width: none;
  }
}

/* Below this width a four-column table no longer fits: each release becomes a
   stacked card with explicit labels in the DOM. */
@media (max-width: 600px) {
  .table-wrapper {
    display: none;
  }

  .mobile-results {
    display: block;
  }

  .mobile-release-card .desc-cell,
  .mobile-release-card .desc-cell a {
    font-size: 0.9rem;
    line-height: 1.5;
  }

  .mobile-release-card .version-link,
  .mobile-release-card .desc-cell a {
    display: inline-block;
    min-height: 32px; /* Comfortable tap target */
  }

  .mobile-release-card .desc-cell a {
    color: #0366d6;
    text-decoration: underline;
    text-underline-offset: 0.12em;
  }

  footer {
    font-size: 0.85rem;
  }
}
