/**
 * Feedback Modal Cursor Fix
 * Comprehensive solution for cursor visibility issues in Ultra Mode
 * This file should be loaded LAST to ensure proper override
 */

/* ============================================
   Z-Index Hierarchy Fix
   ============================================ */

/* Ensure feedback modal is always above custom cursor */
.feedback-modal {
  z-index: 20000 !important;
}

.feedback-modal-content {
  z-index: 20001 !important;
}

/* ============================================
   Custom Cursor Management
   ============================================ */

/* When feedback modal is open, completely hide custom cursor */
body.feedback-modal-open .custom-cursor,
body.feedback-modal-open .cursor-dot,
body.feedback-modal-open .cursor-ring {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* Disable mix-blend-mode when modal is active */
body.feedback-modal-open .custom-cursor {
  mix-blend-mode: normal !important;
}

/* ============================================
   System Cursor Restoration
   ============================================ */

/* Force system cursor to be visible in feedback modals */
body.feedback-modal-open {
  cursor: auto !important;
}

body.feedback-modal-open * {
  cursor: auto !important;
}

/* Specific cursor types for interactive elements */
body.feedback-modal-open .feedback-modal button,
body.feedback-modal-open .feedback-modal a,
body.feedback-modal-open .feedback-modal .btn,
body.feedback-modal-open .feedback-cancel,
body.feedback-modal-open .feedback-submit {
  cursor: pointer !important;
}

body.feedback-modal-open .feedback-modal input[type="text"],
body.feedback-modal-open .feedback-modal input[type="number"],
body.feedback-modal-open .feedback-modal input[type="email"],
body.feedback-modal-open .feedback-modal textarea,
body.feedback-modal-open #expected-code,
body.feedback-modal-open #feedback-comments,
body.feedback-modal-open #expected-nta,
body.feedback-modal-open #nta-comments {
  cursor: text !important;
}

body.feedback-modal-open .feedback-modal select {
  cursor: pointer !important;
}

/* ============================================
   Ultra Mode Overrides
   ============================================ */

/* Override Ultra Mode cursor hiding when modal is open */
body.ultra-mode.feedback-modal-open,
body.ultra-mode.feedback-modal-open body,
body.ultra-mode.feedback-modal-open .feedback-modal,
body.ultra-mode.feedback-modal-open .feedback-modal * {
  cursor: auto !important;
}

/* Ensure interactive elements have proper cursors in Ultra Mode */
body.ultra-mode.feedback-modal-open button,
body.ultra-mode.feedback-modal-open a,
body.ultra-mode.feedback-modal-open .btn {
  cursor: pointer !important;
}

body.ultra-mode.feedback-modal-open input,
body.ultra-mode.feedback-modal-open textarea {
  cursor: text !important;
}

/* Disable all cursor animations when modal is open */
body.feedback-modal-open .cursor-trail,
body.feedback-modal-open .magnetic-cursor,
body.feedback-modal-open .cursor-effect {
  display: none !important;
}

/* ============================================
   Fail-Safe Rules (Maximum Specificity)
   ============================================ */

/* These rules use maximum specificity to ensure they always win */
html body.feedback-modal-open .feedback-modal,
html body.feedback-modal-open .feedback-modal-content,
html body.feedback-modal-open .feedback-modal-content * {
  cursor: auto !important;
}

html body.ultra-mode.feedback-modal-open .feedback-modal button,
html body.ultra-mode.feedback-modal-open .feedback-modal-content button {
  cursor: pointer !important;
}

html body.ultra-mode.feedback-modal-open .feedback-modal input,
html body.ultra-mode.feedback-modal-open .feedback-modal textarea,
html body.ultra-mode.feedback-modal-open .feedback-modal-content input,
html body.ultra-mode.feedback-modal-open .feedback-modal-content textarea {
  cursor: text !important;
}

/* Ensure backdrop also shows cursor */
body.feedback-modal-open::before,
body.feedback-modal-open::after {
  cursor: auto !important;
}

/* ============================================
   Animation and Transition Fixes
   ============================================ */

/* Disable any cursor transitions when modal is open to prevent flickering */
body.feedback-modal-open,
body.feedback-modal-open * {
  transition-property: background-color, border-color, color, fill, stroke, opacity, box-shadow, transform !important;
  /* Explicitly exclude cursor from transitions */
}

/* ============================================
   Debug Helper (Remove in Production)
   ============================================ */

/* Uncomment to debug cursor issues
body.feedback-modal-open::after {
  content: 'MODAL OPEN - Cursor should be visible';
  position: fixed;
  top: 10px;
  left: 10px;
  background: red;
  color: white;
  padding: 5px;
  z-index: 99999;
  pointer-events: none;
}
*/