/**
 * ETHOS Institute - Guided Tours Styling
 * Custom styles for Shepherd.js tours and tour selection modal
 */

/* ========================================================================
   Shepherd.js Core Imports
   ======================================================================== */
@import url('https://cdn.jsdelivr.net/npm/shepherd.js@13.0.0/dist/css/shepherd.css');

/* ========================================================================
   Tour Selection Modal
   ======================================================================== */

.tour-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 30, 0.85);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.tour-modal-overlay.active {
  opacity: 1;
}

.tour-modal-content {
  background: white;
  border-radius: 20px;
  max-width: 700px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
  position: relative;
  animation: modalSlideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalSlideUp {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.tour-modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: transparent;
  border: none;
  font-size: 24px;
  color: #6B7280;
  cursor: pointer;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s;
  z-index: 10;
}

.tour-modal-close:hover {
  background: #F3F4F6;
  color: #1F2937;
  transform: rotate(90deg);
}

/* Modal Header */
.tour-modal-header {
  text-align: center;
  padding: 50px 40px 30px;
  border-bottom: 2px solid #F3F4F6;
}

.tour-modal-icon {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, #3B82F6 0%, #1D4ED8 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  box-shadow: 0 10px 25px rgba(59, 130, 246, 0.3);
  animation: iconPulse 2s ease-in-out infinite;
}

@keyframes iconPulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 10px 25px rgba(59, 130, 246, 0.3);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 15px 35px rgba(59, 130, 246, 0.4);
  }
}

.tour-modal-icon i {
  font-size: 36px;
  color: white;
}

.tour-modal-title {
  font-size: 32px;
  font-weight: 800;
  color: #1F2937;
  margin: 0 0 10px;
  line-height: 1.2;
}

.tour-modal-subtitle {
  font-size: 16px;
  color: #6B7280;
  margin: 0;
  line-height: 1.5;
}

