/**
 * @file
 * Styles for gestion_personalizada module.
 */

/* Dashboard Container */
.gestion-personalizada-dashboard {
  min-height: 100%;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  padding: 2rem;
  border-radius: 1rem;
}

/* Gestion Cards */
.gestion-card {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 1rem;
  overflow: hidden;
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  position: relative;
}

.gestion-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #0d6efd, #6610f2, #d63384);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.gestion-card:hover::before {
  opacity: 1;
}

.gestion-card:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15) !important;
  border-color: rgba(13, 110, 253, 0.2);
}

.gestion-card .card-title {
  color: #1a1a1a;
  font-weight: 700;
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.gestion-card .card-title::before {
  content: '📁';
  font-size: 1.1em;
}

.gestion-card .card-text {
  font-size: 0.9rem;
  line-height: 1.6;
  color: #6c757d;
  margin-bottom: 1rem;
}

/* Actions */
.gestion-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.gestion-actions .btn {
  font-weight: 600;
  padding: 0.625rem 1.25rem;
  border-radius: 0.5rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
  position: relative;
  overflow: hidden;
  text-transform: uppercase;
  letter-spacing: 0.025em;
  font-size: 0.875rem;
}

.gestion-actions .btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.gestion-actions .btn:hover::before {
  width: 300px;
  height: 300px;
}

.gestion-actions .btn:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.gestion-actions .btn i {
  font-size: 0.875em;
}

/* Counter Badge */
.badge.bg-secondary {
  font-size: 0.8rem;
  padding: 0.625em 1em;
  border-radius: 2rem;
  font-weight: 700;
  background: linear-gradient(135deg, #6c757d, #495057) !important;
  color: white !important;
  box-shadow: 0 2px 8px rgba(108, 117, 125, 0.3);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.badge.bg-secondary::before {
  content: '📊';
  font-size: 0.9em;
}

/* Card Footer Link */
.gestion-card .card-footer a {
  transition: color 0.2s ease;
}

.gestion-card .card-footer a:hover {
  color: #0d6efd;
}

/* Resumen Block */
.gestion-resumen .icon-box {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gestion-resumen .h4 {
  font-weight: 600;
  color: #2c3e50;
}

.gestion-resumen .text-muted.small {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Empty State */
.alert-info {
  border: none;
  border-radius: 0.75rem;
  padding: 2rem;
}

/* Admin Theme Overrides */
.toolbar-tray-open .gestion-personalizada-dashboard {
  padding-top: 2rem;
}

/* Animation for cards on load */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.gestion-card {
  animation: fadeInUp 0.5s ease forwards;
}

.gestion-card:nth-child(1) { animation-delay: 0.1s; }
.gestion-card:nth-child(2) { animation-delay: 0.2s; }
.gestion-card:nth-child(3) { animation-delay: 0.3s; }
.gestion-card:nth-child(4) { animation-delay: 0.4s; }
.gestion-card:nth-child(5) { animation-delay: 0.5s; }
.gestion-card:nth-child(6) { animation-delay: 0.6s; }

/* Button Base Styles - Bootstrap Independent */
.gestion-actions .btn {
  display: inline-block;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  vertical-align: middle;
  cursor: pointer;
  user-select: none;
  background-color: transparent;
  border: 1px solid transparent;
  padding: 0.625rem 1.25rem;
  font-size: 0.875rem;
  line-height: 1.5;
  border-radius: 0.5rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.gestion-actions .btn:hover {
  text-decoration: none;
}

.gestion-actions .btn:focus {
  outline: 0;
  box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.gestion-actions .btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

/* Button Sizes */
.gestion-actions .btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  border-radius: 0.375rem;
}

/* Enhanced Button Styles */
.gestion-actions .btn-success {
  background:  #28a745!important;
  border: none !important;
  color: white !important;
  text-decoration: none !important;
}

.gestion-actions .btn-primary {
  background:  #007bff !important;
  border: none !important;
  color: white !important;
  text-decoration: none !important;
}

.gestion-actions .btn-info {
  background: linear-gradient(135deg, #17a2b8, #6f42c1) !important;
  border: none !important;
}

.gestion-actions .btn-light {
  background: linear-gradient(135deg, #f8f9fa, #e9ecef) !important;
  color: #495057 !important;
  border: 1px solid #dee2e6 !important;
}

/* Loading States */
.gestion-actions .btn.loading {
  opacity: 0.7;
  pointer-events: none;
}

.gestion-actions .btn.loading::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  margin: auto;
  border: 2px solid transparent;
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Card Component Styles - Bootstrap Independent */
.gestion-card.card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  word-wrap: break-word;
  background-color: #fff;
  background-clip: border-box;
  height: 100%;
}

.gestion-card .card-body {
  flex: 1 1 auto;
  padding: 1.5rem;
}

.gestion-card .card-footer {
  padding: 1rem 1.5rem;
  background-color: rgba(248, 249, 250, 0.8);
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.gestion-card .card-footer.bg-transparent {
  background-color: transparent;
  border-top: 0;
}

.gestion-card .card-footer.border-top-0 {
  border-top: 0;
}

/* Enhanced Badge Styles */
.badge.bg-secondary {
  background: linear-gradient(135deg, #6c757d, #495057) !important;
  color: white !important;
  box-shadow: 0 2px 8px rgba(108, 117, 125, 0.3);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.badge.bg-secondary::before {
  content: '📊';
  font-size: 0.9em;
}

/* Enhanced Alert Styles */
.alert {
  border: none;
  border-radius: 0.75rem;
  padding: 2rem;
}
.gestion-personalizada-dashboard  table th {
    color: #ffffff;
}


/* Mobile adjustments */
@media (max-width: 768px) {
  .gestion-card {
    margin-bottom: 1rem;
  }

  .gestion-actions .btn {
    width: 100%;
    margin-bottom: 0.5rem;
  }

  .gestion-actions .btn:last-child {
    margin-bottom: 0;
  }
}

/* Focus States for Accessibility */
.gestion-card a:focus,
.gestion-actions .btn:focus {
  outline: 2px solid #0d6efd;
  outline-offset: 2px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
  .gestion-card {
    border-width: 2px;
  }

  .gestion-actions .btn {
    border-width: 2px;
  }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  .gestion-card,
  .gestion-actions .btn {
    transition: none;
    animation: none;
  }
}

/*
 * Grid and layout utilities (Bootstrap-independent).
 * Neither the admin theme (gin) nor the public theme load Bootstrap,
 * so the grid classes used by the dashboard templates are replicated
 * here, scoped to the dashboard to avoid leaking into the host theme.
 */

.gestion-personalizada-dashboard .row {
  --gp-gutter: 1.5rem; /* equivalent to Bootstrap g-4 */
  display: flex;
  flex-wrap: wrap;
  margin-top: calc(-1 * var(--gp-gutter));
  margin-right: calc(-0.5 * var(--gp-gutter));
  margin-left: calc(-0.5 * var(--gp-gutter));
}

.gestion-personalizada-dashboard .row > * {
  flex-shrink: 0;
  width: 100%;
  max-width: 100%;
  padding-right: calc(var(--gp-gutter) * 0.5);
  padding-left: calc(var(--gp-gutter) * 0.5);
  margin-top: var(--gp-gutter);
}

.gestion-personalizada-dashboard .col-6 {
  flex: 0 0 auto;
  width: 50%;
}

.gestion-personalizada-dashboard .col-12 {
  flex: 0 0 auto;
  width: 100%;
}

@media (min-width: 576px) {
  .gestion-personalizada-dashboard .col-sm-6 {
    flex: 0 0 auto;
    width: 50%;
  }
}

@media (min-width: 768px) {
  .gestion-personalizada-dashboard .col-md-4 {
    flex: 0 0 auto;
    width: 33.33333333%;
  }

  .gestion-personalizada-dashboard .col-md-6 {
    flex: 0 0 auto;
    width: 50%;
  }
}

@media (min-width: 992px) {
  .gestion-personalizada-dashboard .col-lg-2 {
    flex: 0 0 auto;
    width: 16.66666667%;
  }

  .gestion-personalizada-dashboard .col-lg-3 {
    flex: 0 0 auto;
    width: 25%;
  }
}

/* Flex utilities used by the cards */
.gestion-personalizada-dashboard .d-flex { display: flex; }
.gestion-personalizada-dashboard .flex-column { flex-direction: column; }
.gestion-personalizada-dashboard .flex-grow-1 { flex-grow: 1; }
.gestion-personalizada-dashboard .justify-content-between { justify-content: space-between; }
.gestion-personalizada-dashboard .align-items-start { align-items: flex-start; }
.gestion-personalizada-dashboard .mt-auto { margin-top: auto; }

/* Spacing utilities used by the dashboard templates */
.gestion-personalizada-dashboard .mt-4 { margin-top: 1.5rem; }
.gestion-personalizada-dashboard .mb-0 { margin-bottom: 0; }
.gestion-personalizada-dashboard .mb-2 { margin-bottom: 0.5rem; }
.gestion-personalizada-dashboard .mb-3 { margin-bottom: 1rem; }
.gestion-personalizada-dashboard .mb-4 { margin-bottom: 1.5rem; }
.gestion-personalizada-dashboard .mb-5 { margin-bottom: 3rem; }
.gestion-personalizada-dashboard .pt-3 { padding-top: 1rem; }
.gestion-personalizada-dashboard .pb-2 { padding-bottom: 0.5rem; }

/* Typography helpers used by the section headings */
.gestion-personalizada-dashboard .h3 { font-size: 1.75rem; }
.gestion-personalizada-dashboard .h5 { font-size: 1.25rem; }
.gestion-personalizada-dashboard .border-bottom { border-bottom: 1px solid rgba(0, 0, 0, 0.125); }
.gestion-personalizada-dashboard .text-muted { color: #6c757d; }
