/* css/tutorial-overlay.css - Tutorial overlay system cho resize columns */

/* Tutorial Overlay Styles - Đơn giản */
.tutorial-overlay-simple {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: transparent; /* Bỏ nền tối */
  z-index: 9999;
  pointer-events: none; /* Không block clicks */
}

/* Tutorial Overlay Container */
.tutorial-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.2);
  z-index: 9999;
  display: none;
  pointer-events: auto;
}

.tutorial-overlay.active {
  display: block;
  animation: tutorialFadeIn 0.5s ease-out;
}

/* Tutorial Tooltips - Nền tối chữ sáng */
.tutorial-tooltip-simple {
  position: fixed;
  background: #2d3748;
  border: 1px solid #4a5568;
  border-radius: 8px;
  padding: 12px 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  max-width: 220px;
  min-width: 200px;
  z-index: 10001;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  pointer-events: auto;
  display: none;
  transition: all 0.2s ease;
}

/* Nút close - màu sáng cho nền tối */
.tutorial-close-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: none;
  border: none;
  font-size: 18px;
  color: #e2e8f0;
  cursor: pointer;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.tutorial-close-btn:hover {
  background: #4a5568;
  color: #ffffff;
}

/* Title - chữ sáng */
.tutorial-title-simple {
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 8px;
  padding-right: 20px;
}

/* Content - chữ sáng */
.tutorial-content-simple {
  font-size: 13px;
  color: #e2e8f0;
  line-height: 1.4;
}

.tutorial-content-simple p {
  margin: 0;
}

/* Mũi tên cho tooltips */
.tutorial-tooltip-simple::before {
  content: '';
  position: absolute;
  width: 0;
  height: 0;
  border-style: solid;
}

/* Mũi tên trỏ sang trái - nền tối */
.tutorial-tooltip-simple.arrow-left::before {
  top: 50%;
  left: -8px;
  transform: translateY(-50%);
  border-width: 8px 8px 8px 0;
  border-color: transparent #2d3748 transparent transparent;
}

/* Mũi tên trỏ sang phải - nền tối */
.tutorial-tooltip-simple.arrow-right::before {
  top: 50%;
  right: -8px;
  transform: translateY(-50%);
  border-width: 8px 0 8px 8px;
  border-color: transparent transparent transparent #2d3748;
}

/* Mũi tên trỏ lên - nền tối */
.tutorial-tooltip-simple.arrow-top::before {
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 0 8px 8px 8px;
  border-color: transparent transparent #2d3748 transparent;
}

/* Mũi tên trỏ xuống - nền tối */
.tutorial-tooltip-simple.arrow-bottom::before {
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 8px 8px 0 8px;
  border-color: #2d3748 transparent transparent transparent;
}

/* Hiệu ứng nhấp nháy cho resize handles - giống hover */
.tutorial-hover-effect {
  background: rgba(139, 69, 19, 0.1) !important;
  cursor: col-resize !important;
  transition: all 0.2s ease !important;
}

/* Spotlight Effect */
.tutorial-spotlight {
  position: absolute;
  background: rgba(255, 255, 255, 0.1);
  border: 3px solid var(--brown-primary, #8B4513);
  border-radius: 8px;
  box-shadow: 
    0 0 20px rgba(139, 69, 19, 0.6),
    inset 0 0 20px rgba(255, 255, 255, 0.1);
  pointer-events: none;
  transition: all 0.2s ease;
  z-index: 9998;
}

.tutorial-spotlight.pulse {
  animation: spotlightPulse 2s infinite;
}

/* Multiple Spotlights - Tạo hiệu ứng highlight với nền nhẹ */
#tutorial-spotlight-left,
#tutorial-spotlight-right {
  position: absolute;
  background: rgba(255, 255, 255, 0.3);
  border: 3px solid var(--brown-primary, #8B4513);
  border-radius: 8px;
  box-shadow: 
    0 0 25px rgba(139, 69, 19, 0.9),
    inset 0 0 15px rgba(255, 255, 255, 0.4),
    0 0 0 2px rgba(255, 215, 0, 0.3);
  pointer-events: none;
  transition: all 0.2s ease;
  z-index: 9998;
}

/* Tạo overlay tối nhẹ cho toàn màn hình khi có multiple spotlights */
.tutorial-overlay.active::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.15);
  z-index: 9997;
  pointer-events: none;
}