/* Modal Options */
.tour-modal-options {
  padding: 30px 40px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.tour-option-card {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px;
  border: 2px solid #E5E7EB;
  border-radius: 12px;
  background: white;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: left;
  width: 100%;
}

.tour-option-card:hover {
  border-color: #3B82F6;
  background: #F0F7FF;
  transform: translateX(5px);
  box-shadow: 0 10px 25px rgba(59, 130, 246, 0.15);
}

.tour-option-icon {
  width: 60px;
  height: 60px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 24px;
  color: white;
  transition: transform 0.3s;
}

.tour-option-card:hover .tour-option-icon {
  transform: scale(1.1) rotate(5deg);
}

.tour-option-icon.first-time {
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
}

.tour-option-icon.enterprise {
  background: linear-gradient(135deg, #3B82F6 0%, #1D4ED8 100%);
}

.tour-option-icon.individual {
  background: linear-gradient(135deg, #8B5CF6 0%, #6D28D9 100%);
}

.tour-option-icon.quick-start {
  background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
}

.tour-option-content {
  flex: 1;
}

.tour-option-content h3 {
  font-size: 18px;
  font-weight: 700;
  color: #1F2937;
  margin: 0 0 5px;
}

.tour-option-content p {
  font-size: 14px;
  color: #6B7280;
  margin: 0 0 8px;
  line-height: 1.4;
}

.tour-duration {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: #9CA3AF;
  font-weight: 500;
}

.tour-duration i {
  font-size: 11px;
}

.tour-option-arrow {
  font-size: 20px;
  color: #D1D5DB;
  transition: all 0.3s;
  flex-shrink: 0;
}

.tour-option-card:hover .tour-option-arrow {
  color: #3B82F6;
  transform: translateX(5px);
}

/* Modal Footer */
.tour-modal-footer {
  padding: 20px 40px 40px;
  text-align: center;
}

.tour-skip-btn {
  background: transparent;
  border: none;
  color: #6B7280;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  padding: 10px 20px;
  border-radius: 8px;
  transition: all 0.2s;
}

.tour-skip-btn:hover {
  background: #F3F4F6;
  color: #1F2937;
}

/* ========================================================================
   Shepherd.js Custom Theme
   ======================================================================== */

.shepherd-element {
  z-index: 9999;
  max-width: 400px;
}

.shepherd-has-title .shepherd-content .shepherd-header {
  background: linear-gradient(135deg, #1F2937 0%, #111827 100%);
  padding: 20px;
  border-radius: 12px 12px 0 0;
}

.shepherd-title {
  font-size: 18px;
  font-weight: 700;
  color: white;
  margin: 0;
}

.shepherd-text {
  padding: 20px;
  font-size: 15px;
  line-height: 1.6;
  color: #374151;
}

.shepherd-text h3 {
  font-size: 18px;
  font-weight: 700;
  color: #1F2937;
  margin: 0 0 10px;
}

.shepherd-text p {
  margin: 0 0 15px;
  color: #4B5563;
}

.shepherd-text p:last-child {
  margin-bottom: 0;
}

.shepherd-text ul {
  margin: 10px 0;
  padding-left: 20px;
}

.shepherd-text li {
  margin: 8px 0;
  color: #4B5563;
}

.shepherd-text strong {
  color: #1F2937;
  font-weight: 600;
}

.shepherd-text em {
  color: #6B7280;
  font-style: italic;
  font-size: 14px;
}

.shepherd-footer {
  padding: 15px 20px 20px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.shepherd-button {
  background: #3B82F6;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.shepherd-button:hover {
  background: #2563EB;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.shepherd-button-secondary {
  background: #F3F4F6;
  color: #6B7280;
}

.shepherd-button-secondary:hover {
  background: #E5E7EB;
  color: #374151;
  box-shadow: none;
}

.shepherd-cancel-icon {
  color: #6B7280;
  transition: color 0.2s;
}

.shepherd-cancel-icon:hover {
  color: #1F2937;
}

/* Arrow styling */
.shepherd-arrow {
  display: none;
}

/* Modal overlay */
.shepherd-modal-overlay-container {
  pointer-events: none;
}

.shepherd-modal-overlay-container.shepherd-modal-is-visible {
  opacity: 0.5;
}

/* Target element highlight */
.shepherd-target-click-disabled.shepherd-enabled.shepherd-target {
  pointer-events: auto;
}

/* Pulsing animation for highlighted elements */
@keyframes shepherdPulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7);
  }
  50% {
    box-shadow: 0 0 0 15px rgba(59, 130, 246, 0);
  }
}

.shepherd-enabled.shepherd-target {
  animation: shepherdPulse 2s ease-in-out infinite;
  border-radius: 8px;
}

/* ========================================================================
   "Take a Tour" Button in Navigation
   ======================================================================== */

.nav-tour-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.nav-tour-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
  background: linear-gradient(135deg, #2563EB 0%, #1D4ED8 100%);
}

.nav-tour-button i {
  font-size: 14px;
  animation: tourIconBounce 2s ease-in-out infinite;
}

@keyframes tourIconBounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-3px);
  }
}

/* ========================================================================
   Responsive Design
   ======================================================================== */

@media (max-width: 768px) {
  .tour-modal-content {
    width: 95%;
    max-height: 95vh;
  }

  .tour-modal-header {
    padding: 40px 20px 20px;
  }

  .tour-modal-options {
    padding: 20px;
  }

  .tour-modal-title {
    font-size: 24px;
  }

  .tour-option-card {
    padding: 15px;
    gap: 15px;
  }

  .tour-option-icon {
    width: 50px;
    height: 50px;
    font-size: 20px;
  }

  .tour-option-content h3 {
    font-size: 16px;
  }

  .tour-option-content p {
    font-size: 13px;
  }

  .shepherd-element {
    max-width: 90%;
  }

  .shepherd-text {
    padding: 15px;
    font-size: 14px;
  }
}

/* ========================================================================
   Accessibility
   ======================================================================== */

.tour-modal-overlay:focus-within {
  outline: 3px solid #3B82F6;
  outline-offset: 2px;
}

.tour-option-card:focus {
  outline: 2px solid #3B82F6;
  outline-offset: 2px;
}

.shepherd-button:focus {
  outline: 2px solid #3B82F6;
  outline-offset: 2px;
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
