/**
 * Cursor Fix - Prevents unwanted text cursor on non-editable elements
 * Fixes the flashing cursor issue when clicking on text
 */

/* Ensure text elements use default cursor instead of text cursor */
body, 
html, 
div, 
span, 
p, 
h1, h2, h3, h4, h5, h6,
article, 
section, 
header, 
footer, 
nav, 
main,
.container,
.hero,
.section,
.card,
.content {
    cursor: default !important;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Allow text selection only for actual content areas */
.article-content,
.blog-content,
.case-study-content,
.testimonial p,
blockquote,
.description,
.snippet-answer,
.case-study-details p,
.case-study-details li {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
    cursor: text;
}

/* Ensure interactive elements have proper cursors */
a, 
button, 
.btn,
[role="button"],
.clickable,
.toggle,
.tab,
.menu-item {
    cursor: pointer !important;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Form elements should have text cursor when appropriate */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="password"],
input[type="search"],
textarea,
[contenteditable="true"] {
    cursor: text !important;
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

/* Prevent outline on non-focusable elements */
div:focus,
span:focus,
p:focus,
h1:focus, h2:focus, h3:focus, h4:focus, h5:focus, h6:focus,
section:focus,
article:focus {
    outline: none !important;
}

/* Ensure proper focus styles only for interactive elements */
a:focus,
button:focus,
.btn:focus,
input:focus,
textarea:focus,
select:focus {
    outline: 2px solid #179e83 !important;
    outline-offset: 2px !important;
}

/* Fix for any elements that might have been accidentally made contenteditable */
[contenteditable="false"],
.no-edit {
    cursor: default !important;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Prevent text selection on UI elements */
.hero-stats,
.metrics,
.statistics,
.counters,
.nav-menu,
.header,
.footer,
.sidebar,
.widget {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    cursor: default !important;
}

/* Code blocks should allow text selection */
code,
pre,
.code-block {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
    cursor: text;
}

/* Draggable elements */
[draggable="true"] {
    cursor: grab;
}

[draggable="true"]:active {
    cursor: grabbing;
}

/* Loading states */
.loading,
.disabled {
    cursor: wait !important;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Tooltips and overlays */
.tooltip,
.overlay,
.modal,
.popup {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    cursor: default;
}

/* Prevent accidental text selection on mobile */
@media (max-width: 768px) {
    * {
        -webkit-touch-callout: none;
        -webkit-tap-highlight-color: transparent;
    }
    
    /* But allow text selection in content areas */
    .article-content,
    .blog-content,
    .case-study-content,
    .description,
    .testimonial p,
    blockquote {
        -webkit-touch-callout: default;
        -webkit-user-select: text;
        user-select: text;
    }
}

/* Fix for Safari text selection issues */
@supports (-webkit-appearance: none) {
    * {
        -webkit-user-select: none;
    }
    
    .article-content,
    .blog-content,
    .case-study-content,
    .description,
    .testimonial p,
    blockquote,
    input,
    textarea {
        -webkit-user-select: text;
    }
}