/**
 * Quill 에디터 한글 공통 스타일
 */

/* 에디터 본문 높이 고정 및 스크롤 */
.ql-editor {
    height: 350px;
    max-height: 350px;
    overflow-y: auto;
}

/* PC 화면에서 에디터 높이 증가 */
@media (min-width: 768px) {
    .ql-editor {
        height: 600px;
        max-height: 600px;
    }
}

/* 모바일에서 에디터만 좌우 여백 제거 */
@media (max-width: 767px) {
    /* Quill 에디터 자체 여백 제거 */
    .ql-editor {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    .ql-container {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    .ql-toolbar {
        padding-left: 4px !important;
        padding-right: 4px !important;
    }

    /* 에디터 카드만 container 밖으로 확장 */
    .quill-editor-card {
        margin-left: calc(-1 * var(--tblr-gutter-x, 0.75rem)) !important;
        margin-right: calc(-1 * var(--tblr-gutter-x, 0.75rem)) !important;
        border-left: 0 !important;
        border-right: 0 !important;
        border-radius: 0 !important;
    }

    .quill-editor-card-body {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    /* 라벨에만 좌우 패딩 */
    .quill-editor-card-body .form-label {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }
}

/* Quill 툴바 버튼 한글 툴팁 */
.ql-toolbar button {
    position: relative;
}

.ql-toolbar button:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 5px 10px;
    background: #333;
    color: #fff;
    font-size: 12px;
    white-space: nowrap;
    border-radius: 4px;
    z-index: 1000;
    margin-bottom: 5px;
}

.ql-toolbar button:hover::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #333;
    z-index: 1000;
}

.ql-toolbar .ql-picker-label {
    position: relative;
}

.ql-toolbar .ql-picker-label:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 5px 10px;
    background: #333;
    color: #fff;
    font-size: 12px;
    white-space: nowrap;
    border-radius: 4px;
    z-index: 1000;
    margin-bottom: 5px;
}

/* 업로드 로딩 오버레이 */
.ql-container {
    position: relative;
}

.quill-upload-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #206bc4;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-text {
    margin-top: 15px;
    font-size: 16px;
    color: #333;
    font-weight: 500;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
