/**
 * SiteRooster - Internal Linking Section Styles
 */

/* ============================================
   Stat Cards Modifications
   ============================================ */

.sr-stat-card-clickable {
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.sr-stat-card-clickable:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.sr-stat-success {
    color: #22c55e !important;
}

.sr-stat-warning {
    color: #f59e0b !important;
}

.sr-stat-danger {
    color: #ef4444 !important;
}

.sr-stat-info {
    color: #3b82f6 !important;
}


/* ============================================
   Link Explorer Table
   ============================================ */

.sr-table-sortable th.sr-sortable {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

.sr-table-sortable th.sr-sortable:hover {
    background-color: #f9fafb;
}

.sr-sort-icon {
    opacity: 0.3;
    margin-left: 4px;
    vertical-align: middle;
}

.sr-table-sortable th.sr-sort-asc .sr-sort-icon,
.sr-table-sortable th.sr-sort-desc .sr-sort-icon {
    opacity: 1;
}

.sr-table-sortable th.sr-sort-desc .sr-sort-icon {
    transform: rotate(180deg);
}

.sr-link-url {
    color: #2563eb;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sr-link-url:hover {
    text-decoration: underline;
}

.sr-link-url svg {
    flex-shrink: 0;
    opacity: 0.5;
}

.sr-found-on {
    color: #6b7280;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
}

.sr-anchor-cell {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sr-flags-cell {
    white-space: nowrap;
}


/* ============================================
   Tags and Badges
   ============================================ */

.sr-tag {
    display: inline-block;
    padding: 2px 6px;
    font-size: 10px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    border-radius: 4px;
    background-color: #e5e7eb;
    color: #374151;
    margin-right: 4px;
}

.sr-tag-sm {
    padding: 1px 4px;
    font-size: 9px;
}

.sr-tag-warning {
    background-color: #fef3c7;
    color: #92400e;
}

.sr-tag-danger {
    background-color: #fee2e2;
    color: #991b1b;
}

.sr-tag-info {
    background-color: #dbeafe;
    color: #1e40af;
}

.sr-tag-success {
    background-color: #dcfce7;
    color: #166534;
}

.sr-tag-muted {
    background-color: #f3f4f6;
    color: #6b7280;
}


/* ============================================
   Anchor Text Analysis
   ============================================ */

.sr-anchor-list {
}

.sr-anchor-item {
    padding: 8px 12px;
    border-bottom: 1px solid #f3f4f6;
    transition: background-color 0.15s ease;
}

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

.sr-anchor-item:hover {
    background-color: #f9fafb;
}

.sr-anchor-item-generic {
    background-color: #fffbeb;
}

.sr-anchor-item-generic:hover {
    background-color: #fef3c7;
}

.sr-anchor-text {
    font-weight: 500;
    font-size: 13px;
    color: #111827;
    margin-bottom: 2px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sr-anchor-stats {
    font-size: 11px;
    color: #9ca3af;
    display: flex;
    gap: 8px;
}


/* ============================================
   Link Opportunities
   ============================================ */

.sr-input-group {
    display: flex;
    gap: 8px;
}

.sr-input-group .sr-input {
    flex: 1;
}

.sr-opportunity-header {
    font-size: 13px;
    color: #374151;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e5e7eb;
}

.sr-opportunity-list {
}

.sr-opportunity-item {
    padding: 12px;
    margin-bottom: 8px;
    background-color: #f9fafb;
    border-radius: 6px;
    border: 1px solid #f3f4f6;
}

.sr-opportunity-item:last-child {
    margin-bottom: 0;
}

.sr-opportunity-item:hover {
    border-color: #e5e7eb;
}

.sr-opportunity-url {
    color: #2563eb;
    text-decoration: none;
    font-weight: 500;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.sr-opportunity-url:hover {
    text-decoration: underline;
}

.sr-opportunity-snippet {
    margin-top: 8px;
    padding: 8px 10px;
    background-color: #fff;
    border-radius: 4px;
    font-size: 12px;
    color: #6b7280;
    font-style: italic;
    line-height: 1.5;
    border: 1px solid #e5e7eb;
}


/* ============================================
   Top Pages
   ============================================ */

.sr-rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background-color: #f3f4f6;
    color: #6b7280;
    font-size: 11px;
    font-weight: 600;
    border-radius: 50%;
    margin-right: 10px;
}

tr:nth-child(1) .sr-rank-badge {
    background-color: #fef3c7;
    color: #92400e;
}

tr:nth-child(2) .sr-rank-badge {
    background-color: #e5e7eb;
    color: #374151;
}

tr:nth-child(3) .sr-rank-badge {
    background-color: #fed7aa;
    color: #9a3412;
}

.sr-stat-highlight {
    font-weight: 600;
    color: #2563eb;
}


/* ============================================
   Utility Classes
   ============================================ */

.sr-mb-3 {
    margin-bottom: 12px;
}

.sr-mt-1 {
    margin-top: 4px;
}

.sr-mt-2 {
    margin-top: 8px;
}

.sr-text-sm {
    font-size: 12px;
}

.sr-text-muted {
    color: #6b7280;
}

.sr-text-danger {
    color: #ef4444;
}

.sr-loading-text {
    padding: 20px;
    text-align: center;
    color: #6b7280;
}

.sr-table-loading {
    text-align: center;
    color: #6b7280;
    padding: 30px !important;
}

.sr-empty-state-sm {
    padding: 20px;
    text-align: center;
}

.sr-empty-state-sm p {
    margin: 0;
    color: #6b7280;
    font-size: 13px;
}


/* ============================================
   Grid Layout
   ============================================ */

.sr-grid {
    display: grid;
    gap: 20px;
}

.sr-grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

@media (max-width: 1024px) {
    .sr-grid-2 {
        grid-template-columns: 1fr;
    }
}


/* ============================================
   Card Header Actions
   ============================================ */

.sr-card-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sr-select-sm {
    padding: 6px 10px;
    font-size: 13px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background-color: #fff;
    color: #374151;
}

.sr-input-sm {
    padding: 6px 10px;
    font-size: 13px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
}

.sr-btn-icon {
    padding: 6px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background-color: #fff;
    color: #6b7280;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.sr-btn-icon:hover {
    background-color: #f9fafb;
    color: #374151;
}


/* ============================================
   Pagination
   ============================================ */

.sr-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 16px 0 0;
    border-top: 1px solid #f3f4f6;
    margin-top: 16px;
}

.sr-pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}


/* ============================================
   Search Box
   ============================================ */

.sr-search-box {
    position: relative;
}

.sr-search-box .sr-input {
    width: 100%;
    box-sizing: border-box;
}


/* ============================================
   Copy Button
   ============================================ */

.sr-btn-copy {
    padding: 4px 8px;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    background-color: #fff;
    color: #6b7280;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    transition: all 0.15s ease;
}

.sr-btn-copy:hover {
    background-color: #f9fafb;
    color: #374151;
    border-color: #d1d5db;
}

.sr-btn-copy.sr-copied {
    background-color: #dcfce7;
    border-color: #86efac;
    color: #166534;
}

/* ============================================
   Anchor Detail Expansion
   ============================================ */

.sr-anchor-details {
    background: var(--gray-50, #f9fafb);
    border-left: 3px solid var(--primary, #3b82f6);
    margin: 0 0 4px 0;
    border-radius: 0 0 6px 6px;
}

.sr-anchor-detail-list {
    padding: 4px 0;
}

.sr-anchor-detail-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-bottom: 1px solid var(--gray-100, #f3f4f6);
    font-size: 12px;
}

.sr-anchor-detail-row:last-child {
    border-bottom: none;
}

.sr-anchor-detail-from,
.sr-anchor-detail-to {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sr-anchor-detail-from a,
.sr-anchor-detail-to a {
    color: var(--primary, #3b82f6);
    text-decoration: none;
}

.sr-anchor-detail-from a:hover,
.sr-anchor-detail-to a:hover {
    text-decoration: underline;
}

.sr-anchor-detail-arrow {
    flex-shrink: 0;
    color: var(--gray-400, #9ca3af);
}

.sr-text-xs {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: block;
    line-height: 1;
    margin-bottom: 2px;
}

.sr-btn-xs {
    padding: 2px 8px;
    font-size: 11px;
}

.sr-pagination-sm {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 4px;
}

/* ============================================
   Opportunity Items (new auto-loaded style)
   ============================================ */

.sr-opportunity-item {
    padding: 10px 12px;
    border: 1px solid var(--gray-200, #e5e7eb);
    border-radius: 6px;
    margin-bottom: 8px;
    background: #fff;
    transition: border-color 0.15s;
}

.sr-opportunity-item:hover {
    border-color: var(--primary, #3b82f6);
}

.sr-opportunity-source {
    margin-bottom: 4px;
}

.sr-opportunity-source a,
.sr-opportunity-target a {
    color: var(--primary, #3b82f6);
    text-decoration: none;
    font-size: 13px;
}

.sr-opportunity-source a:hover,
.sr-opportunity-target a:hover {
    text-decoration: underline;
}

.sr-opportunity-snippet {
    font-size: 12px;
    color: var(--gray-600, #4b5563);
    margin: 4px 0;
    line-height: 1.4;
}

.sr-opportunity-snippet em {
    font-size: 11px;
}

.sr-opportunity-target {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 4px;
}

.sr-opportunity-target a {
    font-weight: 500;
}