/* WP GitHub Embed - Simple GitHub OG Image Style */

.wp-github-embed-link {
  display: inline-block;
  color: inherit;
  width: fit-content;
  max-width: 100%;
}

.wp-github-embed-link:hover {
  text-decoration: none !important;
}

.wp-github-embed-simple {
  width: 100%;
  max-width: 600px;
  background: #ffffff;
  border: 1px solid #d0d7de;
  border-radius: 8px;
  padding: 24px;
  margin: 20px 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans",
    Helvetica, Arial, sans-serif;
  color: #24292f;
  position: relative;
  overflow: hidden;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.wp-github-embed-link:hover .wp-github-embed-simple {
  border-color: #0969da;
  box-shadow: 0 4px 12px rgba(9, 105, 218, 0.15);
  transform: translateY(-1px);
}

.wp-github-embed-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 16px;
}

.wp-github-embed-title {
  flex: 1;
  min-width: 0;
}

.wp-github-embed-repo-name {
  margin: 0 !important;
  font-size: 28px;
  line-height: 1.2;
  color: #24292f;
  word-break: break-word;
}

.wp-github-embed-owner {
  font-weight: 400;
  color: #656d76;
}

.wp-github-embed-repo {
  font-weight: 700 !important;
  color: #24292f;
}

.wp-github-embed-avatar-container {
  flex-shrink: 0;
}

.wp-github-embed-avatar {
  width: 72px;
  height: 72px;
  border-radius: 8px;
  border: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.wp-github-embed-description {
  margin: 0 0 20px 0;
  font-size: 16px;
  line-height: 1.5;
  color: #656d76;
}

.wp-github-embed-cta {
  margin: 20px 0;
}

.wp-github-embed-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: linear-gradient(135deg, #0969da 0%, #0550ae 100%);
  color: #ffffff;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(9, 105, 218, 0.2);
  border: none;
  text-decoration: none;
}

.wp-github-embed-link:hover .wp-github-embed-button {
  background: linear-gradient(135deg, #0550ae 0%, #044b94 100%);
  box-shadow: 0 4px 8px rgba(9, 105, 218, 0.3);
  transform: translateY(-1px);
}

.wp-github-embed-button-icon {
  width: 16px;
  height: 16px;
  fill: currentColor;
  flex-shrink: 0;
}

.wp-github-embed-stats {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 0;
  position: relative;
  flex-wrap: wrap;
}

.wp-github-embed-stat {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: #656d76;
  min-width: 0;
}

.wp-github-embed-icon {
  width: 16px;
  height: 16px;
  color: #656d76;
  flex-shrink: 0;
}

.wp-github-embed-stat-count {
  font-weight: 600;
  color: #24292f;
}

.wp-github-embed-stat-label {
  color: #656d76;
  white-space: nowrap;
}

.wp-github-embed-github-logo {
  margin-left: auto;
  opacity: 0.6;
  flex-shrink: 0;
}

.wp-github-embed-github-logo svg {
  color: #656d76;
}

.wp-github-embed-language-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  border-radius: 0 0 8px 8px;
}

/* Responsive design */
@media (max-width: 768px) {
  .wp-github-embed-simple {
    padding: 20px;
    margin: 16px 0;
    max-width: 100%;
  }

  .wp-github-embed-header {
    flex-direction: row-reverse;
    align-items: flex-start;
    gap: 12px;
  }

  .wp-github-embed-avatar-container {
    align-self: flex-end;
  }

  .wp-github-embed-avatar {
    width: 56px;
    height: 56px;
  }

  .wp-github-embed-repo-name {
    font-size: 24px;
  }

  .wp-github-embed-description {
    font-size: 15px;
    margin-bottom: 16px;
  }

  .wp-github-embed-stats {
    gap: 16px;
  }

  .wp-github-embed-github-logo {
    margin-left: 0;
    margin-top: 8px;
  }
}

@media (max-width: 480px) {
  .wp-github-embed-simple {
    padding: 16px;
    margin: 12px 0;
  }

  .wp-github-embed-repo-name {
    font-size: 20px;
  }

  .wp-github-embed-description {
    font-size: 14px;
  }

  .wp-github-embed-button {
    padding: 8px 16px;
    font-size: 13px;
  }

  .wp-github-embed-stats {
    gap: 12px;
  }

  .wp-github-embed-stat {
    font-size: 13px;
  }

  .wp-github-embed-avatar {
    width: 48px;
    height: 48px;
  }
}

@media (max-width: 360px) {
  .wp-github-embed-simple {
    padding: 12px;
  }

  .wp-github-embed-repo-name {
    font-size: 18px;
  }

  .wp-github-embed-stats {
    gap: 8px;
  }

  .wp-github-embed-stat {
    font-size: 12px;
  }

  .wp-github-embed-stat-label {
    display: none;
  }
}

/* Block editor specific styles */
.wp-block-wp-github-embed-github-repo {
  margin: 16px 0;
}

.wp-github-embed-block-controls {
  margin-bottom: 16px;
  padding: 12px;
  background: #f6f8fa;
  border-radius: 6px;
  border: 1px solid #d0d7de;
}

.wp-github-embed-url-input {
  width: 100%;
  padding: 8px 12px;
  border: 2px solid #d0d7de;
  border-radius: 6px;
  font-size: 14px;
}

.wp-github-embed-url-input:focus {
  outline: none;
  border-color: #0969da;
  box-shadow: 0 0 0 3px rgba(9, 105, 218, 0.1);
}

/* Loading and error states */
.wp-github-embed-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 40px;
  color: #656d76;
  font-style: italic;
  background: #f6f8fa;
  border: 1px solid #d0d7de;
  border-radius: 8px;
  max-width: 600px;
  margin: 20px 0;
}