/* Đảm bảo tutorial elements có thể click */
.tutorial-tooltip,
.tutorial-actions,
.tutorial-btn,
#tutorial-got-it,
#tutorial-show-guide {
  pointer-events: auto !important;
  z-index: 10005 !important;
  position: relative;
}

/* Tutorial Tooltip */
.tutorial-tooltip {
  position: absolute;
  background: linear-gradient(135deg, var(--brown-primary, #8B4513), var(--brown-secondary, #A0522D));
  color: white;
  padding: 1rem 1.5rem;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  max-width: 300px;
  font-size: 0.95rem;
  line-height: 1.4;
  pointer-events: auto;
  z-index: 10001;
  border: 2px solid rgba(255, 255, 255, 0.2);
}

.tutorial-tooltip::before {
  content: '';
  position: absolute;
  width: 0;
  height: 0;
  border-style: solid;
}

/* Tooltip Arrow Positions */
.tutorial-tooltip.arrow-left::before {
  top: 50%;
  right: 100%;
  transform: translateY(-50%);
  border-width: 8px 8px 8px 0;
  border-color: transparent var(--brown-primary, #8B4513) transparent transparent;
}

.tutorial-tooltip.arrow-right::before {
  top: 50%;
  left: 100%;
  transform: translateY(-50%);
  border-width: 8px 0 8px 8px;
  border-color: transparent transparent transparent var(--brown-primary, #8B4513);
}

.tutorial-tooltip.arrow-top::before {
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 0 8px 8px 8px;
  border-color: transparent transparent var(--brown-primary, #8B4513) transparent;
}

.tutorial-tooltip.arrow-bottom::before {
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 8px 8px 0 8px;
  border-color: var(--brown-primary, #8B4513) transparent transparent transparent;
}

/* Tutorial Content */
.tutorial-title {
  font-weight: 600;
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tutorial-title i {
  font-size: 1.2rem;
  color: #FFD700;
}

.tutorial-message {
  margin-bottom: 1rem;
  opacity: 0.95;
}

.tutorial-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  pointer-events: auto;
  z-index: 10003;
  position: relative;
}

.tutorial-btn {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  pointer-events: auto;
  z-index: 10004;
  position: relative;
}

.tutorial-btn-primary {
  background: rgba(255, 255, 255, 0.9);
  color: var(--brown-primary, #8B4513);
}

.tutorial-btn-primary:hover {
  background: white;
  transform: translateY(-1px);
}

.tutorial-btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.tutorial-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Enhanced Resize Handle Highlighting */
.tutorial-active .resize-handle {
  background: linear-gradient(90deg, 
    transparent 0%, 
    var(--brown-primary, #8B4513) 20%, 
    #FFD700 50%, 
    var(--brown-primary, #8B4513) 80%, 
    transparent 100%
  ) !important;
  width: 8px !important;
  opacity: 1 !important;
  animation: resizeHandleGlow 2s infinite;
  box-shadow: 0 0 15px rgba(139, 69, 19, 0.6);
  cursor: col-resize !important;
}

.tutorial-active .resize-handle:hover {
  background: linear-gradient(90deg, 
    transparent 0%, 
    #FFD700 20%, 
    var(--brown-primary, #8B4513) 50%, 
    #FFD700 80%, 
    transparent 100%
  ) !important;
  cursor: col-resize !important;
  width: 12px !important;
  animation: resizeHandleGlow 1s infinite;
}

.tutorial-active .resize-handle:active,
.tutorial-active .resize-handle.dragging {
  cursor: col-resize !important;
  width: 16px !important;
  animation: none;
  background: linear-gradient(90deg, 
    transparent 0%, 
    #FFD700 10%, 
    var(--brown-primary, #8B4513) 50%, 
    #FFD700 90%, 
    transparent 100%
  ) !important;
  box-shadow: 0 0 25px rgba(255, 215, 0, 0.8);
}

/* Hand Cursor Animation */
.tutorial-cursor {
  position: absolute;
  font-size: 1.5rem;
  color: #FFD700;
  pointer-events: none;
  z-index: 10002;
  animation: handCursor 3s infinite;
}

/* Progress Indicator */
.tutorial-progress {
  position: fixed;
  top: 20px;
  right: 20px;
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.85rem;
  z-index: 10000;
  border: 1px solid var(--brown-primary, #8B4513);
}

/* Animations */
@keyframes tutorialFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes spotlightPulse {
  0%, 100% { 
    box-shadow: 
      0 0 25px rgba(139, 69, 19, 0.9),
      inset 0 0 15px rgba(255, 255, 255, 0.4),
      0 0 0 2px rgba(255, 215, 0, 0.3);
  }
  50% { 
    box-shadow: 
      0 0 35px rgba(139, 69, 19, 1),
      inset 0 0 25px rgba(255, 255, 255, 0.6),
      0 0 0 3px rgba(255, 215, 0, 0.5);
  }
}

@keyframes resizeHandleGlow {
  0%, 100% { 
    box-shadow: 0 0 15px rgba(139, 69, 19, 0.6);
    transform: scaleX(1);
  }
  50% { 
    box-shadow: 0 0 25px rgba(255, 215, 0, 0.8);
    transform: scaleX(1.2);
  }
}

@keyframes handCursor {
  0% { 
    transform: translateX(0) rotate(0deg);
    opacity: 1;
  }
  25% { 
    transform: translateX(10px) rotate(-5deg);
    opacity: 0.8;
  }
  50% { 
    transform: translateX(20px) rotate(0deg);
    opacity: 1;
  }
  75% { 
    transform: translateX(10px) rotate(5deg);
    opacity: 0.8;
  }
  100% { 
    transform: translateX(0) rotate(0deg);
    opacity: 1;
  }
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .tutorial-tooltip {
    max-width: 250px;
    font-size: 0.9rem;
    padding: 0.875rem 1.25rem;
  }
  
  .tutorial-progress {
    top: 10px;
    right: 10px;
    font-size: 0.8rem;
    padding: 0.5rem 0.75rem;
  }
  
  .tutorial-cursor {
    font-size: 1.25rem;
  }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
  .tutorial-tooltip {
    background: linear-gradient(135deg, #654321, #8B4513);
    border-color: rgba(255, 255, 255, 0.3);
  }
  
  .tutorial-progress {
    background: rgba(20, 20, 20, 0.9);
    border-color: #8B4513;
  }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  .tutorial-overlay.active,
  .tutorial-spotlight,
  .tutorial-cursor,
  .tutorial-active .resize-handle {
    animation: none !important;
  }
  
  .tutorial-spotlight.pulse {
    box-shadow: 
      0 0 0 9999px rgba(0, 0, 0, 0.8),
      0 0 25px rgba(139, 69, 19, 0.8),
      inset 0 0 25px rgba(255, 255, 255, 0.15);
  }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
  .tutorial-overlay {
    background: rgba(0, 0, 0, 0.4);
  }
  
  .tutorial-overlay.active::before {
    background: rgba(0, 0, 0, 0.3);
  }
  
  .tutorial-spotlight,
  #tutorial-spotlight-left,
  #tutorial-spotlight-right {
    border-color: #FFD700;
    border-width: 4px;
    background: rgba(255, 255, 255, 0.5);
  }
  
  .tutorial-tooltip {
    background: rgba(0, 0, 0, 0.9);
    border: 2px solid #FFD700;
    color: #FFD700;
  }
}
