/* =====================================================================
   USER CARD WIDGET - Modern Glassmorphism Design
   ===================================================================== */

:root {
  /* Градієнти */
  --user-gradient: linear-gradient(135deg, #667eea, #764ba2);
  --status-online: #10b981;
  --status-away: #f59e0b;
  --status-offline: #9ca3af;
  
  /* Glass ефекти */
  --card-glass-bg: rgba(255, 255, 255, 0.95);
  --card-glass-border: rgba(102, 126, 234, 0.2);
  --panel-glass-bg: rgba(255, 255, 255, 0.98);
  
  /* Тіні */
  --card-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
  --card-shadow-hover: 0 8px 32px rgba(102, 126, 234, 0.15);
}

/* Grid Container */
.ucard-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 4px;
}

/* Card */
.ucard.user-card {
  position: relative;
  width: 320px;
  height: 72px;
  background: var(--card-glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--card-glass-border);
  border-radius: 16px;
  padding: 12px;
  box-shadow: var(--card-shadow),
              0 0 0 1px rgba(255, 255, 255, 0.3) inset;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.ucard.user-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--card-shadow-hover),
              0 0 0 1px rgba(255, 255, 255, 0.5) inset;
  border-color: rgba(102, 126, 234, 0.3);
}

/* Decorative gradient */
.ucard.user-card::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -30%;
  width: 100%;
  height: 200%;
  background: radial-gradient(circle, rgba(102, 126, 234, 0.08) 0%, transparent 70%);
  pointer-events: none;
  animation: float 20s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: rotate(0deg) translateY(0); }
  50% { transform: rotate(15deg) translateY(-10px); }
}

/* Profile Link */
.ucard__link {
  position: absolute;
  inset: 0;
  z-index: 2;
}

/* Content Layout */
.ucard__content {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 100%;
}

/* Avatar Wrapper */
.ucard__avatar-wrapper {
  position: relative;
  flex-shrink: 0;
}

.ucard__avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(102, 126, 234, 0.2);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
  transition: all 0.3s ease;
}

.ucard:hover .ucard__avatar {
  transform: scale(1.05) rotate(3deg);
  border-color: rgba(102, 126, 234, 0.4);
}

/* Status Indicator */
.ucard__status {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--card-glass-bg);
  background: var(--status-offline);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.ucard__status.online {
  background: var(--status-online);
  animation: pulse 2s infinite;
}

.ucard__status.away {
  background: var(--status-away);
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
  50% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
}

/* Text Content */
.ucard__text {
  flex: 1;
  min-width: 0;
}

.ucard__name {
  font-weight: 600;
  font-size: 15px;
  color: #2a2a3a;
  margin: 0 0 2px 0;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ucard__login {
  font-size: 13px;
  color: #6b7280;
  opacity: 0.8;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ucard__status-text {
  font-size: 11px;
  margin-top: 2px;
  font-weight: 500;
  opacity: 0.7;
}

.ucard__status-text.online { color: var(--status-online); }
.ucard__status-text.away { color: var(--status-away); }
.ucard__status-text.offline { color: var(--status-offline); }

/* CTA for Guests */
.ucard__cta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  padding: 6px 12px;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(255, 255, 255, 0.8));
  border-radius: 10px;
  font-size: 12px;
  color: #667eea;
  font-weight: 500;
  border: 1px solid rgba(102, 126, 234, 0.2);
  transition: all 0.2s ease;
}

.ucard__cta:hover {
  background: var(--user-gradient);
  color: white;
  transform: scale(1.05);
}

.ucard__cta i {
  font-size: 13px;
}

/* Actions Panel */
.ucard__panel {
  position: absolute;
  inset: 0;
  background: var(--panel-glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 16px;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  border: 1px solid var(--card-glass-border);
  box-shadow: -4px 0 12px rgba(0, 0, 0, 0.1);
}

.ucard.is-open .ucard__panel {
  transform: translateX(0);
}

/* Close Button */
.ucard__close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(102, 126, 234, 0.2);
  background: rgba(255, 255, 255, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 5;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.ucard__close:hover {
  background: var(--user-gradient);
  color: white;
  transform: scale(1.1) rotate(90deg);
}

.ucard__close i {
  font-size: 12px;
}

/* Actions Grid */
.ucard__actions-grid {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  max-width: 280px;
}

/* Action Buttons */
.ucard__action button,
.ucard__action a,
.ucard__action .btn {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  border: 1px solid rgba(102, 126, 234, 0.2);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(248, 250, 252, 0.9));
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  color: #4a4a5a;
  position: relative;
  overflow: hidden;
}

.ucard__action button::before,
.ucard__action a::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: radial-gradient(circle, rgba(102, 126, 234, 0.2) 0%, transparent 70%);
  transform: translate(-50%, -50%);
  transition: width 0.3s ease, height 0.3s ease;
}

.ucard__action button:hover::before,
.ucard__action a:hover::before {
  width: 60px;
  height: 60px;
}

.ucard__action button:hover,
.ucard__action a:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
  border-color: rgba(102, 126, 234, 0.3);
  background: var(--user-gradient);
  color: white;
}

.ucard__action button:active,
.ucard__action a:active {
  transform: scale(0.95);
}

.ucard__action i {
  font-size: 14px;
  z-index: 1;
}

/* Hide text labels */
.ucard__action span,
.ucard__action .text,
.ucard__action .label {
  display: none !important;
}

/* Tooltips */
.ucard__actions-grid[data-tooltips="1"] .ucard__action button::after {
  content: attr(title);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) scale(0);
  background: rgba(0, 0, 0, 0.9);
  color: white;
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 8px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 20;
  transition: transform 0.2s ease;
  opacity: 0;
}

.ucard__actions-grid[data-tooltips="1"] .ucard__action button:hover::after {
  transform: translateX(-50%) scale(1);
  opacity: 1;
}

/* Empty State */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px;
  background: var(--card-glass-bg);
  backdrop-filter: blur(10px);
  border-radius: 16px;
  border: 1px solid var(--card-glass-border);
}

.empty-state__icon {
  font-size: 48px;
  color: #9ca3af;
  margin-bottom: 16px;
}

.empty-state__text {
  color: #6b7280;
  font-size: 14px;
}

/* Responsive */
@media (max-width: 768px) {
  .ucard.user-card {
    width: 100%;
    max-width: 400px;
  }
}

@media (max-width: 480px) {
  .ucard-grid {
    gap: 8px;
  }
  
  .ucard.user-card {
    height: 64px;
    padding: 10px;
  }
  
  .ucard__avatar {
    width: 44px;
    height: 44px;
  }
  
  .ucard__name {
    font-size: 14px;
  }
  
  .ucard__login {
    font-size: 12px;
  }
  
  .ucard__action button,
  .ucard__action a {
    width: 32px;
    height: 32px;
  }
}

/* Accessibility */
.ucard:focus-visible {
  outline: 2px solid #667eea;
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .ucard,
  .ucard__panel,
  .ucard__avatar,
  .ucard__action button {
    animation: none !important;
    transition: opacity 0.2s ease !important;
  }
}