/* ===== COMPONENTES ADICIONALES - NUTRIHELP ===== */

/* ===== NOTIFICACIONES TOAST ===== */
.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  max-width: 400px;
  min-width: 300px;
  padding: 0;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transform: translateX(100%);
  transition: transform 0.3s ease;
}

.notification.show {
  transform: translateX(0);
}

.notification-content {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 20px;
  color: white;
  font-weight: 500;
}

.notification-success {
  background: linear-gradient(135deg, #28a745, #20c997);
}

.notification-error {
  background: linear-gradient(135deg, #dc3545, #e85d75);
}

.notification-warning {
  background: linear-gradient(135deg, #ffc107, #ffda6a);
  color: var(--color-text);
}

.notification-info {
  background: linear-gradient(135deg, #17a2b8, #5bc0de);
}

.notification-close {
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: background-color 0.2s ease;
}

.notification-close:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

/* ===== TOOLTIPS PERSONALIZADOS ===== */
.custom-tooltip {
  position: absolute;
  background: rgba(0, 0, 0, 0.9);
  color: white;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.875rem;
  z-index: 1000;
  pointer-events: none;
  transform: translateX(-50%);
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.custom-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: rgba(0, 0, 0, 0.9) transparent transparent transparent;
}

.custom-tooltip.show {
  opacity: 1;
}

/* ===== MODAL/OVERLAY ===== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(5px);
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.modal-overlay.show {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  background: white;
  border-radius: var(--border-radius-large);
  padding: 2rem;
  max-width: 90vw;
  max-height: 90vh;
  overflow-y: auto;
  transition: transform 0.3s ease;
}

.modal-overlay.show .modal-content {
  transform: translate(-50%, -50%) scale(1);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--color-border);
}

.modal-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-text);
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--color-text-light);
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.modal-close:hover {
  background: var(--color-light-gray);
  color: var(--color-text);
}

/* ===== ACCORDION PERSONALIZADO ===== */
.custom-accordion {
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}

.accordion-item-custom {
  border: none;
  margin-bottom: 1rem;
  border-radius: var(--border-radius);
  overflow: hidden;
  background: white;
  box-shadow: var(--shadow-soft);
}

.accordion-header-custom {
  background: var(--color-warm);
  padding: 1.5rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.3s ease;
  user-select: none;
}

.accordion-header-custom:hover {
  background: var(--color-primary-light);
}

.accordion-header-custom.active {
  background: var(--color-primary);
  color: white;
}

.accordion-title-custom {
  font-weight: 600;
  font-size: 1.1rem;
  margin: 0;
}

.accordion-icon-custom {
  transition: transform 0.3s ease;
}

.accordion-header-custom.active .accordion-icon-custom {
  transform: rotate(180deg);
}

.accordion-body-custom {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  background: white;
}

.accordion-body-custom.active {
  max-height: 300px;
}

.accordion-content-custom {
  padding: 1.5rem;
  color: var(--color-text-light);
  line-height: 1.6;
}

/* ===== TABS PERSONALIZADAS ===== */
.tabs-container {
  background: white;
  border-radius: var(--border-radius-large);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.tabs-nav {
  display: flex;
  background: var(--color-warm);
  border-bottom: 1px solid var(--color-border);
}

.tab-button {
  flex: 1;
  background: none;
  border: none;
  padding: 1rem 1.5rem;
  font-weight: 600;
  color: var(--color-text-light);
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
}

.tab-button:hover {
  background: rgba(212, 165, 116, 0.1);
  color: var(--color-primary);
}

.tab-button.active {
  background: white;
  color: var(--color-primary);
}

.tab-button.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--color-primary);
}

.tab-content {
  padding: 2rem;
  display: none;
}

.tab-content.active {
  display: block;
  animation: fadeInUp 0.5s ease-out;
}

/* ===== PROGRESS BAR ANIMADO ===== */
.progress-container {
  background: var(--color-light-gray);
  border-radius: 10px;
  overflow: hidden;
  height: 8px;
  position: relative;
}

.progress-bar-animated {
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary), var(--color-sage));
  border-radius: 10px;
  position: relative;
  overflow: hidden;
  transition: width 1s ease-out;
}

.progress-bar-animated::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  background-image: linear-gradient(
    -45deg,
    rgba(255, 255, 255, 0.2) 25%,
    transparent 25%,
    transparent 50%,
    rgba(255, 255, 255, 0.2) 50%,
    rgba(255, 255, 255, 0.2) 75%,
    transparent 75%,
    transparent
  );
  background-size: 30px 30px;
  animation: move 1s linear infinite;
}

