/**
 * COMPONENTS CSS - IFC System
 * Clases reutilizables de componentes UI
 * Mobile first - diseño simple y profesional
 * 
 * NOTA: Usar variables de tokens.css cuando estén disponibles
 * Importar después de tokens.css y antes de custom.css
 */

/* ============================================
   NAVIGATION COMPONENTS (NUEVO)
   ============================================ */
.nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  color: #374151;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  transition: background-color 0.15s, color 0.15s;
}

.nav-link:hover {
  background-color: #f3f4f6;
  color: #111827;
}

.nav-link-active,
.nav-link.active {
  background-color: #dbeafe;
  color: #1d4ed8;
}

.nav-link i {
  width: 1.25rem;
  text-align: center;
  font-size: 1rem;
}

/* ============================================
   BUTTON COMPONENTS (MEJORADO)
   ============================================ */
.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  color: #6b7280;
  background: transparent;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}

.btn-icon:hover {
  background-color: #f3f4f6;
  color: #111827;
}

.btn-icon-sm {
  width: 1.75rem;
  height: 1.75rem;
}

.btn-icon-lg {
  width: 2.75rem;
  height: 2.75rem;
}

/* ============================================
   CARD COMPONENTS
   ============================================ */
.card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #e5e7eb;
}

.card-body {
  padding: 1rem;
}

.card-footer {
  padding: 0.75rem 1rem;
  background-color: #f9fafb;
  border-top: 1px solid #e5e7eb;
}

/* ============================================
   LIST COMPONENTS
   ============================================ */
.list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #f3f4f6;
  transition: background-color 0.15s;
}

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

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

/* ============================================
   GRID FORM LAYOUTS
   ============================================ */
.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

@media (min-width: 640px) {
  .form-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .form-grid-4 {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ============================================
   SECTION HEADERS
   ============================================ */
.section-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.75rem;
}

.section-header i {
  color: #2563eb;
}

/* ============================================
   ACTION BUTTONS GROUP
   ============================================ */
.action-buttons {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.action-buttons-end {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
}

/* ============================================
   STAT CARDS
   ============================================ */
.stat-card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  padding: 1rem;
}

.stat-label {
  font-size: 0.75rem;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: #111827;
}

/* ============================================
   LOADING STATES
   ============================================ */
.spinner {
  width: 1rem;
  height: 1rem;
  border: 2px solid #e5e7eb;
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.spinner-lg {
  width: 2rem;
  height: 2rem;
  border-width: 3px;
}

.loading-text {
  font-size: 0.875rem;
  color: #6b7280;
}

/* ============================================
   INFO BANNERS
   ============================================ */
.banner {
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.banner-info {
  background-color: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
}

.banner-warning {
  background-color: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
}

.banner-error {
  background-color: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

.banner-success {
  background-color: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
}

/* ============================================
   DIVIDERS
   ============================================ */
.divider {
  height: 1px;
  background-color: #e5e7eb;
  margin: 1rem 0;
}

.divider-vertical {
  width: 1px;
  background-color: #e5e7eb;
  height: 100%;
}

/* ============================================
   SKELETON LOADERS
   ============================================ */
.skeleton {
  background: linear-gradient(90deg, #f3f4f6 0%, #e5e7eb 50%, #f3f4f6 100%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  border-radius: 0.25rem;
}

@keyframes skeleton-loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.skeleton-text {
  height: 0.875rem;
  margin-bottom: 0.5rem;
}

.skeleton-title {
  height: 1.25rem;
  margin-bottom: 0.75rem;
}

.skeleton-circle {
  border-radius: 50%;
}

/* ============================================
   TABLE COMPONENTS
   ============================================ */
.table-container {
  overflow-x: auto;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
}

.table-responsive {
  width: 100%;
  border-collapse: collapse;
}

.table-responsive thead {
  background-color: #f9fafb;
  border-bottom: 2px solid #e5e7eb;
}

.table-responsive th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.table-responsive td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #f3f4f6;
  font-size: 0.875rem;
  color: #111827;
}

.table-responsive tbody tr:hover {
  background-color: #f9fafb;
}

.table-responsive tbody tr:last-child td {
  border-bottom: none;
}

/* Alineaciones de tabla */
.table-cell-center {
  text-align: center;
}

.table-cell-right {
  text-align: right;
}

.table-cell-bold {
  font-weight: 600;
}

.table-cell-muted {
  color: #6b7280;
}

/* ============================================
   PAGINATION COMPONENTS
   ============================================ */
.pagination-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  background: white;
  border-top: 1px solid #e5e7eb;
}

.pagination-info {
  font-size: 0.875rem;
  color: #6b7280;
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pagination-button {
  padding: 0.5rem 0.75rem;
  background: white;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  color: #374151;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.pagination-button:hover:not(:disabled) {
  background: #f9fafb;
  border-color: #9ca3af;
}

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

.pagination-current {
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  color: #111827;
  font-weight: 500;
}

/* ============================================
   EMPTY STATE COMPONENTS
   ============================================ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
  text-align: center;
}

.empty-state-icon {
  font-size: 3rem;
  color: #d1d5db;
  margin-bottom: 1rem;
}

.empty-state-title {
  font-size: 1rem;
  font-weight: 600;
  color: #4b5563;
  margin-bottom: 0.25rem;
}

.empty-state-message {
  font-size: 0.875rem;
  color: #9ca3af;
}
