/* ==============================================
   Global CSS - 전역 공통 스타일
   모든 페이지에 적용되는 공통 스타일
   ============================================== */

/* 기본 텍스트 선택 방지 - 모든 UI 요소에 적용 */
* {
    user-select: none; /* 텍스트 선택 방지 */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* 입력 필드는 텍스트 선택 허용 */
input, 
textarea, 
[contenteditable="true"], 
.editable,
.selectable {
    user-select: text !important;
    -webkit-user-select: text !important;
    -moz-user-select: text !important;
    -ms-user-select: text !important;
}

/* 특정 컨텐츠 영역도 텍스트 선택 허용 (필요시) */
.content-text,
.article-content,
.post-content,
.comment-content,
.message-content {
    user-select: text !important;
    -webkit-user-select: text !important;
    -moz-user-select: text !important;
    -ms-user-select: text !important;
}

/* 드래그 방지 (이미지, 링크 등) */
img, 
a, 
button {
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    user-drag: none;
}

/* 텍스트 하이라이트 색상 커스터마이징 */
::selection {
    background-color: rgba(59, 130, 246, 0.2);
    color: #1f2937;
}

::-moz-selection {
    background-color: rgba(59, 130, 246, 0.2);
    color: #1f2937;
}

/* 터치 하이라이트 제거 */
* {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

/* 우클릭 메뉴 비활성화 (선택사항) */
.no-context-menu {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* 스크롤바 커스터마이징 */
::-webkit-scrollbar {
    width: 0px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.5);
}

/* 포커스 아웃라인 개선 */
*:focus {
    outline: 2px solid rgba(59, 130, 246, 0.5);
    outline-offset: 2px;
}

/* 버튼 기본 스타일 개선 */
button {
    cursor: pointer;
    border: none;
    background: none;
    padding: 0;
    font: inherit;
}

/* 링크 기본 스타일 */
a {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

/* 애니메이션 최적화 */
* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 반응형 이미지 */
img {
    max-width: 100%;
    height: auto;
}

/* 박스 모델 통일 */
* {
    box-sizing: border-box;
}

/* 모바일 최적화 */
@media (max-width: 768px) {
    /* 모바일에서 더 강한 텍스트 선택 방지 */
    * {
        -webkit-user-select: none !important;
        -moz-user-select: none !important;
        -ms-user-select: none !important;
        user-select: none !important;
    }
    
    /* 입력 필드는 여전히 허용 */
    input, 
    textarea, 
    [contenteditable="true"], 
    .editable,
    .selectable {
        user-select: text !important;
        -webkit-user-select: text !important;
        -moz-user-select: text !important;
        -ms-user-select: text !important;
    }
}

/* 특정 페이지 또는 컴포넌트에서 텍스트 선택을 허용해야 하는 경우 */
.allow-text-selection {
    user-select: text !important;
    -webkit-user-select: text !important;
    -moz-user-select: text !important;
    -ms-user-select: text !important;
}

/* 완전히 비활성화된 요소 */
.disabled {
    pointer-events: none;
    opacity: 0.5;
    cursor: not-allowed;
}

/* 로딩 상태 */
.loading {
    pointer-events: none;
    opacity: 0.6;
}

/* 게시판 컨텐츠는 텍스트 선택 허용 */
.board-content,
.forum-content,
.post-body,
.comment-body {
    user-select: text !important;
    -webkit-user-select: text !important;
    -moz-user-select: text !important;
    -ms-user-select: text !important;
} 