@keyframes move {
  0% { background-position: 0 0; }
  100% { background-position: 30px 30px; }
}

/* ===== CARDS CON EFECTOS ESPECIALES ===== */
.card-hover-3d {
  perspective: 1000px;
  cursor: pointer;
}

.card-hover-3d .card-inner {
  transition: transform 0.6s;
  transform-style: preserve-3d;
  position: relative;
}

.card-hover-3d:hover .card-inner {
  transform: rotateY(180deg);
}

.card-front,
.card-back {
  backface-visibility: hidden;
  border-radius: var(--border-radius-large);
}

.card-back {
  transform: rotateY(180deg);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--color-primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

/* ===== TIMELINE ===== */
.timeline {
  position: relative;
  padding: 2rem 0;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 3px;
  height: 100%;
  background: var(--color-primary);
}

.timeline-item {
  position: relative;
  margin-bottom: 3rem;
  width: 50%;
}

.timeline-item:nth-child(even) {
  left: 50%;
  text-align: left;
}

.timeline-item:nth-child(odd) {
  text-align: right;
}

.timeline-content {
  background: white;
  padding: 1.5rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-soft);
  position: relative;
}

.timeline-item:nth-child(even) .timeline-content::before {
  content: '';
  position: absolute;
  left: -10px;
  top: 20px;
  border: 10px solid transparent;
  border-right-color: white;
}

.timeline-item:nth-child(odd) .timeline-content::before {
  content: '';
  position: absolute;
  right: -10px;
  top: 20px;
  border: 10px solid transparent;
  border-left-color: white;
}

.timeline-marker {
  position: absolute;
  width: 20px;
  height: 20px;
  background: var(--color-primary);
  border-radius: 50%;
  top: 20px;
}

.timeline-item:nth-child(even) .timeline-marker {
  left: -60px;
}

.timeline-item:nth-child(odd) .timeline-marker {
  right: -60px;
}

/* ===== ESTADÍSTICAS/COUNTERS ===== */
.stats-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  margin: 3rem 0;
}

.stat-item {
  text-align: center;
  padding: 2rem;
  background: white;
  border-radius: var(--border-radius-large);
  box-shadow: 0 8px 25px rgba(166, 141, 199, 0.06);
  transition: transform 0.3s ease;
  border: 1px solid rgba(166, 141, 199, 0.05);
}

.stat-item:hover {
  transform: translateY(-5px);
}

.stat-number {
  font-size: 3rem;
  font-weight: 800;
  color: var(--color-primary);
  display: block;
  margin-bottom: 0.5rem;
}

.stat-label {
  font-size: 1.1rem;
  color: var(--color-text-light);
  font-weight: 500;
}

.stat-icon {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  color: white;
  font-size: 1.5rem;
}

/* ===== BREADCRUMB ===== */
.breadcrumb-custom {
  background: none;
  padding: 0;
  margin: 1rem 0;
  font-size: 0.9rem;
}

.breadcrumb-custom ol {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
}

.breadcrumb-custom li {
  color: var(--color-text-light);
}

.breadcrumb-custom li:not(:last-child)::after {
  content: '/';
  margin-left: 0.5rem;
  color: var(--color-text-muted);
}

.breadcrumb-custom a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color 0.3s ease;
}

