/**
 * HTB Profile Widget Styles
 * Minimal, modern, responsive design
 */

.htb-widget {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, "Cascadia Mono", "Segoe UI Mono", "Roboto Mono", "Liberation Mono", monospace;
  border: 1px dashed var(--line, rgba(0,255,136,0.2));
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(0,5,2,0.5), rgba(0,0,0,0.5));
  box-shadow: var(--shadow, 0 0 12px rgba(0,255,136,0.35), 0 0 32px rgba(0,255,136,0.15));
  padding: 16px;
  margin: 22px 0;
  color: var(--fg, #baf8c7);
  max-width: 100%;
}

.htb-widget.loading,
.htb-widget.error {
  text-align: center;
  padding: 32px 16px;
}

.htb-loading {
  color: var(--muted, #76d69b);
  font-size: 0.95rem;
}

.htb-error {
  color: var(--warn, #ff3b3b);
}

.htb-error img {
  margin-top: 12px;
  max-width: 200px;
  height: auto;
}

/* Header */
.htb-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
  position: relative;
}

.htb-avatar {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  border: 1px solid var(--line, rgba(0,255,136,0.3));
  object-fit: cover;
  box-shadow: 0 0 8px rgba(0,255,136,0.25);
}

.htb-identity {
  flex: 1;
  min-width: 0;
}

.htb-handle {
  margin: 0 0 4px 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent-2, #39ff14);
  text-shadow: var(--shadow, 0 0 8px rgba(0,255,136,0.3));
}

.htb-handle a {
  color: inherit;
  text-decoration: none;
  transition: opacity 0.2s;
}

.htb-handle a:hover {
  opacity: 0.8;
  text-decoration: underline;
}

.htb-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: var(--muted, #76d69b);
}

.htb-country::before {
  content: '📍 ';
}

.htb-team::before {
  content: '👥 ';
}

.htb-org::before {
  content: '🏢 ';
}

/* Status indicator */
.htb-status-indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-left: auto;
  transition: background-color 0.3s;
}

.htb-widget.status-fresh .htb-status-indicator {
  background: #00ff88;
  box-shadow: 0 0 8px rgba(0,255,136,0.8);
}

.htb-widget.status-stale .htb-status-indicator {
  background: #ffea00;
  box-shadow: 0 0 8px rgba(255,234,0,0.8);
}

.htb-widget.status-old .htb-status-indicator {
  background: #ff3b3b;
  box-shadow: 0 0 8px rgba(255,59,59,0.8);
}

/* Stats Grid */
.htb-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.htb-stat {
  text-align: center;
  padding: 10px;
  border: 1px dashed var(--line, rgba(0,255,136,0.15));
  border-radius: 6px;
  background: rgba(0,0,0,0.3);
}

.htb-stat-label {
  font-size: 0.75rem;
  color: var(--muted, #76d69b);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.htb-stat-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent, #00ff88);
}

.htb-stat-sub {
  font-size: 0.7rem;
  color: var(--muted, #76d69b);
  margin-top: 2px;
}

/* Progress Bars */
.htb-progress-section {
  margin-bottom: 16px;
}

.htb-progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.htb-progress-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent-2, #39ff14);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.htb-progress-percent {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent, #00ff88);
}

.htb-progress-bar {
  width: 100%;
  height: 20px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--line, rgba(0,255,136,0.3));
  border-radius: 10px;
  overflow: hidden;
  position: relative;
}

.htb-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, 
    var(--accent, #00ff88) 0%, 
    var(--accent-2, #39ff14) 100%
  );
  border-radius: 10px;
  transition: width 0.5s ease-out;
  box-shadow: 0 0 10px rgba(0,255,136,0.5);
  position: relative;
}

.htb-progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    90deg,
    rgba(255,255,255,0) 0%,
    rgba(255,255,255,0.3) 50%,
    rgba(255,255,255,0) 100%
  );
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* Pwned progress bar variant */
.htb-progress-bar.htb-progress-pwned {
  border-color: rgba(184,76,255,0.3);
}

.htb-progress-fill.htb-progress-fill-pwned {
  background: linear-gradient(90deg, 
    #b84cff 0%, 
    #e05cff 100%
  );
  box-shadow: 0 0 10px rgba(184,76,255,0.5);
}

/* Theme variants for progress bars */
body.theme-purple .htb-progress-fill {
  background: linear-gradient(90deg, #b84cff 0%, #e05cff 100%);
  box-shadow: 0 0 10px rgba(184,76,255,0.5);
}

body.theme-cyan .htb-progress-fill {
  background: linear-gradient(90deg, #00e5ff 0%, #39d5ff 100%);
  box-shadow: 0 0 10px rgba(0,229,255,0.5);
}

body.theme-magenta .htb-progress-fill {
  background: linear-gradient(90deg, #ff2fa1 0%, #ff5cc8 100%);
  box-shadow: 0 0 10px rgba(255,47,161,0.5);
}

/* Activity */
.htb-activity {
  margin-bottom: 16px;
}

.htb-activity-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent-2, #39ff14);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.htb-activity-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.htb-activity-item {
  padding: 6px 8px;
  margin-bottom: 4px;
  border-left: 2px solid var(--line, rgba(0,255,136,0.3));
  background: rgba(0,0,0,0.2);
  font-size: 0.8rem;
  display: flex;
  gap: 8px;
  align-items: center;
}

.htb-activity-type {
  color: var(--accent, #00ff88);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.7rem;
  flex-shrink: 0;
}

.htb-activity-name {
  color: var(--fg, #baf8c7);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.htb-activity-machine .htb-activity-type { color: #00d4ff; }
.htb-activity-challenge .htb-activity-type { color: #ff9f00; }
.htb-activity-lab .htb-activity-type { color: #b84cff; }

/* Footer */
.htb-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 12px;
  border-top: 1px dashed var(--line, rgba(0,255,136,0.15));
  font-size: 0.8rem;
}

.htb-link {
  color: var(--accent-2, #39ff14);
  text-decoration: none;
  font-weight: 600;
  transition: opacity 0.2s;
}

.htb-link:hover {
  opacity: 0.8;
  text-decoration: underline;
}

.htb-updated {
  color: var(--muted, #76d69b);
  font-size: 0.75rem;
}

/* Responsive */
@media (max-width: 600px) {
  .htb-stats {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .htb-header {
    flex-wrap: wrap;
  }
  
  .htb-avatar {
    width: 48px;
    height: 48px;
  }
  
  .htb-handle {
    font-size: 1.1rem;
  }
  
  .htb-footer {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }
}

/* Theme overrides for purple/cyan/magenta themes */
body.theme-purple .htb-widget {
  border-color: rgba(184,76,255,0.25);
  background: linear-gradient(180deg, rgba(20,6,29,0.5), rgba(0,0,0,0.5));
}

body.theme-cyan .htb-widget {
  border-color: rgba(0,229,255,0.25);
  background: linear-gradient(180deg, rgba(3,26,34,0.5), rgba(0,0,0,0.5));
}

body.theme-magenta .htb-widget {
  border-color: rgba(255,47,161,0.25);
  background: linear-gradient(180deg, rgba(30,0,18,0.5), rgba(0,0,0,0.5));
}