.wp-github-embed-loading::before {
  content: "";
  width: 20px;
  height: 20px;
  margin-right: 8px;
  border: 2px solid #d0d7de;
  border-top: 2px solid #0969da;
  border-radius: 50%;
  animation: wp-github-embed-spin 1s linear infinite;
}

@keyframes wp-github-embed-spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.wp-github-embed-error {
  color: #d1242f;
  background: #ffebee;
  border: 1px solid #d1242f;
  border-radius: 6px;
  padding: 16px 20px;
  margin: 16px 0;
  font-weight: 500;
  max-width: 600px;
}

/* Placeholder styles for block editor */
.wp-github-embed-placeholder {
  background: #f6f8fa;
  border: 2px dashed #d0d7de;
  border-radius: 8px;
  padding: 40px;
  text-align: center;
  color: #656d76;
  max-width: 600px;
  margin: 20px 0;
}

.wp-github-embed-placeholder svg {
  opacity: 0.6;
  margin-bottom: 16px;
}

.wp-github-embed-placeholder p {
  margin: 8px 0;
  font-size: 14px;
}

.wp-github-embed-placeholder strong {
  color: #24292f;
  font-size: 16px;
}

/* Legacy compatibility */
.wp-github-embed-card,
.wp-github-embed-og-card {
  display: none;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .wp-github-embed-simple {
    background: #0d1117;
    border-color: #30363d;
    color: #f0f6fc;
  }

  .wp-github-embed-repo-name {
    color: #f0f6fc;
  }

  .wp-github-embed-owner {
    color: #8b949e;
  }

  .wp-github-embed-repo {
    color: #f0f6fc;
  }

  .wp-github-embed-description {
    color: #8b949e;
  }

  .wp-github-embed-stat-count {
    color: #f0f6fc;
  }

  .wp-github-embed-stat-label {
    color: #8b949e;
  }

  .wp-github-embed-icon {
    color: #8b949e;
  }

  .wp-github-embed-github-logo svg {
    color: #8b949e;
  }

  .wp-github-embed-link:hover .wp-github-embed-simple {
    border-color: #1f6feb;
    box-shadow: 0 4px 12px rgba(31, 111, 235, 0.15);
  }
}