.breadcrumb-custom a:hover {
  color: var(--color-primary-dark);
}

/* ===== PAGINATION ===== */
.pagination-custom {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin: 2rem 0;
}

.page-item {
  list-style: none;
}

.page-link {
  display: block;
  padding: 0.75rem 1rem;
  color: var(--color-text);
  text-decoration: none;
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  transition: all 0.3s ease;
}

.page-link:hover {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
}

.page-item.active .page-link {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
}

.page-item.disabled .page-link {
  color: var(--color-text-muted);
  pointer-events: none;
  background: var(--color-light-gray);
}

/* ===== BADGES Y TAGS ===== */
.badge-custom {
  display: inline-block;
  padding: 0.35em 0.65em;
  font-size: 0.75em;
  font-weight: 600;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  vertical-align: baseline;
  border-radius: 20px;
  transition: all 0.3s ease;
}

.badge-primary {
  background: var(--color-primary);
  color: white;
}

.badge-secondary {
  background: var(--color-text-light);
  color: white;
}

.badge-success {
  background: #28a745;
  color: white;
}

.badge-warning {
  background: #ffc107;
  color: var(--color-text);
}

.badge-outline {
  background: transparent;
  border: 2px solid var(--color-primary);
  color: var(--color-primary);
}

.badge-outline:hover {
  background: var(--color-primary);
  color: white;
}

/* ===== ALERTS ===== */
.alert-custom {
  padding: 1rem 1.5rem;
  margin-bottom: 1rem;
  border-radius: var(--border-radius);
  border-left: 4px solid;
  position: relative;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.alert-success {
  background: rgba(40, 167, 69, 0.1);
  border-left-color: #28a745;
  color: #155724;
}

.alert-warning {
  background: rgba(255, 193, 7, 0.1);
  border-left-color: #ffc107;
  color: #856404;
}

.alert-danger {
  background: rgba(220, 53, 69, 0.1);
  border-left-color: #dc3545;
  color: #721c24;
}

.alert-info {
  background: rgba(23, 162, 184, 0.1);
  border-left-color: #17a2b8;
  color: #0c5460;
}

.alert-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
}

.alert-content {
  flex: 1;
}

.alert-close {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.3s ease;
}

.alert-close:hover {
  opacity: 1;
}

/* ===== DROPDOWN PERSONALIZADO ===== */
.dropdown-custom {
  position: relative;
  display: inline-block;
}

.dropdown-toggle {
  background: white;
  border: 2px solid var(--color-border);
  border-radius: var(--border-radius);
  padding: 0.75rem 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-width: 200px;
  transition: all 0.3s ease;
}

.dropdown-toggle:hover {
  border-color: var(--color-primary);
}

.dropdown-toggle.active {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(212, 165, 116, 0.1);
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  background: white;
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-card);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  z-index: 1000;
  max-height: 200px;
  overflow-y: auto;
}

.dropdown-menu.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-item {
  display: block;
  width: 100%;
  padding: 0.75rem 1rem;
  border: none;
  background: none;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.3s ease;
  color: var(--color-text);
}

.dropdown-item:hover {
  background: var(--color-warm);
  color: var(--color-primary);
}

.dropdown-item.selected {
  background: var(--color-primary);
  color: white;
}

/* ===== STEPPER/WIZARD ===== */
.stepper {
  display: flex;
  align-items: center;
  margin: 2rem 0;
}

.step {
  display: flex;
  align-items: center;
  flex: 1;
  position: relative;
}

.step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  width: 100%;
  height: 2px;
  background: var(--color-border);
  z-index: 1;
}

.step.completed:not(:last-child)::after {
  background: var(--color-primary);
}

.step-marker {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--color-border);
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  position: relative;
  z-index: 2;
  margin-right: 1rem;
  transition: all 0.3s ease;
}

.step.active .step-marker {
  background: var(--color-primary);
  color: white;
  transform: scale(1.1);
}

.step.completed .step-marker {
  background: var(--color-primary);
  color: white;
}

