/**
 * Link Card Styles
 *
 * Project: LinkCard
 * Author: CuiShuShu <contact@sacredshiptech.com>
 * Website: https://www.cuishushu.com
 * Copyright: Sacred Ship Technologies Inc. https://www.sacredshiptech.com
 * Filename: link-card.css
 * Location: usr/plugins/LinkCard/assets/
 * Description: Styles for social link cards
 */

.link-card {
  display: block;
  margin: 1.5em 0;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
  background: #fafafa;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.link-card:hover {
  border-color: #d1d5db;
  background: #f5f5f5;
}

.link-card-inner {
  display: flex;
  flex-direction: column;
  text-decoration: none !important;
  color: inherit;
  padding: 16px 20px;
  gap: 8px;
}

/* Row 1: Icon + Title */
.link-card-header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
}

.link-card-header > .link-card-favicon {
  flex-shrink: 0;
  width: 20px !important;
  height: 20px !important;
  border-radius: 4px;
  display: unset !important;
  margin: 0px !important;
}

.link-card-title {
  font-size: 15px;
  font-weight: 600;
  color: #1f2937;
  margin: 0;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-decoration: none;
}

/* Row 2: Description */
.link-card-description {
  font-size: 13px;
  color: #6b7280;
  margin: 0;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-decoration: none;
}

/* Row 3: URL */
.link-card-url {
  font-size: 12px;
  color: #9ca3af;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-decoration: none;
}

/* Loading state */
.link-card-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 24px 20px;
  color: #9ca3af;
  font-size: 13px;
}

.link-card-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid #e5e7eb;
  border-top-color: #6b7280;
  border-radius: 50%;
  animation: link-card-spin 0.6s linear infinite;
}

@keyframes link-card-spin {
  to {
    transform: rotate(360deg);
  }
}

/* Fallback link */
.link-card-fallback {
  display: none;
  padding: 16px 20px;
  color: #3b82f6;
  text-decoration: none;
  font-size: 13px;
  word-break: break-all;
}

.link-card.link-card-error .link-card-loading {
  display: none;
}

.link-card.link-card-error .link-card-fallback {
  display: block;
}

.link-card.link-card-loaded .link-card-loading,
.link-card.link-card-loaded .link-card-fallback {
  display: none;
}

/* Mobile responsive */
@media (max-width: 540px) {
  .link-card-inner {
    padding: 14px 16px;
    gap: 6px;
  }

  .link-card-favicon {
    width: 18px;
    height: 18px;
  }

  .link-card-title {
    font-size: 14px;
  }

  .link-card-description {
    font-size: 12px;
  }

  .link-card-url {
    font-size: 11px;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .link-card {
    background: #1f1f1f;
    border-color: #333;
  }

  .link-card:hover {
    border-color: #444;
    background: #252525;
  }

  .link-card-title {
    color: #e5e5e5;
  }

  .link-card-description {
    color: #a3a3a3;
  }

  .link-card-url {
    color: #737373;
  }

  .link-card-fallback {
    color: #60a5fa;
  }

  .link-card-spinner {
    border-color: #404040;
    border-top-color: #a3a3a3;
  }

  .link-card-loading {
    color: #737373;
  }
}
