/* 
 * Component Library 
 */

/* Variantes Botones */
.btn-outline {
  background: transparent;
  border: 2px solid var(--primary);
  color: var(--primary);
  position: relative;
  overflow: hidden;
  transition: all var(--transition-base);
}

.btn-outline::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: var(--primary);
  transition: left var(--transition-base);
  z-index: -1;
}

.btn-outline:hover::before {
  left: 0;
}

.btn-outline:hover {
  color: white;
  border-color: var(--primary-dark);
}

.btn-ghost {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.btn-ghost:hover {
  background: var(--surface-variant);
  color: var(--text-primary);
}

.btn-gradient {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border: none;
  color: white;
  position: relative;
  overflow: hidden;
}

.btn-gradient::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, var(--accent), var(--primary));
  opacity: 0;
  transition: opacity var(--transition-base);
}

.btn-gradient:hover::after {
  opacity: 1;
}

/* Badge Components */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-xs) var(--spacing-sm);
  font-size: var(--font-size-xs);
  font-weight: 600;
  border-radius: var(--radius-full);
  letter-spacing: 0.025em;
  text-transform: uppercase;
}

.badge-primary {
  background: var(--primary);
  color: white;
}

.badge-secondary {
  background: var(--surface-variant);
  color: var(--text-secondary);
}

.badge-success {
  background: var(--success);
  color: white;
}

.badge-warning {
  background: var(--warning);
  color: white;
}

.badge-error {
  background: var(--error);
  color: white;
}

.badge-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

/* Componentes avatar */
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  overflow: hidden;
  flex-shrink: 0;
  background: var(--surface-variant);
  color: var(--text-secondary);
  font-weight: 600;
}

.avatar-sm {
  width: 32px;
  height: 32px;
  font-size: var(--font-size-sm);
}

.avatar-md {
  width: 40px;
  height: 40px;
  font-size: var(--font-size-base);
}

.avatar-lg {
  width: 48px;
  height: 48px;
  font-size: var(--font-size-lg);
}

.avatar-xl {
  width: 64px;
  height: 64px;
  font-size: var(--font-size-xl);
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Tooltip Components */
.tooltip {
  position: relative;
  display: inline-block;
}

.tooltip-content {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  padding: var(--spacing-xs) var(--spacing-sm);
  background: var(--surface-variant);
  color: var(--text-primary);
  font-size: var(--font-size-xs);
  border-radius: var(--radius-md);
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-fast);
  margin-bottom: var(--spacing-xs);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-light);
  z-index: var(--z-tooltip);
}

.tooltip-content::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 4px solid transparent;
  border-top-color: var(--surface-variant);
}

.tooltip:hover .tooltip-content {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(-4px);
}

/* Modal Backdrop */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-md);
}

.modal-content {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border-light);
  max-width: 90vw;
  max-height: 90vh;
  overflow: auto;
  animation: modalSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(-20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Dropdown Components */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-content {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 200px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: var(--z-dropdown);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all var(--transition-fast);
  overflow: hidden;
}

.dropdown.active .dropdown-content {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-item {
  display: block;
  padding: var(--spacing-sm) var(--spacing-md);
  color: var(--text-primary);
  text-decoration: none;
  transition: background var(--transition-fast);
  cursor: pointer;
}

.dropdown-item:hover {
  background: var(--surface-variant);
}

.dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: var(--spacing-xs) 0;
}

/* Status Indicators */
.status-indicator {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-online {
  background: var(--success);
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.4);
}

.status-offline {
  background: var(--text-secondary);
}

.status-busy {
  background: var(--warning);
  box-shadow: 0 0 8px rgba(251, 146, 60, 0.4);
}

.status-away {
  background: var(--error);
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.4);
}

/* Progress Components */
.progress {
  width: 100%;
  height: 8px;
  background: var(--surface-variant);
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  border-radius: var(--radius-full);
  transition: width var(--transition-base);
  position: relative;
}

.progress-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, 
    transparent, 
    rgba(255, 255, 255, 0.3), 
    transparent);
  animation: progressShimmer 2s infinite;
}

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

/* Responsive Utilities */
@media (max-width: 640px) {
  .sm-hidden { display: none; }
  .sm-block { display: block; }
}

@media (max-width: 768px) {
  .md-hidden { display: none; }
  .md-block { display: block; }
}

@media (max-width: 1024px) {
  .lg-hidden { display: none; }
  .lg-block { display: block; }
}

/* Accessibility Utilities */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.focus-within-ring:focus-within {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

/* Performance Utilities */
.gpu-accelerated {
  transform: translateZ(0);
  will-change: transform;
}

.smooth-scroll {
  scroll-behavior: smooth;
}

/* Print Utilities */
@media print {
  .print-hidden { display: none !important; }
  .print-block { display: block !important; }
}

.welcome-message {
  text-align: center;
  margin: 0 auto;
  font-size: 1.25rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
  padding: 2.5rem 0 2.5rem 0;
  border: none;
  box-shadow: none;
}