.step.completed .step-marker::before {
  content: '✓';
  font-size: 1.2rem;
}

.step-label {
  font-weight: 500;
  color: var(--color-text-light);
}

.step.active .step-label {
  color: var(--color-primary);
  font-weight: 600;
}

.step.completed .step-label {
  color: var(--color-primary);
}

/* ===== LOADING SKELETON ===== */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
  border-radius: var(--border-radius);
}

.skeleton-text {
  height: 1rem;
  margin-bottom: 0.5rem;
}

.skeleton-text.short {
  width: 70%;
}

.skeleton-text.medium {
  width: 85%;
}

.skeleton-text.long {
  width: 95%;
}

.skeleton-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
}

.skeleton-card {
  height: 200px;
  width: 100%;
}

@keyframes loading {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

/* ===== SCROLL INDICATOR REFINADO ===== */
.scroll-indicator {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: rgba(166, 141, 199, 0.1);
  z-index: 1001;
}

.scroll-progress {
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
  width: 0%;
  transition: width 0.1s ease;
}

/* ===== BACK TO TOP BUTTON ===== */
.back-to-top {
  position: fixed;
  bottom: 100px;
  right: 30px;
  width: 50px;
  height: 50px;
  background: var(--color-primary);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all 0.3s ease;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  box-shadow: var(--shadow-card);
}

.back-to-top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  background: var(--color-primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

/* ===== SOCIAL SHARE BUTTONS ===== */
.social-share {
  display: flex;
  gap: 1rem;
  margin: 2rem 0;
  justify-content: center;
}

.share-button {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  text-decoration: none;
  font-size: 1.2rem;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-soft);
}

.share-button:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-card);
  color: white;
}

.share-facebook {
  background: #3b5998;
}

.share-twitter {
  background: #1da1f2;
}

.share-linkedin {
  background: #0077b5;
}

.share-whatsapp {
  background: #25d366;
}

.share-email {
  background: var(--color-text);
}

/* ===== RESPONSIVE UTILITIES ===== */
@media (max-width: 991px) {
  .timeline::before {
    left: 30px;
  }
  
  .timeline-item {
    width: 100%;
    left: 0;
    text-align: left;
    padding-left: 60px;
  }
  
  .timeline-item .timeline-marker {
    left: 20px;
  }
  
  .timeline-item .timeline-content::before {
    left: -10px;
    border-right-color: white;
    border-left-color: transparent;
  }
  
  .stats-container {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
  }
  
  .tabs-nav {
    flex-direction: column;
  }
  
  .stepper {
    flex-direction: column;
    align-items: stretch;
  }
  
  .step {
    margin-bottom: 1rem;
  }
  
  .step:not(:last-child)::after {
    display: none;
  }
}

@media (max-width: 767px) {
  .notification {
    left: 10px;
    right: 10px;
    max-width: none;
    min-width: auto;
  }
  
  .modal-content {
    margin: 1rem;
    max-width: calc(100vw - 2rem);
  }
  
  .stat-number {
    font-size: 2rem;
  }
  
  .timeline-item {
    padding-left: 40px;
  }
  
  .timeline-item .timeline-marker {
    left: 10px;
    width: 15px;
    height: 15px;
  }
  
  .back-to-top {
    bottom: 80px;
    right: 20px;
    width: 45px;
    height: 45px;
  }
  
  .social-share {
    gap: 0.5rem;
  }
  
  .share-button {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }
}

/* ===== DARK MODE SUPPORT (OPCIONAL) ===== */
@media (prefers-color-scheme: dark) {
  .modal-content,
  .timeline-content,
  .stat-item,
  .dropdown-toggle,
  .dropdown-menu {
    background: #2c2c2c;
    color: #f0f0f0;
    border-color: #444;
  }
  
  .skeleton {
    background: linear-gradient(90deg, #333 25%, #444 50%, #333 75%);
    background-size: 200% 100%;
  }
}