/**
 * CiteCount Interactive Guide Styles
 * Custom styling for the interactive guide system
 */

/* Overlay */
.cc-guide-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: transparent;
  z-index: 9999998;
  animation: cc-guide-fade-in 0.3s ease-out;
  pointer-events: none;
  transition: background 0.3s ease;
}

/* Overlay with background for center steps */
.cc-guide-overlay.cc-guide-overlay-visible {
  background: rgba(0, 0, 0, 0.65);
}

/* Highlight Box */
.cc-guide-highlight {
  position: absolute;
  border-radius: 8px;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.65),
              0 0 0 4px rgba(74, 144, 226, 1),
              0 0 30px rgba(74, 144, 226, 0.8);
  z-index: 9999999;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  animation: cc-guide-fade-in 0.3s ease-out;
}

/* Pulsing animation for highlight */
@keyframes cc-guide-pulse {
  0%, 100% {
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.65),
                0 0 0 4px rgba(74, 144, 226, 1),
                0 0 30px rgba(74, 144, 226, 0.8);
  }
  50% {
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.65),
                0 0 0 6px rgba(74, 144, 226, 1),
                0 0 40px rgba(74, 144, 226, 1);
  }
}

.cc-guide-highlight.cc-guide-pulse {
  animation: cc-guide-pulse 2s ease-in-out;
}

/* Tooltip Container */
.cc-guide-tooltip {
  position: absolute;
  background: var(--background-primary, #ffffff);
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2),
              0 0 0 1px rgba(0, 0, 0, 0.1);
  max-width: 400px;
  min-width: 320px;
  z-index: 10000000;
  animation: cc-guide-fade-in 0.3s ease-out,
             cc-guide-slide-up 0.3s ease-out;
  color: var(--text-primary, #1f2937);
}

@media (max-width: 768px) {
  .cc-guide-tooltip {
    max-width: calc(100vw - 40px);
    min-width: calc(100vw - 40px);
  }
}

/* Tooltip Header */
.cc-guide-tooltip-header {
  padding: 1rem 1.25rem 0.75rem;
  border-bottom: 1px solid var(--border-primary, #e5e7eb);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

/* Progress */
.cc-guide-progress {
  flex: 1;
}

.cc-guide-progress-text {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary, #6b7280);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: block;
  margin-bottom: 0.5rem;
}

.cc-guide-progress-bar {
  width: 100%;
  height: 4px;
  background: var(--background-secondary, #f3f4f6);
  border-radius: 2px;
  overflow: hidden;
}

.cc-guide-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #4a90e2, #357abd);
  border-radius: 2px;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Close Button */
.cc-guide-close {
  width: 24px;
  height: 24px;
  border: none;
  background: transparent;
  color: var(--text-secondary, #6b7280);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.cc-guide-close:hover {
  background: var(--background-secondary, #f3f4f6);
  color: var(--text-primary, #1f2937);
}

.cc-guide-close:active {
  transform: scale(0.95);
}

/* Tooltip Body */
.cc-guide-tooltip-body {
  padding: 1.25rem;
}

.cc-guide-tooltip-title {
  font-size: 1.125rem;
  font-weight: 700;
  margin: 0 0 0.75rem 0;
  color: var(--text-primary, #1f2937);
  line-height: 1.4;
}

.cc-guide-tooltip-content {
  font-size: 0.9375rem;
  line-height: 1.6;
  margin: 0;
  color: var(--text-secondary, #4b5563);
}

.cc-guide-tooltip-content strong {
  font-weight: 600;
  color: var(--text-primary, #1f2937);
}

/* Tooltip Footer */
.cc-guide-tooltip-footer {
  padding: 0.75rem 1.25rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

@media (max-width: 480px) {
  .cc-guide-tooltip-footer {
    flex-direction: column;
    align-items: stretch;
  }
}

/* Navigation Buttons */
.cc-guide-navigation {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

@media (max-width: 480px) {
  .cc-guide-navigation {
    width: 100%;
  }
  
  .cc-guide-navigation .cc-guide-btn {
    flex: 1;
  }
}

/* Buttons */
.cc-guide-btn {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
}

.cc-guide-btn:active {
  transform: scale(0.98);
}

.cc-guide-btn-primary {
  background: linear-gradient(135deg, #4a90e2, #357abd);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(74, 144, 226, 0.3);
}

.cc-guide-btn-primary:hover {
  background: linear-gradient(135deg, #357abd, #2868a8);
  box-shadow: 0 4px 12px rgba(74, 144, 226, 0.4);
}

.cc-guide-btn-secondary {
  background: var(--background-secondary, #f3f4f6);
  color: var(--text-primary, #1f2937);
  border: 1px solid var(--border-primary, #e5e7eb);
}

.cc-guide-btn-secondary:hover {
  background: var(--background-primary, #ffffff);
  border-color: var(--accent-color, #4a90e2);
  color: var(--accent-color, #4a90e2);
}

/* Arrow */
.cc-guide-arrow {
  position: absolute;
  width: 16px;
  height: 16px;
  background: var(--background-primary, #ffffff);
  transform: rotate(45deg);
  box-shadow: -2px -2px 4px rgba(0, 0, 0, 0.05);
  display: none;
}

.cc-guide-arrow-top {
  display: block;
  top: -8px;
  left: 50%;
  margin-left: -8px;
}

.cc-guide-arrow-bottom {
  display: block;
  bottom: -8px;
  left: 50%;
  margin-left: -8px;
  box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.05);
}

.cc-guide-arrow-left {
  display: block;
  left: -8px;
  top: 50%;
  margin-top: -8px;
}

.cc-guide-arrow-right {
  display: block;
  right: -8px;
  top: 50%;
  margin-top: -8px;
  box-shadow: 2px -2px 4px rgba(0, 0, 0, 0.05);
}

/* Animations */
@keyframes cc-guide-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes cc-guide-slide-up {
  from {
    transform: translateY(20px);
  }
  to {
    transform: translateY(0);
  }
}

@keyframes cc-guide-fade-out {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

.cc-guide-fade-out {
  animation: cc-guide-fade-out 0.3s ease-out forwards;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .cc-guide-overlay {
    background: transparent;
  }
  
  .cc-guide-highlight {
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.75),
                0 0 0 4px rgba(74, 144, 226, 1),
                0 0 30px rgba(74, 144, 226, 0.8);
  }
  
  .cc-guide-tooltip {
    background: var(--background-primary, #1f2937);
    color: var(--text-primary, #f9fafb);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5),
                0 0 0 1px rgba(255, 255, 255, 0.1);
  }
  
  .cc-guide-tooltip-title {
    color: var(--text-primary, #f9fafb);
  }
  
  .cc-guide-tooltip-content {
    color: var(--text-secondary, #d1d5db);
  }
  
  .cc-guide-arrow {
    background: var(--background-primary, #1f2937);
  }
  
  .cc-guide-btn-secondary {
    background: var(--background-secondary, #374151);
    border-color: var(--border-primary, #4b5563);
    color: var(--text-primary, #f9fafb);
  }
  
  .cc-guide-btn-secondary:hover {
    background: var(--background-primary, #1f2937);
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .cc-guide-highlight {
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.8),
                0 0 0 6px #4a90e2,
                0 0 30px #4a90e2;
  }
  
  .cc-guide-tooltip {
    border: 2px solid var(--accent-color, #4a90e2);
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .cc-guide-overlay,
  .cc-guide-highlight,
  .cc-guide-tooltip {
    animation: none !important;
    transition: none !important;
  }
  
  .cc-guide-highlight.cc-guide-pulse {
    animation: none !important;
  }
  
  .cc-guide-progress-fill {
    transition: none !important;
  }
}

/* Focus states for accessibility */
.cc-guide-btn:focus-visible,
.cc-guide-close:focus-visible {
  outline: 2px solid var(--accent-color, #4a90e2);
  outline-offset: 2px;
}

/* Print styles - hide guide when printing */
@media print {
  .cc-guide-overlay,
  .cc-guide-highlight,
  .cc-guide-tooltip {
    display: none !important;
  }
}
